ccp.c (45193) | ccp.c (46310) |
---|---|
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: ccp.c,v 1.44 1999/03/11 01:49:15 brian Exp $ | 20 * $Id: ccp.c,v 1.45 1999/03/31 14:21:44 brian Exp $ |
21 * 22 * TODO: 23 * o Support other compression protocols 24 */ 25#include <sys/param.h> 26#include <netinet/in.h> 27#include <netinet/in_systm.h> 28#include <netinet/ip.h> --- 377 unchanged lines hidden (view full) --- 406} 407 408static void 409CcpDecodeConfig(struct fsm *fp, u_char *cp, int plen, int mode_type, 410 struct fsm_decode *dec) 411{ 412 /* Deal with incoming data */ 413 struct ccp *ccp = fsm2ccp(fp); | 21 * 22 * TODO: 23 * o Support other compression protocols 24 */ 25#include <sys/param.h> 26#include <netinet/in.h> 27#include <netinet/in_systm.h> 28#include <netinet/ip.h> --- 377 unchanged lines hidden (view full) --- 406} 407 408static void 409CcpDecodeConfig(struct fsm *fp, u_char *cp, int plen, int mode_type, 410 struct fsm_decode *dec) 411{ 412 /* Deal with incoming data */ 413 struct ccp *ccp = fsm2ccp(fp); |
414 int type, length; 415 int f; | 414 int type, length, f; |
416 const char *end; 417 | 415 const char *end; 416 |
417 if (mode_type == MODE_REQ) 418 ccp->in.algorithm = -1; /* In case we've received two REQs in a row */ 419 |
|
418 while (plen >= sizeof(struct fsmconfig)) { 419 type = *cp; 420 length = cp[1]; 421 422 if (length == 0) { 423 log_Printf(LogCCP, "%s: CCP size zero\n", fp->link->name); 424 break; 425 } --- 213 unchanged lines hidden --- | 420 while (plen >= sizeof(struct fsmconfig)) { 421 type = *cp; 422 length = cp[1]; 423 424 if (length == 0) { 425 log_Printf(LogCCP, "%s: CCP size zero\n", fp->link->name); 426 break; 427 } --- 213 unchanged lines hidden --- |