Lines Matching defs:hdlc

50 #include "hdlc.h"
77 struct hdlc *hdlc = &link2physical(lcp->fsm.link)->hdlc;
82 echo.sequence = htonl(hdlc->lqm.echo.seq_sent);
83 fsm_Output(&lcp->fsm, CODE_ECHOREQ, hdlc->lqm.echo.seq_sent++,
90 struct hdlc *hdlc = &link2physical(fp->link)->hdlc;
114 if ((hdlc->lqm.echo.seq_recv > (u_int32_t)0 - 5 && lqr.sequence < 5) ||
115 (hdlc->lqm.echo.seq_recv <= (u_int32_t)0 - 5 &&
116 lqr.sequence > hdlc->lqm.echo.seq_recv))
117 hdlc->lqm.echo.seq_recv = lqr.sequence;
168 timer_Stop(&p->hdlc.lqm.timer);
170 if (p->hdlc.lqm.method & LQM_LQR) {
171 if (p->hdlc.lqm.lqr.resent > 5) {
177 p->hdlc.lqm.method = 0;
181 p->hdlc.lqm.lqr.resent++;
183 } else if (p->hdlc.lqm.method & LQM_ECHO) {
184 if ((p->hdlc.lqm.echo.seq_sent > 5 &&
185 p->hdlc.lqm.echo.seq_sent - 5 > p->hdlc.lqm.echo.seq_recv) ||
186 (p->hdlc.lqm.echo.seq_sent <= 5 &&
187 p->hdlc.lqm.echo.seq_sent > p->hdlc.lqm.echo.seq_recv + 5)) {
192 p->hdlc.lqm.method = 0;
197 if (p->hdlc.lqm.method && p->hdlc.lqm.timer.load)
198 timer_Start(&p->hdlc.lqm.timer);
205 struct lcp *lcp = p->hdlc.lqm.owner;
218 else if (!IsAccepted(l->lcp.cfg.lqr) && !(p->hdlc.lqm.method & LQM_LQR)) {
233 memcpy(&lastlqr, &p->hdlc.lqm.lqr.peer, sizeof lastlqr);
234 lqr_ChangeOrder(lqr, &p->hdlc.lqm.lqr.peer);
235 lqr_Dump(l->name, "Input", &p->hdlc.lqm.lqr.peer);
237 p->hdlc.lqm.lqr.resent = 0;
240 memcpy(&p->hdlc.lqm.lqr.prevSave, &p->hdlc.lqm.lqr.Save,
241 sizeof p->hdlc.lqm.lqr.prevSave);
242 p->hdlc.lqm.lqr.Save.InLQRs = ++p->hdlc.lqm.lqr.InLQRs;
243 p->hdlc.lqm.lqr.Save.InPackets = p->hdlc.lqm.ifInUniPackets;
244 p->hdlc.lqm.lqr.Save.InDiscards = p->hdlc.lqm.ifInDiscards;
245 p->hdlc.lqm.lqr.Save.InErrors = p->hdlc.lqm.ifInErrors;
246 p->hdlc.lqm.lqr.Save.InOctets = p->hdlc.lqm.lqr.InGoodOctets;
248 lqr_Analyse(&p->hdlc, &lastlqr, &p->hdlc.lqm.lqr.peer);
254 if (p->hdlc.lqm.timer.load == 0 || !(p->hdlc.lqm.method & LQM_LQR) ||
256 lastlqr.PeerInLQRs == p->hdlc.lqm.lqr.peer.PeerInLQRs))
273 physical->hdlc.lqm.lqr.resent = 0;
274 physical->hdlc.lqm.echo.seq_sent = 0;
275 physical->hdlc.lqm.echo.seq_recv = 0;
276 memset(&physical->hdlc.lqm.lqr.peer, '\0',
277 sizeof physical->hdlc.lqm.lqr.peer);
279 physical->hdlc.lqm.method = lcp->cfg.echo ? LQM_ECHO : 0;
281 physical->hdlc.lqm.method |= LQM_LQR;
282 timer_Stop(&physical->hdlc.lqm.timer);
284 physical->hdlc.lqm.lqr.peer_timeout = lcp->his_lqrperiod;
292 physical->hdlc.lqm.timer.func = SendLqrReport;
293 physical->hdlc.lqm.timer.name = "lqm";
294 physical->hdlc.lqm.timer.arg = lcp;
296 if (lcp->want_lqrperiod || physical->hdlc.lqm.method & LQM_ECHO) {
300 physical->hdlc.lqm.timer.load = period * SECTICKS / 100;
302 physical->hdlc.lqm.timer.load = 0;
315 if (p->hdlc.lqm.timer.load)
325 if (p->hdlc.lqm.timer.load)
326 timer_Start(&p->hdlc.lqm.timer);
332 timer_Stop(&physical->hdlc.lqm.timer);
344 physical->hdlc.lqm.method &= ~method;
345 if (physical->hdlc.lqm.method)
346 SendLqrReport(physical->hdlc.lqm.owner);
348 timer_Stop(&physical->hdlc.lqm.timer);
372 lqr_Analyse(const struct hdlc *hdlc, const struct lqrdata *oldlqr,
384 transitLQRs = hdlc->lqm.lqr.OutLQRs - newlqr->LastOutLQRs;
395 (hdlc->lqm.lqr.Save.InPackets - hdlc->lqm.lqr.prevSave.InPackets);
397 (hdlc->lqm.lqr.Save.InOctets - hdlc->lqm.lqr.prevSave.InOctets);
449 p->hdlc.lqm.ifOutUniPackets++;
450 p->hdlc.lqm.ifOutOctets += len + 1; /* plus 1 flag octet! */
454 p->hdlc.lqm.ifOutOctets += acf_WrapperOctets(&l->lcp, *proto);
460 p->hdlc.lqm.ifOutOctets += hdlc_WrapperOctets();
466 p->hdlc.lqm.ifOutOctets += proto_WrapperOctets(&l->lcp, *proto);
482 p->hdlc.lqm.lqr.OutLQRs++;
493 lqr.LastOutLQRs = p->hdlc.lqm.lqr.peer.PeerOutLQRs;
494 lqr.LastOutPackets = p->hdlc.lqm.lqr.peer.PeerOutPackets;
495 lqr.LastOutOctets = p->hdlc.lqm.lqr.peer.PeerOutOctets;
496 lqr.PeerInLQRs = p->hdlc.lqm.lqr.Save.InLQRs;
497 lqr.PeerInPackets = p->hdlc.lqm.lqr.Save.InPackets;
498 lqr.PeerInDiscards = p->hdlc.lqm.lqr.Save.InDiscards;
499 lqr.PeerInErrors = p->hdlc.lqm.lqr.Save.InErrors;
500 lqr.PeerInOctets = p->hdlc.lqm.lqr.Save.InOctets;
501 lqr.PeerOutLQRs = p->hdlc.lqm.lqr.OutLQRs;
502 lqr.PeerOutPackets = p->hdlc.lqm.ifOutUniPackets - pending_pkts;
504 lqr.PeerOutOctets = p->hdlc.lqm.ifOutOctets - pending_octets - pending_pkts;