Guilherme:
- fix config parser:
-- Perform a better treatment of missing configuration items, actually the
- application just crashes.
-
- Documentation of the functions (doxygen)
- Make the link down interval also configurable. Today it is possible just to
ConfigFileCmdDesc( "Name of the configuration file." ),
SourceNetworkInterfaceCmdStr( "source-network-interface" ),
SourceNetworkInterfaceCmdDesc( "The network interface from where the packets will be received and originated" ),
+ DefaultNameServer( "127.0.0.1" ),
NameServerCmdStr( "nameserver" ),
NameServerCmdDesc( "The local address from where the DNS query will be made." ),
DefaultHostsDownLimit( 0 ), // no host down
options_description options( "Configuration" );
options.add_options()
( SourceNetworkInterfaceCmdStr.c_str(), value<string>(), SourceNetworkInterfaceCmdDesc.c_str() )
- ( NameServerCmdStr.c_str(), value<string>(), NameServerCmdDesc.c_str() )
+ ( NameServerCmdStr.c_str(), value<string>()->default_value( DefaultNameServer ), NameServerCmdDesc.c_str() )
( HostsDownLimitCmdStr.c_str(), value<int>()->default_value( DefaultHostsDownLimit ), HostsDownLimitCmdDesc.c_str() )
( PingFailLimitCmdStr.c_str(), value<int>()->default_value( DefaultPingFailLimit ), PingFailLimitCmdDesc.c_str() )
( StatusNotifierCmdCmdStr.c_str(), value<string>(), StatusNotifierCmdCmdDesc.c_str() )
const std::string ConfigFileCmdDesc;
const std::string SourceNetworkInterfaceCmdStr;
const std::string SourceNetworkInterfaceCmdDesc;
+ const std::string DefaultNameServer;
const std::string NameServerCmdStr;
const std::string NameServerCmdDesc;
const int DefaultHostsDownLimit;