]> git.ozlabs.org Git - ppp.git/commitdiff
Removing option to configure PPP_WITH_MAXOCTETS, helps clean up the code and it can...
authorEivind Næss <eivnaes@yahoo.com>
Fri, 15 Jul 2022 22:21:27 +0000 (15:21 -0700)
committerEivind Næss <eivnaes@yahoo.com>
Fri, 15 Jul 2022 22:32:57 +0000 (15:32 -0700)
Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
configure.ac
pppd/auth.c
pppd/options.c
pppd/plugins/radius/radius.c
pppd/pppd.h
pppd/pppdconf.h.in

index a6cf82916c4a72751d6e89a8abf58b3975cabe70..5a134fa4cf59f29e4a80edf6cc874982313def7f 100644 (file)
@@ -116,13 +116,6 @@ AM_CONDITIONAL(PPP_WITH_CBCP, test "x${enable_cbcp}" = "xyes")
 AM_COND_IF([PPP_WITH_CBCP],
     AC_DEFINE([PPP_WITH_CBCP], 1, [Have Callback Protocol support]))
 
-#
-# Disable support for limiting session duration by maximum octets
-AC_ARG_ENABLE([maxoctets],
-    AS_HELP_STRING([--disable-maxoctets], [Disable support for limiting session by maximum octets]))
-AS_IF([test "x$enable_maxoctets" != "xno"],
-    AC_DEFINE([PPP_WITH_MAXOCTETS], 1, [Limit sessions by maximum number of octets]))
-
 #
 # Disable Microsoft extensions will remove CHAP and MPPE support
 AC_ARG_ENABLE([microsoft-extensions],
index 1e9cba09825555ad6146c984ebd1e739cad97796..fc2839009c35d0c76836d15f3ece65208b4bf9c9 100644 (file)
@@ -317,10 +317,7 @@ static int  set_noauth_addr (char **);
 static int  set_permitted_number (char **);
 static void check_access (FILE *, char *);
 static int  wordlist_count (struct wordlist *);
-
-#ifdef PPP_WITH_MAXOCTETS
 static void check_maxoctets (void *);
-#endif
 
 /*
  * Authentication-related options.
@@ -1164,10 +1161,8 @@ np_up(int unit, int proto)
        if (maxconnect > 0)
            TIMEOUT(connect_time_expired, 0, maxconnect);
 
-#ifdef PPP_WITH_MAXOCTETS
        if (maxoctets > 0)
            TIMEOUT(check_maxoctets, NULL, maxoctets_timeout);
-#endif
 
        /*
         * Detach now, if the updetach option was given.
@@ -1194,9 +1189,7 @@ np_down(int unit, int proto)
     if (--num_np_up == 0) {
        UNTIMEOUT(check_idle, NULL);
        UNTIMEOUT(connect_time_expired, NULL);
-#ifdef PPP_WITH_MAXOCTETS
        UNTIMEOUT(check_maxoctets, NULL);
-#endif 
        new_phase(PHASE_NETWORK);
     }
 }
@@ -1213,7 +1206,6 @@ np_finished(int unit, int proto)
     }
 }
 
-#ifdef PPP_WITH_MAXOCTETS
 static void
 check_maxoctets(void *arg)
 {
@@ -1246,7 +1238,6 @@ check_maxoctets(void *arg)
         TIMEOUT(check_maxoctets, NULL, maxoctets_timeout);
     }
 }
-#endif
 
 /*
  * check_idle - check whether the link has been idle for long
index ec36bfe6be540a9cddc786277eb895187903fe7e..1fbe46e642c316b28096f557f5ed5dc83cae0551 100644 (file)
@@ -138,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[];
@@ -184,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 *);
@@ -373,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 },
@@ -384,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 },
@@ -1574,7 +1568,6 @@ setlogfile(char **argv)
     return 1;
 }
 
-#ifdef PPP_WITH_MAXOCTETS
 static int
 setmodir(char **argv)
 {
@@ -1591,7 +1584,6 @@ setmodir(char **argv)
     }
     return 1;
 }
-#endif
 
 #ifdef PPP_WITH_PLUGINS
 static int
index 0417454d504ecbe52dd566639a978eb484740bf9..02875b4fec2069de9d31339b80df793bf8a709e5 100644 (file)
@@ -606,7 +606,6 @@ radius_setparams(VALUE_PAIR *vp, char *msg, REQUEST_INFO *req_info,
                /* idle parameter */
                idle_time_limit = vp->lvalue;
                break;
-#ifdef PPP_WITH_MAXOCTETS
            case PW_SESSION_OCTETS_LIMIT:
                /* Session traffic limit */
                maxoctets = vp->lvalue;
@@ -615,7 +614,6 @@ radius_setparams(VALUE_PAIR *vp, char *msg, REQUEST_INFO *req_info,
                /* Session traffic limit direction check */
                maxoctets_dir = ( vp->lvalue > 4 ) ? 0 : vp->lvalue ;
                break;
-#endif
            case PW_ACCT_INTERIM_INTERVAL:
                /* Send accounting updates every few seconds */
                rstate.acct_interim_interval = vp->lvalue;
@@ -1089,11 +1087,9 @@ radius_acct_stop(void)
            av_type = PW_ACCT_SESSION_TIMEOUT;
            break;
            
-#ifdef PPP_WITH_MAXOCTETS
        case EXIT_TRAFFIC_LIMIT:
            av_type = PW_NAS_REQUEST;
            break;
-#endif
 
        default:
            av_type = PW_NAS_ERROR;
index e59e0e508058d03dd9729129f68280f999ca1308..bd9faf0f993396742e87862d076b86e9be672b5b 100644 (file)
@@ -386,7 +386,6 @@ extern char *tls_verify_method;
 extern char *pkcs12_file;
 #endif /* PPP_WITH_EAPTLS */
 
-#ifdef PPP_WITH_MAXOCTETS
 extern unsigned int maxoctets;      /* Maximum octetes per session (in bytes) */
 extern int       maxoctets_dir;      /* Direction :
                                      0 - in+out (default)
@@ -400,7 +399,6 @@ extern int       maxoctets_timeout;  /* Timeout for check of octets limit */
 #define PPP_OCTETS_DIRECTION_MAXOVERAL  3
 /* same as previos, but little different on RADIUS side */
 #define PPP_OCTETS_DIRECTION_MAXSESSION 4
-#endif
 
 #ifdef PPP_WITH_FILTER
 extern struct  bpf_program pass_filter;   /* Filter for pkts to pass */
@@ -895,9 +893,7 @@ extern void (*snoop_send_hook)(unsigned char *p, int len);
 #define EXIT_LOOPBACK          17
 #define EXIT_INIT_FAILED       18
 #define EXIT_AUTH_TOPEER_FAILED        19
-#ifdef PPP_WITH_MAXOCTETS
 #define EXIT_TRAFFIC_LIMIT     20
-#endif
 #define EXIT_CNID_AUTH_FAILED  21
 
 /*
index 2ae6255ac9460ab937475c82229dd57faa2b3e34..64c37f7f6c97b77f49535a53a216a0761c01b375 100644 (file)
@@ -24,9 +24,6 @@
 /* Have support for loadable plugins */
 #undef PPP_WITH_PLUGINS
 
-/* Limit sessions by maximum number of octets */
-#undef PPP_WITH_MAXOCTETS
-
 /* Have Callback Protocol support */
 #undef PPP_WITH_CBCP