From c970e06ccf646c8d420b2216f605eefeef3cdc0d Mon Sep 17 00:00:00 2001 From: brian Date: Thu, 28 Jan 1999 01:56:34 +0000 Subject: Initial RADIUS support (using libradius). See the man page for details. Compiling with -DNORADIUS (the default for `release') removes support. TODO: The functionality in libradius::rad_send_request() needs to be supplied as a set of routines so that ppp doesn't have to wait indefinitely for the radius server(s). Instead, we need to get a descriptor back, select() on the descriptor, and ask libradius to service it when necessary. For now, ppp blocks SIGALRM while in rad_send_request(), so it misses PAP/CHAP retries & timeouts if they occur. Only PAP is functional. When CHAP is attempted, libradius complains that no User-Password has been specified... rfc2138 says that it *mustn't* be used for CHAP :-( Sponsored by: Internet Business Solutions Ltd., Switzerland --- usr.sbin/ppp/bundle.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'usr.sbin/ppp/bundle.c') diff --git a/usr.sbin/ppp/bundle.c b/usr.sbin/ppp/bundle.c index 89388b9..681cafd 100644 --- a/usr.sbin/ppp/bundle.c +++ b/usr.sbin/ppp/bundle.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: bundle.c,v 1.42 1998/12/14 19:24:28 brian Exp $ + * $Id: bundle.c,v 1.43 1999/01/06 00:08:03 brian Exp $ */ #include @@ -76,6 +76,9 @@ #include "ccp.h" #include "link.h" #include "mp.h" +#ifndef NORADIUS +#include "radius.h" +#endif #include "bundle.h" #include "async.h" #include "physical.h" @@ -134,7 +137,6 @@ bundle_NewPhase(struct bundle *bundle, u_int new) break; case PHASE_NETWORK: - ipcp_Setup(&bundle->ncp.ipcp); fsm_Up(&bundle->ncp.ipcp.fsm); fsm_Open(&bundle->ncp.ipcp.fsm); bundle->phase = new; @@ -874,6 +876,9 @@ bundle_Create(const char *prefix, int type, const char **argv) bundle.autoload.done = 0; bundle.autoload.running = 0; memset(&bundle.choked.timer, '\0', sizeof bundle.choked.timer); +#ifndef NORADIUS + radius_Init(&bundle.radius); +#endif /* Clean out any leftover crud */ iface_Clear(bundle.iface, IFACE_CLEAR_ALL); @@ -933,6 +938,11 @@ bundle_Destroy(struct bundle *bundle) ipcp_CleanInterface(&bundle->ncp.ipcp); bundle_DownInterface(bundle); +#ifndef NORADIUS + /* Tell the radius server the bad news */ + radius_Destroy(&bundle->radius); +#endif + /* Again, these are all DATALINK_CLOSED unless we're abending */ dl = bundle->links; while (dl) @@ -1224,6 +1234,11 @@ bundle_ShowStatus(struct cmdargs const *arg) prompt_Printf(arg->prompt, " Choked Timer: %ds\n", arg->bundle->cfg.choked.timeout); + +#ifndef NORADIUS + radius_Show(&arg->bundle->radius, arg->prompt); +#endif + prompt_Printf(arg->prompt, " Idle Timer: "); if (arg->bundle->cfg.idle_timeout) { prompt_Printf(arg->prompt, "%ds", arg->bundle->cfg.idle_timeout); -- cgit v1.1