Lines Matching refs:hdlc
28 * $FreeBSD: src/usr.sbin/ppp/hdlc.c,v 1.51.26.1 2010/12/21 17:10:29 kensmith Exp $
47 #include "hdlc.h"
99 hdlc_Init(struct hdlc *hdlc, struct lcp *lcp)
101 memset(hdlc, '\0', sizeof(struct hdlc));
102 hdlc->lqm.owner = lcp;
106 * HDLC FCS computation. Read RFC 1171 Appendix B and CCITT X.25 section
309 log_Printf(LogERROR, "Can't Pull a hdlc packet from a logical link\n");
322 p->hdlc.lqm.ifInOctets += len + 1; /* plus 1 flag octet! */
325 p->hdlc.lqm.ifInErrors++;
326 p->hdlc.stats.badfcs++;
332 p->hdlc.lqm.lqr.InGoodOctets += len + 1; /* plus 1 flag octet! */
333 p->hdlc.lqm.ifInUniPackets++;
346 /* Detect a HDLC frame */
385 struct hdlc *hdlc = &arg->cx->physical->hdlc;
387 prompt_Printf(arg->prompt, "%s HDLC level errors:\n", arg->cx->name);
389 hdlc->stats.badfcs);
391 HDLC_ADDR, hdlc->stats.badaddr);
393 HDLC_UI, hdlc->stats.badcommand);
395 hdlc->stats.unknownproto);
402 /* Moan about HDLC errors */
403 struct hdlc *hdlc = (struct hdlc *)v;
405 timer_Stop(&hdlc->ReportTimer);
407 if (memcmp(&hdlc->laststats, &hdlc->stats, sizeof hdlc->stats)) {
409 "%s: HDLC errors -> FCS: %u, ADDR: %u, COMD: %u, PROTO: %u\n",
410 hdlc->lqm.owner->fsm.link->name,
411 hdlc->stats.badfcs - hdlc->laststats.badfcs,
412 hdlc->stats.badaddr - hdlc->laststats.badaddr,
413 hdlc->stats.badcommand - hdlc->laststats.badcommand,
414 hdlc->stats.unknownproto - hdlc->laststats.unknownproto);
415 hdlc->laststats = hdlc->stats;
418 timer_Start(&hdlc->ReportTimer);
422 hdlc_StartTimer(struct hdlc *hdlc)
424 timer_Stop(&hdlc->ReportTimer);
425 hdlc->ReportTimer.load = 60 * SECTICKS;
426 hdlc->ReportTimer.arg = hdlc;
427 hdlc->ReportTimer.func = hdlc_ReportTime;
428 hdlc->ReportTimer.name = "hdlc";
429 timer_Start(&hdlc->ReportTimer);
433 hdlc_StopTimer(struct hdlc *hdlc)
435 timer_Stop(&hdlc->ReportTimer);
438 struct layer hdlclayer = { LAYER_HDLC, "hdlc", hdlc_LayerPush, hdlc_LayerPull };