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 #ifdefCONFIG_IP_MULTICAST 40 externvoid ip_mc_dropsocket(structsock *);
41 externvoid ip_mc_dropdevice(structdevice *dev);
42 externintip_mc_procinfo(char *, char **, off_t, int);
43 #defineMULTICAST(x) (IN_MULTICAST(htonl(x)))
44 #endif 45
46
47 /* Describe an IP fragment. */ 48 structipfrag{ 49 intoffset; /* offset of fragment in IP datagram */ 50 intend; /* last byte of data in datagram */ 51 intlen; /* length of this fragment */ 52 structsk_buff *skb; /* complete received fragment */ 53 unsignedchar *ptr; /* pointer into real fragment data */ 54 structipfrag *next; /* linked list pointers */ 55 structipfrag *prev;
56 };
57
58 /* Describe an entry in the "incomplete datagrams" queue. */ 59 structipq{ 60 unsignedchar *mac; /* pointer to MAC header */ 61 structiphdr *iph; /* pointer to IP header */ 62 intlen; /* total length of original datagram */ 63 shortihlen; /* length of the IP header */ 64 shortmaclen; /* length of the MAC header */ 65 structtimer_listtimer; /* when will this queue expire? */ 66 structipfrag *fragments; /* linked list of received fragments */ 67 structipq *next; /* linked list pointers */ 68 structipq *prev;
69 structdevice *dev; /* Device - for icmp replies */ 70 };
71
72
73 externintbackoff(intn);
74
75 externvoid ip_print(conststructiphdr *ip);
76 externintip_ioctl(structsock *sk, intcmd,
77 unsignedlongarg);
78 externvoidip_route_check(unsignedlongdaddr);
79 externintip_build_header(structsk_buff *skb,
80 unsignedlongsaddr,
81 unsignedlongdaddr,
82 structdevice **dev, inttype,
83 structoptions *opt, intlen,
84 inttos,intttl);
85 externunsignedshortip_compute_csum(unsignedchar * buff, intlen);
86 externintip_rcv(structsk_buff *skb, structdevice *dev,
87 structpacket_type *pt);
88 externvoidip_send_check(structiphdr *ip);
89 externintip_id_count;
90 externvoidip_queue_xmit(structsock *sk,
91 structdevice *dev, structsk_buff *skb,
92 intfree);
93 externintip_setsockopt(structsock *sk, intlevel, intoptname, char *optval, intoptlen);
94 externintip_getsockopt(structsock *sk, intlevel, intoptname, char *optval, int *optlen);
95 externvoidip_init(void);
96
97 externstructip_mibip_statistics;
98 #endif/* _IP_H */