summaryrefslogtreecommitdiff
path: root/pppd
diff options
context:
space:
mode:
authorEivind Næss <eivnaes@yahoo.com>2022-07-15 15:21:27 -0700
committerEivind Næss <eivnaes@yahoo.com>2022-07-15 15:32:57 -0700
commitebe6b4ad00c2290a9147b9bedb57c1c49bb18b02 (patch)
tree194316cf76ef19a806dd96606569cab32716efa5 /pppd
parentee860dc3de8647e67bc907bd9fd60650a22155ca (diff)
downloadppp-ebe6b4ad00c2290a9147b9bedb57c1c49bb18b02.tar.gz
Removing option to configure PPP_WITH_MAXOCTETS, helps clean up the code and it can be controlled via config options. It does nothing by default
Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
Diffstat (limited to 'pppd')
-rw-r--r--pppd/auth.c9
-rw-r--r--pppd/options.c8
-rw-r--r--pppd/plugins/radius/radius.c4
-rw-r--r--pppd/pppd.h4
-rw-r--r--pppd/pppdconf.h.in3
5 files changed, 0 insertions, 28 deletions
diff --git a/pppd/auth.c b/pppd/auth.c
index 1e9cba0..fc28390 100644
--- a/pppd/auth.c
+++ b/pppd/auth.c
@@ -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
diff --git a/pppd/options.c b/pppd/options.c
index ec36bfe..1fbe46e 100644
--- a/pppd/options.c
+++ b/pppd/options.c
@@ -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
diff --git a/pppd/plugins/radius/radius.c b/pppd/plugins/radius/radius.c
index 0417454..02875b4 100644
--- a/pppd/plugins/radius/radius.c
+++ b/pppd/plugins/radius/radius.c
@@ -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;
diff --git a/pppd/pppd.h b/pppd/pppd.h
index e59e0e5..bd9faf0 100644
--- a/pppd/pppd.h
+++ b/pppd/pppd.h
@@ -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
/*
diff --git a/pppd/pppdconf.h.in b/pppd/pppdconf.h.in
index 2ae6255..64c37f7 100644
--- a/pppd/pppdconf.h.in
+++ b/pppd/pppdconf.h.in
@@ -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