Deleted Added
full compact
ccp.c (37009) ccp.c (37160)
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.33 1998/05/23 13:38:00 brian Exp $
20 * $Id: ccp.c,v 1.34 1998/06/15 19:06:02 brian Exp $
21 *
22 * TODO:
23 * o Support other compression protocols
24 */
25#include <sys/types.h>
26#include <netinet/in.h>
27#include <netinet/in_systm.h>
28#include <netinet/ip.h>

--- 272 unchanged lines hidden (view full) ---

301static void
302CcpLayerStart(struct fsm *fp)
303{
304 /* We're about to start up ! */
305 log_Printf(LogCCP, "%s: CcpLayerStart.\n", fp->link->name);
306}
307
308static void
21 *
22 * TODO:
23 * o Support other compression protocols
24 */
25#include <sys/types.h>
26#include <netinet/in.h>
27#include <netinet/in_systm.h>
28#include <netinet/ip.h>

--- 272 unchanged lines hidden (view full) ---

301static void
302CcpLayerStart(struct fsm *fp)
303{
304 /* We're about to start up ! */
305 log_Printf(LogCCP, "%s: CcpLayerStart.\n", fp->link->name);
306}
307
308static void
309CcpLayerFinish(struct fsm *fp)
309CcpLayerDown(struct fsm *fp)
310{
310{
311 /* We're now down */
311 /* About to come down */
312 struct ccp *ccp = fsm2ccp(fp);
313 struct ccp_opt *next;
314
312 struct ccp *ccp = fsm2ccp(fp);
313 struct ccp_opt *next;
314
315 log_Printf(LogCCP, "%s: CcpLayerFinish.\n", fp->link->name);
315 log_Printf(LogCCP, "%s: CcpLayerDown.\n", fp->link->name);
316 if (ccp->in.state != NULL) {
317 (*algorithm[ccp->in.algorithm]->i.Term)(ccp->in.state);
318 ccp->in.state = NULL;
319 ccp->in.algorithm = -1;
320 }
321 if (ccp->out.state != NULL) {
322 (*algorithm[ccp->out.algorithm]->o.Term)(ccp->out.state);
323 ccp->out.state = NULL;
324 ccp->out.algorithm = -1;
325 }
326 ccp->his_reject = ccp->my_reject = 0;
327
328 while (ccp->out.opt) {
329 next = ccp->out.opt->next;
330 free(ccp->out.opt);
331 ccp->out.opt = next;
332 }
316 if (ccp->in.state != NULL) {
317 (*algorithm[ccp->in.algorithm]->i.Term)(ccp->in.state);
318 ccp->in.state = NULL;
319 ccp->in.algorithm = -1;
320 }
321 if (ccp->out.state != NULL) {
322 (*algorithm[ccp->out.algorithm]->o.Term)(ccp->out.state);
323 ccp->out.state = NULL;
324 ccp->out.algorithm = -1;
325 }
326 ccp->his_reject = ccp->my_reject = 0;
327
328 while (ccp->out.opt) {
329 next = ccp->out.opt->next;
330 free(ccp->out.opt);
331 ccp->out.opt = next;
332 }
333 ccp_Setup(ccp);
333}
334
335static void
334}
335
336static void
336CcpLayerDown(struct fsm *fp)
337CcpLayerFinish(struct fsm *fp)
337{
338{
338 /* About to come down */
339 log_Printf(LogCCP, "%s: CcpLayerDown.\n", fp->link->name);
339 /* We're now down */
340 log_Printf(LogCCP, "%s: CcpLayerFinish.\n", fp->link->name);
340}
341
342/*
343 * Called when CCP has reached the OPEN state
344 */
345static int
346CcpLayerUp(struct fsm *fp)
347{

--- 255 unchanged lines hidden ---
341}
342
343/*
344 * Called when CCP has reached the OPEN state
345 */
346static int
347CcpLayerUp(struct fsm *fp)
348{

--- 255 unchanged lines hidden ---