1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 #ifndef _IP_H
20 #define _IP_H
21
22
23 #include <linux/config.h>
24 #include <linux/types.h>
25 #include <linux/socket.h>
26 #include <linux/ip.h>
27 #include <linux/netdevice.h>
28
29 #ifndef _SNMP_H
30 #include "snmp.h"
31 #endif
32
33 #include "sock.h"
34
35
36 #define IP_CE 0x8000
37 #define IP_DF 0x4000
38 #define IP_MF 0x2000
39 #define IP_OFFSET 0x1FFF
40
41 #define IP_FRAG_TIME (30 * HZ)
42
43 #ifdef CONFIG_IP_MULTICAST
44 extern void ip_mc_dropsocket(struct sock *);
45 extern void ip_mc_dropdevice(struct device *dev);
46 extern int ip_mc_procinfo(char *, char **, off_t, int);
47 #define MULTICAST(x) (IN_MULTICAST(htonl(x)))
48 #endif
49
50
51
52 struct ipfrag {
53 int offset;
54 int end;
55 int len;
56 struct sk_buff *skb;
57 unsigned char *ptr;
58 struct ipfrag *next;
59 struct ipfrag *prev;
60 };
61
62
63 struct ipq {
64 unsigned char *mac;
65 struct iphdr *iph;
66 int len;
67 short ihlen;
68 short maclen;
69 struct timer_list timer;
70 struct ipfrag *fragments;
71 struct ipq *next;
72 struct ipq *prev;
73 struct device *dev;
74 };
75
76
77 extern int backoff(int n);
78
79 extern void ip_print(const struct iphdr *ip);
80 extern int ip_ioctl(struct sock *sk, int cmd,
81 unsigned long arg);
82 extern void ip_route_check(unsigned long daddr);
83 extern int ip_build_header(struct sk_buff *skb,
84 unsigned long saddr,
85 unsigned long daddr,
86 struct device **dev, int type,
87 struct options *opt, int len,
88 int tos,int ttl);
89
90 extern int ip_rcv(struct sk_buff *skb, struct device *dev,
91 struct packet_type *pt);
92 extern void ip_forward(struct sk_buff *skb, struct device *dev, int is_frag, unsigned long target_addr, int target_strict);
93 extern void ip_send_check(struct iphdr *ip);
94 extern int ip_id_count;
95 extern void ip_queue_xmit(struct sock *sk,
96 struct device *dev, struct sk_buff *skb,
97 int free);
98 extern int ip_setsockopt(struct sock *sk, int level, int optname, char *optval, int optlen);
99 extern int ip_getsockopt(struct sock *sk, int level, int optname, char *optval, int *optlen);
100 extern void ip_init(void);
101 extern int ip_build_xmit(struct sock *sk,
102 void getfrag (void *,
103 int,
104 char *,
105 unsigned int,
106 unsigned int),
107 void *frag,
108 unsigned short int length,
109 int daddr,
110 int flags,
111 int type);
112
113 extern struct ip_mib ip_statistics;
114
115 #endif