Deleted Added
full compact
ip.c (13379) ip.c (13389)
1/*
2 * PPP IP Protocol Interface
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. 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 IP Protocol Interface
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. 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: ip.c,v 1.5 1995/09/17 16:14:46 amurai Exp $
20 * $Id: ip.c,v 1.6 1996/01/10 21:27:50 phk Exp $
21 *
22 * TODO:
23 * o Return ICMP message for filterd packet
24 * and optionaly record it into log.
25 */
26#include "fsm.h"
27#include "lcpproto.h"
28#include "hdlc.h"
29#include <netinet/in_systm.h>
30#include <netinet/ip.h>
31#include <netinet/ip_icmp.h>
32#include <netinet/udp.h>
33#include <netinet/tcp.h>
21 *
22 * TODO:
23 * o Return ICMP message for filterd packet
24 * and optionaly record it into log.
25 */
26#include "fsm.h"
27#include "lcpproto.h"
28#include "hdlc.h"
29#include <netinet/in_systm.h>
30#include <netinet/ip.h>
31#include <netinet/ip_icmp.h>
32#include <netinet/udp.h>
33#include <netinet/tcp.h>
34#include <arpa/inet.h>
34#include "vars.h"
35#include "filter.h"
36
37extern void SendPppFrame();
35#include "vars.h"
36#include "filter.h"
37
38extern void SendPppFrame();
38extern int PacketCheck();
39extern void LcpClose();
40
41static struct pppTimer IdleTimer;
42
43static void IdleTimeout()
44{
45 LogPrintf(LOG_PHASE, "Idle timer expired.\n");
46 LcpClose();

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

336 }
337
338 ipInOctets += nb;
339 /*
340 * Pass it to tunnel device
341 */
342 nw = write(tun_out, tunbuff, nb);
343 if (nw != nb)
39extern void LcpClose();
40
41static struct pppTimer IdleTimer;
42
43static void IdleTimeout()
44{
45 LogPrintf(LOG_PHASE, "Idle timer expired.\n");
46 LcpClose();

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

336 }
337
338 ipInOctets += nb;
339 /*
340 * Pass it to tunnel device
341 */
342 nw = write(tun_out, tunbuff, nb);
343 if (nw != nb)
344 fprintf(stderr, "wrote %d, got %d\r\n");
344 fprintf(stderr, "wrote %d, got %d\r\n", nb, nw);
345 pfree(bp);
346
347 RestartIdleTimer();
348}
349
350void
351IpOutput(ptr, cnt)
352u_char *ptr; /* IN: Pointer to IP packet */

--- 70 unchanged lines hidden ---
345 pfree(bp);
346
347 RestartIdleTimer();
348}
349
350void
351IpOutput(ptr, cnt)
352u_char *ptr; /* IN: Pointer to IP packet */

--- 70 unchanged lines hidden ---