diff --git a/src/config.cpp b/src/config.cpp index 10a4355..40ad095 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -209,6 +209,7 @@ void CConfig::Load (void) m_INetworkSubnetMask = m_Properties.GetIPAddress("NetworkSubnetMask") != 0; m_INetworkDefaultGateway = m_Properties.GetIPAddress("NetworkDefaultGateway") != 0; m_INetworkDNSServer = m_Properties.GetIPAddress("NetworkDNSServer") != 0; + m_INetworkSyslogServerIPAddress = m_Properties.GetIPAddress("NetworkSyslogServerIPAddress") != 0; } unsigned CConfig::GetToneGenerators (void) const @@ -767,3 +768,8 @@ CIPAddress CConfig::GetNetworkDNSServer (void) const { return m_INetworkDNSServer; } + +CIPAddress CConfig::GetNetworkSyslogServerIPAddress (void) const +{ + return m_INetworkSyslogServerIPAddress; +} diff --git a/src/config.h b/src/config.h index b87a94c..7af0bfc 100644 --- a/src/config.h +++ b/src/config.h @@ -248,6 +248,7 @@ public: CIPAddress GetNetworkSubnetMask (void) const; CIPAddress GetNetworkDefaultGateway (void) const; CIPAddress GetNetworkDNSServer (void) const; + CIPAddress GetNetworkSyslogServerIPAddress (void) const; private: CPropertiesFatFsFile m_Properties; @@ -372,6 +373,7 @@ private: CIPAddress m_INetworkSubnetMask; CIPAddress m_INetworkDefaultGateway; CIPAddress m_INetworkDNSServer; + CIPAddress m_INetworkSyslogServerIPAddress; }; #endif diff --git a/src/minidexed.cpp b/src/minidexed.cpp index f4b30a6..f61c835 100644 --- a/src/minidexed.cpp +++ b/src/minidexed.cpp @@ -23,6 +23,8 @@ #include #include #include +#include +#include #include #include #include @@ -2326,6 +2328,18 @@ bool CMiniDexed::InitNetwork() } m_pNetDevice = CNetDevice::GetNetDevice(NetDeviceType); + + // Syslog configuration + static const u8 SysLogServer[] = {192, 168, 0, 143}; // FIXME: Don't hardcode this, use m_INetworkSyslogServerIPAddress instead + static const u16 usServerPort = 8514; // standard port is 514 + CIPAddress ServerIP (SysLogServer); + CString IPString; + ServerIP.Format (&IPString); + LOGNOTE ( "Sending log messages to %s:%u", + (const char *) IPString, (unsigned) usServerPort); + + new CSysLogDaemon (m_pNet, ServerIP, usServerPort); + } return m_pNet != nullptr; } diff --git a/src/minidexed.ini b/src/minidexed.ini index 644ef4a..ac24026 100644 --- a/src/minidexed.ini +++ b/src/minidexed.ini @@ -153,6 +153,7 @@ NetworkIPAddress=0 NetworkSubnetMask=0 NetworkDefaultGateway=0 NetworkDNSServer=0 +NetworkSyslogServerIPAddress=0 # Performance PerformanceSelectToLoad=1