#include <syslog.h>
#include <string.h>
#include <pwd.h>
+#include <sys/param.h>
+#include <net/if.h>
#ifdef PPP_WITH_PLUGINS
#include <dlfcn.h>
#endif
-#ifdef PPP_FILTER
+#ifdef PPP_WITH_FILTER
#include <pcap.h>
/*
* There have been 3 or 4 different names for this in libpcap CVS, but
#define DLT_PPP_PPPD DLT_PPP
#endif
#endif
-#endif /* PPP_FILTER */
+#endif /* PPP_WITH_FILTER */
#include "pppd.h"
#include "pathnames.h"
char path_ipv6down[MAXPATHLEN]; /* pathname of ipv6-down script */
#endif
-#ifdef MAXOCTETS
unsigned int maxoctets = 0; /* default - no limit */
int maxoctets_dir = 0; /* default - sum of traffic */
int maxoctets_timeout = 1; /* default 1 second */
-#endif
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
static int loadplugin(char **);
#endif
-#ifdef PPP_FILTER
+#ifdef PPP_WITH_FILTER
static int setpassfilter(char **);
static int setactivefilter(char **);
#endif
-#ifdef MAXOCTETS
static int setmodir(char **);
-#endif
static int user_setenv(char **);
static void user_setprint(option_t *, printer_func, void *);
"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 },
"set filter for active pkts", OPT_PRIO },
#endif
-#ifdef MAXOCTETS
{ "maxoctets", o_int, &maxoctets,
"Set connection traffic limit",
OPT_PRIO | OPT_LLIMIT | OPT_NOINCR | OPT_ZEROINF },
"Set direction for limit traffic (sum,in,out,max)" },
{ "mo-timeout", o_int, &maxoctets_timeout,
"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 },
pw = getpwuid(getuid());
if (pw == NULL || (user = pw->pw_dir) == NULL || user[0] == 0)
return 1;
- file = _PATH_USEROPT;
+ file = PPP_PATH_USEROPT;
pl = strlen(user) + strlen(file) + 2;
path = malloc(pl);
if (path == NULL)
dev = p + 5;
if (dev[0] == 0 || strcmp(dev, "tty") == 0)
return 1; /* don't look for /etc/ppp/options.tty */
- pl = strlen(_PATH_TTYOPT) + strlen(dev) + 1;
+ pl = strlen(PPP_PATH_TTYOPT) + strlen(dev) + 1;
path = malloc(pl);
if (path == NULL)
novm("tty init file name");
- slprintf(path, pl, "%s%s", _PATH_TTYOPT, dev);
+ slprintf(path, pl, "%s%s", PPP_PATH_TTYOPT, dev);
/* Turn slashes into dots, for Solaris case (e.g. /dev/term/a) */
- for (p = path + strlen(_PATH_TTYOPT); *p != 0; ++p)
+ for (p = path + strlen(PPP_PATH_TTYOPT); *p != 0; ++p)
if (*p == '/')
*p = '.';
option_priority = OPRIO_CFGFILE;
return 0;
}
- l = strlen(arg) + strlen(_PATH_PEERFILES) + 1;
+ l = strlen(arg) + strlen(PPP_PATH_PEERFILES) + 1;
if ((fname = (char *) malloc(l)) == NULL)
novm("call file name");
- slprintf(fname, l, "%s%s", _PATH_PEERFILES, arg);
+ slprintf(fname, l, "%s%s", PPP_PATH_PEERFILES, arg);
script_setenv("CALL_FILE", arg, 0);
ok = options_from_file(fname, 1, 1, 1);
return ok;
}
-#ifdef PPP_FILTER
+#ifdef PPP_WITH_FILTER
/*
* setpassfilter - Set the pass filter for packets
*/
return 1;
}
-#ifdef MAXOCTETS
static int
setmodir(char **argv)
{
}
return 1;
}
-#endif
#ifdef PPP_WITH_PLUGINS
static int
const char *vers;
if (strchr(arg, '/') == 0) {
- const char *base = _PATH_PLUGIN;
+ const char *base = PPP_PATH_PLUGIN;
int l = strlen(base) + strlen(arg) + 2;
path = malloc(l);
if (path == 0)