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 #include <linux/config.h>
25
26 #ifndef_SNMP_H 27 #include "snmp.h"
28 #endif 29
30 #include "sock.h" /* struct sock */ 31
32 /* IP flags. */ 33 #define IP_CE 0x8000 /* Flag: "Congestion" */ 34 #defineIP_DF 0x4000 /* Flag: "Don't Fragment" */ 35 #defineIP_MF 0x2000 /* Flag: "More Fragments" */ 36 #defineIP_OFFSET 0x1FFF /* "Fragment Offset" part */ 37
38 #defineIP_FRAG_TIME (30 * HZ) /* fragment lifetime */ 39
40 #ifdefCONFIG_IP_MULTICAST 41 externvoid ip_mc_dropsocket(structsock *);
42 externvoid ip_mc_dropdevice(structdevice *dev);
43 externintip_mc_procinfo(char *, char **, off_t, int);
44 #defineMULTICAST(x) (IN_MULTICAST(htonl(x)))
45 #endif 46
47
48 /* Describe an IP fragment. */ 49 structipfrag{ 50 intoffset; /* offset of fragment in IP datagram */ 51 intend; /* last byte of data in datagram */ 52 intlen; /* length of this fragment */ 53 structsk_buff *skb; /* complete received fragment */ 54 unsignedchar *ptr; /* pointer into real fragment data */ 55 structipfrag *next; /* linked list pointers */ 56 structipfrag *prev;
57 };
58
59 /* Describe an entry in the "incomplete datagrams" queue. */ 60 structipq{ 61 unsignedchar *mac; /* pointer to MAC header */ 62 structiphdr *iph; /* pointer to IP header */ 63 intlen; /* total length of original datagram */ 64 shortihlen; /* length of the IP header */ 65 shortmaclen; /* length of the MAC header */ 66 structtimer_listtimer; /* when will this queue expire? */ 67 structipfrag *fragments; /* linked list of received fragments */ 68 structipq *next; /* linked list pointers */ 69 structipq *prev;
70 structdevice *dev; /* Device - for icmp replies */ 71 };
72
73
74 externintbackoff(intn);
75
76 externvoid ip_print(conststructiphdr *ip);
77 externintip_ioctl(structsock *sk, intcmd,
78 unsignedlongarg);
79 externvoidip_route_check(unsignedlongdaddr);
80 externintip_build_header(structsk_buff *skb,
81 unsignedlongsaddr,
82 unsignedlongdaddr,
83 structdevice **dev, inttype,
84 structoptions *opt, intlen,
85 inttos,intttl);
86 externunsignedshortip_compute_csum(unsignedchar * buff, intlen);
87 externintip_rcv(structsk_buff *skb, structdevice *dev,
88 structpacket_type *pt);
89 externvoidip_send_check(structiphdr *ip);
90 externintip_id_count;
91 externvoidip_queue_xmit(structsock *sk,
92 structdevice *dev, structsk_buff *skb,
93 intfree);
94 externintip_setsockopt(structsock *sk, intlevel, intoptname, char *optval, intoptlen);
95 externintip_getsockopt(structsock *sk, intlevel, intoptname, char *optval, int *optlen);
96 externvoidip_init(void);
97
98 externstructip_mibip_statistics;
99 #endif/* _IP_H */