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 <net/snmp.h>
31 #endif
32
33 #include <net/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, int);
47 #endif
48
49
50
51 struct ipfrag {
52 int offset;
53 int end;
54 int len;
55 struct sk_buff *skb;
56 unsigned char *ptr;
57 struct ipfrag *next;
58 struct ipfrag *prev;
59 };
60
61
62 struct ipq {
63 unsigned char *mac;
64 struct iphdr *iph;
65 int len;
66 short ihlen;
67 short maclen;
68 struct timer_list timer;
69 struct ipfrag *fragments;
70 struct ipq *next;
71 struct ipq *prev;
72 struct device *dev;
73 };
74
75
76 extern void ip_print(const struct iphdr *ip);
77 extern int ip_ioctl(struct sock *sk, int cmd,
78 unsigned long arg);
79 extern void ip_route_check(__u32 daddr);
80 extern int ip_build_header(struct sk_buff *skb,
81 __u32 saddr,
82 __u32 daddr,
83 struct device **dev, int type,
84 struct options *opt, int len,
85 int tos,int ttl);
86
87 extern int ip_rcv(struct sk_buff *skb, struct device *dev,
88 struct packet_type *pt);
89 extern int ip_forward(struct sk_buff *skb, struct device *dev,
90 int is_frag, __u32 target_addr);
91 extern int ip_options_echo(struct options * dopt, struct options * sopt,
92 __u32 daddr, __u32 saddr,
93 struct sk_buff * skb);
94 extern int ip_options_compile(struct options * opt, struct sk_buff * skb);
95 extern void ip_send_check(struct iphdr *ip);
96 extern int ip_id_count;
97 extern void ip_queue_xmit(struct sock *sk,
98 struct device *dev, struct sk_buff *skb,
99 int free);
100 extern int ip_setsockopt(struct sock *sk, int level, int optname, char *optval, int optlen);
101 extern int ip_getsockopt(struct sock *sk, int level, int optname, char *optval, int *optlen);
102 extern void ip_init(void);
103 extern int ip_build_xmit(struct sock *sk,
104 void getfrag (const void *,
105 __u32,
106 char *,
107 unsigned int,
108 unsigned int),
109 const void *frag,
110 unsigned short int length,
111 __u32 daddr,
112 __u32 saddr,
113 struct options * opt,
114 int flags,
115 int type);
116
117 extern struct ip_mib ip_statistics;
118
119 #endif