o Check the LCP Identifier field for correctness and drop
dodgy packets by default. The old behaviour is still available with ``disable idcheck''. o Make all FSM diagnostics consistent and tidy up the way we build our LCP/CCP/IPCP requests. o Don't assume sizeof(u_long) == 4.
This commit is contained in:
parent
1a56baf602
commit
2267893f11
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/cvs2svn/branches/MP/; revision=34719
@ -17,7 +17,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: ccp.c,v 1.30.2.24 1998/03/17 22:29:02 brian Exp $
|
||||
* $Id: ccp.c,v 1.30.2.25 1998/03/18 23:16:05 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
* o Support other compression protocols
|
||||
@ -62,8 +62,8 @@
|
||||
#include "datalink.h"
|
||||
|
||||
static void CcpSendConfigReq(struct fsm *);
|
||||
static void CcpSendTerminateReq(struct fsm *);
|
||||
static void CcpSendTerminateAck(struct fsm *);
|
||||
static void CcpSentTerminateReq(struct fsm *);
|
||||
static void CcpSendTerminateAck(struct fsm *, u_char);
|
||||
static void CcpDecodeConfig(struct fsm *, u_char *, int, int,
|
||||
struct fsm_decode *);
|
||||
static void CcpLayerStart(struct fsm *);
|
||||
@ -81,7 +81,7 @@ static struct fsm_callbacks ccp_Callbacks = {
|
||||
CcpLayerFinish,
|
||||
CcpInitRestartCounter,
|
||||
CcpSendConfigReq,
|
||||
CcpSendTerminateReq,
|
||||
CcpSentTerminateReq,
|
||||
CcpSendTerminateAck,
|
||||
CcpDecodeConfig,
|
||||
CcpRecvResetReq,
|
||||
@ -190,7 +190,6 @@ CcpSendConfigReq(struct fsm *fp)
|
||||
u_char *cp, buff[100];
|
||||
int f, alloc;
|
||||
|
||||
LogPrintf(LogCCP, "CcpSendConfigReq\n");
|
||||
cp = buff;
|
||||
o = &ccp->out.opt;
|
||||
alloc = ccp->his_reject == 0 && ccp->out.opt == NULL;
|
||||
@ -219,8 +218,8 @@ CcpSendConfigReq(struct fsm *fp)
|
||||
LogPrintf(LogERROR, "CCP REQ buffer overrun !\n");
|
||||
break;
|
||||
}
|
||||
cp += LcpPutConf(LogCCP, cp, &(*o)->val, cftypes[(*o)->val.id],
|
||||
(*algorithm[f]->Disp)(&(*o)->val));
|
||||
memcpy(cp, &(*o)->val, (*o)->val.len);
|
||||
cp += (*o)->val.len;
|
||||
|
||||
ccp->my_proto = (*o)->val.id;
|
||||
ccp->out.algorithm = f;
|
||||
@ -228,7 +227,8 @@ CcpSendConfigReq(struct fsm *fp)
|
||||
if (alloc)
|
||||
o = &(*o)->next;
|
||||
}
|
||||
FsmOutput(fp, CODE_CONFIGREQ, fp->reqid++, buff, cp - buff);
|
||||
|
||||
FsmOutput(fp, CODE_CONFIGREQ, fp->reqid, buff, cp - buff);
|
||||
}
|
||||
|
||||
void
|
||||
@ -236,24 +236,23 @@ CcpSendResetReq(struct fsm *fp)
|
||||
{
|
||||
/* We can't read our input - ask peer to reset */
|
||||
struct ccp *ccp = fsm2ccp(fp);
|
||||
LogPrintf(LogCCP, "SendResetReq(%d)\n", fp->reqid);
|
||||
|
||||
ccp->reset_sent = fp->reqid;
|
||||
ccp->last_reset = -1;
|
||||
FsmOutput(fp, CODE_RESETREQ, fp->reqid, NULL, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
CcpSendTerminateReq(struct fsm *fp)
|
||||
CcpSentTerminateReq(struct fsm *fp)
|
||||
{
|
||||
/* Term REQ just sent by FSM */
|
||||
}
|
||||
|
||||
static void
|
||||
CcpSendTerminateAck(struct fsm *fp)
|
||||
CcpSendTerminateAck(struct fsm *fp, u_char id)
|
||||
{
|
||||
/* Send Term ACK please */
|
||||
LogPrintf(LogCCP, "CcpSendTerminateAck\n");
|
||||
FsmOutput(fp, CODE_TERMACK, fp->reqid++, NULL, 0);
|
||||
FsmOutput(fp, CODE_TERMACK, id, NULL, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -505,11 +504,10 @@ ccp_Decompress(struct ccp *ccp, u_short *proto, struct mbuf *bp)
|
||||
if (ccp->fsm.state == ST_OPENED)
|
||||
if (*proto == PROTO_COMPD) {
|
||||
/* Decompress incoming data */
|
||||
if (ccp->reset_sent != -1) {
|
||||
if (ccp->reset_sent != -1)
|
||||
/* Send another REQ and put the packet in the bit bucket */
|
||||
LogPrintf(LogCCP, "ReSendResetReq(%d)\n", ccp->reset_sent);
|
||||
FsmOutput(&ccp->fsm, CODE_RESETREQ, ccp->reset_sent, NULL, 0);
|
||||
} else if (ccp->in.state != NULL)
|
||||
else if (ccp->in.state != NULL)
|
||||
return (*algorithm[ccp->in.algorithm]->i.Read)
|
||||
(ccp->in.state, ccp, proto, bp);
|
||||
pfree(bp);
|
||||
|
@ -17,7 +17,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: fsm.c,v 1.27.2.21 1998/03/16 22:52:10 brian Exp $
|
||||
* $Id: fsm.c,v 1.27.2.22 1998/03/16 22:53:45 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
* o Refer loglevel for log output
|
||||
@ -66,11 +66,49 @@ static void FsmSendConfigReq(struct fsm *);
|
||||
static void FsmSendTerminateReq(struct fsm *);
|
||||
static void FsmInitRestartCounter(struct fsm *);
|
||||
|
||||
typedef void (recvfn)(struct fsm *, struct fsmheader *, struct mbuf *);
|
||||
static recvfn FsmRecvConfigReq, FsmRecvConfigAck, FsmRecvConfigNak,
|
||||
FsmRecvConfigRej, FsmRecvTermReq, FsmRecvTermAck,
|
||||
FsmRecvCodeRej, FsmRecvProtoRej, FsmRecvEchoReq,
|
||||
FsmRecvEchoRep, FsmRecvDiscReq, FsmRecvIdent,
|
||||
FsmRecvTimeRemain, FsmRecvResetReq, FsmRecvResetAck;
|
||||
|
||||
static const struct fsmcodedesc {
|
||||
recvfn *recv;
|
||||
unsigned check_reqid : 1;
|
||||
unsigned inc_reqid : 1;
|
||||
const char *name;
|
||||
} FsmCodes[] = {
|
||||
{ FsmRecvConfigReq, 0, 0, "ConfigReq" },
|
||||
{ FsmRecvConfigAck, 1, 1, "ConfigAck" },
|
||||
{ FsmRecvConfigNak, 1, 1, "ConfigNak" },
|
||||
{ FsmRecvConfigRej, 1, 1, "ConfigRej" },
|
||||
{ FsmRecvTermReq, 0, 0, "TerminateReq" },
|
||||
{ FsmRecvTermAck, 1, 1, "TerminateAck" },
|
||||
{ FsmRecvCodeRej, 0, 0, "CodeRej" },
|
||||
{ FsmRecvProtoRej, 0, 0, "ProtocolRej" },
|
||||
{ FsmRecvEchoReq, 0, 0, "EchoRequest" },
|
||||
{ FsmRecvEchoRep, 0, 0, "EchoReply" },
|
||||
{ FsmRecvDiscReq, 0, 0, "DiscardReq" },
|
||||
{ FsmRecvIdent, 0, 0, "Ident" },
|
||||
{ FsmRecvTimeRemain,0, 0, "TimeRemain" },
|
||||
{ FsmRecvResetReq, 0, 0, "ResetReqt" },
|
||||
{ FsmRecvResetAck, 0, 1, "ResetAck" }
|
||||
};
|
||||
|
||||
char const *StateNames[] = {
|
||||
"Initial", "Starting", "Closed", "Stopped", "Closing", "Stopping",
|
||||
"Req-Sent", "Ack-Rcvd", "Ack-Sent", "Opened",
|
||||
};
|
||||
|
||||
static const char *
|
||||
Code2Nam(u_int code)
|
||||
{
|
||||
if (code == 0 || code > sizeof FsmCodes / sizeof FsmCodes[0])
|
||||
return "Unknown";
|
||||
return FsmCodes[code-1].name;
|
||||
}
|
||||
|
||||
static void
|
||||
StoppedTimeout(void *v)
|
||||
{
|
||||
@ -128,12 +166,27 @@ NewState(struct fsm * fp, int new)
|
||||
}
|
||||
|
||||
void
|
||||
FsmOutput(struct fsm * fp, u_int code, u_int id, u_char * ptr, int count)
|
||||
FsmOutput(struct fsm *fp, u_int code, u_int id, u_char *ptr, int count)
|
||||
{
|
||||
int plen;
|
||||
struct fsmheader lh;
|
||||
struct mbuf *bp;
|
||||
|
||||
if (LogIsKept(fp->LogLevel)) {
|
||||
LogPrintf(fp->LogLevel, "Send%s(%d) state = %s\n", Code2Nam(code),
|
||||
id, StateNames[fp->state]);
|
||||
switch (code) {
|
||||
case CODE_CONFIGREQ:
|
||||
case CODE_CONFIGACK:
|
||||
case CODE_CONFIGREJ:
|
||||
case CODE_CONFIGNAK:
|
||||
(*fp->fn->DecodeConfig)(fp, ptr, count, MODE_NOP, NULL);
|
||||
if (count < sizeof(struct fsmconfig))
|
||||
LogPrintf(fp->LogLevel, " [EMPTY]\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
plen = sizeof(struct fsmheader) + count;
|
||||
lh.code = code;
|
||||
lh.id = id;
|
||||
@ -294,48 +347,14 @@ FsmSendConfigReq(struct fsm * fp)
|
||||
}
|
||||
|
||||
static void
|
||||
FsmSendTerminateReq(struct fsm * fp)
|
||||
FsmSendTerminateReq(struct fsm *fp)
|
||||
{
|
||||
LogPrintf(fp->LogLevel, "SendTerminateReq.\n");
|
||||
FsmOutput(fp, CODE_TERMREQ, fp->reqid++, NULL, 0);
|
||||
(*fp->fn->SendTerminateReq)(fp);
|
||||
FsmOutput(fp, CODE_TERMREQ, fp->reqid, NULL, 0);
|
||||
(*fp->fn->SentTerminateReq)(fp);
|
||||
StartTimer(&fp->FsmTimer); /* Start restart timer */
|
||||
fp->restart--; /* Decrement restart counter */
|
||||
}
|
||||
|
||||
static void
|
||||
FsmSendConfigAck(struct fsm *fp, struct fsmheader *lhp,
|
||||
u_char *option, int count)
|
||||
{
|
||||
LogPrintf(fp->LogLevel, "SendConfigAck(%s)\n", StateNames[fp->state]);
|
||||
(*fp->fn->DecodeConfig)(fp, option, count, MODE_NOP, NULL);
|
||||
if (count < sizeof(struct fsmconfig))
|
||||
LogPrintf(fp->LogLevel, " [EMPTY]\n");
|
||||
FsmOutput(fp, CODE_CONFIGACK, lhp->id, option, count);
|
||||
}
|
||||
|
||||
static void
|
||||
FsmSendConfigRej(struct fsm *fp, struct fsmheader *lhp,
|
||||
u_char *option, int count)
|
||||
{
|
||||
LogPrintf(fp->LogLevel, "SendConfigRej(%s)\n", StateNames[fp->state]);
|
||||
(*fp->fn->DecodeConfig)(fp, option, count, MODE_NOP, NULL);
|
||||
if (count < sizeof(struct fsmconfig))
|
||||
LogPrintf(fp->LogLevel, " [EMPTY]\n");
|
||||
FsmOutput(fp, CODE_CONFIGREJ, lhp->id, option, count);
|
||||
}
|
||||
|
||||
static void
|
||||
FsmSendConfigNak(struct fsm *fp, struct fsmheader *lhp,
|
||||
u_char *option, int count)
|
||||
{
|
||||
LogPrintf(fp->LogLevel, "SendConfigNak(%s)\n", StateNames[fp->state]);
|
||||
(*fp->fn->DecodeConfig)(fp, option, count, MODE_NOP, NULL);
|
||||
if (count < sizeof(struct fsmconfig))
|
||||
LogPrintf(fp->LogLevel, " [EMPTY]\n");
|
||||
FsmOutput(fp, CODE_CONFIGNAK, lhp->id, option, count);
|
||||
}
|
||||
|
||||
/*
|
||||
* Timeout actions
|
||||
*/
|
||||
@ -423,7 +442,7 @@ FsmRecvConfigReq(struct fsm *fp, struct fsmheader *lhp, struct mbuf *bp)
|
||||
pfree(bp);
|
||||
return;
|
||||
case ST_CLOSED:
|
||||
(*fp->fn->SendTerminateAck)(fp);
|
||||
(*fp->fn->SendTerminateAck)(fp, lhp->id);
|
||||
pfree(bp);
|
||||
return;
|
||||
case ST_CLOSING:
|
||||
@ -438,6 +457,8 @@ FsmRecvConfigReq(struct fsm *fp, struct fsmheader *lhp, struct mbuf *bp)
|
||||
dec.nakend = dec.nak;
|
||||
dec.rejend = dec.rej;
|
||||
(*fp->fn->DecodeConfig)(fp, MBUF_CTOP(bp), flen, MODE_REQ, &dec);
|
||||
if (flen < sizeof(struct fsmconfig))
|
||||
LogPrintf(fp->LogLevel, " [EMPTY]\n");
|
||||
|
||||
if (dec.nakend == dec.nak && dec.rejend == dec.rej)
|
||||
ackaction = 1;
|
||||
@ -455,11 +476,11 @@ FsmRecvConfigReq(struct fsm *fp, struct fsmheader *lhp, struct mbuf *bp)
|
||||
}
|
||||
|
||||
if (dec.rejend != dec.rej)
|
||||
FsmSendConfigRej(fp, lhp, dec.rej, dec.rejend - dec.rej);
|
||||
FsmOutput(fp, CODE_CONFIGREJ, lhp->id, dec.rej, dec.rejend - dec.rej);
|
||||
if (dec.nakend != dec.nak)
|
||||
FsmSendConfigNak(fp, lhp, dec.nak, dec.nakend - dec.nak);
|
||||
FsmOutput(fp, CODE_CONFIGNAK, lhp->id, dec.nak, dec.nakend - dec.nak);
|
||||
if (ackaction)
|
||||
FsmSendConfigAck(fp, lhp, dec.ack, dec.ackend - dec.ack);
|
||||
FsmOutput(fp, CODE_CONFIGACK, lhp->id, dec.ack, dec.ackend - dec.ack);
|
||||
|
||||
switch (fp->state) {
|
||||
case ST_OPENED:
|
||||
@ -489,13 +510,13 @@ FsmRecvConfigReq(struct fsm *fp, struct fsmheader *lhp, struct mbuf *bp)
|
||||
}
|
||||
|
||||
static void
|
||||
FsmRecvConfigAck(struct fsm * fp, struct fsmheader * lhp, struct mbuf * bp)
|
||||
FsmRecvConfigAck(struct fsm *fp, struct fsmheader *lhp, struct mbuf *bp)
|
||||
/* RCA */
|
||||
{
|
||||
switch (fp->state) {
|
||||
case ST_CLOSED:
|
||||
case ST_STOPPED:
|
||||
(*fp->fn->SendTerminateAck)(fp);
|
||||
(*fp->fn->SendTerminateAck)(fp, lhp->id);
|
||||
break;
|
||||
case ST_CLOSING:
|
||||
case ST_STOPPING:
|
||||
@ -549,7 +570,7 @@ FsmRecvConfigNak(struct fsm *fp, struct fsmheader *lhp, struct mbuf *bp)
|
||||
return;
|
||||
case ST_CLOSED:
|
||||
case ST_STOPPED:
|
||||
(*fp->fn->SendTerminateAck)(fp);
|
||||
(*fp->fn->SendTerminateAck)(fp, lhp->id);
|
||||
pfree(bp);
|
||||
return;
|
||||
case ST_CLOSING:
|
||||
@ -562,6 +583,8 @@ FsmRecvConfigNak(struct fsm *fp, struct fsmheader *lhp, struct mbuf *bp)
|
||||
dec.nakend = dec.nak;
|
||||
dec.rejend = dec.rej;
|
||||
(*fp->fn->DecodeConfig)(fp, MBUF_CTOP(bp), flen, MODE_NAK, &dec);
|
||||
if (flen < sizeof(struct fsmconfig))
|
||||
LogPrintf(fp->LogLevel, " [EMPTY]\n");
|
||||
|
||||
switch (fp->state) {
|
||||
case ST_REQSENT:
|
||||
@ -585,7 +608,7 @@ FsmRecvConfigNak(struct fsm *fp, struct fsmheader *lhp, struct mbuf *bp)
|
||||
}
|
||||
|
||||
static void
|
||||
FsmRecvTermReq(struct fsm * fp, struct fsmheader * lhp, struct mbuf * bp)
|
||||
FsmRecvTermReq(struct fsm *fp, struct fsmheader *lhp, struct mbuf *bp)
|
||||
/* RTR */
|
||||
{
|
||||
switch (fp->state) {
|
||||
@ -598,16 +621,16 @@ FsmRecvTermReq(struct fsm * fp, struct fsmheader * lhp, struct mbuf * bp)
|
||||
case ST_CLOSING:
|
||||
case ST_STOPPING:
|
||||
case ST_REQSENT:
|
||||
(*fp->fn->SendTerminateAck)(fp);
|
||||
(*fp->fn->SendTerminateAck)(fp, lhp->id);
|
||||
break;
|
||||
case ST_ACKRCVD:
|
||||
case ST_ACKSENT:
|
||||
(*fp->fn->SendTerminateAck)(fp);
|
||||
(*fp->fn->SendTerminateAck)(fp, lhp->id);
|
||||
NewState(fp, ST_REQSENT);
|
||||
break;
|
||||
case ST_OPENED:
|
||||
(*fp->fn->LayerDown)(fp);
|
||||
(*fp->fn->SendTerminateAck)(fp);
|
||||
(*fp->fn->SendTerminateAck)(fp, lhp->id);
|
||||
StartTimer(&fp->FsmTimer); /* Start restart timer */
|
||||
fp->restart = 0;
|
||||
NewState(fp, ST_STOPPING);
|
||||
@ -658,7 +681,6 @@ FsmRecvConfigRej(struct fsm *fp, struct fsmheader *lhp, struct mbuf *bp)
|
||||
pfree(bp);
|
||||
return;
|
||||
}
|
||||
LogPrintf(fp->LogLevel, "RecvConfigRej.\n");
|
||||
|
||||
/*
|
||||
* Check and process easy case
|
||||
@ -671,7 +693,7 @@ FsmRecvConfigRej(struct fsm *fp, struct fsmheader *lhp, struct mbuf *bp)
|
||||
return;
|
||||
case ST_CLOSED:
|
||||
case ST_STOPPED:
|
||||
(*fp->fn->SendTerminateAck)(fp);
|
||||
(*fp->fn->SendTerminateAck)(fp, lhp->id);
|
||||
pfree(bp);
|
||||
return;
|
||||
case ST_CLOSING:
|
||||
@ -684,6 +706,8 @@ FsmRecvConfigRej(struct fsm *fp, struct fsmheader *lhp, struct mbuf *bp)
|
||||
dec.nakend = dec.nak;
|
||||
dec.rejend = dec.rej;
|
||||
(*fp->fn->DecodeConfig)(fp, MBUF_CTOP(bp), flen, MODE_REJ, &dec);
|
||||
if (flen < sizeof(struct fsmconfig))
|
||||
LogPrintf(fp->LogLevel, " [EMPTY]\n");
|
||||
|
||||
switch (fp->state) {
|
||||
case ST_REQSENT:
|
||||
@ -706,9 +730,8 @@ FsmRecvConfigRej(struct fsm *fp, struct fsmheader *lhp, struct mbuf *bp)
|
||||
}
|
||||
|
||||
static void
|
||||
FsmRecvCodeRej(struct fsm * fp, struct fsmheader * lhp, struct mbuf * bp)
|
||||
FsmRecvCodeRej(struct fsm *fp, struct fsmheader *lhp, struct mbuf *bp)
|
||||
{
|
||||
LogPrintf(fp->LogLevel, "RecvCodeRej\n");
|
||||
pfree(bp);
|
||||
}
|
||||
|
||||
@ -766,7 +789,6 @@ FsmRecvEchoReq(struct fsm *fp, struct fsmheader *lhp, struct mbuf *bp)
|
||||
}
|
||||
if (fp->state == ST_OPENED) {
|
||||
*lp = htonl(lcp->want_magic); /* Insert local magic number */
|
||||
LogPrintf(fp->LogLevel, "SendEchoRep(%s)\n", StateNames[fp->state]);
|
||||
FsmOutput(fp, CODE_ECHOREP, lhp->id, cp, plength(bp));
|
||||
}
|
||||
}
|
||||
@ -800,28 +822,24 @@ FsmRecvEchoRep(struct fsm *fp, struct fsmheader *lhp, struct mbuf *bp)
|
||||
static void
|
||||
FsmRecvDiscReq(struct fsm * fp, struct fsmheader * lhp, struct mbuf * bp)
|
||||
{
|
||||
LogPrintf(fp->LogLevel, "RecvDiscReq\n");
|
||||
pfree(bp);
|
||||
}
|
||||
|
||||
static void
|
||||
FsmRecvIdent(struct fsm * fp, struct fsmheader * lhp, struct mbuf * bp)
|
||||
{
|
||||
LogPrintf(fp->LogLevel, "RecvIdent\n");
|
||||
pfree(bp);
|
||||
}
|
||||
|
||||
static void
|
||||
FsmRecvTimeRemain(struct fsm * fp, struct fsmheader * lhp, struct mbuf * bp)
|
||||
{
|
||||
LogPrintf(fp->LogLevel, "RecvTimeRemain\n");
|
||||
pfree(bp);
|
||||
}
|
||||
|
||||
static void
|
||||
FsmRecvResetReq(struct fsm *fp, struct fsmheader *lhp, struct mbuf *bp)
|
||||
{
|
||||
LogPrintf(fp->LogLevel, "RecvResetReq(%d)\n", lhp->id);
|
||||
(*fp->fn->RecvResetReq)(fp);
|
||||
/*
|
||||
* All sendable compressed packets are queued in the PRI_NORMAL modem
|
||||
@ -829,7 +847,6 @@ FsmRecvResetReq(struct fsm *fp, struct fsmheader *lhp, struct mbuf *bp)
|
||||
* at the peer before our ResetAck.
|
||||
*/
|
||||
link_SequenceQueue(fp->link);
|
||||
LogPrintf(fp->LogLevel, "SendResetAck(%d)\n", lhp->id);
|
||||
FsmOutput(fp, CODE_RESETACK, lhp->id, NULL, 0);
|
||||
pfree(bp);
|
||||
}
|
||||
@ -837,35 +854,12 @@ FsmRecvResetReq(struct fsm *fp, struct fsmheader *lhp, struct mbuf *bp)
|
||||
static void
|
||||
FsmRecvResetAck(struct fsm *fp, struct fsmheader *lhp, struct mbuf *bp)
|
||||
{
|
||||
LogPrintf(fp->LogLevel, "RecvResetAck(%d)\n", lhp->id);
|
||||
(*fp->fn->RecvResetAck)(fp, lhp->id);
|
||||
fp->reqid++;
|
||||
pfree(bp);
|
||||
}
|
||||
|
||||
static const struct fsmcodedesc {
|
||||
void (*action)(struct fsm *, struct fsmheader *, struct mbuf *);
|
||||
const char *name;
|
||||
} FsmCodes[] = {
|
||||
{FsmRecvConfigReq, "Configure Request",},
|
||||
{FsmRecvConfigAck, "Configure Ack",},
|
||||
{FsmRecvConfigNak, "Configure Nak",},
|
||||
{FsmRecvConfigRej, "Configure Reject",},
|
||||
{FsmRecvTermReq, "Terminate Request",},
|
||||
{FsmRecvTermAck, "Terminate Ack",},
|
||||
{FsmRecvCodeRej, "Code Reject",},
|
||||
{FsmRecvProtoRej, "Protocol Reject",},
|
||||
{FsmRecvEchoReq, "Echo Request",},
|
||||
{FsmRecvEchoRep, "Echo Reply",},
|
||||
{FsmRecvDiscReq, "Discard Request",},
|
||||
{FsmRecvIdent, "Ident",},
|
||||
{FsmRecvTimeRemain, "Time Remain",},
|
||||
{FsmRecvResetReq, "Reset Request",},
|
||||
{FsmRecvResetAck, "Reset Ack",}
|
||||
};
|
||||
|
||||
void
|
||||
FsmInput(struct fsm *fp, struct mbuf * bp)
|
||||
FsmInput(struct fsm *fp, struct mbuf *bp)
|
||||
{
|
||||
int len;
|
||||
struct fsmheader *lhp;
|
||||
@ -886,11 +880,24 @@ FsmInput(struct fsm *fp, struct mbuf * bp)
|
||||
bp->cnt -= sizeof(struct fsmheader);
|
||||
|
||||
codep = FsmCodes + lhp->code - 1;
|
||||
LogPrintf(fp->LogLevel, "Received %s (%d) state = %s (%d)\n",
|
||||
codep->name, lhp->id, StateNames[fp->state], fp->state);
|
||||
if (lhp->id != fp->reqid && codep->check_reqid && Enabled(ConfIdCheck)) {
|
||||
LogPrintf(fp->LogLevel, "Recv%s(%d), dropped (expected %d)\n",
|
||||
codep->name, lhp->id, fp->reqid);
|
||||
return;
|
||||
}
|
||||
|
||||
LogPrintf(fp->LogLevel, "Recv%s(%d) state = %s\n",
|
||||
codep->name, lhp->id, StateNames[fp->state]);
|
||||
|
||||
if (LogIsKept(LogDEBUG))
|
||||
LogMemory();
|
||||
(codep->action)(fp, lhp, bp);
|
||||
|
||||
if (codep->inc_reqid && (lhp->id == fp->reqid ||
|
||||
(!Enabled(ConfIdCheck) && codep->check_reqid)))
|
||||
fp->reqid++; /* That's the end of that ``exchange''.... */
|
||||
|
||||
(codep->recv)(fp, lhp, bp);
|
||||
|
||||
if (LogIsKept(LogDEBUG))
|
||||
LogMemory();
|
||||
}
|
||||
|
@ -15,7 +15,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: fsm.h,v 1.16.2.9 1998/02/27 01:22:24 brian Exp $
|
||||
* $Id: fsm.h,v 1.16.2.10 1998/03/13 21:08:02 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
*/
|
||||
@ -60,8 +60,8 @@ struct fsm_callbacks {
|
||||
void (*LayerFinish) (struct fsm *); /* Layer now down (tlf) */
|
||||
void (*InitRestartCounter) (struct fsm *); /* Set fsm timer load */
|
||||
void (*SendConfigReq) (struct fsm *); /* Send REQ please */
|
||||
void (*SendTerminateReq) (struct fsm *); /* Term REQ just sent */
|
||||
void (*SendTerminateAck) (struct fsm *); /* Send Term ACK please */
|
||||
void (*SentTerminateReq) (struct fsm *); /* Term REQ just sent */
|
||||
void (*SendTerminateAck) (struct fsm *, u_char); /* Send Term ACK please */
|
||||
void (*DecodeConfig) (struct fsm *, u_char *, int, int, struct fsm_decode *);
|
||||
/* Deal with incoming data */
|
||||
void (*RecvResetReq) (struct fsm *fp); /* Reset output */
|
||||
|
@ -17,7 +17,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: ipcp.c,v 1.50.2.23 1998/03/16 22:52:20 brian Exp $
|
||||
* $Id: ipcp.c,v 1.50.2.24 1998/03/16 22:53:53 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
* o More RFC1772 backwoard compatibility
|
||||
@ -85,8 +85,8 @@ static void IpcpLayerStart(struct fsm *);
|
||||
static void IpcpLayerFinish(struct fsm *);
|
||||
static void IpcpInitRestartCounter(struct fsm *);
|
||||
static void IpcpSendConfigReq(struct fsm *);
|
||||
static void IpcpSendTerminateReq(struct fsm *);
|
||||
static void IpcpSendTerminateAck(struct fsm *);
|
||||
static void IpcpSentTerminateReq(struct fsm *);
|
||||
static void IpcpSendTerminateAck(struct fsm *, u_char);
|
||||
static void IpcpDecodeConfig(struct fsm *, u_char *, int, int,
|
||||
struct fsm_decode *);
|
||||
|
||||
@ -97,7 +97,7 @@ static struct fsm_callbacks ipcp_Callbacks = {
|
||||
IpcpLayerFinish,
|
||||
IpcpInitRestartCounter,
|
||||
IpcpSendConfigReq,
|
||||
IpcpSendTerminateReq,
|
||||
IpcpSentTerminateReq,
|
||||
IpcpSendTerminateAck,
|
||||
IpcpDecodeConfig,
|
||||
NullRecvResetReq,
|
||||
@ -404,49 +404,39 @@ IpcpSendConfigReq(struct fsm *fp)
|
||||
/* Send config REQ please */
|
||||
struct physical *p = link2physical(fp->link);
|
||||
struct ipcp *ipcp = fsm2ipcp(fp);
|
||||
u_char *cp, buff[12];
|
||||
struct lcp_opt o;
|
||||
u_char buff[12];
|
||||
struct lcp_opt *o;
|
||||
|
||||
LogPrintf(LogIPCP, "IpcpSendConfigReq\n");
|
||||
cp = buff;
|
||||
o = (struct lcp_opt *)buff;
|
||||
|
||||
if ((p && !Physical_IsSync(p)) || !REJECTED(ipcp, TY_IPADDR)) {
|
||||
o.id = TY_IPADDR;
|
||||
o.len = 6;
|
||||
*(u_long *)o.data = ipcp->my_ip.s_addr;
|
||||
cp += LcpPutConf(LogIPCP, cp, &o, cftypes[o.id],
|
||||
inet_ntoa(ipcp->my_ip));
|
||||
*(u_int32_t *)o->data = ipcp->my_ip.s_addr;
|
||||
INC_LCP_OPT(TY_IPADDR, 6, o);
|
||||
}
|
||||
|
||||
if (ipcp->my_compproto && !REJECTED(ipcp, TY_COMPPROTO)) {
|
||||
const char *args;
|
||||
o.id = TY_COMPPROTO;
|
||||
if (ipcp->my_compproto && !REJECTED(ipcp, TY_COMPPROTO))
|
||||
if (ipcp->heis1172) {
|
||||
o.len = 4;
|
||||
*(u_short *)o.data = htons(PROTO_VJCOMP);
|
||||
args = "";
|
||||
*(u_short *)o->data = htons(PROTO_VJCOMP);
|
||||
INC_LCP_OPT(TY_COMPPROTO, 4, o);
|
||||
} else {
|
||||
o.len = 6;
|
||||
*(u_long *)o.data = htonl(ipcp->my_compproto);
|
||||
args = vj2asc(ipcp->my_compproto);
|
||||
*(u_long *)o->data = htonl(ipcp->my_compproto);
|
||||
INC_LCP_OPT(TY_COMPPROTO, 6, o);
|
||||
}
|
||||
cp += LcpPutConf(LogIPCP, cp, &o, cftypes[o.id], args);
|
||||
}
|
||||
FsmOutput(fp, CODE_CONFIGREQ, fp->reqid++, buff, cp - buff);
|
||||
|
||||
FsmOutput(fp, CODE_CONFIGREQ, fp->reqid, buff, (u_char *)o - buff);
|
||||
}
|
||||
|
||||
static void
|
||||
IpcpSendTerminateReq(struct fsm * fp)
|
||||
IpcpSentTerminateReq(struct fsm * fp)
|
||||
{
|
||||
/* Term REQ just sent by FSM */
|
||||
}
|
||||
|
||||
static void
|
||||
IpcpSendTerminateAck(struct fsm * fp)
|
||||
IpcpSendTerminateAck(struct fsm *fp, u_char id)
|
||||
{
|
||||
/* Send Term ACK please */
|
||||
LogPrintf(LogIPCP, "IpcpSendTerminateAck\n");
|
||||
FsmOutput(fp, CODE_TERMACK, fp->reqid++, NULL, 0);
|
||||
FsmOutput(fp, CODE_TERMACK, id, NULL, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -538,7 +528,7 @@ IpcpLayerUp(struct fsm *fp)
|
||||
struct ipcp *ipcp = fsm2ipcp(fp);
|
||||
char tbuff[100];
|
||||
|
||||
LogPrintf(LogIPCP, "IpcpLayerUp(%d).\n", fp->state);
|
||||
LogPrintf(LogIPCP, "IpcpLayerUp.\n");
|
||||
snprintf(tbuff, sizeof tbuff, "myaddr = %s ", inet_ntoa(ipcp->my_ip));
|
||||
LogPrintf(LogIsKept(LogIPCP) ? LogIPCP : LogLINK, " %s hisaddr = %s\n",
|
||||
tbuff, inet_ntoa(ipcp->peer_ip));
|
||||
@ -785,9 +775,7 @@ IpcpDecodeConfig(struct fsm *fp, u_char * cp, int plen, int mode_type,
|
||||
*/
|
||||
memcpy(dec->nakend, cp, 2); /* copy first two (type/length) */
|
||||
LogPrintf(LogIPCP, "MS NS req %d:%s->%s - nak\n",
|
||||
type,
|
||||
inet_ntoa(dnsstuff),
|
||||
inet_ntoa(ms_info_req));
|
||||
type, inet_ntoa(dnsstuff), inet_ntoa(ms_info_req));
|
||||
memcpy(dec->nakend+2, &ms_info_req, length);
|
||||
dec->nakend += length;
|
||||
break;
|
||||
@ -798,8 +786,7 @@ IpcpDecodeConfig(struct fsm *fp, u_char * cp, int plen, int mode_type,
|
||||
* back confirming it... end of story
|
||||
*/
|
||||
LogPrintf(LogIPCP, "MS NS req %d:%s ok - ack\n",
|
||||
type,
|
||||
inet_ntoa(ms_info_req));
|
||||
type, inet_ntoa(ms_info_req));
|
||||
memcpy(dec->ackend, cp, length);
|
||||
dec->ackend += length;
|
||||
break;
|
||||
@ -831,15 +818,12 @@ IpcpDecodeConfig(struct fsm *fp, u_char * cp, int plen, int mode_type,
|
||||
memcpy(dec->nakend, cp, 2);
|
||||
memcpy(dec->nakend+2, &ms_info_req.s_addr, length);
|
||||
LogPrintf(LogIPCP, "MS NBNS req %d:%s->%s - nak\n",
|
||||
type,
|
||||
inet_ntoa(dnsstuff),
|
||||
inet_ntoa(ms_info_req));
|
||||
type, inet_ntoa(dnsstuff), inet_ntoa(ms_info_req));
|
||||
dec->nakend += length;
|
||||
break;
|
||||
}
|
||||
LogPrintf(LogIPCP, "MS NBNS req %d:%s ok - ack\n",
|
||||
type,
|
||||
inet_ntoa(ms_info_req));
|
||||
type, inet_ntoa(ms_info_req));
|
||||
memcpy(dec->ackend, cp, length);
|
||||
dec->ackend += length;
|
||||
break;
|
||||
|
@ -17,7 +17,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: lcp.c,v 1.55.2.29 1998/03/16 22:52:23 brian Exp $
|
||||
* $Id: lcp.c,v 1.55.2.30 1998/03/16 22:54:02 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
* o Limit data field length by MRU
|
||||
@ -90,8 +90,8 @@ static void LcpLayerStart(struct fsm *);
|
||||
static void LcpLayerFinish(struct fsm *);
|
||||
static void LcpInitRestartCounter(struct fsm *);
|
||||
static void LcpSendConfigReq(struct fsm *);
|
||||
static void LcpSendTerminateReq(struct fsm *);
|
||||
static void LcpSendTerminateAck(struct fsm *);
|
||||
static void LcpSentTerminateReq(struct fsm *);
|
||||
static void LcpSendTerminateAck(struct fsm *, u_char);
|
||||
static void LcpDecodeConfig(struct fsm *, u_char *, int, int,
|
||||
struct fsm_decode *);
|
||||
|
||||
@ -102,7 +102,7 @@ static struct fsm_callbacks lcp_Callbacks = {
|
||||
LcpLayerFinish,
|
||||
LcpInitRestartCounter,
|
||||
LcpSendConfigReq,
|
||||
LcpSendTerminateReq,
|
||||
LcpSentTerminateReq,
|
||||
LcpSendTerminateAck,
|
||||
LcpDecodeConfig,
|
||||
NullRecvResetReq,
|
||||
@ -224,157 +224,88 @@ LcpInitRestartCounter(struct fsm * fp)
|
||||
fp->restart = 5;
|
||||
}
|
||||
|
||||
int
|
||||
LcpPutConf(int log, u_char *tgt, const struct lcp_opt *o, const char *nm,
|
||||
const char *arg, ...)
|
||||
{
|
||||
va_list ap;
|
||||
char buf[30];
|
||||
|
||||
va_start(ap, arg);
|
||||
memcpy(tgt, o, o->len);
|
||||
if (arg == NULL || *arg == '\0')
|
||||
LogPrintf(log, " %s[%d]\n", nm, o->len);
|
||||
else {
|
||||
vsnprintf(buf, sizeof buf, arg, ap);
|
||||
LogPrintf(log, " %s[%d] %s\n", nm, o->len, buf);
|
||||
}
|
||||
va_end(ap);
|
||||
|
||||
return o->len;
|
||||
}
|
||||
|
||||
#define PUTN(ty) \
|
||||
do { \
|
||||
o.id = ty; \
|
||||
o.len = 2; \
|
||||
cp += LcpPutConf(LogLCP, cp, &o, cftypes[o.id], NULL); \
|
||||
} while (0)
|
||||
|
||||
#define PUTHEX32(ty, arg) \
|
||||
do { \
|
||||
o.id = ty; \
|
||||
o.len = 6; \
|
||||
*(u_long *)o.data = htonl(arg); \
|
||||
cp += LcpPutConf(LogLCP, cp, &o, cftypes[o.id], "0x%08lx", (u_long)arg);\
|
||||
} while (0)
|
||||
|
||||
#define PUTACCMAP(arg) PUTHEX32(TY_ACCMAP, arg)
|
||||
#define PUTMAGIC(arg) PUTHEX32(TY_MAGICNUM, arg)
|
||||
|
||||
#define PUTMRU(arg) \
|
||||
do { \
|
||||
o.id = TY_MRU; \
|
||||
o.len = 4; \
|
||||
*(u_short *)o.data = htons(arg); \
|
||||
cp += LcpPutConf(LogLCP, cp, &o, cftypes[o.id], "%u", arg); \
|
||||
} while (0)
|
||||
|
||||
#define PUTLQR(period) \
|
||||
do { \
|
||||
o.id = TY_QUALPROTO; \
|
||||
o.len = 8; \
|
||||
*(u_short *)o.data = htons(PROTO_LQR); \
|
||||
*(u_long *)(o.data+2) = htonl(period); \
|
||||
cp += LcpPutConf(LogLCP, cp, &o, cftypes[o.id], \
|
||||
"period %ld", (u_long)period); \
|
||||
} while (0)
|
||||
|
||||
#define PUTPAP() \
|
||||
do { \
|
||||
o.id = TY_AUTHPROTO; \
|
||||
o.len = 4; \
|
||||
*(u_short *)o.data = htons(PROTO_PAP); \
|
||||
cp += LcpPutConf(LogLCP, cp, &o, cftypes[o.id], \
|
||||
"0x%04x (PAP)", PROTO_PAP); \
|
||||
} while (0)
|
||||
|
||||
#define PUTCHAP(val) \
|
||||
do { \
|
||||
o.id = TY_AUTHPROTO; \
|
||||
o.len = 5; \
|
||||
*(u_short *)o.data = htons(PROTO_CHAP); \
|
||||
o.data[2] = val; \
|
||||
cp += LcpPutConf(LogLCP, cp, &o, cftypes[o.id], \
|
||||
"0x%04x (CHAP 0x%02x)", PROTO_CHAP, val); \
|
||||
} while (0)
|
||||
|
||||
#define PUTMD5CHAP() PUTCHAP(0x05)
|
||||
#define PUTMSCHAP() PUTCHAP(0x80)
|
||||
|
||||
static void
|
||||
LcpSendConfigReq(struct fsm *fp)
|
||||
{
|
||||
/* Send config REQ please */
|
||||
struct physical *p = link2physical(fp->link);
|
||||
struct lcp *lcp = fsm2lcp(fp);
|
||||
u_char *cp, buff[100];
|
||||
struct lcp_opt o;
|
||||
u_char buff[100];
|
||||
struct lcp_opt *o;
|
||||
|
||||
if (!p) {
|
||||
LogPrintf(LogERROR, "LcpSendConfigReq: Not a physical link !\n");
|
||||
return;
|
||||
}
|
||||
|
||||
LogPrintf(LogLCP, "LcpSendConfigReq\n");
|
||||
cp = buff;
|
||||
o = (struct lcp_opt *)buff;
|
||||
if (!Physical_IsSync(p)) {
|
||||
if (lcp->want_acfcomp && !REJECTED(lcp, TY_ACFCOMP))
|
||||
PUTN(TY_ACFCOMP);
|
||||
INC_LCP_OPT(TY_ACFCOMP, 2, o);
|
||||
|
||||
if (lcp->want_protocomp && !REJECTED(lcp, TY_PROTOCOMP))
|
||||
PUTN(TY_PROTOCOMP);
|
||||
INC_LCP_OPT(TY_PROTOCOMP, 2, o);
|
||||
|
||||
if (!REJECTED(lcp, TY_ACCMAP))
|
||||
PUTACCMAP(lcp->want_accmap);
|
||||
if (!REJECTED(lcp, TY_ACCMAP)) {
|
||||
*(u_int32_t *)o->data = htonl(lcp->want_accmap);
|
||||
INC_LCP_OPT(TY_ACCMAP, 6, o);
|
||||
}
|
||||
}
|
||||
|
||||
if (!REJECTED(lcp, TY_MRU))
|
||||
PUTMRU(lcp->want_mru);
|
||||
if (!REJECTED(lcp, TY_MRU)) {
|
||||
*(u_short *)o->data = htons(lcp->want_mru);
|
||||
INC_LCP_OPT(TY_MRU, 4, o);
|
||||
}
|
||||
|
||||
if (lcp->want_magic && !REJECTED(lcp, TY_MAGICNUM))
|
||||
PUTMAGIC(lcp->want_magic);
|
||||
if (lcp->want_magic && !REJECTED(lcp, TY_MAGICNUM)) {
|
||||
*(u_int32_t *)o->data = htonl(lcp->want_magic);
|
||||
INC_LCP_OPT(TY_MAGICNUM, 6, o);
|
||||
}
|
||||
|
||||
if (lcp->want_lqrperiod && !REJECTED(lcp, TY_QUALPROTO))
|
||||
PUTLQR(lcp->want_lqrperiod);
|
||||
if (lcp->want_lqrperiod && !REJECTED(lcp, TY_QUALPROTO)) {
|
||||
*(u_short *)o->data = htons(PROTO_LQR);
|
||||
*(u_long *)(o->data + 2) = htonl(lcp->want_lqrperiod);
|
||||
INC_LCP_OPT(TY_QUALPROTO, 8, o);
|
||||
}
|
||||
|
||||
switch (lcp->want_auth) {
|
||||
case PROTO_PAP:
|
||||
PUTPAP();
|
||||
*(u_short *)o->data = htons(PROTO_PAP);
|
||||
INC_LCP_OPT(TY_AUTHPROTO, 4, o);
|
||||
break;
|
||||
|
||||
case PROTO_CHAP:
|
||||
*(u_short *)o->data = htons(PROTO_CHAP);
|
||||
#ifdef HAVE_DES
|
||||
if (VarMSChap)
|
||||
PUTMSCHAP(); /* Use MSChap */
|
||||
o->data[2] = 0x80;
|
||||
else
|
||||
#endif
|
||||
PUTMD5CHAP(); /* Use MD5 */
|
||||
o->data[2] = 0x05;
|
||||
INC_LCP_OPT(TY_AUTHPROTO, 5, o);
|
||||
break;
|
||||
}
|
||||
FsmOutput(fp, CODE_CONFIGREQ, fp->reqid++, buff, cp - buff);
|
||||
FsmOutput(fp, CODE_CONFIGREQ, fp->reqid, buff, (u_char *)o - buff);
|
||||
}
|
||||
|
||||
void
|
||||
lcp_SendProtoRej(struct lcp *lcp, u_char *option, int count)
|
||||
{
|
||||
/* Don't understand `option' */
|
||||
LogPrintf(LogLCP, "lcp_SendProtoRej\n");
|
||||
FsmOutput(&lcp->fsm, CODE_PROTOREJ, lcp->fsm.reqid, option, count);
|
||||
}
|
||||
|
||||
static void
|
||||
LcpSendTerminateReq(struct fsm * fp)
|
||||
LcpSentTerminateReq(struct fsm * fp)
|
||||
{
|
||||
/* Term REQ just sent by FSM */
|
||||
}
|
||||
|
||||
static void
|
||||
LcpSendTerminateAck(struct fsm * fp)
|
||||
LcpSendTerminateAck(struct fsm *fp, u_char id)
|
||||
{
|
||||
/* Send Term ACK please */
|
||||
LogPrintf(LogLCP, "LcpSendTerminateAck.\n");
|
||||
FsmOutput(fp, CODE_TERMACK, fp->reqid++, NULL, 0);
|
||||
FsmOutput(fp, CODE_TERMACK, id, NULL, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -15,7 +15,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: lcp.h,v 1.16.2.13 1998/03/13 00:44:45 brian Exp $
|
||||
* $Id: lcp.h,v 1.16.2.14 1998/03/13 21:07:07 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
*/
|
||||
@ -69,6 +69,13 @@ struct lcp_opt {
|
||||
u_char data[MAX_LCP_OPT_LEN-2];
|
||||
};
|
||||
|
||||
#define INC_LCP_OPT(ty, length, o) \
|
||||
do { \
|
||||
(o)->id = (ty); \
|
||||
(o)->len = (length); \
|
||||
(o) = (struct lcp_opt *)((char *)(o) + (length)); \
|
||||
} while (0)
|
||||
|
||||
struct physical;
|
||||
|
||||
#define fsm2lcp(fp) (fp->proto == PROTO_LCP ? (struct lcp *)fp : NULL)
|
||||
@ -79,7 +86,5 @@ extern void lcp_Init(struct lcp *, struct bundle *, struct physical *,
|
||||
extern void lcp_Setup(struct lcp *, int);
|
||||
|
||||
extern void lcp_SendProtoRej(struct lcp *, u_char *, int);
|
||||
extern int LcpPutConf(int, u_char *, const struct lcp_opt *, const char *,
|
||||
const char *, ...);
|
||||
extern int lcp_ReportStatus(struct cmdargs const *);
|
||||
extern void LcpInput(struct lcp *, struct mbuf *);
|
||||
|
@ -17,7 +17,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: lqr.c,v 1.22.2.13 1998/03/16 22:52:25 brian Exp $
|
||||
* $Id: lqr.c,v 1.22.2.14 1998/03/16 22:54:07 brian Exp $
|
||||
*
|
||||
* o LQR based on RFC1333
|
||||
*
|
||||
@ -76,8 +76,8 @@ SendEchoReq(struct lcp *lcp)
|
||||
|
||||
echo.magic = htonl(lcp->want_magic);
|
||||
echo.signature = htonl(SIGNATURE);
|
||||
echo.sequence = htonl(hdlc->lqm.echo.seq_sent++);
|
||||
FsmOutput(&lcp->fsm, CODE_ECHOREQ, lcp->fsm.reqid++,
|
||||
echo.sequence = htonl(hdlc->lqm.echo.seq_sent);
|
||||
FsmOutput(&lcp->fsm, CODE_ECHOREQ, hdlc->lqm.echo.seq_sent++,
|
||||
(u_char *)&echo, sizeof echo);
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
.\" $Id: ppp.8,v 1.97.2.5 1998/03/16 22:52:42 brian Exp $
|
||||
.\" $Id: ppp.8,v 1.97.2.6 1998/03/17 22:29:11 brian Exp $
|
||||
.Dd 20 September 1995
|
||||
.Os FreeBSD
|
||||
.Dt PPP 8
|
||||
@ -1661,6 +1661,16 @@ this option will tell
|
||||
.Nm
|
||||
not to make any utmp or wtmp entries. This is usually only necessary if
|
||||
you require the user to both login and authenticate themselves.
|
||||
.It idcheck
|
||||
Default: Enabled. When
|
||||
.Nm Ppp
|
||||
responds to an LCP packet, it must set the LCP Identifier field to be the
|
||||
same as the Identifier field of the request. Disabling
|
||||
.Ar idcheck
|
||||
makes
|
||||
.Nm
|
||||
ignore the value of the identifier field so that packets are
|
||||
processed rather than being dropped.
|
||||
.El
|
||||
.Pp
|
||||
.It add[!] dest mask gateway
|
||||
|
@ -17,7 +17,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: vars.c,v 1.45.2.14 1998/03/10 03:06:03 brian Exp $
|
||||
* $Id: vars.c,v 1.45.2.15 1998/03/13 00:44:25 brian Exp $
|
||||
*
|
||||
*/
|
||||
#include <sys/param.h>
|
||||
@ -47,7 +47,7 @@
|
||||
#include "prompt.h"
|
||||
|
||||
char VarVersion[] = "PPP Version 2.0-beta";
|
||||
char VarLocalVersion[] = "$Date: 1998/03/10 03:06:03 $";
|
||||
char VarLocalVersion[] = "$Date: 1998/03/13 00:44:25 $";
|
||||
int ipKeepAlive = 0;
|
||||
|
||||
/*
|
||||
@ -68,6 +68,7 @@ struct confdesc pppConfs[] = {
|
||||
{"proxy", CONF_DISABLE, CONF_NONE},
|
||||
{"throughput", CONF_DISABLE, CONF_NONE},
|
||||
{"utmp", CONF_ENABLE, CONF_NONE},
|
||||
{"idcheck", CONF_ENABLE, CONF_NONE},
|
||||
{NULL},
|
||||
};
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: vars.h,v 1.42.2.12 1998/03/09 19:26:41 brian Exp $
|
||||
* $Id: vars.h,v 1.42.2.13 1998/03/10 03:06:07 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
*/
|
||||
@ -47,7 +47,8 @@ struct confdesc {
|
||||
#define ConfProxy 11
|
||||
#define ConfThroughput 12
|
||||
#define ConfUtmp 13
|
||||
#define MAXCONFS 14
|
||||
#define ConfIdCheck 14
|
||||
#define MAXCONFS 15
|
||||
|
||||
#define Enabled(x) (pppConfs[x].myside & CONF_ENABLE)
|
||||
#define Acceptable(x) (pppConfs[x].hisside & CONF_ACCEPT)
|
||||
|
Loading…
Reference in New Issue
Block a user