hdlc.c (31537) | hdlc.c (31962) |
---|---|
1/* 2 * PPP High Level Link Control (HDLC) Module 3 * 4 * Written by Toshiharu OHNO (tony-o@iij.ad.jp) 5 * 6 * Copyright (C) 1993, Internet Initiative Japan, Inc. All rights reserverd. 7 * 8 * Redistribution and use in source and binary forms are permitted 9 * provided that the above copyright notice and this paragraph are 10 * duplicated in all such forms and that any documentation, 11 * advertising materials, and other materials related to such 12 * distribution and use acknowledge that the software was developed 13 * by the Internet Initiative Japan, Inc. The name of the 14 * IIJ may not be used to endorse or promote products derived 15 * from this software without specific prior written permission. 16 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 17 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 18 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 19 * | 1/* 2 * PPP High Level Link Control (HDLC) Module 3 * 4 * Written by Toshiharu OHNO (tony-o@iij.ad.jp) 5 * 6 * Copyright (C) 1993, Internet Initiative Japan, Inc. All rights reserverd. 7 * 8 * Redistribution and use in source and binary forms are permitted 9 * provided that the above copyright notice and this paragraph are 10 * duplicated in all such forms and that any documentation, 11 * advertising materials, and other materials related to such 12 * distribution and use acknowledge that the software was developed 13 * by the Internet Initiative Japan, Inc. The name of the 14 * IIJ may not be used to endorse or promote products derived 15 * from this software without specific prior written permission. 16 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 17 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 18 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 19 * |
20 * $Id: hdlc.c,v 1.23 1997/12/03 10:23:47 brian Exp $ | 20 * $Id: hdlc.c,v 1.24 1997/12/04 18:49:26 brian Exp $ |
21 * 22 * TODO: 23 */ 24#include <sys/param.h> 25#include <netinet/in.h> 26 27#include <stdio.h> 28#include <string.h> --- 321 unchanged lines hidden (view full) --- 350 { 0xc225, 0xc225, "RSA Authentication Protocol" }, 351 { 0xc227, 0xc227, "Extensible Authentication Protocol" }, 352 { 0xc26f, 0xc26f, "Stampede Bridging Authorization Protocol" }, 353 { 0xc281, 0xc281, "Proprietary Authentication Protocol" }, 354 { 0xc283, 0xc283, "Proprietary Authentication Protocol" }, 355 { 0xc481, 0xc481, "Proprietary Node ID Authentication Protocol" } 356}; 357 | 21 * 22 * TODO: 23 */ 24#include <sys/param.h> 25#include <netinet/in.h> 26 27#include <stdio.h> 28#include <string.h> --- 321 unchanged lines hidden (view full) --- 350 { 0xc225, 0xc225, "RSA Authentication Protocol" }, 351 { 0xc227, 0xc227, "Extensible Authentication Protocol" }, 352 { 0xc26f, 0xc26f, "Stampede Bridging Authorization Protocol" }, 353 { 0xc281, 0xc281, "Proprietary Authentication Protocol" }, 354 { 0xc283, 0xc283, "Proprietary Authentication Protocol" }, 355 { 0xc481, 0xc481, "Proprietary Node ID Authentication Protocol" } 356}; 357 |
358#define NPROTOCOLS (sizeof(protocols)/sizeof(protocols[0])) | 358#define NPROTOCOLS (sizeof protocols/sizeof protocols[0]) |
359 360static const char * 361Protocol2Nam(u_short proto) 362{ 363 int f; 364 365 for (f = 0; f < NPROTOCOLS; f++) 366 if (proto >= protocols[f].from && proto <= protocols[f].to) --- 105 unchanged lines hidden (view full) --- 472static struct hdlcstat laststat; 473 474void 475HdlcErrorCheck() 476{ 477 struct hdlcstat *hp = &HdlcStat; 478 struct hdlcstat *op = &laststat; 479 | 359 360static const char * 361Protocol2Nam(u_short proto) 362{ 363 int f; 364 365 for (f = 0; f < NPROTOCOLS; f++) 366 if (proto >= protocols[f].from && proto <= protocols[f].to) --- 105 unchanged lines hidden (view full) --- 472static struct hdlcstat laststat; 473 474void 475HdlcErrorCheck() 476{ 477 struct hdlcstat *hp = &HdlcStat; 478 struct hdlcstat *op = &laststat; 479 |
480 if (memcmp(hp, op, sizeof(laststat))) { | 480 if (memcmp(hp, op, sizeof laststat)) { |
481 LogPrintf(LogPHASE, "HDLC errors -> FCS: %u ADDR: %u COMD: %u PROTO: %u\n", 482 hp->badfcs - op->badfcs, hp->badaddr - op->badaddr, 483 hp->badcommand - op->badcommand, hp->unknownproto - op->unknownproto); 484 } 485 laststat = HdlcStat; 486} 487 488void --- 92 unchanged lines hidden --- | 481 LogPrintf(LogPHASE, "HDLC errors -> FCS: %u ADDR: %u COMD: %u PROTO: %u\n", 482 hp->badfcs - op->badfcs, hp->badaddr - op->badaddr, 483 hp->badcommand - op->badcommand, hp->unknownproto - op->unknownproto); 484 } 485 laststat = HdlcStat; 486} 487 488void --- 92 unchanged lines hidden --- |