Search:

SENF Extensible Network Framework

  • Home
  • Download
  • Wiki
  • BerliOS
  • ChangeLog
  • Browse SVN
  • Bug Tracker
  • Overview
  • Examples
  • HowTos
  • Glossary
  • PPI
  • Packets
  • Scheduler
  • Socket
  • Utils
  • Console
  • Daemon
  • Logger
  • Termlib
  • Main Page
  • Modules
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

SyslogUDPTarget.cci

Go to the documentation of this file.
00001 // $Id: SyslogUDPTarget.cci 1772 2011-03-10 12:45:21Z tho $
00002 //
00003 // Copyright (C) 2008
00004 // Fraunhofer (FOKUS)
00005 // Competence Center NETwork research (NET), St. Augustin, GERMANY
00006 //     Stefan Bund <g0dil@berlios.de>
00007 //
00008 // This program is free software; you can redistribute it and/or modify
00009 // it under the terms of the GNU General Public License as published by
00010 // the Free Software Foundation; either version 2 of the License, or
00011 // (at your option) any later version.
00012 //
00013 // This program is distributed in the hope that it will be useful,
00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016 // GNU General Public License for more details.
00017 //
00018 // You should have received a copy of the GNU General Public License
00019 // along with this program; if not, write to the
00020 // Free Software Foundation, Inc.,
00021 // 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00022 
00026 //#include "SyslogUDPTarget.ih"
00027 
00028 // Custom includes
00029 #include <senf/Socket/Protocols/INet/ConnectedUDPSocketHandle.hh>
00030 #include <senf/Utils/String.hh>
00031 
00032 #define prefix_ inline
00033 //-/////////////////////////////////////////////////////////////////////////////////////////////////
00034 
00035 prefix_ senf::log::SyslogUDPTarget::SyslogUDPTarget(INet4Address const & target, int facility)
00036     : Target("udp-" + senf::str(target)), LogFormat(consoleDir()), facility_ (facility),
00037       handle_ ( ConnectedUDPv4ClientSocketHandle(INet4SocketAddress(target, 514u)) ),
00038       syslogFormat_ (true)
00039 {
00040     init();
00041 }
00042 
00043 prefix_ senf::log::SyslogUDPTarget::SyslogUDPTarget(INet4SocketAddress const & target, int facility)
00044     : Target("udp-" + senf::str(target)), LogFormat(consoleDir()), facility_ (facility),
00045       handle_ ( ConnectedUDPv4ClientSocketHandle(target) ),
00046       syslogFormat_ (true)
00047 {
00048     init();
00049 }
00050 
00051 prefix_ senf::log::SyslogUDPTarget::SyslogUDPTarget(INet6Address const & target, int facility)
00052     : Target("udp-" + senf::str(target)), LogFormat(consoleDir()), facility_ (facility),
00053       handle_ ( ConnectedUDPv6ClientSocketHandle(INet6SocketAddress(target, 514u)) ),
00054       syslogFormat_ (true)
00055 {
00056     init();
00057 }
00058 
00059 prefix_ senf::log::SyslogUDPTarget::SyslogUDPTarget(INet6SocketAddress const & target, int facility)
00060     : Target("udp-" + senf::str(target)), LogFormat(consoleDir()), facility_ (facility),
00061       handle_ ( ConnectedUDPv6ClientSocketHandle(target) ),
00062       syslogFormat_ (true)
00063 {
00064     init();
00065 }
00066 
00067 prefix_ bool senf::log::SyslogUDPTarget::syslog()
00068     const
00069 {
00070     return syslogFormat_;
00071 }
00072 
00073 prefix_ void senf::log::SyslogUDPTarget::syslog(bool enabled)
00074 {
00075     syslogFormat_ = enabled;
00076 }
00077 
00078 //-/////////////////////////////////////////////////////////////////////////////////////////////////
00079 #undef prefix_
00080 
00081 
00082 // Local Variables:
00083 // mode: c++
00084 // fill-column: 100
00085 // comment-column: 40
00086 // c-file-style: "senf"
00087 // indent-tabs-mode: nil
00088 // ispell-local-dictionary: "american"
00089 // compile-command: "scons -u test"
00090 // End:

Contact: senf-dev@lists.berlios.de | © 2006-2010 Fraunhofer Institute for Open Communication Systems, Network Research