1 /* 2 * INET An implementation of the TCP/IP protocol suite for the LINUX 3 * operating system. INET is implemented using the BSD Socket 4 * interface as the means of communication with the user level. 5 * 6 * Definitions for the IP module. 7 * 8 * Version: @(#)ip.h 1.0.2 05/07/93 9 * 10 * Authors: Ross Biro, <bir7@leland.Stanford.Edu> 11 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> 12 * Alan Cox, <gw4pts@gw4pts.ampr.org> 13 * 14 * This program is free software; you can redistribute it and/or 15 * modify it under the terms of the GNU General Public License 16 * as published by the Free Software Foundation; either version 17 * 2 of the License, or (at your option) any later version. 18 */ 19 #ifndef_IP_H 20 #define_IP_H 21
22
23 #include <linux/ip.h>
24
25 #ifndef_SNMP_H 26 #include "snmp.h"
27 #endif 28
29 #include "sock.h" /* struct sock */ 30
31 /* IP flags. */ 32 #define IP_CE 0x8000 /* Flag: "Congestion" */ 33 #defineIP_DF 0x4000 /* Flag: "Don't Fragment" */ 34 #defineIP_MF 0x2000 /* Flag: "More Fragments" */ 35 #defineIP_OFFSET 0x1FFF /* "Fragment Offset" part */ 36
37 #defineIP_FRAG_TIME (30 * HZ) /* fragment lifetime */ 38
39
40 /* Describe an IP fragment. */ 41 structipfrag{ 42 intoffset; /* offset of fragment in IP datagram */ 43 intend; /* last byte of data in datagram */ 44 intlen; /* length of this fragment */ 45 structsk_buff *skb; /* complete received fragment */ 46 unsignedchar *ptr; /* pointer into real fragment data */ 47 structipfrag *next; /* linked list pointers */ 48 structipfrag *prev;
49 };
50
51 /* Describe an entry in the "incomplete datagrams" queue. */ 52 structipq{ 53 unsignedchar *mac; /* pointer to MAC header */ 54 structiphdr *iph; /* pointer to IP header */ 55 intlen; /* total length of original datagram */ 56 shortihlen; /* length of the IP header */ 57 shortmaclen; /* length of the MAC header */ 58 structtimer_listtimer; /* when will this queue expire? */ 59 structipfrag *fragments; /* linked list of received fragments */ 60 structipq *next; /* linked list pointers */ 61 structipq *prev;
62 structdevice *dev; /* Device - for icmp replies */ 63 };
64
65
66 externintbackoff(intn);
67
68 externvoid ip_print(conststructiphdr *ip);
69 externintip_ioctl(structsock *sk, intcmd,
70 unsignedlongarg);
71 externvoidip_route_check(unsignedlongdaddr);
72 externintip_build_header(structsk_buff *skb,
73 unsignedlongsaddr,
74 unsignedlongdaddr,
75 structdevice **dev, inttype,
76 structoptions *opt, intlen,
77 inttos,intttl);
78 externunsignedshortip_compute_csum(unsignedchar * buff, intlen);
79 externintip_rcv(structsk_buff *skb, structdevice *dev,
80 structpacket_type *pt);
81 externvoidip_queue_xmit(structsock *sk,
82 structdevice *dev, structsk_buff *skb,
83 intfree);
84 externvoidip_retransmit(structsock *sk, intall);
85 externvoidip_do_retransmit(structsock *sk, intall);
86 externintip_setsockopt(structsock *sk, intlevel, intoptname, char *optval, intoptlen);
87 externintip_getsockopt(structsock *sk, intlevel, intoptname, char *optval, int *optlen);
88 externvoidip_init(void);
89
90 externstructip_mibip_statistics;
91 #endif/* _IP_H */