De-staticise LQR information
Increment OutPackets for any packet - not just LQRs MFC: o Fix a few comment typos. o Fix ``set timeout'' usage message and documentation. o Change ifOutPackets, ifOutOctets and ifOutLQRs to `u_int32_t's so that they wrap correctly. o Put the LQR in network byte order using the correct struct size (sizeof u_int32_t, not sizeof u_long). o Wrap LQR ECHO counters correctly. o Don't increment OutLQR count if the last LQR hasn't been replied to. o Initialise last received LQR in StartLqm. o Don't start the LQR timer if we're `disabled' and `accepted'. o Generate LQR responses when both sides are using a timer and we're not going to send our next LQR before the peers max timeout.
This commit is contained in:
parent
9364152520
commit
879ed6fa82
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/cvs2svn/branches/MP/; revision=34530
@ -17,7 +17,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: async.c,v 1.15.2.6 1998/02/09 19:20:31 brian Exp $
|
||||
* $Id: async.c,v 1.15.2.7 1998/02/18 19:35:07 brian Exp $
|
||||
*
|
||||
*/
|
||||
#include <sys/param.h>
|
||||
@ -33,6 +33,7 @@
|
||||
#include "defs.h"
|
||||
#include "timer.h"
|
||||
#include "fsm.h"
|
||||
#include "lqr.h"
|
||||
#include "hdlc.h"
|
||||
#include "lcp.h"
|
||||
#include "lcpproto.h"
|
||||
|
@ -17,7 +17,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: auth.c,v 1.27.2.10 1998/03/01 01:07:37 brian Exp $
|
||||
* $Id: auth.c,v 1.27.2.11 1998/03/09 19:25:33 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
* o Implement check against with registered IP addresses.
|
||||
@ -45,6 +45,7 @@
|
||||
#include "auth.h"
|
||||
#include "systems.h"
|
||||
#include "lcp.h"
|
||||
#include "lqr.h"
|
||||
#include "hdlc.h"
|
||||
#include "async.h"
|
||||
#include "link.h"
|
||||
|
@ -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.1.2.19 1998/03/02 17:25:19 brian Exp $
|
||||
* $Id: bundle.c,v 1.1.2.20 1998/03/09 19:26:35 brian Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -51,6 +51,7 @@
|
||||
#include "timer.h"
|
||||
#include "fsm.h"
|
||||
#include "iplist.h"
|
||||
#include "lqr.h"
|
||||
#include "hdlc.h"
|
||||
#include "throughput.h"
|
||||
#include "ipcp.h"
|
||||
@ -669,6 +670,19 @@ bundle2ccp(struct bundle *bundle, const char *name)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct lcp *
|
||||
bundle2lcp(struct bundle *bundle, const char *name)
|
||||
{
|
||||
#ifdef realcode
|
||||
struct datalink *dl = bundle2datalink(bundle, name);
|
||||
if (dl)
|
||||
return &dl->lcp;
|
||||
return NULL;
|
||||
#else
|
||||
return &LcpInfo;
|
||||
#endif
|
||||
}
|
||||
|
||||
struct authinfo *
|
||||
bundle2pap(struct bundle *bundle, const char *name)
|
||||
{
|
||||
|
@ -23,7 +23,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: bundle.h,v 1.1.2.12 1998/03/01 01:07:39 brian Exp $
|
||||
* $Id: bundle.h,v 1.1.2.13 1998/03/09 19:26:35 brian Exp $
|
||||
*/
|
||||
|
||||
#define PHASE_DEAD 0 /* Link is dead */
|
||||
@ -83,3 +83,4 @@ extern struct datalink *bundle2datalink(struct bundle *, const char *);
|
||||
extern struct authinfo *bundle2pap(struct bundle *, const char *);
|
||||
extern struct chap *bundle2chap(struct bundle *, const char *);
|
||||
extern struct ccp *bundle2ccp(struct bundle *, const char *);
|
||||
extern struct lcp *bundle2lcp(struct bundle *, const char *);
|
||||
|
@ -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.16 1998/02/27 21:46:20 brian Exp $
|
||||
* $Id: ccp.c,v 1.30.2.17 1998/03/01 01:07:39 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
* o Support other compression protocols
|
||||
@ -45,6 +45,7 @@
|
||||
#include "bundle.h"
|
||||
#include "descriptor.h"
|
||||
#include "prompt.h"
|
||||
#include "lqr.h"
|
||||
#include "hdlc.h"
|
||||
#include "throughput.h"
|
||||
#include "link.h"
|
||||
|
@ -17,7 +17,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: chap.c,v 1.28.2.12 1998/03/06 00:34:41 brian Exp $
|
||||
* $Id: chap.c,v 1.28.2.13 1998/03/10 03:05:39 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
*/
|
||||
@ -50,6 +50,7 @@
|
||||
#include "chap_ms.h"
|
||||
#include "lcpproto.h"
|
||||
#include "lcp.h"
|
||||
#include "lqr.h"
|
||||
#include "hdlc.h"
|
||||
#include "loadalias.h"
|
||||
#include "vars.h"
|
||||
|
@ -23,7 +23,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: chat.c,v 1.44.2.13 1998/03/09 19:24:51 brian Exp $
|
||||
* $Id: chat.c,v 1.44.2.14 1998/03/09 19:25:33 brian Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -50,6 +50,7 @@
|
||||
#include "loadalias.h"
|
||||
#include "vars.h"
|
||||
#include "modem.h"
|
||||
#include "lqr.h"
|
||||
#include "hdlc.h"
|
||||
#include "throughput.h"
|
||||
#include "fsm.h"
|
||||
|
@ -17,7 +17,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: command.c,v 1.131.2.32 1998/03/09 19:24:53 brian Exp $
|
||||
* $Id: command.c,v 1.131.2.33 1998/03/09 19:26:36 brian Exp $
|
||||
*
|
||||
*/
|
||||
#include <sys/param.h>
|
||||
@ -60,6 +60,7 @@
|
||||
#ifndef NOALIAS
|
||||
#include "alias_cmd.h"
|
||||
#endif
|
||||
#include "lqr.h"
|
||||
#include "hdlc.h"
|
||||
#include "loadalias.h"
|
||||
#include "vars.h"
|
||||
@ -1148,7 +1149,7 @@ SetPreferredMTU(struct cmdargs const *arg)
|
||||
}
|
||||
|
||||
static int
|
||||
SetIdleTimeout(struct cmdargs const *arg)
|
||||
SetTimeout(struct cmdargs const *arg)
|
||||
{
|
||||
if (arg->argc > 0) {
|
||||
bundle_SetIdleTimer(arg->bundle, atoi(arg->argv[0]));
|
||||
@ -1453,8 +1454,8 @@ static struct cmdtab const SetCommands[] = {
|
||||
"Set server port", "set server|socket TcpPort|LocalName|none [mask]"},
|
||||
{"speed", NULL, SetModemSpeed, LOCAL_AUTH | LOCAL_CX,
|
||||
"Set modem speed", "set speed value"},
|
||||
{"timeout", NULL, SetIdleTimeout, LOCAL_AUTH,
|
||||
"Set Idle timeout", "set timeout value"},
|
||||
{"timeout", NULL, SetTimeout, LOCAL_AUTH,
|
||||
"Set Idle timeout", "set timeout idle LQR FSM-resend"},
|
||||
{"vj", NULL, SetInitVJ, LOCAL_AUTH,
|
||||
"Set vj values", "set vj slots|slotcomp"},
|
||||
{"help", "?", HelpCommand, LOCAL_AUTH | LOCAL_NO_AUTH,
|
||||
|
@ -23,7 +23,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: datalink.c,v 1.1.2.16 1998/03/01 01:07:43 brian Exp $
|
||||
* $Id: datalink.c,v 1.1.2.17 1998/03/09 19:24:55 brian Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -45,6 +45,7 @@
|
||||
#include "fsm.h"
|
||||
#include "lcp.h"
|
||||
#include "descriptor.h"
|
||||
#include "lqr.h"
|
||||
#include "hdlc.h"
|
||||
#include "async.h"
|
||||
#include "throughput.h"
|
||||
|
@ -23,7 +23,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: deflate.c,v 1.6.4.5 1998/02/18 19:35:35 brian Exp $
|
||||
* $Id: deflate.c,v 1.6.4.6 1998/02/23 00:38:28 brian Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -40,6 +40,7 @@
|
||||
#include "loadalias.h"
|
||||
#include "vars.h"
|
||||
#include "timer.h"
|
||||
#include "lqr.h"
|
||||
#include "hdlc.h"
|
||||
#include "fsm.h"
|
||||
#include "lcp.h"
|
||||
|
@ -17,7 +17,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: filter.c,v 1.22.2.4 1998/02/10 03:23:18 brian Exp $
|
||||
* $Id: filter.c,v 1.22.2.5 1998/02/21 01:45:06 brian Exp $
|
||||
*
|
||||
* TODO: Shoud send ICMP error message when we discard packets.
|
||||
*/
|
||||
@ -41,6 +41,7 @@
|
||||
#include "iplist.h"
|
||||
#include "timer.h"
|
||||
#include "throughput.h"
|
||||
#include "lqr.h"
|
||||
#include "hdlc.h"
|
||||
#include "link.h"
|
||||
#include "fsm.h"
|
||||
|
@ -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.15 1998/02/24 03:36:46 brian Exp $
|
||||
* $Id: fsm.c,v 1.27.2.16 1998/02/27 01:22:22 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
* o Refer loglevel for log output
|
||||
@ -36,8 +36,8 @@
|
||||
#include "defs.h"
|
||||
#include "timer.h"
|
||||
#include "fsm.h"
|
||||
#include "hdlc.h"
|
||||
#include "lqr.h"
|
||||
#include "hdlc.h"
|
||||
#include "lcpproto.h"
|
||||
#include "lcp.h"
|
||||
#include "ccp.h"
|
||||
@ -727,7 +727,7 @@ FsmRecvProtoRej(struct fsm *fp, struct fsmheader *lhp, struct mbuf *bp)
|
||||
}
|
||||
|
||||
static void
|
||||
FsmRecvEchoReq(struct fsm * fp, struct fsmheader * lhp, struct mbuf * bp)
|
||||
FsmRecvEchoReq(struct fsm *fp, struct fsmheader *lhp, struct mbuf *bp)
|
||||
{
|
||||
u_char *cp;
|
||||
u_long *lp, magic;
|
||||
@ -748,15 +748,13 @@ FsmRecvEchoReq(struct fsm * fp, struct fsmheader * lhp, struct mbuf * bp)
|
||||
}
|
||||
|
||||
static void
|
||||
FsmRecvEchoRep(struct fsm * fp, struct fsmheader * lhp, struct mbuf * bp)
|
||||
FsmRecvEchoRep(struct fsm *fp, struct fsmheader *lhp, struct mbuf *bp)
|
||||
{
|
||||
u_long *lp, magic;
|
||||
|
||||
lp = (u_long *) MBUF_CTOP(bp);
|
||||
magic = ntohl(*lp);
|
||||
/*
|
||||
* Tolerate echo replies with either magic number
|
||||
*/
|
||||
/* Tolerate echo replies with either magic number */
|
||||
if (magic != 0 && magic != LcpInfo.his_magic && magic != LcpInfo.want_magic) {
|
||||
LogPrintf(LogERROR, "RecvEchoRep: his magic is wrong! expect: %x got: %x\n",
|
||||
LcpInfo.his_magic, magic);
|
||||
@ -766,7 +764,7 @@ FsmRecvEchoRep(struct fsm * fp, struct fsmheader * lhp, struct mbuf * bp)
|
||||
* as a result.
|
||||
*/
|
||||
}
|
||||
RecvEchoLqr(bp);
|
||||
RecvEchoLqr(fp, bp);
|
||||
pfree(bp);
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: hdlc.c,v 1.28.2.14 1998/02/23 00:38:30 brian Exp $
|
||||
* $Id: hdlc.c,v 1.28.2.15 1998/03/01 01:07:44 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
*/
|
||||
@ -34,6 +34,7 @@
|
||||
#include "defs.h"
|
||||
#include "timer.h"
|
||||
#include "fsm.h"
|
||||
#include "lqr.h"
|
||||
#include "hdlc.h"
|
||||
#include "lcpproto.h"
|
||||
#include "iplist.h"
|
||||
@ -46,7 +47,6 @@
|
||||
#include "chap.h"
|
||||
#include "lcp.h"
|
||||
#include "async.h"
|
||||
#include "lqr.h"
|
||||
#include "loadalias.h"
|
||||
#include "vars.h"
|
||||
#include "modem.h"
|
||||
@ -137,7 +137,6 @@ HdlcOutput(struct link *l, int pri, u_short proto, struct mbuf *bp)
|
||||
{
|
||||
struct physical *p = link2physical(l);
|
||||
struct mbuf *mhp, *mfcs;
|
||||
struct lqrdata *lqr;
|
||||
u_char *cp;
|
||||
u_short fcs;
|
||||
|
||||
@ -179,30 +178,43 @@ HdlcOutput(struct link *l, int pri, u_short proto, struct mbuf *bp)
|
||||
mhp->cnt += 2;
|
||||
}
|
||||
|
||||
/* Tack mfcs onto the end and set bp back to the start of the data */
|
||||
mhp->next = bp;
|
||||
while (bp->next != NULL)
|
||||
bp = bp->next;
|
||||
bp->next = mfcs;
|
||||
bp = mhp->next;
|
||||
|
||||
lqr = &MyLqrData;
|
||||
lqr->PeerOutPackets = p->hdlc.lqr.OutPackets++;
|
||||
p->hdlc.lqr.OutOctets += plength(mhp) + 1;
|
||||
lqr->PeerOutOctets = p->hdlc.lqr.OutOctets;
|
||||
p->hdlc.lqm.OutOctets += plength(mhp) + 1;
|
||||
p->hdlc.lqm.OutPackets++;
|
||||
|
||||
if (proto == PROTO_LQR) {
|
||||
lqr->MagicNumber = LcpInfo.want_magic;
|
||||
lqr->LastOutLQRs = HisLqrData.PeerOutLQRs;
|
||||
lqr->LastOutPackets = HisLqrData.PeerOutPackets;
|
||||
lqr->LastOutOctets = HisLqrData.PeerOutOctets;
|
||||
lqr->PeerInLQRs = HisLqrSave.SaveInLQRs;
|
||||
lqr->PeerInPackets = HisLqrSave.SaveInPackets;
|
||||
lqr->PeerInDiscards = HisLqrSave.SaveInDiscards;
|
||||
lqr->PeerInErrors = HisLqrSave.SaveInErrors;
|
||||
lqr->PeerInOctets = HisLqrSave.SaveInOctets;
|
||||
lqr->PeerOutLQRs = ++p->hdlc.lqr.OutLQRs;
|
||||
LqrDump("LqrOutput", lqr);
|
||||
LqrChangeOrder(lqr, (struct lqrdata *) (MBUF_CTOP(bp)));
|
||||
/* Overwrite the entire packet */
|
||||
struct lqrdata lqr;
|
||||
|
||||
lqr.MagicNumber = LcpInfo.want_magic;
|
||||
lqr.LastOutLQRs = p->hdlc.lqm.lqr.peer.PeerOutLQRs;
|
||||
lqr.LastOutPackets = p->hdlc.lqm.lqr.peer.PeerOutPackets;
|
||||
lqr.LastOutOctets = p->hdlc.lqm.lqr.peer.PeerOutOctets;
|
||||
lqr.PeerInLQRs = p->hdlc.lqm.lqr.SaveInLQRs;
|
||||
lqr.PeerInPackets = p->hdlc.lqm.SaveInPackets;
|
||||
lqr.PeerInDiscards = p->hdlc.lqm.SaveInDiscards;
|
||||
lqr.PeerInErrors = p->hdlc.lqm.SaveInErrors;
|
||||
lqr.PeerInOctets = p->hdlc.lqm.SaveInOctets;
|
||||
lqr.PeerOutPackets = p->hdlc.lqm.OutPackets;
|
||||
lqr.PeerOutOctets = p->hdlc.lqm.OutOctets;
|
||||
if (p->hdlc.lqm.lqr.peer.LastOutLQRs == p->hdlc.lqm.lqr.OutLQRs) {
|
||||
/*
|
||||
* only increment if it's the first time or we've got a reply
|
||||
* from the last one
|
||||
*/
|
||||
lqr.PeerOutLQRs = ++p->hdlc.lqm.lqr.OutLQRs;
|
||||
LqrDump("LqrOutput", &lqr);
|
||||
} else {
|
||||
lqr.PeerOutLQRs = p->hdlc.lqm.lqr.OutLQRs;
|
||||
LqrDump("LqrOutput (again)", &lqr);
|
||||
}
|
||||
LqrChangeOrder(&lqr, (struct lqrdata *)MBUF_CTOP(bp));
|
||||
}
|
||||
|
||||
if (mfcs) {
|
||||
@ -379,10 +391,10 @@ DecodePacket(struct bundle *bundle, u_short proto, struct mbuf * bp,
|
||||
}
|
||||
break;
|
||||
case PROTO_LQR:
|
||||
HisLqrSave.SaveInLQRs++;
|
||||
if (p)
|
||||
if (p) {
|
||||
p->hdlc.lqm.lqr.SaveInLQRs++;
|
||||
LqrInput(p, bp);
|
||||
else {
|
||||
} else {
|
||||
LogPrintf(LogERROR, "DecodePacket: LQR: Not a physical link !\n");
|
||||
pfree(bp);
|
||||
}
|
||||
@ -417,7 +429,7 @@ DecodePacket(struct bundle *bundle, u_short proto, struct mbuf * bp,
|
||||
bp->cnt += 2;
|
||||
cp = MBUF_CTOP(bp);
|
||||
LcpSendProtoRej(cp, bp->cnt);
|
||||
HisLqrSave.SaveInDiscards++;
|
||||
p->hdlc.lqm.SaveInDiscards++;
|
||||
p->hdlc.stats.unknownproto++;
|
||||
pfree(bp);
|
||||
break;
|
||||
@ -435,12 +447,12 @@ HdlcInput(struct bundle *bundle, struct mbuf * bp, struct physical *physical)
|
||||
fcs = GOODFCS;
|
||||
else
|
||||
fcs = HdlcFcs(INITFCS, MBUF_CTOP(bp), bp->cnt);
|
||||
HisLqrSave.SaveInOctets += bp->cnt + 1;
|
||||
physical->hdlc.lqm.SaveInOctets += bp->cnt + 1;
|
||||
|
||||
LogPrintf(LogDEBUG, "HdlcInput: fcs = %04x (%s)\n",
|
||||
fcs, (fcs == GOODFCS) ? "good" : "bad");
|
||||
if (fcs != GOODFCS) {
|
||||
HisLqrSave.SaveInErrors++;
|
||||
physical->hdlc.lqm.SaveInErrors++;
|
||||
LogPrintf(LogDEBUG, "HdlcInput: Bad FCS\n");
|
||||
physical->hdlc.stats.badfcs++;
|
||||
pfree(bp);
|
||||
@ -462,7 +474,7 @@ HdlcInput(struct bundle *bundle, struct mbuf * bp, struct physical *physical)
|
||||
*/
|
||||
addr = *cp++;
|
||||
if (addr != HDLC_ADDR) {
|
||||
HisLqrSave.SaveInErrors++;
|
||||
physical->hdlc.lqm.SaveInErrors++;
|
||||
physical->hdlc.stats.badaddr++;
|
||||
LogPrintf(LogDEBUG, "HdlcInput: addr %02x\n", *cp);
|
||||
pfree(bp);
|
||||
@ -470,7 +482,7 @@ HdlcInput(struct bundle *bundle, struct mbuf * bp, struct physical *physical)
|
||||
}
|
||||
ctrl = *cp++;
|
||||
if (ctrl != HDLC_UI) {
|
||||
HisLqrSave.SaveInErrors++;
|
||||
physical->hdlc.lqm.SaveInErrors++;
|
||||
physical->hdlc.stats.badcommand++;
|
||||
LogPrintf(LogDEBUG, "HdlcInput: %02x\n", *cp);
|
||||
pfree(bp);
|
||||
@ -506,7 +518,7 @@ HdlcInput(struct bundle *bundle, struct mbuf * bp, struct physical *physical)
|
||||
}
|
||||
|
||||
link_ProtocolRecord(physical2link(physical), proto, PROTO_IN);
|
||||
HisLqrSave.SaveInPackets++;
|
||||
physical->hdlc.lqm.SaveInPackets++;
|
||||
|
||||
DecodePacket(bundle, proto, bp, physical2link(physical));
|
||||
}
|
||||
|
@ -15,7 +15,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: hdlc.h,v 1.14.2.5 1998/02/18 19:35:20 brian Exp $
|
||||
* $Id: hdlc.h,v 1.14.2.6 1998/02/18 19:35:45 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
*/
|
||||
@ -70,10 +70,31 @@ struct hdlc {
|
||||
} laststats, stats;
|
||||
|
||||
struct {
|
||||
int OutPackets;
|
||||
int OutOctets;
|
||||
int OutLQRs;
|
||||
} lqr;
|
||||
struct lcp *owner; /* parent LCP */
|
||||
struct pppTimer timer; /* When to send */
|
||||
int method; /* bit-mask for LQM_* from lqr.h */
|
||||
|
||||
u_int32_t OutPackets; /* Packets sent by me */
|
||||
u_int32_t OutOctets; /* Octets sent by me */
|
||||
u_int32_t SaveInPackets; /* Packets received from peer */
|
||||
u_int32_t SaveInDiscards; /* Discards */
|
||||
u_int32_t SaveInErrors; /* Errors */
|
||||
u_int32_t SaveInOctets; /* Octets received from peer */
|
||||
|
||||
struct {
|
||||
u_int32_t OutLQRs; /* LQRs sent by me */
|
||||
u_int32_t SaveInLQRs; /* LQRs received from peer */
|
||||
struct lqrdata peer; /* Last LQR from peer */
|
||||
int peer_timeout; /* peers max lqr timeout */
|
||||
int resent; /* Resent last packet `resent' times */
|
||||
} lqr;
|
||||
|
||||
struct {
|
||||
u_int32_t seq_sent; /* last echo sent */
|
||||
u_int32_t seq_recv; /* last echo received */
|
||||
} echo;
|
||||
} lqm;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: ip.c,v 1.38.2.9 1998/03/02 17:25:22 brian Exp $
|
||||
* $Id: ip.c,v 1.38.2.10 1998/03/09 19:26:37 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
* o Return ICMP message for filterd packet
|
||||
@ -53,6 +53,7 @@
|
||||
#include "defs.h"
|
||||
#include "timer.h"
|
||||
#include "fsm.h"
|
||||
#include "lqr.h"
|
||||
#include "hdlc.h"
|
||||
#include "loadalias.h"
|
||||
#include "vars.h"
|
||||
|
@ -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.18 1998/02/27 21:46:23 brian Exp $
|
||||
* $Id: ipcp.c,v 1.50.2.19 1998/03/09 19:26:38 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
* o More RFC1772 backwoard compatibility
|
||||
@ -59,6 +59,7 @@
|
||||
#include "ip.h"
|
||||
#include "route.h"
|
||||
#include "filter.h"
|
||||
#include "lqr.h"
|
||||
#include "hdlc.h"
|
||||
#include "async.h"
|
||||
#include "link.h"
|
||||
|
@ -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.24 1998/03/02 17:25:27 brian Exp $
|
||||
* $Id: lcp.c,v 1.55.2.25 1998/03/09 19:26:39 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
* o Limit data field length by MRU
|
||||
@ -52,9 +52,9 @@
|
||||
#include "ipcp.h"
|
||||
#include "lcpproto.h"
|
||||
#include "bundle.h"
|
||||
#include "lqr.h"
|
||||
#include "hdlc.h"
|
||||
#include "ccp.h"
|
||||
#include "lqr.h"
|
||||
#include "loadalias.h"
|
||||
#include "vars.h"
|
||||
#include "auth.h"
|
||||
@ -380,18 +380,11 @@ LcpLayerStart(struct fsm *fp)
|
||||
LcpInfo.LcpFailedMagic = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
StopAllTimers(void)
|
||||
{
|
||||
StopLqrTimer();
|
||||
}
|
||||
|
||||
static void
|
||||
LcpLayerFinish(struct fsm *fp)
|
||||
{
|
||||
/* We're now down */
|
||||
LogPrintf(LogLCP, "LcpLayerFinish\n");
|
||||
StopAllTimers();
|
||||
}
|
||||
|
||||
static void
|
||||
@ -405,7 +398,7 @@ LcpLayerUp(struct fsm *fp)
|
||||
|
||||
if (p) {
|
||||
async_SetLinkParams(&p->async, lcp);
|
||||
StartLqm(p);
|
||||
StartLqm(lcp);
|
||||
hdlc_StartTimer(&p->hdlc);
|
||||
} else
|
||||
LogPrintf(LogERROR, "LcpLayerUp: Not a physical link !\n");
|
||||
@ -419,6 +412,7 @@ LcpLayerDown(struct fsm *fp)
|
||||
|
||||
LogPrintf(LogLCP, "LcpLayerDown\n");
|
||||
hdlc_StopTimer(&p->hdlc);
|
||||
StopLqrTimer(p);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -23,7 +23,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: link.c,v 1.1.2.8 1998/02/23 00:38:33 brian Exp $
|
||||
* $Id: link.c,v 1.1.2.9 1998/02/27 01:22:36 brian Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -38,6 +38,7 @@
|
||||
#include "log.h"
|
||||
#include "defs.h"
|
||||
#include "timer.h"
|
||||
#include "lqr.h"
|
||||
#include "hdlc.h"
|
||||
#include "throughput.h"
|
||||
#include "lcpproto.h"
|
||||
|
@ -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.7 1998/02/09 19:20:56 brian Exp $
|
||||
* $Id: lqm.c,v 1.22.2.8 1998/02/16 00:00:27 brian Exp $
|
||||
*
|
||||
* o LQR based on RFC1333
|
||||
*
|
||||
@ -25,10 +25,12 @@
|
||||
* o LQM policy
|
||||
* o Allow user to configure LQM method and interval.
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <termios.h>
|
||||
|
||||
#include "command.h"
|
||||
@ -39,6 +41,7 @@
|
||||
#include "fsm.h"
|
||||
#include "lcpproto.h"
|
||||
#include "lcp.h"
|
||||
#include "lqr.h"
|
||||
#include "hdlc.h"
|
||||
#include "async.h"
|
||||
#include "throughput.h"
|
||||
@ -46,22 +49,9 @@
|
||||
#include "descriptor.h"
|
||||
#include "physical.h"
|
||||
#include "bundle.h"
|
||||
#include "lqr.h"
|
||||
#include "loadalias.h"
|
||||
#include "vars.h"
|
||||
|
||||
struct lqrdata MyLqrData, HisLqrData;
|
||||
struct lqrsave HisLqrSave;
|
||||
|
||||
static struct pppTimer LqrTimer;
|
||||
|
||||
static u_long lastpeerin = (u_long) - 1;
|
||||
|
||||
static int lqmmethod;
|
||||
static u_int32_t echoseq;
|
||||
static u_int32_t gotseq;
|
||||
static int lqrsendcnt;
|
||||
|
||||
struct echolqr {
|
||||
u_int32_t magic;
|
||||
u_int32_t signature;
|
||||
@ -71,35 +61,43 @@ struct echolqr {
|
||||
#define SIGNATURE 0x594e4f54
|
||||
|
||||
static void
|
||||
SendEchoReq(void)
|
||||
SendEchoReq(struct lcp *lcp)
|
||||
{
|
||||
struct echolqr *lqr, lqrdata;
|
||||
struct hdlc *hdlc = &link2physical(lcp->fsm.link)->hdlc;
|
||||
struct echolqr echo;
|
||||
|
||||
if (LcpInfo.fsm.state == ST_OPENED) {
|
||||
lqr = &lqrdata;
|
||||
lqr->magic = htonl(LcpInfo.want_magic);
|
||||
lqr->signature = htonl(SIGNATURE);
|
||||
LogPrintf(LogLQM, "Send echo LQR [%d]\n", echoseq);
|
||||
lqr->sequence = htonl(echoseq++);
|
||||
FsmOutput(&LcpInfo.fsm, CODE_ECHOREQ, LcpInfo.fsm.reqid++,
|
||||
(u_char *) lqr, sizeof(struct echolqr));
|
||||
}
|
||||
LogPrintf(LogLQM, "Send echo LQR [%lu]\n", (u_long)hdlc->lqm.echo.seq_sent);
|
||||
|
||||
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++,
|
||||
(u_char *)&echo, sizeof echo);
|
||||
}
|
||||
|
||||
void
|
||||
RecvEchoLqr(struct mbuf * bp)
|
||||
RecvEchoLqr(struct fsm *fp, struct mbuf * bp)
|
||||
{
|
||||
struct hdlc *hdlc = &link2physical(fp->link)->hdlc;
|
||||
struct echolqr *lqr;
|
||||
u_int32_t seq;
|
||||
|
||||
if (plength(bp) == sizeof(struct echolqr)) {
|
||||
lqr = (struct echolqr *) MBUF_CTOP(bp);
|
||||
if (htonl(lqr->signature) == SIGNATURE) {
|
||||
if (ntohl(lqr->signature) == SIGNATURE) {
|
||||
seq = ntohl(lqr->sequence);
|
||||
LogPrintf(LogLQM, "Got echo LQR [%d]\n", ntohl(lqr->sequence));
|
||||
gotseq = seq;
|
||||
}
|
||||
}
|
||||
/* careful not to update lqm.echo.seq_recv with older values */
|
||||
if ((hdlc->lqm.echo.seq_recv > (u_int32_t)0 - 5 && seq < 5) ||
|
||||
(hdlc->lqm.echo.seq_recv <= (u_int32_t)0 - 5 &&
|
||||
seq > hdlc->lqm.echo.seq_recv))
|
||||
hdlc->lqm.echo.seq_recv = seq;
|
||||
} else
|
||||
LogPrintf(LogERROR, "RecvEchoLqr: Got sig 0x%08x, expecting 0x%08x !\n",
|
||||
ntohl(lqr->signature), SIGNATURE);
|
||||
} else
|
||||
LogPrintf(LogERROR, "RecvEchoLqr: Got packet size %d, expecting %d !\n",
|
||||
plength(bp), sizeof(struct echolqr));
|
||||
}
|
||||
|
||||
void
|
||||
@ -110,88 +108,92 @@ LqrChangeOrder(struct lqrdata * src, struct lqrdata * dst)
|
||||
|
||||
sp = (u_long *) src;
|
||||
dp = (u_long *) dst;
|
||||
for (n = 0; n < sizeof(struct lqrdata) / sizeof(u_long); n++)
|
||||
for (n = 0; n < sizeof(struct lqrdata) / sizeof(u_int32_t); n++)
|
||||
*dp++ = ntohl(*sp++);
|
||||
}
|
||||
|
||||
static void
|
||||
SendLqrReport(void *v)
|
||||
{
|
||||
struct lcp *lcp = (struct lcp *)v;
|
||||
struct hdlc *hdlc = &link2physical(lcp->fsm.link)->hdlc;
|
||||
struct mbuf *bp;
|
||||
struct physical *physical = v;
|
||||
|
||||
StopTimer(&LqrTimer);
|
||||
StopTimer(&hdlc->lqm.timer);
|
||||
|
||||
if (lqmmethod & LQM_LQR) {
|
||||
if (lqrsendcnt > 5) {
|
||||
|
||||
/*
|
||||
* XXX: Should implement LQM strategy
|
||||
*/
|
||||
LogPrintf(LogPHASE, "** 1 Too many ECHO packets are lost. **\n");
|
||||
lqmmethod = 0; /* Prevent rcursion via bundle_Close() */
|
||||
if (hdlc->lqm.method & LQM_LQR) {
|
||||
if (hdlc->lqm.lqr.resent > 5) {
|
||||
/* XXX: Should implement LQM strategy */
|
||||
LogPrintf(LogPHASE, "** Too many LQR packets lost **\n");
|
||||
LogPrintf(LogLQM, "LqrOutput: Too many LQR packets lost\n");
|
||||
hdlc->lqm.method = 0; /* Prevent recursion via bundle_Close() */
|
||||
bundle_Close(LcpInfo.fsm.bundle, NULL, 1);
|
||||
} else {
|
||||
bp = mballoc(sizeof(struct lqrdata), MB_LQR);
|
||||
HdlcOutput(physical2link(physical), PRI_LINK, PROTO_LQR, bp);
|
||||
lqrsendcnt++;
|
||||
HdlcOutput(lcp->fsm.link, PRI_LINK, PROTO_LQR, bp);
|
||||
hdlc->lqm.lqr.resent++;
|
||||
}
|
||||
} else if (lqmmethod & LQM_ECHO) {
|
||||
if (echoseq - gotseq > 5) {
|
||||
LogPrintf(LogPHASE, "** 2 Too many ECHO packets are lost. **\n");
|
||||
lqmmethod = 0; /* Prevent rcursion via bundle_Close() */
|
||||
} else if (hdlc->lqm.method & LQM_ECHO) {
|
||||
if ((hdlc->lqm.echo.seq_sent > 5 &&
|
||||
hdlc->lqm.echo.seq_sent - 5 > hdlc->lqm.echo.seq_recv) ||
|
||||
(hdlc->lqm.echo.seq_sent <= 5 &&
|
||||
hdlc->lqm.echo.seq_sent > hdlc->lqm.echo.seq_recv + 5)) {
|
||||
LogPrintf(LogPHASE, "** Too many ECHO LQR packets lost **\n");
|
||||
LogPrintf(LogLQM, "LqrOutput: Too many ECHO LQR packets lost\n");
|
||||
hdlc->lqm.method = 0; /* Prevent recursion via bundle_Close() */
|
||||
bundle_Close(LcpInfo.fsm.bundle, NULL, 1);
|
||||
} else
|
||||
SendEchoReq();
|
||||
SendEchoReq(lcp);
|
||||
}
|
||||
if (lqmmethod && Enabled(ConfLqr))
|
||||
StartTimer(&LqrTimer);
|
||||
if (hdlc->lqm.method && hdlc->lqm.timer.load)
|
||||
StartTimer(&hdlc->lqm.timer);
|
||||
}
|
||||
|
||||
void
|
||||
LqrInput(struct physical *physical, struct mbuf * bp)
|
||||
LqrInput(struct physical *physical, struct mbuf *bp)
|
||||
{
|
||||
int len;
|
||||
u_char *cp;
|
||||
struct lqrdata *lqr;
|
||||
|
||||
len = plength(bp);
|
||||
if (len != sizeof(struct lqrdata)) {
|
||||
pfree(bp);
|
||||
return;
|
||||
}
|
||||
if (!Acceptable(ConfLqr)) {
|
||||
if (len != sizeof(struct lqrdata))
|
||||
LogPrintf(LogERROR, "LqrInput: Got packet size %d, expecting %d !\n",
|
||||
len, sizeof(struct lqrdata));
|
||||
else if (!Acceptable(ConfLqr)) {
|
||||
bp->offset -= 2;
|
||||
bp->cnt += 2;
|
||||
|
||||
cp = MBUF_CTOP(bp);
|
||||
LcpSendProtoRej(cp, bp->cnt);
|
||||
LcpSendProtoRej(MBUF_CTOP(bp), bp->cnt);
|
||||
} else {
|
||||
cp = MBUF_CTOP(bp);
|
||||
lqr = (struct lqrdata *) cp;
|
||||
if (ntohl(lqr->MagicNumber) != LcpInfo.his_magic) {
|
||||
struct lqrdata *lqr;
|
||||
u_int32_t lastLQR;
|
||||
|
||||
lqr = (struct lqrdata *)MBUF_CTOP(bp);
|
||||
if (ntohl(lqr->MagicNumber) != LcpInfo.his_magic)
|
||||
LogPrintf(LogERROR, "LqrInput: magic %x != expecting %x\n",
|
||||
ntohl(lqr->MagicNumber), LcpInfo.his_magic);
|
||||
pfree(bp);
|
||||
return;
|
||||
}
|
||||
else {
|
||||
/*
|
||||
* Remember our PeerInLQRs, then convert byte order and save
|
||||
*/
|
||||
lastLQR = physical->hdlc.lqm.lqr.peer.PeerInLQRs;
|
||||
physical->hdlc.lqm.method |= LQM_LQR;
|
||||
|
||||
/*
|
||||
* Convert byte order and save into our strage
|
||||
*/
|
||||
LqrChangeOrder(lqr, &HisLqrData);
|
||||
LqrDump("LqrInput", &HisLqrData);
|
||||
lqrsendcnt = 0; /* we have received LQR from peer */
|
||||
LqrChangeOrder(lqr, &physical->hdlc.lqm.lqr.peer);
|
||||
LqrDump("Input", &physical->hdlc.lqm.lqr.peer);
|
||||
/* we have received an LQR from peer */
|
||||
physical->hdlc.lqm.lqr.resent = 0;
|
||||
|
||||
/*
|
||||
* Generate LQR responce to peer, if i) We are not running LQR timer. ii)
|
||||
* Two successive LQR's PeerInLQRs are same.
|
||||
*/
|
||||
if (LqrTimer.load == 0 || lastpeerin == HisLqrData.PeerInLQRs) {
|
||||
lqmmethod |= LQM_LQR;
|
||||
SendLqrReport(physical);
|
||||
/*
|
||||
* Generate an LQR response if we're not running an LQR timer OR
|
||||
* two successive LQR's PeerInLQRs are the same OR we're not going to
|
||||
* send our next one before the peers max timeout.
|
||||
*/
|
||||
if (physical->hdlc.lqm.timer.load == 0 ||
|
||||
lastLQR == physical->hdlc.lqm.lqr.peer.PeerInLQRs ||
|
||||
(physical->hdlc.lqm.lqr.peer_timeout &&
|
||||
physical->hdlc.lqm.timer.rest * 100 / SECTICKS >
|
||||
physical->hdlc.lqm.lqr.peer_timeout))
|
||||
SendLqrReport(physical->hdlc.lqm.owner);
|
||||
}
|
||||
lastpeerin = HisLqrData.PeerInLQRs;
|
||||
}
|
||||
pfree(bp);
|
||||
}
|
||||
@ -200,45 +202,47 @@ LqrInput(struct physical *physical, struct mbuf * bp)
|
||||
* When LCP is reached to opened state, We'll start LQM activity.
|
||||
*/
|
||||
void
|
||||
StartLqm(struct physical *physical)
|
||||
StartLqm(struct lcp *lcp)
|
||||
{
|
||||
int period;
|
||||
struct physical *physical = link2physical(lcp->fsm.link);
|
||||
|
||||
lqrsendcnt = 0; /* start waiting all over for ECHOs */
|
||||
echoseq = 0;
|
||||
gotseq = 0;
|
||||
physical->hdlc.lqm.lqr.resent = 0;
|
||||
physical->hdlc.lqm.echo.seq_sent = 0;
|
||||
physical->hdlc.lqm.echo.seq_recv = 0;
|
||||
memset(&physical->hdlc.lqm.lqr.peer, '\0',
|
||||
sizeof physical->hdlc.lqm.lqr.peer);
|
||||
|
||||
lqmmethod = LQM_ECHO;
|
||||
physical->hdlc.lqm.method = LQM_ECHO;
|
||||
if (Enabled(ConfLqr))
|
||||
lqmmethod |= LQM_LQR;
|
||||
StopTimer(&LqrTimer);
|
||||
LogPrintf(LogLQM, "LQM method = %d\n", lqmmethod);
|
||||
physical->hdlc.lqm.method |= LQM_LQR;
|
||||
StopTimer(&physical->hdlc.lqm.timer);
|
||||
|
||||
if (LcpInfo.his_lqrperiod || LcpInfo.want_lqrperiod) {
|
||||
physical->hdlc.lqm.lqr.peer_timeout = lcp->his_lqrperiod;
|
||||
physical->hdlc.lqm.owner = lcp;
|
||||
if (lcp->his_lqrperiod)
|
||||
LogPrintf(LogLQM, "Expecting LQR every %d.%02d secs\n",
|
||||
lcp->his_lqrperiod / 100, lcp->his_lqrperiod % 100);
|
||||
|
||||
/*
|
||||
* We need to run timer. Let's figure out period.
|
||||
*/
|
||||
period = LcpInfo.his_lqrperiod ?
|
||||
LcpInfo.his_lqrperiod : LcpInfo.want_lqrperiod;
|
||||
StopTimer(&LqrTimer);
|
||||
LqrTimer.state = TIMER_STOPPED;
|
||||
LqrTimer.load = period * SECTICKS / 100;
|
||||
LqrTimer.func = SendLqrReport;
|
||||
LqrTimer.arg = physical;
|
||||
SendLqrReport(physical);
|
||||
StartTimer(&LqrTimer);
|
||||
LogPrintf(LogLQM, "Will send LQR every %d.%d secs\n",
|
||||
period / 100, period % 100);
|
||||
if (lcp->want_lqrperiod) {
|
||||
LogPrintf(LogLQM, "Will send %s every %d.%02d secs\n",
|
||||
physical->hdlc.lqm.method & LQM_LQR ? "LQR" : "ECHO LQR",
|
||||
lcp->want_lqrperiod / 100, lcp->want_lqrperiod % 100);
|
||||
physical->hdlc.lqm.timer.state = TIMER_STOPPED;
|
||||
physical->hdlc.lqm.timer.load = lcp->want_lqrperiod * SECTICKS / 100;
|
||||
physical->hdlc.lqm.timer.func = SendLqrReport;
|
||||
physical->hdlc.lqm.timer.arg = lcp;
|
||||
SendLqrReport(lcp);
|
||||
} else {
|
||||
LogPrintf(LogLQM, "LQR is not activated.\n");
|
||||
physical->hdlc.lqm.timer.load = 0;
|
||||
if (!lcp->his_lqrperiod)
|
||||
LogPrintf(LogLQM, "LQR/ECHO LQR not negotiated\n");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
StopLqrTimer()
|
||||
StopLqrTimer(struct physical *physical)
|
||||
{
|
||||
StopTimer(&LqrTimer);
|
||||
StopTimer(&physical->hdlc.lqm.timer);
|
||||
}
|
||||
|
||||
void
|
||||
@ -250,11 +254,11 @@ StopLqr(struct physical *physical, int method)
|
||||
LogPrintf(LogLQM, "Stop sending LQR, Use LCP ECHO instead.\n");
|
||||
if (method == LQM_ECHO)
|
||||
LogPrintf(LogLQM, "Stop sending LCP ECHO.\n");
|
||||
lqmmethod &= ~method;
|
||||
if (lqmmethod)
|
||||
SendLqrReport(physical);
|
||||
physical->hdlc.lqm.method &= ~method;
|
||||
if (physical->hdlc.lqm.method)
|
||||
SendLqrReport(physical->hdlc.lqm.owner);
|
||||
else
|
||||
StopTimer(&LqrTimer);
|
||||
StopTimer(&physical->hdlc.lqm.timer);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -15,50 +15,43 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: lqr.h,v 1.12 1998/01/21 02:15:20 brian Exp $
|
||||
* $Id: lqr.h,v 1.12.2.1 1998/01/29 00:49:26 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
*/
|
||||
|
||||
/*
|
||||
* Structure of LQR packet defined in RFC1333
|
||||
* Structure of LQR packet defined in RFC1989
|
||||
*/
|
||||
struct lqrdata {
|
||||
u_int32_t MagicNumber;
|
||||
u_int32_t LastOutLQRs;
|
||||
u_int32_t LastOutPackets;
|
||||
u_int32_t LastOutOctets;
|
||||
u_int32_t PeerInLQRs;
|
||||
u_int32_t PeerInPackets;
|
||||
u_int32_t PeerInDiscards;
|
||||
u_int32_t PeerInErrors;
|
||||
u_int32_t PeerInOctets;
|
||||
u_int32_t PeerOutLQRs;
|
||||
u_int32_t PeerOutPackets;
|
||||
u_int32_t PeerOutOctets;
|
||||
u_int32_t LastOutLQRs; /* most recently received PeerOutLQRs */
|
||||
u_int32_t LastOutPackets; /* most recently received PeerOutPackets */
|
||||
u_int32_t LastOutOctets; /* most recently received PeerOutOctets */
|
||||
u_int32_t PeerInLQRs; /* Peers SaveInLQRs */
|
||||
u_int32_t PeerInPackets; /* Peers SaveInPackets */
|
||||
u_int32_t PeerInDiscards; /* Peers SaveInDiscards */
|
||||
u_int32_t PeerInErrors; /* Peers SaveInErrors */
|
||||
u_int32_t PeerInOctets; /* Peers SaveInOctets */
|
||||
u_int32_t PeerOutLQRs; /* Peers OutLQRs (hdlc.h) */
|
||||
u_int32_t PeerOutPackets; /* Peers OutPackets (hdlc.h) */
|
||||
u_int32_t PeerOutOctets; /* Peers OutOctets (hdlc.h) */
|
||||
};
|
||||
|
||||
struct lqrsave {
|
||||
u_int32_t SaveInLQRs;
|
||||
u_int32_t SaveInPackets;
|
||||
u_int32_t SaveInDiscards;
|
||||
u_int32_t SaveInErrors;
|
||||
u_int32_t SaveInOctets;
|
||||
};
|
||||
|
||||
extern struct lqrdata MyLqrData, HisLqrData;
|
||||
extern struct lqrsave HisLqrSave;
|
||||
|
||||
/*
|
||||
* We support LQR and ECHO as LQM method
|
||||
*/
|
||||
#define LQM_LQR 1
|
||||
#define LQM_ECHO 2
|
||||
|
||||
struct physical;
|
||||
struct lcp;
|
||||
struct fsm;
|
||||
|
||||
extern void LqrDump(const char *, const struct lqrdata *);
|
||||
extern void LqrChangeOrder(struct lqrdata *, struct lqrdata *);
|
||||
extern void StartLqm(struct physical *);
|
||||
extern void StartLqm(struct lcp *);
|
||||
extern void StopLqr(struct physical *, int);
|
||||
extern void StopLqrTimer(void);
|
||||
extern void RecvEchoLqr(struct mbuf *);
|
||||
extern void StopLqrTimer(struct physical *);
|
||||
extern void RecvEchoLqr(struct fsm *, struct mbuf *);
|
||||
extern void LqrInput(struct physical *, struct mbuf *);
|
||||
|
@ -17,7 +17,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: main.c,v 1.121.2.28 1998/02/23 00:38:35 brian Exp $
|
||||
* $Id: main.c,v 1.121.2.29 1998/03/01 01:07:46 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
* o Add commands for traffic summary, version display, etc.
|
||||
@ -55,6 +55,7 @@
|
||||
#include "fsm.h"
|
||||
#include "modem.h"
|
||||
#include "bundle.h"
|
||||
#include "lqr.h"
|
||||
#include "hdlc.h"
|
||||
#include "lcp.h"
|
||||
#include "ccp.h"
|
||||
|
@ -17,7 +17,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: modem.c,v 1.77.2.30 1998/03/10 03:05:44 brian Exp $
|
||||
* $Id: modem.c,v 1.77.2.31 1998/03/11 02:21:59 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
*/
|
||||
@ -49,6 +49,7 @@
|
||||
#include "id.h"
|
||||
#include "timer.h"
|
||||
#include "fsm.h"
|
||||
#include "lqr.h"
|
||||
#include "hdlc.h"
|
||||
#include "lcp.h"
|
||||
#include "ip.h"
|
||||
|
@ -18,7 +18,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: pap.c,v 1.20.2.13 1998/03/09 19:25:34 brian Exp $
|
||||
* $Id: pap.c,v 1.20.2.14 1998/03/10 03:05:50 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
*/
|
||||
@ -48,6 +48,7 @@
|
||||
#include "pap.h"
|
||||
#include "loadalias.h"
|
||||
#include "vars.h"
|
||||
#include "lqr.h"
|
||||
#include "hdlc.h"
|
||||
#include "lcpproto.h"
|
||||
#include "async.h"
|
||||
|
@ -16,7 +16,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: physical.c,v 1.1.2.13 1998/03/06 00:34:46 brian Exp $
|
||||
* $Id: physical.c,v 1.1.2.14 1998/03/10 03:05:54 brian Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -45,6 +45,7 @@
|
||||
|
||||
/* Name space pollution for physical.h */
|
||||
#include "timer.h"
|
||||
#include "lqr.h"
|
||||
#include "hdlc.h"
|
||||
#include "throughput.h"
|
||||
#include "fsm.h"
|
||||
|
@ -1,4 +1,4 @@
|
||||
.\" $Id: ppp.8,v 1.97.2.1 1998/02/23 00:38:39 brian Exp $
|
||||
.\" $Id: ppp.8,v 1.97.2.2 1998/03/09 19:25:35 brian Exp $
|
||||
.Dd 20 September 1995
|
||||
.Os FreeBSD
|
||||
.Dt PPP 8
|
||||
@ -847,7 +847,7 @@ ui-gate:
|
||||
set escape 0xff
|
||||
set device ui-gate:ppp-in
|
||||
set dial
|
||||
set timeout 30 5 4
|
||||
set timeout 30 15 5
|
||||
set log Phase Chat Connect Carrier hdlc LCP IPCP CCP tun
|
||||
set ifaddr 10.0.4.2 10.0.4.1
|
||||
add 10.0.2.0 255.255.255.0 10.0.4.1
|
||||
@ -969,7 +969,7 @@ See
|
||||
To check/set idle timer, use the
|
||||
.Dq show timeout
|
||||
and
|
||||
.Dq set timeout [lqrtimer [retrytimer]]
|
||||
.Dq set timeout idle [LQR [FSM-resend]]
|
||||
commands:
|
||||
.Bd -literal -offset indent
|
||||
ppp ON awfulhak> set timeout 600
|
||||
@ -2395,9 +2395,11 @@ can also be used, but link encryption may be implemented in the future, so
|
||||
should not be relied upon.
|
||||
.It set speed value
|
||||
This sets the speed of the serial device.
|
||||
.It set timeout Idle [ lqr [ retry ] ]
|
||||
.Dq set timeout idle [LQR [FSM-resend]]
|
||||
This command allows the setting of the idle timer, the LQR timer (if
|
||||
enabled) and the retry timer.
|
||||
enabled) and the finite state machine
|
||||
.Pq FSM
|
||||
retry timer.
|
||||
.It set vj slots nslots
|
||||
This command sets the initial number of
|
||||
.Ar slots
|
||||
|
@ -26,7 +26,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: pred.c,v 1.20.2.3 1998/01/31 02:48:29 brian Exp $
|
||||
* $Id: pred.c,v 1.20.2.4 1998/02/23 00:38:41 brian Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -44,6 +44,7 @@
|
||||
#include "vars.h"
|
||||
#include "timer.h"
|
||||
#include "fsm.h"
|
||||
#include "lqr.h"
|
||||
#include "hdlc.h"
|
||||
#include "lcpproto.h"
|
||||
#include "lcp.h"
|
||||
|
@ -23,7 +23,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: prompt.c,v 1.1.2.9 1998/02/27 01:22:37 brian Exp $
|
||||
* $Id: prompt.c,v 1.1.2.10 1998/03/01 01:07:49 brian Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -52,6 +52,7 @@
|
||||
#include "iplist.h"
|
||||
#include "throughput.h"
|
||||
#include "ipcp.h"
|
||||
#include "lqr.h"
|
||||
#include "hdlc.h"
|
||||
#include "async.h"
|
||||
#include "mbuf.h"
|
||||
|
@ -17,7 +17,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: route.c,v 1.42.2.7 1998/02/10 03:23:39 brian Exp $
|
||||
* $Id: route.c,v 1.42.2.8 1998/02/27 01:22:38 brian Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -51,6 +51,7 @@
|
||||
#include "iplist.h"
|
||||
#include "timer.h"
|
||||
#include "throughput.h"
|
||||
#include "lqr.h"
|
||||
#include "hdlc.h"
|
||||
#include "link.h"
|
||||
#include "fsm.h"
|
||||
|
@ -23,7 +23,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: tun.c,v 1.6.4.3 1998/02/27 01:22:39 brian Exp $
|
||||
* $Id: tun.c,v 1.6.4.4 1998/03/02 17:25:30 brian Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -43,6 +43,7 @@
|
||||
#include "mbuf.h"
|
||||
#include "log.h"
|
||||
#include "timer.h"
|
||||
#include "lqr.h"
|
||||
#include "hdlc.h"
|
||||
#include "defs.h"
|
||||
#include "loadalias.h"
|
||||
|
@ -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.13 1998/03/09 19:26:40 brian Exp $
|
||||
* $Id: vars.c,v 1.45.2.14 1998/03/10 03:06:03 brian Exp $
|
||||
*
|
||||
*/
|
||||
#include <sys/param.h>
|
||||
@ -32,6 +32,7 @@
|
||||
#include "defs.h"
|
||||
#include "timer.h"
|
||||
#include "fsm.h"
|
||||
#include "lqr.h"
|
||||
#include "hdlc.h"
|
||||
#include "termios.h"
|
||||
#include "loadalias.h"
|
||||
@ -46,7 +47,7 @@
|
||||
#include "prompt.h"
|
||||
|
||||
char VarVersion[] = "PPP Version 2.0-beta";
|
||||
char VarLocalVersion[] = "$Date: 1998/03/09 19:26:40 $";
|
||||
char VarLocalVersion[] = "$Date: 1998/03/10 03:06:03 $";
|
||||
int ipKeepAlive = 0;
|
||||
|
||||
/*
|
||||
|
@ -17,7 +17,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: vjcomp.c,v 1.16.2.4 1998/02/21 01:45:26 brian Exp $
|
||||
* $Id: vjcomp.c,v 1.16.2.5 1998/02/23 00:38:43 brian Exp $
|
||||
*
|
||||
* TODO:
|
||||
*/
|
||||
@ -36,6 +36,7 @@
|
||||
#include "fsm.h"
|
||||
#include "lcpproto.h"
|
||||
#include "slcompress.h"
|
||||
#include "lqr.h"
|
||||
#include "hdlc.h"
|
||||
#include "defs.h"
|
||||
#include "iplist.h"
|
||||
|
Loading…
Reference in New Issue
Block a user