]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/options.c
Let ./configure control the paths for pppd
[ppp.git] / pppd / options.c
index 42a3456429fb682df83bf26eb467d78c62f25985..92997e6c2310d1cd67c6bb2ce1a3bfc99ab21164 100644 (file)
@@ -54,6 +54,8 @@
 #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
@@ -136,11 +138,9 @@ char       path_ipv6up[MAXPATHLEN];   /* pathname of ipv6-up script */
 char   path_ipv6down[MAXPATHLEN]; /* pathname of ipv6-down script */
 #endif
 
-#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 */ 
-#endif
 
 
 extern option_t auth_options[];
@@ -182,9 +182,7 @@ static int setpassfilter(char **);
 static int setactivefilter(char **);
 #endif
 
-#ifdef PPP_WITH_MAXOCTETS
 static int setmodir(char **);
-#endif
 
 static int user_setenv(char **);
 static void user_setprint(option_t *, printer_func, void *);
@@ -371,7 +369,6 @@ option_t general_options[] = {
       "set filter for active pkts", OPT_PRIO },
 #endif
 
-#ifdef PPP_WITH_MAXOCTETS
     { "maxoctets", o_int, &maxoctets,
       "Set connection traffic limit",
       OPT_PRIO | OPT_LLIMIT | OPT_NOINCR | OPT_ZEROINF },
@@ -382,7 +379,6 @@ option_t general_options[] = {
       "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 },
@@ -535,7 +531,7 @@ options_from_user(void)
     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)
@@ -567,13 +563,13 @@ options_for_tty(void)
        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;
@@ -1470,10 +1466,10 @@ callfile(char **argv)
        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);
@@ -1572,7 +1568,6 @@ setlogfile(char **argv)
     return 1;
 }
 
-#ifdef PPP_WITH_MAXOCTETS
 static int
 setmodir(char **argv)
 {
@@ -1589,7 +1584,6 @@ setmodir(char **argv)
     }
     return 1;
 }
-#endif
 
 #ifdef PPP_WITH_PLUGINS
 static int
@@ -1603,7 +1597,7 @@ loadplugin(char **argv)
     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)