X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fplugins%2Fpppoe%2Fpppoe-discovery.c;h=15a80fb4a5bb7007d220e84f46dc9a1477e2cd58;hb=edc1926d935237c301b69c8f793710dcbe3d8976;hp=10f51dc975dbd9df1a851ca056f586770e09aa8d;hpb=3492e78b33c8ef96ec4b4e6e2766cd700fd205e7;p=ppp.git diff --git a/pppd/plugins/pppoe/pppoe-discovery.c b/pppd/plugins/pppoe/pppoe-discovery.c index 10f51dc..15a80fb 100644 --- a/pppd/plugins/pppoe/pppoe-discovery.c +++ b/pppd/plugins/pppoe/pppoe-discovery.c @@ -10,7 +10,7 @@ */ #ifdef HAVE_CONFIG_H -#include +#include "config.h" #endif #include @@ -21,6 +21,9 @@ #include #include #include +#include +#include +#include #include "pppoe.h" @@ -123,6 +126,17 @@ get_time(struct timeval *tv) return gettimeofday(tv, NULL); } +int signaled(int signal) { + if (signal == SIGTERM) + return got_sigterm; + return 0; +} + +bool debug_on() +{ + return !!debug; +} + static void term_handler(int signum) { @@ -207,7 +221,7 @@ int main(int argc, char *argv[]) optarg, strerror(errno)); exit(1); } - fprintf(debugFile, "pppoe-discovery from pppd %s\n", VERSION); + fprintf(debugFile, "pppoe-discovery from pppd %s\n", PPPD_VERSION); break; case 'I': conn->ifName = xstrdup(optarg); @@ -269,5 +283,5 @@ usage(void) " -U -- Use Host-Unique to allow multiple PPPoE sessions.\n" " -W hexvalue -- Set the Host-Unique to the supplied hex string.\n" " -h -- Print usage information.\n"); - fprintf(stderr, "\npppoe-discovery from pppd " VERSION "\n"); + fprintf(stderr, "\npppoe-discovery from pppd " PPPD_VERSION "\n"); }