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()
113 if ((hdlc->lqm.echo.seq_recv > (u_int32_t)0 - 5 && lqr.sequence < 5) || in lqr_RecvEcho()
114 (hdlc->lqm.echo.seq_recv <= (u_int32_t)0 - 5 && in lqr_RecvEcho()
115 lqr.sequence > hdlc->lqm.echo.seq_recv)) in lqr_RecvEcho()
116 hdlc->lqm.echo.seq_recv = lqr.sequence; in lqr_RecvEcho()
167 timer_Stop(&p->hdlc.lqm.timer); in SendLqrReport()
169 if (p->hdlc.lqm.method & LQM_LQR) { in SendLqrReport()
170 if (p->hdlc.lqm.lqr.resent > 5) { in SendLqrReport()
176 p->hdlc.lqm.method = 0; in SendLqrReport()
180 p->hdlc.lqm.lqr.resent++; in SendLqrReport()
182 } else if (p->hdlc.lqm.method & LQM_ECHO) { in SendLqrReport()
183 if ((p->hdlc.lqm.echo.seq_sent > 5 && in SendLqrReport()
184 p->hdlc.lqm.echo.seq_sent - 5 > p->hdlc.lqm.echo.seq_recv) || in SendLqrReport()
185 (p->hdlc.lqm.echo.seq_sent <= 5 && in SendLqrReport()
186 p->hdlc.lqm.echo.seq_sent > p->hdlc.lqm.echo.seq_recv + 5)) { in SendLqrReport()
191 p->hdlc.lqm.method = 0; in SendLqrReport()
196 if (p->hdlc.lqm.method && p->hdlc.lqm.timer.load) in SendLqrReport()
197 timer_Start(&p->hdlc.lqm.timer); in SendLqrReport()
204 struct lcp *lcp = p->hdlc.lqm.owner; in lqr_Input()
217 else if (!IsAccepted(l->lcp.cfg.lqr) && !(p->hdlc.lqm.method & LQM_LQR)) { in lqr_Input()
232 memcpy(&lastlqr, &p->hdlc.lqm.lqr.peer, sizeof lastlqr); in lqr_Input()
233 lqr_ChangeOrder(lqr, &p->hdlc.lqm.lqr.peer); in lqr_Input()
234 lqr_Dump(l->name, "Input", &p->hdlc.lqm.lqr.peer); in lqr_Input()
236 p->hdlc.lqm.lqr.resent = 0; in lqr_Input()
239 memcpy(&p->hdlc.lqm.lqr.prevSave, &p->hdlc.lqm.lqr.Save, in lqr_Input()
240 sizeof p->hdlc.lqm.lqr.prevSave); in lqr_Input()
241 p->hdlc.lqm.lqr.Save.InLQRs = ++p->hdlc.lqm.lqr.InLQRs; in lqr_Input()
242 p->hdlc.lqm.lqr.Save.InPackets = p->hdlc.lqm.ifInUniPackets; in lqr_Input()
243 p->hdlc.lqm.lqr.Save.InDiscards = p->hdlc.lqm.ifInDiscards; in lqr_Input()
244 p->hdlc.lqm.lqr.Save.InErrors = p->hdlc.lqm.ifInErrors; in lqr_Input()
245 p->hdlc.lqm.lqr.Save.InOctets = p->hdlc.lqm.lqr.InGoodOctets; in lqr_Input()
247 lqr_Analyse(&p->hdlc, &lastlqr, &p->hdlc.lqm.lqr.peer); in lqr_Input()
253 if (p->hdlc.lqm.timer.load == 0 || !(p->hdlc.lqm.method & LQM_LQR) || in lqr_Input()
255 lastlqr.PeerInLQRs == p->hdlc.lqm.lqr.peer.PeerInLQRs)) in lqr_Input()
272 physical->hdlc.lqm.lqr.resent = 0; in lqr_Setup()
273 physical->hdlc.lqm.echo.seq_sent = 0; in lqr_Setup()
274 physical->hdlc.lqm.echo.seq_recv = 0; in lqr_Setup()
275 memset(&physical->hdlc.lqm.lqr.peer, '\0', in lqr_Setup()
276 sizeof physical->hdlc.lqm.lqr.peer); in lqr_Setup()
278 physical->hdlc.lqm.method = lcp->cfg.echo ? LQM_ECHO : 0; in lqr_Setup()
280 physical->hdlc.lqm.method |= LQM_LQR; in lqr_Setup()
281 timer_Stop(&physical->hdlc.lqm.timer); in lqr_Setup()
283 physical->hdlc.lqm.lqr.peer_timeout = lcp->his_lqrperiod; in lqr_Setup()
291 physical->hdlc.lqm.timer.func = SendLqrReport; in lqr_Setup()
292 physical->hdlc.lqm.timer.name = "lqm"; in lqr_Setup()
293 physical->hdlc.lqm.timer.arg = lcp; in lqr_Setup()
295 if (lcp->want_lqrperiod || physical->hdlc.lqm.method & LQM_ECHO) { in lqr_Setup()
299 physical->hdlc.lqm.timer.load = period * SECTICKS / 100; in lqr_Setup()
301 physical->hdlc.lqm.timer.load = 0; in lqr_Setup()
314 if (p->hdlc.lqm.timer.load) in lqr_Start()
324 if (p->hdlc.lqm.timer.load) in lqr_reStart()
325 timer_Start(&p->hdlc.lqm.timer); in lqr_reStart()
331 timer_Stop(&physical->hdlc.lqm.timer); in lqr_StopTimer()
343 physical->hdlc.lqm.method &= ~method; in lqr_Stop()
344 if (physical->hdlc.lqm.method) in lqr_Stop()
345 SendLqrReport(physical->hdlc.lqm.owner); in lqr_Stop()
347 timer_Stop(&physical->hdlc.lqm.timer); in lqr_Stop()
383 transitLQRs = hdlc->lqm.lqr.OutLQRs - newlqr->LastOutLQRs; in lqr_Analyse()
394 (hdlc->lqm.lqr.Save.InPackets - hdlc->lqm.lqr.prevSave.InPackets); in lqr_Analyse()
396 (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()