hdlc
p->hdlc.lqm.ifInErrors++;
p->hdlc.stats.badaddr++;
p->hdlc.lqm.ifInErrors++;
p->hdlc.stats.badcommand++;
cx->physical->hdlc.lqm.method &= ~LQM_ECHO;
if (cx->physical->hdlc.lqm.method & LQM_ECHO &&
cx->physical->hdlc.lqm.timer.load) {
cx->physical->hdlc.lqm.timer.load = 0;
cx->physical->hdlc.lqm.method |= LQM_ECHO;
cx->physical->hdlc.lqm.timer.load =
(*cx->physical->hdlc.lqm.timer.func)(&cx->physical->link.lcp);
hdlc_Init(&dl->physical->hdlc, &dl->physical->link.lcp);
memset(hdlc, '\0', sizeof(struct hdlc));
hdlc->lqm.owner = lcp;
p->hdlc.lqm.ifInOctets += len + 1; /* plus 1 flag octet! */
p->hdlc.lqm.ifInErrors++;
p->hdlc.stats.badfcs++;
p->hdlc.lqm.lqr.InGoodOctets += len + 1; /* plus 1 flag octet! */
p->hdlc.lqm.ifInUniPackets++;
struct hdlc *hdlc = &arg->cx->physical->hdlc;
hdlc->stats.badfcs);
HDLC_ADDR, hdlc->stats.badaddr);
HDLC_UI, hdlc->stats.badcommand);
hdlc->stats.unknownproto);
struct hdlc *hdlc = (struct hdlc *)v;
timer_Stop(&hdlc->ReportTimer);
if (memcmp(&hdlc->laststats, &hdlc->stats, sizeof hdlc->stats)) {
hdlc->lqm.owner->fsm.link->name,
hdlc->stats.badfcs - hdlc->laststats.badfcs,
hdlc->stats.badaddr - hdlc->laststats.badaddr,
hdlc->stats.badcommand - hdlc->laststats.badcommand,
hdlc->stats.unknownproto - hdlc->laststats.unknownproto);
hdlc->laststats = hdlc->stats;
timer_Start(&hdlc->ReportTimer);
hdlc_StartTimer(struct hdlc *hdlc)
timer_Stop(&hdlc->ReportTimer);
hdlc->ReportTimer.load = 60 * SECTICKS;
hdlc->ReportTimer.arg = hdlc;
hdlc->ReportTimer.func = hdlc_ReportTime;
hdlc->ReportTimer.name = "hdlc";
timer_Start(&hdlc->ReportTimer);
hdlc_StopTimer(struct hdlc *hdlc)
timer_Stop(&hdlc->ReportTimer);
hdlc_Init(struct hdlc *hdlc, struct lcp *lcp)
extern void hdlc_Init(struct hdlc *, struct lcp *);
extern void hdlc_StartTimer(struct hdlc *);
extern void hdlc_StopTimer(struct hdlc *);
hdlc_StartTimer(&p->hdlc);
hdlc_StopTimer(&p->hdlc);
p->hdlc.lqm.ifInDiscards++;
p->hdlc.stats.unknownproto++;
if ((hdlc->lqm.echo.seq_recv > (u_int32_t)0 - 5 && lqr.sequence < 5) ||
(hdlc->lqm.echo.seq_recv <= (u_int32_t)0 - 5 &&
lqr.sequence > hdlc->lqm.echo.seq_recv))
hdlc->lqm.echo.seq_recv = lqr.sequence;
timer_Stop(&p->hdlc.lqm.timer);
if (p->hdlc.lqm.method & LQM_LQR) {
if (p->hdlc.lqm.lqr.resent > 5) {
p->hdlc.lqm.method = 0;
p->hdlc.lqm.lqr.resent++;
} else if (p->hdlc.lqm.method & LQM_ECHO) {
if ((p->hdlc.lqm.echo.seq_sent > 5 &&
p->hdlc.lqm.echo.seq_sent - 5 > p->hdlc.lqm.echo.seq_recv) ||
(p->hdlc.lqm.echo.seq_sent <= 5 &&
p->hdlc.lqm.echo.seq_sent > p->hdlc.lqm.echo.seq_recv + 5)) {
p->hdlc.lqm.method = 0;
if (p->hdlc.lqm.method && p->hdlc.lqm.timer.load)
timer_Start(&p->hdlc.lqm.timer);
struct lcp *lcp = p->hdlc.lqm.owner;
else if (!IsAccepted(l->lcp.cfg.lqr) && !(p->hdlc.lqm.method & LQM_LQR)) {
memcpy(&lastlqr, &p->hdlc.lqm.lqr.peer, sizeof lastlqr);
lqr_ChangeOrder(lqr, &p->hdlc.lqm.lqr.peer);
lqr_Dump(l->name, "Input", &p->hdlc.lqm.lqr.peer);
p->hdlc.lqm.lqr.resent = 0;
memcpy(&p->hdlc.lqm.lqr.prevSave, &p->hdlc.lqm.lqr.Save,
sizeof p->hdlc.lqm.lqr.prevSave);
p->hdlc.lqm.lqr.Save.InLQRs = ++p->hdlc.lqm.lqr.InLQRs;
p->hdlc.lqm.lqr.Save.InPackets = p->hdlc.lqm.ifInUniPackets;
p->hdlc.lqm.lqr.Save.InDiscards = p->hdlc.lqm.ifInDiscards;
p->hdlc.lqm.lqr.Save.InErrors = p->hdlc.lqm.ifInErrors;
p->hdlc.lqm.lqr.Save.InOctets = p->hdlc.lqm.lqr.InGoodOctets;
lqr_Analyse(&p->hdlc, &lastlqr, &p->hdlc.lqm.lqr.peer);
if (p->hdlc.lqm.timer.load == 0 || !(p->hdlc.lqm.method & LQM_LQR) ||
lastlqr.PeerInLQRs == p->hdlc.lqm.lqr.peer.PeerInLQRs))
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);
physical->hdlc.lqm.method = lcp->cfg.echo ? LQM_ECHO : 0;
physical->hdlc.lqm.method |= LQM_LQR;
timer_Stop(&physical->hdlc.lqm.timer);
physical->hdlc.lqm.lqr.peer_timeout = lcp->his_lqrperiod;
physical->hdlc.lqm.timer.func = SendLqrReport;
physical->hdlc.lqm.timer.name = "lqm";
physical->hdlc.lqm.timer.arg = lcp;
if (lcp->want_lqrperiod || physical->hdlc.lqm.method & LQM_ECHO) {
physical->hdlc.lqm.timer.load = period * SECTICKS / 100;
physical->hdlc.lqm.timer.load = 0;
if (p->hdlc.lqm.timer.load)
if (p->hdlc.lqm.timer.load)
timer_Start(&p->hdlc.lqm.timer);
timer_Stop(&physical->hdlc.lqm.timer);
physical->hdlc.lqm.method &= ~method;
if (physical->hdlc.lqm.method)
SendLqrReport(physical->hdlc.lqm.owner);
timer_Stop(&physical->hdlc.lqm.timer);
lqr_Analyse(const struct hdlc *hdlc, const struct lqrdata *oldlqr,
transitLQRs = hdlc->lqm.lqr.OutLQRs - newlqr->LastOutLQRs;
(hdlc->lqm.lqr.Save.InPackets - hdlc->lqm.lqr.prevSave.InPackets);
(hdlc->lqm.lqr.Save.InOctets - hdlc->lqm.lqr.prevSave.InOctets);
p->hdlc.lqm.ifOutUniPackets++;
p->hdlc.lqm.ifOutOctets += len + 1; /* plus 1 flag octet! */
p->hdlc.lqm.ifOutOctets += acf_WrapperOctets(&l->lcp, *proto);
p->hdlc.lqm.ifOutOctets += hdlc_WrapperOctets();
p->hdlc.lqm.ifOutOctets += proto_WrapperOctets(&l->lcp, *proto);
p->hdlc.lqm.lqr.OutLQRs++;
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.Save.InLQRs;
lqr.PeerInPackets = p->hdlc.lqm.lqr.Save.InPackets;
lqr.PeerInDiscards = p->hdlc.lqm.lqr.Save.InDiscards;
lqr.PeerInErrors = p->hdlc.lqm.lqr.Save.InErrors;
lqr.PeerInOctets = p->hdlc.lqm.lqr.Save.InOctets;
lqr.PeerOutLQRs = p->hdlc.lqm.lqr.OutLQRs;
lqr.PeerOutPackets = p->hdlc.lqm.ifOutUniPackets - pending_pkts;
lqr.PeerOutOctets = p->hdlc.lqm.ifOutOctets - pending_octets - pending_pkts;
struct hdlc *hdlc = &link2physical(lcp->fsm.link)->hdlc;
echo.sequence = htonl(hdlc->lqm.echo.seq_sent);
fsm_Output(&lcp->fsm, CODE_ECHOREQ, hdlc->lqm.echo.seq_sent++,
struct hdlc *hdlc = &link2physical(fp->link)->hdlc;
struct hdlc;
extern void lqr_Analyse(const struct hdlc *, const struct lqrdata *,
hdlc_Init(&p->hdlc, &p->link.lcp);
p->hdlc.lqm.owner = &p->link.lcp;
p->hdlc.ReportTimer.state = TIMER_STOPPED;
p->hdlc.lqm.timer.state = TIMER_STOPPED;
if (p->hdlc.lqm.method && p->hdlc.lqm.timer.load)
hdlc_StartTimer(&p->hdlc);
hdlc_StopTimer(&p->hdlc);
struct hdlc hdlc; /* Our hdlc state */
p->hdlc.lqm.ifInOctets += len + 1; /* plus 1 flag octet! */
p->hdlc.lqm.lqr.InGoodOctets += len + 1; /* plus 1 flag octet! */
p->hdlc.lqm.ifInUniPackets++;