Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
AM_COND_IF([PPP_WITH_CBCP],
AC_DEFINE([PPP_WITH_CBCP], 1, [Have Callback Protocol support]))
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],
#
# Disable Microsoft extensions will remove CHAP and MPPE support
AC_ARG_ENABLE([microsoft-extensions],
static int set_permitted_number (char **);
static void check_access (FILE *, char *);
static int wordlist_count (struct wordlist *);
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 *);
static void check_maxoctets (void *);
/*
* Authentication-related options.
/*
* Authentication-related options.
if (maxconnect > 0)
TIMEOUT(connect_time_expired, 0, maxconnect);
if (maxconnect > 0)
TIMEOUT(connect_time_expired, 0, maxconnect);
-#ifdef PPP_WITH_MAXOCTETS
if (maxoctets > 0)
TIMEOUT(check_maxoctets, NULL, maxoctets_timeout);
if (maxoctets > 0)
TIMEOUT(check_maxoctets, NULL, maxoctets_timeout);
/*
* Detach now, if the updetach option was given.
/*
* Detach now, if the updetach option was given.
if (--num_np_up == 0) {
UNTIMEOUT(check_idle, NULL);
UNTIMEOUT(connect_time_expired, NULL);
if (--num_np_up == 0) {
UNTIMEOUT(check_idle, NULL);
UNTIMEOUT(connect_time_expired, NULL);
-#ifdef PPP_WITH_MAXOCTETS
UNTIMEOUT(check_maxoctets, NULL);
UNTIMEOUT(check_maxoctets, NULL);
new_phase(PHASE_NETWORK);
}
}
new_phase(PHASE_NETWORK);
}
}
-#ifdef PPP_WITH_MAXOCTETS
static void
check_maxoctets(void *arg)
{
static void
check_maxoctets(void *arg)
{
TIMEOUT(check_maxoctets, NULL, maxoctets_timeout);
}
}
TIMEOUT(check_maxoctets, NULL, maxoctets_timeout);
}
}
/*
* check_idle - check whether the link has been idle for long
/*
* check_idle - check whether the link has been idle for long
char path_ipv6down[MAXPATHLEN]; /* pathname of ipv6-down script */
#endif
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 */
unsigned int maxoctets = 0; /* default - no limit */
int maxoctets_dir = 0; /* default - sum of traffic */
int maxoctets_timeout = 1; /* default 1 second */
extern option_t auth_options[];
extern option_t auth_options[];
static int setactivefilter(char **);
#endif
static int setactivefilter(char **);
#endif
-#ifdef PPP_WITH_MAXOCTETS
static int setmodir(char **);
static int setmodir(char **);
static int user_setenv(char **);
static void user_setprint(option_t *, printer_func, void *);
static int user_setenv(char **);
static void user_setprint(option_t *, printer_func, void *);
"set filter for active pkts", OPT_PRIO },
#endif
"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 },
{ "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 },
"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 },
/* Dummy option, does nothing */
{ "noipx", o_bool, &noipx_opt, NULL, OPT_NOPRINT | 1 },
/* Dummy option, does nothing */
{ "noipx", o_bool, &noipx_opt, NULL, OPT_NOPRINT | 1 },
-#ifdef PPP_WITH_MAXOCTETS
static int
setmodir(char **argv)
{
static int
setmodir(char **argv)
{
#ifdef PPP_WITH_PLUGINS
static int
#ifdef PPP_WITH_PLUGINS
static int
/* idle parameter */
idle_time_limit = vp->lvalue;
break;
/* idle parameter */
idle_time_limit = vp->lvalue;
break;
-#ifdef PPP_WITH_MAXOCTETS
case PW_SESSION_OCTETS_LIMIT:
/* Session traffic limit */
maxoctets = vp->lvalue;
case PW_SESSION_OCTETS_LIMIT:
/* Session traffic limit */
maxoctets = vp->lvalue;
/* Session traffic limit direction check */
maxoctets_dir = ( vp->lvalue > 4 ) ? 0 : vp->lvalue ;
break;
/* Session traffic limit direction check */
maxoctets_dir = ( vp->lvalue > 4 ) ? 0 : vp->lvalue ;
break;
case PW_ACCT_INTERIM_INTERVAL:
/* Send accounting updates every few seconds */
rstate.acct_interim_interval = vp->lvalue;
case PW_ACCT_INTERIM_INTERVAL:
/* Send accounting updates every few seconds */
rstate.acct_interim_interval = vp->lvalue;
av_type = PW_ACCT_SESSION_TIMEOUT;
break;
av_type = PW_ACCT_SESSION_TIMEOUT;
break;
-#ifdef PPP_WITH_MAXOCTETS
case EXIT_TRAFFIC_LIMIT:
av_type = PW_NAS_REQUEST;
break;
case EXIT_TRAFFIC_LIMIT:
av_type = PW_NAS_REQUEST;
break;
default:
av_type = PW_NAS_ERROR;
default:
av_type = PW_NAS_ERROR;
extern char *pkcs12_file;
#endif /* PPP_WITH_EAPTLS */
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)
extern unsigned int maxoctets; /* Maximum octetes per session (in bytes) */
extern int maxoctets_dir; /* Direction :
0 - in+out (default)
#define PPP_OCTETS_DIRECTION_MAXOVERAL 3
/* same as previos, but little different on RADIUS side */
#define PPP_OCTETS_DIRECTION_MAXSESSION 4
#define PPP_OCTETS_DIRECTION_MAXOVERAL 3
/* same as previos, but little different on RADIUS side */
#define PPP_OCTETS_DIRECTION_MAXSESSION 4
#ifdef PPP_WITH_FILTER
extern struct bpf_program pass_filter; /* Filter for pkts to pass */
#ifdef PPP_WITH_FILTER
extern struct bpf_program pass_filter; /* Filter for pkts to pass */
#define EXIT_LOOPBACK 17
#define EXIT_INIT_FAILED 18
#define EXIT_AUTH_TOPEER_FAILED 19
#define EXIT_LOOPBACK 17
#define EXIT_INIT_FAILED 18
#define EXIT_AUTH_TOPEER_FAILED 19
-#ifdef PPP_WITH_MAXOCTETS
#define EXIT_TRAFFIC_LIMIT 20
#define EXIT_TRAFFIC_LIMIT 20
#define EXIT_CNID_AUTH_FAILED 21
/*
#define EXIT_CNID_AUTH_FAILED 21
/*
/* Have support for loadable plugins */
#undef PPP_WITH_PLUGINS
/* 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
/* Have Callback Protocol support */
#undef PPP_WITH_CBCP