diff --git a/README b/README index 50ef612..32901b8 100644 --- a/README +++ b/README @@ -1,6 +1,6 @@ ndppd - NDP Proxy Daemon - Version 0.2.1 + Version 0.2.2 ------------------------------------------------------------------------ 1. Legal @@ -78,14 +78,7 @@ 3. Dependencies ------------------------------------------------------------------------ - This daemon depends on 'libconfuse'. If you're running Debian or - Ubuntu you should be able to get that from the repositories. - - apt-get install libconfuse0-dev - - You can get it here otherwise: - - http://www.nongnu.org/confuse/ + As of version 0.2.2, libconfuse is no longer needed. ------------------------------------------------------------------------ 4. Compiling @@ -122,6 +115,9 @@ -d Daemonize the process, putting it in the background. Also enables syslogging. + + -v Increase logging verbosity. Can be used several times in + order to increase even further. ------------------------------------------------------------------------ 5. Website and contact diff --git a/ndppd.1 b/ndppd.1 index f126396..5eaa445 100644 --- a/ndppd.1 +++ b/ndppd.1 @@ -5,7 +5,7 @@ .SH NAME ndppd \- NDP Proxy Daemon .SH SYNOPSIS -.B ndppd [-d] [-c ] [-p ] +.B ndppd [-d] [-vvv] [-c ] [-p ] .SH DESCRIPTION .BR ndppd, or @@ -26,6 +26,9 @@ enables syslogging. Creates a .I pidfile at the specified location. +.IP -v +Increases logging verbosity. Can be specified several times to increase +verbosity even further. .SH FILES .I /etc/ndppd.conf .RS diff --git a/ndppd.conf.5 b/ndppd.conf.5 index 40ac995..53817b3 100644 --- a/ndppd.conf.5 +++ b/ndppd.conf.5 @@ -61,18 +61,42 @@ should send the .I router bit when sending Neighbor Advertisement messages. The default value here is -.B yes. +.BR yes . .SH RULE OPTIONS +Specify a method here. See below. +.SH METHOD +One of the following options must be specified in the +.B rule +section. All of these are mutually exclusive options, and cannot +be combined. .IP "iface " Specify which .I interface the Neighbor Solicitation message will be sent out through. -If this option is not specified, +.IP "auto" +.B (NEW) +If this option is specified .B ndppd -will immediately answer with a Neighbor Advertisement message -if the rule matches, without querying an interface. It's recommended -that you set this value to avoid sending responses for IPs that does -not exist. +will attempt to detect which interface to use in order to forward +Neighbor Solicitation Messages, by reading the routing table +.BR /proc/sys/ipv6_route . +.IP "static" +.B (NEW) +This option tells +.B ndppd +that it should immediately respond to a Neighbor Solicitation Message +without querying an internal interface. +Note that it's recommended that you use this option sparingly, and with +as high prefix length as possible. This is to make sure upstream routers +are not polluted with spurious neighbor entries. + +If no rule option has been specified, it will default to +.B static +in order to be compatible with +.BR 0.2.1 . +This will, however, produce a warning, and most likely not work in +future versions of +.BR ndppd . .SH AUTHOR Daniel Adolfsson .SH "SEE ALSO" diff --git a/src/logger.cc b/src/logger.cc index 82d3ff8..7ac4b58 100644 --- a/src/logger.cc +++ b/src/logger.cc @@ -175,6 +175,18 @@ void logger::max_pri(int pri) _max_pri = pri; } +int logger::verbosity() +{ + return _max_pri; +} + +void logger::verbosity(int pri) +{ + if ((pri >= 0) && (pri <= 7)) { + _max_pri = pri; + } +} + bool logger::verbosity(const std::string& name) { const char* c_name = name.c_str(); diff --git a/src/logger.h b/src/logger.h index 7f12349..5e47f02 100644 --- a/src/logger.h +++ b/src/logger.h @@ -51,6 +51,10 @@ public: static bool verbosity(const std::string& name); + static int verbosity(); + + static void verbosity(int pri); + logger& operator<<(const std::string& str); logger& operator<<(logger& (*pf)(logger& )); logger& operator<<(int n); diff --git a/src/ndppd.cc b/src/ndppd.cc index 2b1690f..ed09e71 100644 --- a/src/ndppd.cc +++ b/src/ndppd.cc @@ -158,7 +158,7 @@ int main(int argc, char* argv[], char* env[]) { 0, 0, 0, 0} }; - c = getopt_long(argc, argv, "c:dp:v::", long_options,& opt); + c = getopt_long(argc, argv, "c:dp:v", long_options,& opt); if (c == -1) break; @@ -177,12 +177,13 @@ int main(int argc, char* argv[], char* env[]) break; case 'v': - if (optarg) { + logger::verbosity(logger::verbosity() + 1); + /*if (optarg) { if (!logger::verbosity(optarg)) logger::error() << "Unknown verbosity level '" << optarg << "'"; } else { logger::max_pri(LOG_INFO); - } + }*/ break; } }