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