… | |
… | |
41 | #include "pidfile.h" |
41 | #include "pidfile.h" |
42 | |
42 | |
43 | #include "conf.h" |
43 | #include "conf.h" |
44 | #include "slog.h" |
44 | #include "slog.h" |
45 | #include "util.h" |
45 | #include "util.h" |
46 | #include "protocol.h" |
46 | #include "vpn.h" |
47 | #include "iom.h" |
47 | #include "iom.h" |
48 | |
48 | |
49 | vpn network; |
49 | vpn network; |
50 | |
50 | |
51 | static loglevel llevel = L_NONE; |
51 | static loglevel llevel = L_NONE; |
… | |
… | |
180 | } |
180 | } |
181 | |
181 | |
182 | RETSIGTYPE |
182 | RETSIGTYPE |
183 | sigusr1_handler (int a) |
183 | sigusr1_handler (int a) |
184 | { |
184 | { |
|
|
185 | network.dump_status (); |
185 | } |
186 | } |
186 | |
187 | |
187 | RETSIGTYPE |
188 | RETSIGTYPE |
188 | sigusr2_handler (int a) |
189 | sigusr2_handler (int a) |
189 | { |
190 | { |
… | |
… | |
199 | |
200 | |
200 | act.sa_handler = sighup_handler; sigaction (SIGHUP , &act, NULL); |
201 | act.sa_handler = sighup_handler; sigaction (SIGHUP , &act, NULL); |
201 | act.sa_handler = sigusr1_handler; sigaction (SIGUSR1, &act, NULL); |
202 | act.sa_handler = sigusr1_handler; sigaction (SIGUSR1, &act, NULL); |
202 | act.sa_handler = sigusr2_handler; sigaction (SIGUSR2, &act, NULL); |
203 | act.sa_handler = sigusr2_handler; sigaction (SIGUSR2, &act, NULL); |
203 | act.sa_handler = SIG_IGN; sigaction (SIGCHLD, &act, NULL); |
204 | act.sa_handler = SIG_IGN; sigaction (SIGCHLD, &act, NULL); |
|
|
205 | act.sa_handler = SIG_IGN; sigaction (SIGPIPE, &act, NULL); |
204 | act.sa_flags = SA_RESETHAND; |
206 | act.sa_flags = SA_RESETHAND; |
205 | act.sa_handler = sigterm_handler; sigaction (SIGINT , &act, NULL); |
207 | act.sa_handler = sigterm_handler; sigaction (SIGINT , &act, NULL); |
206 | act.sa_handler = sigterm_handler; sigaction (SIGTERM, &act, NULL); |
208 | act.sa_handler = sigterm_handler; sigaction (SIGTERM, &act, NULL); |
207 | } |
209 | } |
208 | |
210 | |
… | |
… | |
219 | |
221 | |
220 | parse_options (argc, argv, envp); |
222 | parse_options (argc, argv, envp); |
221 | |
223 | |
222 | if (show_version) |
224 | if (show_version) |
223 | { |
225 | { |
224 | printf (_("%s version %s (built %s %s, protocol %d:%d)\n"), get_identity (), |
226 | printf (_("%s version %s (built %s %s, protocol %d.%d)\n"), get_identity (), |
225 | VERSION, __DATE__, __TIME__, PROTOCOL_MAJOR, PROTOCOL_MINOR); |
227 | VERSION, __DATE__, __TIME__, PROTOCOL_MAJOR, PROTOCOL_MINOR); |
226 | printf (_ |
228 | printf (_ |
227 | ("Copyright (C) 2003 Marc Lehmann <vpe@plan9.de> and others.\n" |
229 | ("Copyright (C) 2003 Marc Lehmann <vpe@plan9.de> and others.\n" |
228 | "See the AUTHORS file for a complete list.\n\n" |
230 | "See the AUTHORS file for a complete list.\n\n" |
229 | "tinc comes with ABSOLUTELY NO WARRANTY. This is free software,\n" |
231 | "tinc comes with ABSOLUTELY NO WARRANTY. This is free software,\n" |