*/
#ifndef lint
-static char rcsid[] = "$Id: auth.c,v 1.30 1997/03/04 03:37:21 paulus Exp $";
+static char rcsid[] = "$Id: auth.c,v 1.31 1997/04/30 05:50:16 paulus Exp $";
#endif
#include <stdio.h>
#include <netinet/in.h>
#include <arpa/inet.h>
-#if defined(SVR4) || defined(_linux_)
-#include <crypt.h>
-#else
-#if defined(SUNOS4) || defined(ULTRIX)
-extern char *crypt();
-#endif
-#endif
-
#ifdef USE_PAM
#include <security/pam_appl.h>
#include <security/pam_modules.h>
#ifdef HAS_SHADOW
#include <shadow.h>
+#ifndef SVR4
#include <shadow/pwauth.h>
+#endif
#ifndef PW_PPP
#define PW_PPP PW_LOGIN
#endif
#define CHAP_WITHPEER 4
#define CHAP_PEER 8
+extern char *crypt __P((const char *, const char *));
+
/* Prototypes for procedures local to this file. */
static void network_phase __P((int));
-static void check_idle __P((caddr_t));
-static void connect_time_expired __P((caddr_t));
+static void check_idle __P((void *));
+static void connect_time_expired __P((void *));
static int login __P((char *, char *, char **, int *));
static void logout __P((void));
static int null_login __P((int));
*/
static void
check_idle(arg)
- caddr_t arg;
+ void *arg;
{
struct ppp_idle idle;
time_t itime;
*/
static void
connect_time_expired(arg)
- caddr_t arg;
+ void *arg;
{
syslog(LOG_INFO, "Connect time expired");
lcp_close(0, "Connect time expired"); /* Close connection */
option_error("can't override device name when noauth option used");
exit(1);
}
- if (connector != NULL && connector_info.priv == 0
- || disconnector != NULL && disconnector_info.priv == 0
- || welcomer != NULL && welcomer_info.priv == 0) {
+ if ((connector != NULL && connector_info.priv == 0)
+ || (disconnector != NULL && disconnector_info.priv == 0)
+ || (welcomer != NULL && welcomer_info.priv == 0)) {
option_error("can't override connect, disconnect or welcome");
option_error("option values when noauth option used");
exit(1);
#else /* #ifdef USE_PAM */
struct passwd *pw;
- char *epasswd;
#ifdef HAS_SHADOW
struct spwd *spwd;
if (ptr_mask != NULL)
*ptr_mask = '/';
- if (a == -1L)
+ if (a == (u_int32_t)-1L)
syslog (LOG_WARNING,
"unknown host %s in auth. address list",
addrs->word);
*/
#ifndef lint
-static char rcsid[] = "$Id: cbcp.c,v 1.1 1996/10/08 04:35:41 paulus Exp $";
+static char rcsid[] = "$Id: cbcp.c,v 1.2 1997/04/30 05:50:26 paulus Exp $";
#endif
#include <stdio.h>
/* internal prototypes */
-void cbcp_recvreq(cbcp_state *us, char *pckt, int len);
-void cbcp_resp(cbcp_state *us);
-void cbcp_up(cbcp_state *us);
-void cbcp_recvack(cbcp_state *us, char *pckt, int len);
-void cbcp_send(cbcp_state *us, u_char code, u_char *buf, int len);
+static void cbcp_recvreq __P((cbcp_state *us, char *pckt, int len));
+static void cbcp_resp __P((cbcp_state *us));
+static void cbcp_up __P((cbcp_state *us));
+static void cbcp_recvack __P((cbcp_state *us, char *pckt, int len));
+static void cbcp_send __P((cbcp_state *us, u_char code, u_char *buf, int len));
/* init state */
static void
void *arg;
{
int code, opt, id, len, olen, delay;
- u_char *pstart, *optend;
- u_short cishort;
- u_long cilong;
+ u_char *pstart;
if (plen < HEADERLEN)
return 0;
PUTCHAR(len , bufp);
PUTCHAR(0, bufp);
cbcp_send(us, CBCP_RESP, buf, len);
- ipcp_open(us->us_unit);
+ (*ipcp_protent.open)(us->us_unit);
return;
}
}
cbcp_state *us;
{
persist = 0;
- lcp_close(0);
+ lcp_close(0, "Call me back, please");
}
*/
#ifndef lint
-static char rcsid[] = "$Id: ccp.c,v 1.19 1996/09/26 06:20:52 paulus Exp $";
+static char rcsid[] = "$Id: ccp.c,v 1.20 1997/04/30 05:50:40 paulus Exp $";
#endif
#include <string.h>
static void ccp_up __P((fsm *));
static void ccp_down __P((fsm *));
static int ccp_extcode __P((fsm *, int, int, u_char *, int));
-static void ccp_rack_timeout __P(());
+static void ccp_rack_timeout __P((void *));
static char *method_name __P((ccp_options *, ccp_options *));
static fsm_callbacks ccp_callbacks = {
case CCP_RESETACK:
if (ccp_localstate[f->unit] & RACK_PENDING && id == f->reqid) {
ccp_localstate[f->unit] &= ~(RACK_PENDING | RREQ_REPEAT);
- UNTIMEOUT(ccp_rack_timeout, (caddr_t) f);
+ UNTIMEOUT(ccp_rack_timeout, f);
}
break;
if (newret == CONFNAK && dont_nak)
newret = CONFREJ;
- if (!(newret == CONFACK || newret == CONFNAK && ret == CONFREJ)) {
+ if (!(newret == CONFACK || (newret == CONFNAK && ret == CONFREJ))) {
/* we're returning this option */
if (newret == CONFREJ && ret == CONFNAK)
retp = p0;
fsm *f;
{
if (ccp_localstate[f->unit] & RACK_PENDING)
- UNTIMEOUT(ccp_rack_timeout, (caddr_t) f);
+ UNTIMEOUT(ccp_rack_timeout, f);
ccp_localstate[f->unit] = 0;
ccp_flags_set(f->unit, 1, 0);
}
*/
if (!(ccp_localstate[f->unit] & RACK_PENDING)) {
fsm_sdata(f, CCP_RESETREQ, f->reqid = ++f->id, NULL, 0);
- TIMEOUT(ccp_rack_timeout, (caddr_t) f, RACKTIMEOUT);
+ TIMEOUT(ccp_rack_timeout, f, RACKTIMEOUT);
ccp_localstate[f->unit] |= RACK_PENDING;
} else
ccp_localstate[f->unit] |= RREQ_REPEAT;
*/
static void
ccp_rack_timeout(arg)
- caddr_t arg;
+ void *arg;
{
- fsm *f = (fsm *) arg;
+ fsm *f = arg;
if (f->state == OPENED && ccp_localstate[f->unit] & RREQ_REPEAT) {
fsm_sdata(f, CCP_RESETREQ, f->reqid, NULL, 0);
- TIMEOUT(ccp_rack_timeout, (caddr_t) f, RACKTIMEOUT);
+ TIMEOUT(ccp_rack_timeout, f, RACKTIMEOUT);
ccp_localstate[f->unit] &= ~RREQ_REPEAT;
} else
ccp_localstate[f->unit] &= ~RACK_PENDING;
*/
#ifndef lint
-static char rcsid[] = "$Id: ipcp.c,v 1.30 1997/03/04 03:39:10 paulus Exp $";
+static char rcsid[] = "$Id: ipcp.c,v 1.31 1997/04/30 05:52:48 paulus Exp $";
#endif
/*
no.neg_vj = 1;
break;
case CI_ADDRS:
- if (go->neg_addr && go->old_addrs || no.old_addrs
+ if ((go->neg_addr && go->old_addrs) || no.old_addrs
|| cilen != CILEN_ADDRS)
goto bad;
try.neg_addr = 1;
ipcp_down(f)
fsm *f;
{
- u_int32_t ouraddr, hisaddr;
-
IPCPDEBUG((LOG_INFO, "ipcp: down"));
np_down(f->unit, PPP_IP);
sifvjcomp(f->unit, 0, 0, 0);
*/
#ifndef lint
-static char rcsid[] = "$Id: lcp.c,v 1.29 1997/03/04 03:39:56 paulus Exp $";
+static char rcsid[] = "$Id: lcp.c,v 1.30 1997/04/30 05:52:59 paulus Exp $";
#endif
/*
static void lcp_echo_lowerup __P((int));
static void lcp_echo_lowerdown __P((int));
-static void LcpEchoTimeout __P((caddr_t));
+static void LcpEchoTimeout __P((void *));
static void lcp_received_echo_reply __P((fsm *, int, u_char *, int));
static void LcpSendEchoRequest __P((fsm *));
static void LcpLinkFailure __P((fsm *));
+static void LcpEchoCheck __P((fsm *));
static fsm_callbacks lcp_callbacks = { /* LCP callback routines */
lcp_resetci, /* Reset our Configuration Information */
switch (citype) {
case CI_MRU:
- if (go->neg_mru && go->mru != DEFMRU
+ if ((go->neg_mru && go->mru != DEFMRU)
|| no.neg_mru || cilen != CILEN_SHORT)
goto bad;
GETSHORT(cishort, p);
try.mru = cishort;
break;
case CI_ASYNCMAP:
- if (go->neg_asyncmap && go->asyncmap != 0xFFFFFFFF
+ if ((go->neg_asyncmap && go->asyncmap != 0xFFFFFFFF)
|| no.neg_asyncmap || cilen != CILEN_LONG)
goto bad;
break;
u_char *pstart, *optend;
u_short cishort;
u_int32_t cilong;
- int fascii;
if (plen < HEADERLEN)
return 0;
* Start the timer for the next interval.
*/
assert (lcp_echo_timer_running==0);
- TIMEOUT (LcpEchoTimeout, (caddr_t) f, lcp_echo_interval);
+ TIMEOUT (LcpEchoTimeout, f, lcp_echo_interval);
lcp_echo_timer_running = 1;
}
static void
LcpEchoTimeout (arg)
- caddr_t arg;
+ void *arg;
{
if (lcp_echo_timer_running != 0) {
lcp_echo_timer_running = 0;
fsm *f = &lcp_fsm[unit];
if (lcp_echo_timer_running != 0) {
- UNTIMEOUT (LcpEchoTimeout, (caddr_t) f);
+ UNTIMEOUT (LcpEchoTimeout, f);
lcp_echo_timer_running = 0;
}
}