X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Foptions.c;h=ec36bfe6be540a9cddc786277eb895187903fe7e;hb=509f04959ad891d7f981f035ed461d51bd1f74b0;hp=c9592837473b9becd62bf8fa5c998e2c73d21a52;hpb=7f8c1a1f8e486b232340fd9a0a19c5d34f1c5ae0;p=ppp.git diff --git a/pppd/options.c b/pppd/options.c index c959283..ec36bfe 100644 --- a/pppd/options.c +++ b/pppd/options.c @@ -54,11 +54,13 @@ #include #include #include -#ifdef PLUGIN +#include +#include +#ifdef PPP_WITH_PLUGINS #include #endif -#ifdef PPP_FILTER +#ifdef PPP_WITH_FILTER #include /* * There have been 3 or 4 different names for this in libpcap CVS, but @@ -73,7 +75,7 @@ #define DLT_PPP_PPPD DLT_PPP #endif #endif -#endif /* PPP_FILTER */ +#endif /* PPP_WITH_FILTER */ #include "pppd.h" #include "pathnames.h" @@ -131,12 +133,12 @@ int child_wait = 5; /* # seconds to wait for children at exit */ struct userenv *userenv_list; /* user environment variables */ int dfl_route_metric = -1; /* metric of the default route to set over the PPP link */ -#ifdef INET6 +#ifdef PPP_WITH_IPV6CP char path_ipv6up[MAXPATHLEN]; /* pathname of ipv6-up script */ char path_ipv6down[MAXPATHLEN]; /* pathname of ipv6-down script */ #endif -#ifdef MAXOCTETS +#ifdef PPP_WITH_MAXOCTETS unsigned int maxoctets = 0; /* default - no limit */ int maxoctets_dir = 0; /* default - sum of traffic */ int maxoctets_timeout = 1; /* default 1 second */ @@ -146,7 +148,7 @@ int maxoctets_timeout = 1; /* default 1 second */ extern option_t auth_options[]; extern struct stat devstat; -#ifdef PPP_FILTER +#ifdef PPP_WITH_FILTER struct bpf_program pass_filter;/* Filter program for packets to pass */ struct bpf_program active_filter; /* Filter program for link-active pkts */ #endif @@ -161,6 +163,8 @@ bool devnam_fixed; /* can no longer change device name */ static int logfile_fd = -1; /* fd opened for log file */ static char logfile_name[MAXPATHLEN]; /* name of log file */ +static bool noipx_opt; /* dummy for noipx option */ + /* * Prototypes */ @@ -171,16 +175,16 @@ static int showversion(char **); static int showhelp(char **); static void usage(void); static int setlogfile(char **); -#ifdef PLUGIN +#ifdef PPP_WITH_PLUGINS static int loadplugin(char **); #endif -#ifdef PPP_FILTER +#ifdef PPP_WITH_FILTER static int setpassfilter(char **); static int setactivefilter(char **); #endif -#ifdef MAXOCTETS +#ifdef PPP_WITH_MAXOCTETS static int setmodir(char **); #endif @@ -333,7 +337,7 @@ option_t general_options[] = { "Set pathname of ip-down script", OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN }, -#ifdef INET6 +#ifdef PPP_WITH_IPV6CP { "ipv6-up-script", o_string, path_ipv6up, "Set pathname of ipv6-up script", OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN }, @@ -342,7 +346,7 @@ option_t general_options[] = { OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN }, #endif -#ifdef HAVE_MULTILINK +#ifdef PPP_WITH_MULTILINK { "multilink", o_bool, &multilink, "Enable multilink operation", OPT_PRIO | 1 }, { "mp", o_bool, &multilink, @@ -354,14 +358,14 @@ option_t general_options[] = { { "bundle", o_string, &bundle_name, "Bundle name for multilink", OPT_PRIO }, -#endif /* HAVE_MULTILINK */ +#endif /* PPP_WITH_MULTILINK */ -#ifdef PLUGIN +#ifdef PPP_WITH_PLUGINS { "plugin", o_special, (void *)loadplugin, "Load a plug-in module into pppd", OPT_PRIV | OPT_A2LIST }, #endif -#ifdef PPP_FILTER +#ifdef PPP_WITH_FILTER { "pass-filter", o_special, setpassfilter, "set filter for packets to pass", OPT_PRIO }, @@ -369,7 +373,7 @@ option_t general_options[] = { "set filter for active pkts", OPT_PRIO }, #endif -#ifdef MAXOCTETS +#ifdef PPP_WITH_MAXOCTETS { "maxoctets", o_int, &maxoctets, "Set connection traffic limit", OPT_PRIO | OPT_LLIMIT | OPT_NOINCR | OPT_ZEROINF }, @@ -382,6 +386,9 @@ option_t general_options[] = { "Check for traffic limit every N seconds", OPT_PRIO | OPT_LLIMIT | 1 }, #endif + /* Dummy option, does nothing */ + { "noipx", o_bool, &noipx_opt, NULL, OPT_NOPRINT | 1 }, + { NULL } }; @@ -1477,7 +1484,7 @@ callfile(char **argv) return ok; } -#ifdef PPP_FILTER +#ifdef PPP_WITH_FILTER /* * setpassfilter - Set the pass filter for packets */ @@ -1567,7 +1574,7 @@ setlogfile(char **argv) return 1; } -#ifdef MAXOCTETS +#ifdef PPP_WITH_MAXOCTETS static int setmodir(char **argv) { @@ -1586,7 +1593,7 @@ setmodir(char **argv) } #endif -#ifdef PLUGIN +#ifdef PPP_WITH_PLUGINS static int loadplugin(char **argv) { @@ -1639,7 +1646,7 @@ loadplugin(char **argv) free(path); return 0; } -#endif /* PLUGIN */ +#endif /* PPP_WITH_PLUGINS */ /* * Set an environment variable specified by the user.