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 * 13 * This program is free software; you can redistribute it and/or 14 * modify it under the terms of the GNU General Public License 15 * as published by the Free Software Foundation; either version 16 * 2 of the License, or (at your option) any later version. 17 */ 18 #ifndef_IP_H 19 #define_IP_H 20
21
22 #include <linux/ip.h>
23
24
25 #include "sock.h" /* struct sock */ 26
27 /* IP flags. */ 28 #define IP_CE 0x8000 /* Flag: "Congestion" */ 29 #defineIP_DF 0x4000 /* Flag: "Don't Fragment" */ 30 #defineIP_MF 0x2000 /* Flag: "More Fragments" */ 31 #defineIP_OFFSET 0x1FFF /* "Fragment Offset" part */ 32
33 #defineIP_FRAG_TIME (30 * HZ) /* fragment lifetime */ 34
35
36 /* Describe an IP fragment. */ 37 structipfrag{ 38 intoffset; /* offset of fragment in IP datagram */ 39 intend; /* last byte of data in datagram */ 40 intlen; /* length of this fragment */ 41 structsk_buff *skb; /* complete received fragment */ 42 unsignedchar *ptr; /* pointer into real fragment data */ 43 structipfrag *next; /* linked list pointers */ 44 structipfrag *prev;
45 };
46
47 /* Describe an entry in the "incomplete datagrams" queue. */ 48 structipq{ 49 unsignedchar *mac; /* pointer to MAC header */ 50 structiphdr *iph; /* pointer to IP header */ 51 intlen; /* total length of original datagram */ 52 shortihlen; /* length of the IP header */ 53 shortmaclen; /* length of the MAC header */ 54 structtimer_listtimer; /* when will this queue expire? */ 55 structipfrag *fragments; /* linked list of received fragments */ 56 structipq *next; /* linked list pointers */ 57 structipq *prev;
58 structdevice *dev; /* Device - for icmp replies */ 59 };
60
61
62 externintbackoff(intn);
63
64 externvoidip_print(structiphdr *ip);
65 externintip_ioctl(structsock *sk, intcmd,
66 unsignedlongarg);
67 externvoidip_route_check(unsignedlongdaddr);
68 externintip_build_header(structsk_buff *skb,
69 unsignedlongsaddr,
70 unsignedlongdaddr,
71 structdevice **dev, inttype,
72 structoptions *opt, intlen,
73 inttos,intttl);
74 externunsignedshortip_compute_csum(unsignedchar * buff, intlen);
75 externintip_rcv(structsk_buff *skb, structdevice *dev,
76 structpacket_type *pt);
77 externvoidip_queue_xmit(structsock *sk,
78 structdevice *dev, structsk_buff *skb,
79 intfree);
80 externvoidip_retransmit(structsock *sk, intall);
81 externintip_setsockopt(structsock *sk, intlevel, intoptname, char *optval, intoptlen);
82 externintip_getsockopt(structsock *sk, intlevel, intoptname, char *optval, int *optlen);
83
84 #endif/* _IP_H */