ccp.c (22997) | ccp.c (25630) |
---|---|
1/* 2 * PPP Compression Control Protocol (CCP) Module 3 * 4 * Written by Toshiharu OHNO (tony-o@iij.ad.jp) 5 * 6 * Copyright (C) 1994, 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 Compression Control Protocol (CCP) Module 3 * 4 * Written by Toshiharu OHNO (tony-o@iij.ad.jp) 5 * 6 * Copyright (C) 1994, 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$ | 20 * $Id: ccp.c,v 1.10 1997/02/22 16:10:03 peter Exp $ |
21 * 22 * TODO: 23 * o Support other compression protocols 24 */ 25#include "fsm.h" 26#include "lcpproto.h" 27#include "lcp.h" 28#include "ccp.h" 29#include "phase.h" 30#include "vars.h" 31#include "pred.h" 32#include "cdefs.h" 33 | 21 * 22 * TODO: 23 * o Support other compression protocols 24 */ 25#include "fsm.h" 26#include "lcpproto.h" 27#include "lcp.h" 28#include "ccp.h" 29#include "phase.h" 30#include "vars.h" 31#include "pred.h" 32#include "cdefs.h" 33 |
34extern void PutConfValue __P((void)); 35 | |
36struct ccpstate CcpInfo; 37 38static void CcpSendConfigReq __P((struct fsm *)); 39static void CcpSendTerminateReq __P((struct fsm *fp)); 40static void CcpSendTerminateAck __P((struct fsm *fp)); 41static void CcpDecodeConfig __P((u_char *cp, int flen, int mode)); 42static void CcpLayerStart __P((struct fsm *)); 43static void CcpLayerFinish __P((struct fsm *)); --- 29 unchanged lines hidden (view full) --- 73/* 0 */ "OUI", "PRED1", "PRED2", "PUDDLE", 74/* 4 */ "???", "???", "???", "???", 75/* 8 */ "???", "???", "???", "???", 76/* 12 */ "???", "???", "???", "???", 77/* 16 */ "HWPPC", "STAC", "MSPPC", "GAND", 78/* 20 */ "V42BIS", "BSD", 79}; 80 | 34struct ccpstate CcpInfo; 35 36static void CcpSendConfigReq __P((struct fsm *)); 37static void CcpSendTerminateReq __P((struct fsm *fp)); 38static void CcpSendTerminateAck __P((struct fsm *fp)); 39static void CcpDecodeConfig __P((u_char *cp, int flen, int mode)); 40static void CcpLayerStart __P((struct fsm *)); 41static void CcpLayerFinish __P((struct fsm *)); --- 29 unchanged lines hidden (view full) --- 71/* 0 */ "OUI", "PRED1", "PRED2", "PUDDLE", 72/* 4 */ "???", "???", "???", "???", 73/* 8 */ "???", "???", "???", "???", 74/* 12 */ "???", "???", "???", "???", 75/* 16 */ "HWPPC", "STAC", "MSPPC", "GAND", 76/* 20 */ "V42BIS", "BSD", 77}; 78 |
81void | 79int |
82ReportCcpStatus() 83{ 84 struct ccpstate *icp = &CcpInfo; 85 struct fsm *fp = &CcpFsm; 86 87 printf("%s [%s]\n", fp->name, StateNames[fp->state]); 88 printf("myproto = %s, hisproto = %s\n", 89 cftypes[icp->want_proto], cftypes[icp->his_proto]); 90 printf("Input: %ld --> %ld, Output: %ld --> %ld\n", 91 icp->orgin, icp->compin, icp->orgout, icp->compout); | 80ReportCcpStatus() 81{ 82 struct ccpstate *icp = &CcpInfo; 83 struct fsm *fp = &CcpFsm; 84 85 printf("%s [%s]\n", fp->name, StateNames[fp->state]); 86 printf("myproto = %s, hisproto = %s\n", 87 cftypes[icp->want_proto], cftypes[icp->his_proto]); 88 printf("Input: %ld --> %ld, Output: %ld --> %ld\n", 89 icp->orgin, icp->compin, icp->orgout, icp->compout); |
90 return 0; |
|
92} 93 94void 95CcpInit() 96{ 97 struct ccpstate *icp = &CcpInfo; 98 99 FsmInit(&CcpFsm); --- 178 unchanged lines hidden --- | 91} 92 93void 94CcpInit() 95{ 96 struct ccpstate *icp = &CcpInfo; 97 98 FsmInit(&CcpFsm); --- 178 unchanged lines hidden --- |