X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Ftincd.c;h=a220154b79be239d4d5c775ee6124bc4e0ae8922;hp=89519c15da60e2e1e69905975b64e4fe0d384916;hb=a26d371d0df3bee1bdc6e9d7046e949ee29e6de7;hpb=73f7efddd723b25c1477ec1139dc7211307ff660 diff --git a/src/tincd.c b/src/tincd.c index 89519c15..a220154b 100644 --- a/src/tincd.c +++ b/src/tincd.c @@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id: tincd.c,v 1.10.4.14 2000/10/20 19:46:58 guus Exp $ + $Id: tincd.c,v 1.10.4.18 2000/10/29 02:07:41 guus Exp $ */ #include "config.h" @@ -33,6 +33,7 @@ #include #include #include +#include #ifdef HAVE_SYS_IOCTL_H # include @@ -47,6 +48,7 @@ #include "net.h" #include "netutl.h" #include "protocol.h" +#include "subnet.h" #include "system.h" @@ -118,8 +120,7 @@ parse_options(int argc, char **argv, char **envp) { int r; int option_index = 0; - config_t *p; - + while((r = getopt_long(argc, argv, "c:Ddkn:K::", long_options, &option_index)) != EOF) { switch(r) @@ -281,11 +282,11 @@ int detach(void) openlog(identname, LOG_CONS | LOG_PID, LOG_DAEMON); - if(debug_lvl > 0) + if(debug_lvl > DEBUG_NOTHING) syslog(LOG_NOTICE, _("tincd %s (%s %s) starting, debug level %d"), VERSION, __DATE__, __TIME__, debug_lvl); else - syslog(LOG_NOTICE, _("tincd %s starting"), VERSION, debug_lvl); + syslog(LOG_NOTICE, _("tincd %s starting"), VERSION); xalloc_fail_func = memory_full; @@ -299,7 +300,7 @@ void cleanup_and_exit(int c) { close_network_connections(); - if(debug_lvl > 0) + if(debug_lvl > DEBUG_NOTHING) syslog(LOG_INFO, _("Total bytes written: tap %d, socket %d; bytes read: tap %d, socket %d"), total_tap_out, total_socket_out, total_tap_in, total_socket_in); @@ -458,7 +459,7 @@ main(int argc, char **argv, char **envp) } else { - syslog(LOG_ERR, _("Aieee! Not restarting.")); + syslog(LOG_ERR, _("Not restarting.")); exit(0); } } @@ -467,7 +468,7 @@ main(int argc, char **argv, char **envp) RETSIGTYPE sigterm_handler(int a) { - if(debug_lvl > 0) + if(debug_lvl > DEBUG_NOTHING) syslog(LOG_NOTICE, _("Got TERM signal")); cleanup_and_exit(0); } @@ -475,7 +476,7 @@ sigterm_handler(int a) RETSIGTYPE sigquit_handler(int a) { - if(debug_lvl > 0) + if(debug_lvl > DEBUG_NOTHING) syslog(LOG_NOTICE, _("Got QUIT signal")); cleanup_and_exit(0); } @@ -504,7 +505,7 @@ sigsegv_handler(int a) } else { - syslog(LOG_NOTICE, _("Aieee! Not restarting.")); + syslog(LOG_NOTICE, _("Not restarting.")); exit(0); } } @@ -512,15 +513,15 @@ sigsegv_handler(int a) RETSIGTYPE sighup_handler(int a) { - if(debug_lvl > 0) - syslog(LOG_NOTICE, _("Got HUP signal, rereading configuration and restarting")); + if(debug_lvl > DEBUG_NOTHING) + syslog(LOG_NOTICE, _("Got HUP signal")); sighup = 1; } RETSIGTYPE sigint_handler(int a) { - if(debug_lvl > 0) + if(debug_lvl > DEBUG_NOTHING) syslog(LOG_NOTICE, _("Got INT signal, exiting")); cleanup_and_exit(0); } @@ -534,9 +535,10 @@ sigusr1_handler(int a) RETSIGTYPE sigusr2_handler(int a) { - if(debug_lvl > 1) - syslog(LOG_NOTICE, _("Got USR2 signal, forcing new key generation")); + dump_subnet_list(); /* FIXME: reprogram this. + if(debug_lvl > DEBUG_NOTHING) + syslog(LOG_NOTICE, _("Got USR2 signal, forcing new key generation")); regenerate_keys(); */ }