diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-21 12:31:48 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-21 12:31:48 -0500 |
commit | 3d1f337b3e7378923c89f37afb573a918ef40be5 (patch) | |
tree | 386798378567a10d1c7b24f599cb50f70298694c /include/net | |
parent | 2bf2154c6bb5599e3ec3f73c34861a0b12aa839e (diff) | |
parent | 5e35941d990123f155b02d5663e51a24f816b6f3 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: (235 commits)
[NETFILTER]: Add H.323 conntrack/NAT helper
[TG3]: Don't mark tg3_test_registers() as returning const.
[IPV6]: Cleanups for net/ipv6/addrconf.c (kzalloc, early exit) v2
[IPV6]: Nearly complete kzalloc cleanup for net/ipv6
[IPV6]: Cleanup of net/ipv6/reassambly.c
[BRIDGE]: Remove duplicate const from is_link_local() argument type.
[DECNET]: net/decnet/dn_route.c: fix inconsequent NULL checking
[TG3]: make drivers/net/tg3.c:tg3_request_irq() static
[BRIDGE]: use LLC to send STP
[LLC]: llc_mac_hdr_init const arguments
[BRIDGE]: allow show/store of group multicast address
[BRIDGE]: use llc for receiving STP packets
[BRIDGE]: stp timer to jiffies cleanup
[BRIDGE]: forwarding remove unneeded preempt and bh diasables
[BRIDGE]: netfilter inline cleanup
[BRIDGE]: netfilter VLAN macro cleanup
[BRIDGE]: netfilter dont use __constant_htons
[BRIDGE]: netfilter whitespace
[BRIDGE]: optimize frame pass up
[BRIDGE]: use kzalloc
...
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/af_unix.h | 3 | ||||
-rw-r--r-- | include/net/dn.h | 105 | ||||
-rw-r--r-- | include/net/dn_dev.h | 88 | ||||
-rw-r--r-- | include/net/dn_fib.h | 22 | ||||
-rw-r--r-- | include/net/dn_neigh.h | 4 | ||||
-rw-r--r-- | include/net/dn_nsp.h | 72 | ||||
-rw-r--r-- | include/net/dn_route.h | 12 | ||||
-rw-r--r-- | include/net/flow.h | 8 | ||||
-rw-r--r-- | include/net/if_inet6.h | 3 | ||||
-rw-r--r-- | include/net/inet_connection_sock.h | 26 | ||||
-rw-r--r-- | include/net/ip.h | 4 | ||||
-rw-r--r-- | include/net/ip6_route.h | 24 | ||||
-rw-r--r-- | include/net/ipv6.h | 22 | ||||
-rw-r--r-- | include/net/llc.h | 2 | ||||
-rw-r--r-- | include/net/ndisc.h | 2 | ||||
-rw-r--r-- | include/net/neighbour.h | 2 | ||||
-rw-r--r-- | include/net/netfilter/nf_conntrack.h | 56 | ||||
-rw-r--r-- | include/net/scm.h | 10 | ||||
-rw-r--r-- | include/net/sctp/structs.h | 10 | ||||
-rw-r--r-- | include/net/sock.h | 12 | ||||
-rw-r--r-- | include/net/tcp.h | 16 | ||||
-rw-r--r-- | include/net/xfrm.h | 62 |
22 files changed, 371 insertions, 194 deletions
diff --git a/include/net/af_unix.h b/include/net/af_unix.h index bfc1779fc753..427dac94bc7e 100644 --- a/include/net/af_unix.h +++ b/include/net/af_unix.h | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <linux/config.h> | 4 | #include <linux/config.h> |
5 | #include <linux/socket.h> | 5 | #include <linux/socket.h> |
6 | #include <linux/un.h> | 6 | #include <linux/un.h> |
7 | #include <linux/mutex.h> | ||
7 | #include <net/sock.h> | 8 | #include <net/sock.h> |
8 | 9 | ||
9 | extern void unix_inflight(struct file *fp); | 10 | extern void unix_inflight(struct file *fp); |
@@ -71,7 +72,7 @@ struct unix_sock { | |||
71 | struct unix_address *addr; | 72 | struct unix_address *addr; |
72 | struct dentry *dentry; | 73 | struct dentry *dentry; |
73 | struct vfsmount *mnt; | 74 | struct vfsmount *mnt; |
74 | struct semaphore readsem; | 75 | struct mutex readlock; |
75 | struct sock *peer; | 76 | struct sock *peer; |
76 | struct sock *other; | 77 | struct sock *other; |
77 | struct sock *gc_tree; | 78 | struct sock *gc_tree; |
diff --git a/include/net/dn.h b/include/net/dn.h index a4b6168e1e25..465b78302782 100644 --- a/include/net/dn.h +++ b/include/net/dn.h | |||
@@ -6,10 +6,8 @@ | |||
6 | #include <net/tcp.h> | 6 | #include <net/tcp.h> |
7 | #include <asm/byteorder.h> | 7 | #include <asm/byteorder.h> |
8 | 8 | ||
9 | typedef unsigned short dn_address; | 9 | #define dn_ntohs(x) le16_to_cpu(x) |
10 | 10 | #define dn_htons(x) cpu_to_le16(x) | |
11 | #define dn_ntohs(x) le16_to_cpu((unsigned short)(x)) | ||
12 | #define dn_htons(x) cpu_to_le16((unsigned short)(x)) | ||
13 | 11 | ||
14 | struct dn_scp /* Session Control Port */ | 12 | struct dn_scp /* Session Control Port */ |
15 | { | 13 | { |
@@ -31,36 +29,36 @@ struct dn_scp /* Session Control Port */ | |||
31 | #define DN_CL 15 /* Closed */ | 29 | #define DN_CL 15 /* Closed */ |
32 | #define DN_CN 16 /* Closed Notification */ | 30 | #define DN_CN 16 /* Closed Notification */ |
33 | 31 | ||
34 | unsigned short addrloc; | 32 | __le16 addrloc; |
35 | unsigned short addrrem; | 33 | __le16 addrrem; |
36 | unsigned short numdat; | 34 | __u16 numdat; |
37 | unsigned short numoth; | 35 | __u16 numoth; |
38 | unsigned short numoth_rcv; | 36 | __u16 numoth_rcv; |
39 | unsigned short numdat_rcv; | 37 | __u16 numdat_rcv; |
40 | unsigned short ackxmt_dat; | 38 | __u16 ackxmt_dat; |
41 | unsigned short ackxmt_oth; | 39 | __u16 ackxmt_oth; |
42 | unsigned short ackrcv_dat; | 40 | __u16 ackrcv_dat; |
43 | unsigned short ackrcv_oth; | 41 | __u16 ackrcv_oth; |
44 | unsigned char flowrem_sw; | 42 | __u8 flowrem_sw; |
45 | unsigned char flowloc_sw; | 43 | __u8 flowloc_sw; |
46 | #define DN_SEND 2 | 44 | #define DN_SEND 2 |
47 | #define DN_DONTSEND 1 | 45 | #define DN_DONTSEND 1 |
48 | #define DN_NOCHANGE 0 | 46 | #define DN_NOCHANGE 0 |
49 | unsigned short flowrem_dat; | 47 | __u16 flowrem_dat; |
50 | unsigned short flowrem_oth; | 48 | __u16 flowrem_oth; |
51 | unsigned short flowloc_dat; | 49 | __u16 flowloc_dat; |
52 | unsigned short flowloc_oth; | 50 | __u16 flowloc_oth; |
53 | unsigned char services_rem; | 51 | __u8 services_rem; |
54 | unsigned char services_loc; | 52 | __u8 services_loc; |
55 | unsigned char info_rem; | 53 | __u8 info_rem; |
56 | unsigned char info_loc; | 54 | __u8 info_loc; |
57 | 55 | ||
58 | unsigned short segsize_rem; | 56 | __u16 segsize_rem; |
59 | unsigned short segsize_loc; | 57 | __u16 segsize_loc; |
60 | 58 | ||
61 | unsigned char nonagle; | 59 | __u8 nonagle; |
62 | unsigned char multi_ireq; | 60 | __u8 multi_ireq; |
63 | unsigned char accept_mode; | 61 | __u8 accept_mode; |
64 | unsigned long seg_total; /* Running total of current segment */ | 62 | unsigned long seg_total; /* Running total of current segment */ |
65 | 63 | ||
66 | struct optdata_dn conndata_in; | 64 | struct optdata_dn conndata_in; |
@@ -160,40 +158,41 @@ static inline struct dn_scp *DN_SK(struct sock *sk) | |||
160 | */ | 158 | */ |
161 | #define DN_SKB_CB(skb) ((struct dn_skb_cb *)(skb)->cb) | 159 | #define DN_SKB_CB(skb) ((struct dn_skb_cb *)(skb)->cb) |
162 | struct dn_skb_cb { | 160 | struct dn_skb_cb { |
163 | unsigned short dst; | 161 | __le16 dst; |
164 | unsigned short src; | 162 | __le16 src; |
165 | unsigned short hops; | 163 | __u16 hops; |
166 | unsigned short dst_port; | 164 | __le16 dst_port; |
167 | unsigned short src_port; | 165 | __le16 src_port; |
168 | unsigned char services; | 166 | __u8 services; |
169 | unsigned char info; | 167 | __u8 info; |
170 | unsigned char rt_flags; | 168 | __u8 rt_flags; |
171 | unsigned char nsp_flags; | 169 | __u8 nsp_flags; |
172 | unsigned short segsize; | 170 | __u16 segsize; |
173 | unsigned short segnum; | 171 | __u16 segnum; |
174 | unsigned short xmit_count; | 172 | __u16 xmit_count; |
175 | unsigned long stamp; | 173 | unsigned long stamp; |
176 | int iif; | 174 | int iif; |
177 | }; | 175 | }; |
178 | 176 | ||
179 | static inline dn_address dn_eth2dn(unsigned char *ethaddr) | 177 | static inline __le16 dn_eth2dn(unsigned char *ethaddr) |
180 | { | 178 | { |
181 | return ethaddr[4] | (ethaddr[5] << 8); | 179 | return dn_htons(ethaddr[4] | (ethaddr[5] << 8)); |
182 | } | 180 | } |
183 | 181 | ||
184 | static inline dn_address dn_saddr2dn(struct sockaddr_dn *saddr) | 182 | static inline __le16 dn_saddr2dn(struct sockaddr_dn *saddr) |
185 | { | 183 | { |
186 | return *(dn_address *)saddr->sdn_nodeaddr; | 184 | return *(__le16 *)saddr->sdn_nodeaddr; |
187 | } | 185 | } |
188 | 186 | ||
189 | static inline void dn_dn2eth(unsigned char *ethaddr, dn_address addr) | 187 | static inline void dn_dn2eth(unsigned char *ethaddr, __le16 addr) |
190 | { | 188 | { |
189 | __u16 a = dn_ntohs(addr); | ||
191 | ethaddr[0] = 0xAA; | 190 | ethaddr[0] = 0xAA; |
192 | ethaddr[1] = 0x00; | 191 | ethaddr[1] = 0x00; |
193 | ethaddr[2] = 0x04; | 192 | ethaddr[2] = 0x04; |
194 | ethaddr[3] = 0x00; | 193 | ethaddr[3] = 0x00; |
195 | ethaddr[4] = (unsigned char)(addr & 0xff); | 194 | ethaddr[4] = (__u8)(a & 0xff); |
196 | ethaddr[5] = (unsigned char)(addr >> 8); | 195 | ethaddr[5] = (__u8)(a >> 8); |
197 | } | 196 | } |
198 | 197 | ||
199 | static inline void dn_sk_ports_copy(struct flowi *fl, struct dn_scp *scp) | 198 | static inline void dn_sk_ports_copy(struct flowi *fl, struct dn_scp *scp) |
@@ -202,7 +201,7 @@ static inline void dn_sk_ports_copy(struct flowi *fl, struct dn_scp *scp) | |||
202 | fl->uli_u.dnports.dport = scp->addrrem; | 201 | fl->uli_u.dnports.dport = scp->addrrem; |
203 | fl->uli_u.dnports.objnum = scp->addr.sdn_objnum; | 202 | fl->uli_u.dnports.objnum = scp->addr.sdn_objnum; |
204 | if (fl->uli_u.dnports.objnum == 0) { | 203 | if (fl->uli_u.dnports.objnum == 0) { |
205 | fl->uli_u.dnports.objnamel = scp->addr.sdn_objnamel; | 204 | fl->uli_u.dnports.objnamel = (__u8)dn_ntohs(scp->addr.sdn_objnamel); |
206 | memcpy(fl->uli_u.dnports.objname, scp->addr.sdn_objname, 16); | 205 | memcpy(fl->uli_u.dnports.objname, scp->addr.sdn_objname, 16); |
207 | } | 206 | } |
208 | } | 207 | } |
@@ -217,7 +216,7 @@ extern unsigned dn_mss_from_pmtu(struct net_device *dev, int mtu); | |||
217 | extern struct sock *dn_sklist_find_listener(struct sockaddr_dn *addr); | 216 | extern struct sock *dn_sklist_find_listener(struct sockaddr_dn *addr); |
218 | extern struct sock *dn_find_by_skb(struct sk_buff *skb); | 217 | extern struct sock *dn_find_by_skb(struct sk_buff *skb); |
219 | #define DN_ASCBUF_LEN 9 | 218 | #define DN_ASCBUF_LEN 9 |
220 | extern char *dn_addr2asc(dn_address, char *); | 219 | extern char *dn_addr2asc(__u16, char *); |
221 | extern int dn_destroy_timer(struct sock *sk); | 220 | extern int dn_destroy_timer(struct sock *sk); |
222 | 221 | ||
223 | extern int dn_sockaddr2username(struct sockaddr_dn *addr, unsigned char *buf, unsigned char type); | 222 | extern int dn_sockaddr2username(struct sockaddr_dn *addr, unsigned char *buf, unsigned char type); |
@@ -226,7 +225,7 @@ extern int dn_username2sockaddr(unsigned char *data, int len, struct sockaddr_dn | |||
226 | extern void dn_start_slow_timer(struct sock *sk); | 225 | extern void dn_start_slow_timer(struct sock *sk); |
227 | extern void dn_stop_slow_timer(struct sock *sk); | 226 | extern void dn_stop_slow_timer(struct sock *sk); |
228 | 227 | ||
229 | extern dn_address decnet_address; | 228 | extern __le16 decnet_address; |
230 | extern int decnet_debug_level; | 229 | extern int decnet_debug_level; |
231 | extern int decnet_time_wait; | 230 | extern int decnet_time_wait; |
232 | extern int decnet_dn_count; | 231 | extern int decnet_dn_count; |
diff --git a/include/net/dn_dev.h b/include/net/dn_dev.h index 5a86e78081bf..cee46821dc53 100644 --- a/include/net/dn_dev.h +++ b/include/net/dn_dev.h | |||
@@ -7,11 +7,11 @@ struct dn_dev; | |||
7 | struct dn_ifaddr { | 7 | struct dn_ifaddr { |
8 | struct dn_ifaddr *ifa_next; | 8 | struct dn_ifaddr *ifa_next; |
9 | struct dn_dev *ifa_dev; | 9 | struct dn_dev *ifa_dev; |
10 | dn_address ifa_local; | 10 | __le16 ifa_local; |
11 | dn_address ifa_address; | 11 | __le16 ifa_address; |
12 | unsigned char ifa_flags; | 12 | __u8 ifa_flags; |
13 | unsigned char ifa_scope; | 13 | __u8 ifa_scope; |
14 | char ifa_label[IFNAMSIZ]; | 14 | char ifa_label[IFNAMSIZ]; |
15 | }; | 15 | }; |
16 | 16 | ||
17 | #define DN_DEV_S_RU 0 /* Run - working normally */ | 17 | #define DN_DEV_S_RU 0 /* Run - working normally */ |
@@ -91,7 +91,7 @@ struct dn_dev { | |||
91 | struct timer_list timer; | 91 | struct timer_list timer; |
92 | unsigned long t3; | 92 | unsigned long t3; |
93 | struct neigh_parms *neigh_parms; | 93 | struct neigh_parms *neigh_parms; |
94 | unsigned char addr[ETH_ALEN]; | 94 | __u8 addr[ETH_ALEN]; |
95 | struct neighbour *router; /* Default router on circuit */ | 95 | struct neighbour *router; /* Default router on circuit */ |
96 | struct neighbour *peer; /* Peer on pointopoint links */ | 96 | struct neighbour *peer; /* Peer on pointopoint links */ |
97 | unsigned long uptime; /* Time device went up in jiffies */ | 97 | unsigned long uptime; /* Time device went up in jiffies */ |
@@ -99,56 +99,56 @@ struct dn_dev { | |||
99 | 99 | ||
100 | struct dn_short_packet | 100 | struct dn_short_packet |
101 | { | 101 | { |
102 | unsigned char msgflg; | 102 | __u8 msgflg; |
103 | unsigned short dstnode; | 103 | __le16 dstnode; |
104 | unsigned short srcnode; | 104 | __le16 srcnode; |
105 | unsigned char forward; | 105 | __u8 forward; |
106 | } __attribute__((packed)); | 106 | } __attribute__((packed)); |
107 | 107 | ||
108 | struct dn_long_packet | 108 | struct dn_long_packet |
109 | { | 109 | { |
110 | unsigned char msgflg; | 110 | __u8 msgflg; |
111 | unsigned char d_area; | 111 | __u8 d_area; |
112 | unsigned char d_subarea; | 112 | __u8 d_subarea; |
113 | unsigned char d_id[6]; | 113 | __u8 d_id[6]; |
114 | unsigned char s_area; | 114 | __u8 s_area; |
115 | unsigned char s_subarea; | 115 | __u8 s_subarea; |
116 | unsigned char s_id[6]; | 116 | __u8 s_id[6]; |
117 | unsigned char nl2; | 117 | __u8 nl2; |
118 | unsigned char visit_ct; | 118 | __u8 visit_ct; |
119 | unsigned char s_class; | 119 | __u8 s_class; |
120 | unsigned char pt; | 120 | __u8 pt; |
121 | } __attribute__((packed)); | 121 | } __attribute__((packed)); |
122 | 122 | ||
123 | /*------------------------- DRP - Routing messages ---------------------*/ | 123 | /*------------------------- DRP - Routing messages ---------------------*/ |
124 | 124 | ||
125 | struct endnode_hello_message | 125 | struct endnode_hello_message |
126 | { | 126 | { |
127 | unsigned char msgflg; | 127 | __u8 msgflg; |
128 | unsigned char tiver[3]; | 128 | __u8 tiver[3]; |
129 | unsigned char id[6]; | 129 | __u8 id[6]; |
130 | unsigned char iinfo; | 130 | __u8 iinfo; |
131 | unsigned short blksize; | 131 | __le16 blksize; |
132 | unsigned char area; | 132 | __u8 area; |
133 | unsigned char seed[8]; | 133 | __u8 seed[8]; |
134 | unsigned char neighbor[6]; | 134 | __u8 neighbor[6]; |
135 | unsigned short timer; | 135 | __le16 timer; |
136 | unsigned char mpd; | 136 | __u8 mpd; |
137 | unsigned char datalen; | 137 | __u8 datalen; |
138 | unsigned char data[2]; | 138 | __u8 data[2]; |
139 | } __attribute__((packed)); | 139 | } __attribute__((packed)); |
140 | 140 | ||
141 | struct rtnode_hello_message | 141 | struct rtnode_hello_message |
142 | { | 142 | { |
143 | unsigned char msgflg; | 143 | __u8 msgflg; |
144 | unsigned char tiver[3]; | 144 | __u8 tiver[3]; |
145 | unsigned char id[6]; | 145 | __u8 id[6]; |
146 | unsigned char iinfo; | 146 | __u8 iinfo; |
147 | unsigned short blksize; | 147 | __le16 blksize; |
148 | unsigned char priority; | 148 | __u8 priority; |
149 | unsigned char area; | 149 | __u8 area; |
150 | unsigned short timer; | 150 | __le16 timer; |
151 | unsigned char mpd; | 151 | __u8 mpd; |
152 | } __attribute__((packed)); | 152 | } __attribute__((packed)); |
153 | 153 | ||
154 | 154 | ||
@@ -169,12 +169,12 @@ extern void dn_dev_down(struct net_device *); | |||
169 | 169 | ||
170 | extern int dn_dev_set_default(struct net_device *dev, int force); | 170 | extern int dn_dev_set_default(struct net_device *dev, int force); |
171 | extern struct net_device *dn_dev_get_default(void); | 171 | extern struct net_device *dn_dev_get_default(void); |
172 | extern int dn_dev_bind_default(dn_address *addr); | 172 | extern int dn_dev_bind_default(__le16 *addr); |
173 | 173 | ||
174 | extern int register_dnaddr_notifier(struct notifier_block *nb); | 174 | extern int register_dnaddr_notifier(struct notifier_block *nb); |
175 | extern int unregister_dnaddr_notifier(struct notifier_block *nb); | 175 | extern int unregister_dnaddr_notifier(struct notifier_block *nb); |
176 | 176 | ||
177 | static inline int dn_dev_islocal(struct net_device *dev, dn_address addr) | 177 | static inline int dn_dev_islocal(struct net_device *dev, __le16 addr) |
178 | { | 178 | { |
179 | struct dn_dev *dn_db = dev->dn_ptr; | 179 | struct dn_dev *dn_db = dev->dn_ptr; |
180 | struct dn_ifaddr *ifa; | 180 | struct dn_ifaddr *ifa; |
diff --git a/include/net/dn_fib.h b/include/net/dn_fib.h index cd3c96d9601b..a15dcf0d5c1e 100644 --- a/include/net/dn_fib.h +++ b/include/net/dn_fib.h | |||
@@ -37,7 +37,7 @@ struct dn_fib_nh { | |||
37 | int nh_weight; | 37 | int nh_weight; |
38 | int nh_power; | 38 | int nh_power; |
39 | int nh_oif; | 39 | int nh_oif; |
40 | u32 nh_gw; | 40 | __le16 nh_gw; |
41 | }; | 41 | }; |
42 | 42 | ||
43 | struct dn_fib_info { | 43 | struct dn_fib_info { |
@@ -48,7 +48,7 @@ struct dn_fib_info { | |||
48 | int fib_dead; | 48 | int fib_dead; |
49 | unsigned fib_flags; | 49 | unsigned fib_flags; |
50 | int fib_protocol; | 50 | int fib_protocol; |
51 | dn_address fib_prefsrc; | 51 | __le16 fib_prefsrc; |
52 | __u32 fib_priority; | 52 | __u32 fib_priority; |
53 | __u32 fib_metrics[RTAX_MAX]; | 53 | __u32 fib_metrics[RTAX_MAX]; |
54 | #define dn_fib_mtu fib_metrics[RTAX_MTU-1] | 54 | #define dn_fib_mtu fib_metrics[RTAX_MTU-1] |
@@ -71,15 +71,15 @@ struct dn_fib_info { | |||
71 | #define DN_FIB_RES_OIF(res) (DN_FIB_RES_NH(res).nh_oif) | 71 | #define DN_FIB_RES_OIF(res) (DN_FIB_RES_NH(res).nh_oif) |
72 | 72 | ||
73 | typedef struct { | 73 | typedef struct { |
74 | u16 datum; | 74 | __le16 datum; |
75 | } dn_fib_key_t; | 75 | } dn_fib_key_t; |
76 | 76 | ||
77 | typedef struct { | 77 | typedef struct { |
78 | u16 datum; | 78 | __le16 datum; |
79 | } dn_fib_hash_t; | 79 | } dn_fib_hash_t; |
80 | 80 | ||
81 | typedef struct { | 81 | typedef struct { |
82 | u16 datum; | 82 | __u16 datum; |
83 | } dn_fib_idx_t; | 83 | } dn_fib_idx_t; |
84 | 84 | ||
85 | struct dn_fib_node { | 85 | struct dn_fib_node { |
@@ -126,11 +126,11 @@ extern int dn_fib_semantic_match(int type, struct dn_fib_info *fi, | |||
126 | const struct flowi *fl, | 126 | const struct flowi *fl, |
127 | struct dn_fib_res *res); | 127 | struct dn_fib_res *res); |
128 | extern void dn_fib_release_info(struct dn_fib_info *fi); | 128 | extern void dn_fib_release_info(struct dn_fib_info *fi); |
129 | extern u16 dn_fib_get_attr16(struct rtattr *attr, int attrlen, int type); | 129 | extern __le16 dn_fib_get_attr16(struct rtattr *attr, int attrlen, int type); |
130 | extern void dn_fib_flush(void); | 130 | extern void dn_fib_flush(void); |
131 | extern void dn_fib_select_multipath(const struct flowi *fl, | 131 | extern void dn_fib_select_multipath(const struct flowi *fl, |
132 | struct dn_fib_res *res); | 132 | struct dn_fib_res *res); |
133 | extern int dn_fib_sync_down(dn_address local, struct net_device *dev, | 133 | extern int dn_fib_sync_down(__le16 local, struct net_device *dev, |
134 | int force); | 134 | int force); |
135 | extern int dn_fib_sync_up(struct net_device *dev); | 135 | extern int dn_fib_sync_up(struct net_device *dev); |
136 | 136 | ||
@@ -148,8 +148,8 @@ extern void dn_fib_table_cleanup(void); | |||
148 | extern void dn_fib_rules_init(void); | 148 | extern void dn_fib_rules_init(void); |
149 | extern void dn_fib_rules_cleanup(void); | 149 | extern void dn_fib_rules_cleanup(void); |
150 | extern void dn_fib_rule_put(struct dn_fib_rule *); | 150 | extern void dn_fib_rule_put(struct dn_fib_rule *); |
151 | extern __u16 dn_fib_rules_policy(__u16 saddr, struct dn_fib_res *res, unsigned *flags); | 151 | extern __le16 dn_fib_rules_policy(__le16 saddr, struct dn_fib_res *res, unsigned *flags); |
152 | extern unsigned dnet_addr_type(__u16 addr); | 152 | extern unsigned dnet_addr_type(__le16 addr); |
153 | extern int dn_fib_lookup(const struct flowi *fl, struct dn_fib_res *res); | 153 | extern int dn_fib_lookup(const struct flowi *fl, struct dn_fib_res *res); |
154 | 154 | ||
155 | /* | 155 | /* |
@@ -194,10 +194,10 @@ extern struct dn_fib_table *dn_fib_tables[]; | |||
194 | 194 | ||
195 | #endif /* CONFIG_DECNET_ROUTER */ | 195 | #endif /* CONFIG_DECNET_ROUTER */ |
196 | 196 | ||
197 | static inline u16 dnet_make_mask(int n) | 197 | static inline __le16 dnet_make_mask(int n) |
198 | { | 198 | { |
199 | if (n) | 199 | if (n) |
200 | return htons(~((1<<(16-n))-1)); | 200 | return dn_htons(~((1<<(16-n))-1)); |
201 | return 0; | 201 | return 0; |
202 | } | 202 | } |
203 | 203 | ||
diff --git a/include/net/dn_neigh.h b/include/net/dn_neigh.h index 4b1eb038d637..4cb4ae7fb81f 100644 --- a/include/net/dn_neigh.h +++ b/include/net/dn_neigh.h | |||
@@ -7,13 +7,13 @@ | |||
7 | */ | 7 | */ |
8 | struct dn_neigh { | 8 | struct dn_neigh { |
9 | struct neighbour n; | 9 | struct neighbour n; |
10 | dn_address addr; | 10 | __le16 addr; |
11 | unsigned long flags; | 11 | unsigned long flags; |
12 | #define DN_NDFLAG_R1 0x0001 /* Router L1 */ | 12 | #define DN_NDFLAG_R1 0x0001 /* Router L1 */ |
13 | #define DN_NDFLAG_R2 0x0002 /* Router L2 */ | 13 | #define DN_NDFLAG_R2 0x0002 /* Router L2 */ |
14 | #define DN_NDFLAG_P3 0x0004 /* Phase III Node */ | 14 | #define DN_NDFLAG_P3 0x0004 /* Phase III Node */ |
15 | unsigned long blksize; | 15 | unsigned long blksize; |
16 | unsigned char priority; | 16 | __u8 priority; |
17 | }; | 17 | }; |
18 | 18 | ||
19 | extern void dn_neigh_init(void); | 19 | extern void dn_neigh_init(void); |
diff --git a/include/net/dn_nsp.h b/include/net/dn_nsp.h index e6182b86262b..96e816b6974d 100644 --- a/include/net/dn_nsp.h +++ b/include/net/dn_nsp.h | |||
@@ -72,77 +72,77 @@ extern struct sk_buff *dn_alloc_send_skb(struct sock *sk, size_t *size, int nobl | |||
72 | 72 | ||
73 | struct nsp_data_seg_msg | 73 | struct nsp_data_seg_msg |
74 | { | 74 | { |
75 | unsigned char msgflg; | 75 | __u8 msgflg; |
76 | unsigned short dstaddr; | 76 | __le16 dstaddr; |
77 | unsigned short srcaddr; | 77 | __le16 srcaddr; |
78 | } __attribute__((packed)); | 78 | } __attribute__((packed)); |
79 | 79 | ||
80 | struct nsp_data_opt_msg | 80 | struct nsp_data_opt_msg |
81 | { | 81 | { |
82 | unsigned short acknum; | 82 | __le16 acknum; |
83 | unsigned short segnum; | 83 | __le16 segnum; |
84 | unsigned short lsflgs; | 84 | __le16 lsflgs; |
85 | } __attribute__((packed)); | 85 | } __attribute__((packed)); |
86 | 86 | ||
87 | struct nsp_data_opt_msg1 | 87 | struct nsp_data_opt_msg1 |
88 | { | 88 | { |
89 | unsigned short acknum; | 89 | __le16 acknum; |
90 | unsigned short segnum; | 90 | __le16 segnum; |
91 | } __attribute__((packed)); | 91 | } __attribute__((packed)); |
92 | 92 | ||
93 | 93 | ||
94 | /* Acknowledgment Message (data/other data) */ | 94 | /* Acknowledgment Message (data/other data) */ |
95 | struct nsp_data_ack_msg | 95 | struct nsp_data_ack_msg |
96 | { | 96 | { |
97 | unsigned char msgflg; | 97 | __u8 msgflg; |
98 | unsigned short dstaddr; | 98 | __le16 dstaddr; |
99 | unsigned short srcaddr; | 99 | __le16 srcaddr; |
100 | unsigned short acknum; | 100 | __le16 acknum; |
101 | } __attribute__((packed)); | 101 | } __attribute__((packed)); |
102 | 102 | ||
103 | /* Connect Acknowledgment Message */ | 103 | /* Connect Acknowledgment Message */ |
104 | struct nsp_conn_ack_msg | 104 | struct nsp_conn_ack_msg |
105 | { | 105 | { |
106 | unsigned char msgflg; | 106 | __u8 msgflg; |
107 | unsigned short dstaddr; | 107 | __le16 dstaddr; |
108 | } __attribute__((packed)); | 108 | } __attribute__((packed)); |
109 | 109 | ||
110 | 110 | ||
111 | /* Connect Initiate/Retransmit Initiate/Connect Confirm */ | 111 | /* Connect Initiate/Retransmit Initiate/Connect Confirm */ |
112 | struct nsp_conn_init_msg | 112 | struct nsp_conn_init_msg |
113 | { | 113 | { |
114 | unsigned char msgflg; | 114 | __u8 msgflg; |
115 | #define NSP_CI 0x18 /* Connect Initiate */ | 115 | #define NSP_CI 0x18 /* Connect Initiate */ |
116 | #define NSP_RCI 0x68 /* Retrans. Conn Init */ | 116 | #define NSP_RCI 0x68 /* Retrans. Conn Init */ |
117 | unsigned short dstaddr; | 117 | __le16 dstaddr; |
118 | unsigned short srcaddr; | 118 | __le16 srcaddr; |
119 | unsigned char services; | 119 | __u8 services; |
120 | #define NSP_FC_NONE 0x00 /* Flow Control None */ | 120 | #define NSP_FC_NONE 0x00 /* Flow Control None */ |
121 | #define NSP_FC_SRC 0x04 /* Seg Req. Count */ | 121 | #define NSP_FC_SRC 0x04 /* Seg Req. Count */ |
122 | #define NSP_FC_SCMC 0x08 /* Sess. Control Mess */ | 122 | #define NSP_FC_SCMC 0x08 /* Sess. Control Mess */ |
123 | #define NSP_FC_MASK 0x0c /* FC type mask */ | 123 | #define NSP_FC_MASK 0x0c /* FC type mask */ |
124 | unsigned char info; | 124 | __u8 info; |
125 | unsigned short segsize; | 125 | __le16 segsize; |
126 | } __attribute__((packed)); | 126 | } __attribute__((packed)); |
127 | 127 | ||
128 | /* Disconnect Initiate/Disconnect Confirm */ | 128 | /* Disconnect Initiate/Disconnect Confirm */ |
129 | struct nsp_disconn_init_msg | 129 | struct nsp_disconn_init_msg |
130 | { | 130 | { |
131 | unsigned char msgflg; | 131 | __u8 msgflg; |
132 | unsigned short dstaddr; | 132 | __le16 dstaddr; |
133 | unsigned short srcaddr; | 133 | __le16 srcaddr; |
134 | unsigned short reason; | 134 | __le16 reason; |
135 | } __attribute__((packed)); | 135 | } __attribute__((packed)); |
136 | 136 | ||
137 | 137 | ||
138 | 138 | ||
139 | struct srcobj_fmt | 139 | struct srcobj_fmt |
140 | { | 140 | { |
141 | char format; | 141 | __u8 format; |
142 | unsigned char task; | 142 | __u8 task; |
143 | unsigned short grpcode; | 143 | __le16 grpcode; |
144 | unsigned short usrcode; | 144 | __le16 usrcode; |
145 | char dlen; | 145 | __u8 dlen; |
146 | } __attribute__((packed)); | 146 | } __attribute__((packed)); |
147 | 147 | ||
148 | /* | 148 | /* |
@@ -150,7 +150,7 @@ struct srcobj_fmt | |||
150 | * numbers used in NSP. Similar in operation to the functions | 150 | * numbers used in NSP. Similar in operation to the functions |
151 | * of the same name in TCP. | 151 | * of the same name in TCP. |
152 | */ | 152 | */ |
153 | static __inline__ int dn_before(unsigned short seq1, unsigned short seq2) | 153 | static __inline__ int dn_before(__u16 seq1, __u16 seq2) |
154 | { | 154 | { |
155 | seq1 &= 0x0fff; | 155 | seq1 &= 0x0fff; |
156 | seq2 &= 0x0fff; | 156 | seq2 &= 0x0fff; |
@@ -159,7 +159,7 @@ static __inline__ int dn_before(unsigned short seq1, unsigned short seq2) | |||
159 | } | 159 | } |
160 | 160 | ||
161 | 161 | ||
162 | static __inline__ int dn_after(unsigned short seq1, unsigned short seq2) | 162 | static __inline__ int dn_after(__u16 seq1, __u16 seq2) |
163 | { | 163 | { |
164 | seq1 &= 0x0fff; | 164 | seq1 &= 0x0fff; |
165 | seq2 &= 0x0fff; | 165 | seq2 &= 0x0fff; |
@@ -167,23 +167,23 @@ static __inline__ int dn_after(unsigned short seq1, unsigned short seq2) | |||
167 | return (int)((seq2 - seq1) & 0x0fff) > 2048; | 167 | return (int)((seq2 - seq1) & 0x0fff) > 2048; |
168 | } | 168 | } |
169 | 169 | ||
170 | static __inline__ int dn_equal(unsigned short seq1, unsigned short seq2) | 170 | static __inline__ int dn_equal(__u16 seq1, __u16 seq2) |
171 | { | 171 | { |
172 | return ((seq1 ^ seq2) & 0x0fff) == 0; | 172 | return ((seq1 ^ seq2) & 0x0fff) == 0; |
173 | } | 173 | } |
174 | 174 | ||
175 | static __inline__ int dn_before_or_equal(unsigned short seq1, unsigned short seq2) | 175 | static __inline__ int dn_before_or_equal(__u16 seq1, __u16 seq2) |
176 | { | 176 | { |
177 | return (dn_before(seq1, seq2) || dn_equal(seq1, seq2)); | 177 | return (dn_before(seq1, seq2) || dn_equal(seq1, seq2)); |
178 | } | 178 | } |
179 | 179 | ||
180 | static __inline__ void seq_add(unsigned short *seq, unsigned short off) | 180 | static __inline__ void seq_add(__u16 *seq, __u16 off) |
181 | { | 181 | { |
182 | (*seq) += off; | 182 | (*seq) += off; |
183 | (*seq) &= 0x0fff; | 183 | (*seq) &= 0x0fff; |
184 | } | 184 | } |
185 | 185 | ||
186 | static __inline__ int seq_next(unsigned short seq1, unsigned short seq2) | 186 | static __inline__ int seq_next(__u16 seq1, __u16 seq2) |
187 | { | 187 | { |
188 | return dn_equal(seq1 + 1, seq2); | 188 | return dn_equal(seq1 + 1, seq2); |
189 | } | 189 | } |
@@ -191,7 +191,7 @@ static __inline__ int seq_next(unsigned short seq1, unsigned short seq2) | |||
191 | /* | 191 | /* |
192 | * Can we delay the ack ? | 192 | * Can we delay the ack ? |
193 | */ | 193 | */ |
194 | static __inline__ int sendack(unsigned short seq) | 194 | static __inline__ int sendack(__u16 seq) |
195 | { | 195 | { |
196 | return (int)((seq & 0x1000) ? 0 : 1); | 196 | return (int)((seq & 0x1000) ? 0 : 1); |
197 | } | 197 | } |
diff --git a/include/net/dn_route.h b/include/net/dn_route.h index 5122da3f2eb3..76f957e258b0 100644 --- a/include/net/dn_route.h +++ b/include/net/dn_route.h | |||
@@ -71,12 +71,12 @@ struct dn_route { | |||
71 | struct dn_route *rt_next; | 71 | struct dn_route *rt_next; |
72 | } u; | 72 | } u; |
73 | 73 | ||
74 | __u16 rt_saddr; | 74 | __le16 rt_saddr; |
75 | __u16 rt_daddr; | 75 | __le16 rt_daddr; |
76 | __u16 rt_gateway; | 76 | __le16 rt_gateway; |
77 | __u16 rt_local_src; /* Source used for forwarding packets */ | 77 | __le16 rt_local_src; /* Source used for forwarding packets */ |
78 | __u16 rt_src_map; | 78 | __le16 rt_src_map; |
79 | __u16 rt_dst_map; | 79 | __le16 rt_dst_map; |
80 | 80 | ||
81 | unsigned rt_flags; | 81 | unsigned rt_flags; |
82 | unsigned rt_type; | 82 | unsigned rt_type; |
diff --git a/include/net/flow.h b/include/net/flow.h index ec7eb86eb203..04d89f763451 100644 --- a/include/net/flow.h +++ b/include/net/flow.h | |||
@@ -30,8 +30,8 @@ struct flowi { | |||
30 | } ip6_u; | 30 | } ip6_u; |
31 | 31 | ||
32 | struct { | 32 | struct { |
33 | __u16 daddr; | 33 | __le16 daddr; |
34 | __u16 saddr; | 34 | __le16 saddr; |
35 | __u32 fwmark; | 35 | __u32 fwmark; |
36 | __u8 scope; | 36 | __u8 scope; |
37 | } dn_u; | 37 | } dn_u; |
@@ -64,8 +64,8 @@ struct flowi { | |||
64 | } icmpt; | 64 | } icmpt; |
65 | 65 | ||
66 | struct { | 66 | struct { |
67 | __u16 sport; | 67 | __le16 sport; |
68 | __u16 dport; | 68 | __le16 dport; |
69 | __u8 objnum; | 69 | __u8 objnum; |
70 | __u8 objnamel; /* Not 16 bits since max val is 16 */ | 70 | __u8 objnamel; /* Not 16 bits since max val is 16 */ |
71 | __u8 objname[16]; /* Not zero terminated */ | 71 | __u8 objname[16]; /* Not zero terminated */ |
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h index eb8afe3499a9..e459e1a0ae4a 100644 --- a/include/net/if_inet6.h +++ b/include/net/if_inet6.h | |||
@@ -180,11 +180,8 @@ struct inet6_dev | |||
180 | 180 | ||
181 | #ifdef CONFIG_IPV6_PRIVACY | 181 | #ifdef CONFIG_IPV6_PRIVACY |
182 | u8 rndid[8]; | 182 | u8 rndid[8]; |
183 | u8 entropy[8]; | ||
184 | struct timer_list regen_timer; | 183 | struct timer_list regen_timer; |
185 | struct inet6_ifaddr *tempaddr_list; | 184 | struct inet6_ifaddr *tempaddr_list; |
186 | __u8 work_eui64[8]; | ||
187 | __u8 work_digest[16]; | ||
188 | #endif | 185 | #endif |
189 | 186 | ||
190 | struct neigh_parms *nd_parms; | 187 | struct neigh_parms *nd_parms; |
diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h index fa587c94e9d0..9bf73fe50948 100644 --- a/include/net/inet_connection_sock.h +++ b/include/net/inet_connection_sock.h | |||
@@ -50,6 +50,12 @@ struct inet_connection_sock_af_ops { | |||
50 | char __user *optval, int optlen); | 50 | char __user *optval, int optlen); |
51 | int (*getsockopt)(struct sock *sk, int level, int optname, | 51 | int (*getsockopt)(struct sock *sk, int level, int optname, |
52 | char __user *optval, int __user *optlen); | 52 | char __user *optval, int __user *optlen); |
53 | int (*compat_setsockopt)(struct sock *sk, | ||
54 | int level, int optname, | ||
55 | char __user *optval, int optlen); | ||
56 | int (*compat_getsockopt)(struct sock *sk, | ||
57 | int level, int optname, | ||
58 | char __user *optval, int __user *optlen); | ||
53 | void (*addr2sockaddr)(struct sock *sk, struct sockaddr *); | 59 | void (*addr2sockaddr)(struct sock *sk, struct sockaddr *); |
54 | int sockaddr_len; | 60 | int sockaddr_len; |
55 | }; | 61 | }; |
@@ -72,6 +78,7 @@ struct inet_connection_sock_af_ops { | |||
72 | * @icsk_probes_out: unanswered 0 window probes | 78 | * @icsk_probes_out: unanswered 0 window probes |
73 | * @icsk_ext_hdr_len: Network protocol overhead (IP/IPv6 options) | 79 | * @icsk_ext_hdr_len: Network protocol overhead (IP/IPv6 options) |
74 | * @icsk_ack: Delayed ACK control data | 80 | * @icsk_ack: Delayed ACK control data |
81 | * @icsk_mtup; MTU probing control data | ||
75 | */ | 82 | */ |
76 | struct inet_connection_sock { | 83 | struct inet_connection_sock { |
77 | /* inet_sock has to be the first member! */ | 84 | /* inet_sock has to be the first member! */ |
@@ -104,6 +111,16 @@ struct inet_connection_sock { | |||
104 | __u16 last_seg_size; /* Size of last incoming segment */ | 111 | __u16 last_seg_size; /* Size of last incoming segment */ |
105 | __u16 rcv_mss; /* MSS used for delayed ACK decisions */ | 112 | __u16 rcv_mss; /* MSS used for delayed ACK decisions */ |
106 | } icsk_ack; | 113 | } icsk_ack; |
114 | struct { | ||
115 | int enabled; | ||
116 | |||
117 | /* Range of MTUs to search */ | ||
118 | int search_high; | ||
119 | int search_low; | ||
120 | |||
121 | /* Information on the current probe. */ | ||
122 | int probe_size; | ||
123 | } icsk_mtup; | ||
107 | u32 icsk_ca_priv[16]; | 124 | u32 icsk_ca_priv[16]; |
108 | #define ICSK_CA_PRIV_SIZE (16 * sizeof(u32)) | 125 | #define ICSK_CA_PRIV_SIZE (16 * sizeof(u32)) |
109 | }; | 126 | }; |
@@ -310,4 +327,13 @@ extern void inet_csk_listen_stop(struct sock *sk); | |||
310 | 327 | ||
311 | extern void inet_csk_addr2sockaddr(struct sock *sk, struct sockaddr *uaddr); | 328 | extern void inet_csk_addr2sockaddr(struct sock *sk, struct sockaddr *uaddr); |
312 | 329 | ||
330 | extern int inet_csk_ctl_sock_create(struct socket **sock, | ||
331 | unsigned short family, | ||
332 | unsigned short type, | ||
333 | unsigned char protocol); | ||
334 | |||
335 | extern int inet_csk_compat_getsockopt(struct sock *sk, int level, int optname, | ||
336 | char __user *optval, int __user *optlen); | ||
337 | extern int inet_csk_compat_setsockopt(struct sock *sk, int level, int optname, | ||
338 | char __user *optval, int optlen); | ||
313 | #endif /* _INET_CONNECTION_SOCK_H */ | 339 | #endif /* _INET_CONNECTION_SOCK_H */ |
diff --git a/include/net/ip.h b/include/net/ip.h index fab3d5b3ab1c..8fe6156ca9b0 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
@@ -356,6 +356,10 @@ extern void ip_cmsg_recv(struct msghdr *msg, struct sk_buff *skb); | |||
356 | extern int ip_cmsg_send(struct msghdr *msg, struct ipcm_cookie *ipc); | 356 | extern int ip_cmsg_send(struct msghdr *msg, struct ipcm_cookie *ipc); |
357 | extern int ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval, int optlen); | 357 | extern int ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval, int optlen); |
358 | extern int ip_getsockopt(struct sock *sk, int level, int optname, char __user *optval, int __user *optlen); | 358 | extern int ip_getsockopt(struct sock *sk, int level, int optname, char __user *optval, int __user *optlen); |
359 | extern int compat_ip_setsockopt(struct sock *sk, int level, | ||
360 | int optname, char __user *optval, int optlen); | ||
361 | extern int compat_ip_getsockopt(struct sock *sk, int level, | ||
362 | int optname, char __user *optval, int __user *optlen); | ||
359 | extern int ip_ra_control(struct sock *sk, unsigned char on, void (*destructor)(struct sock *)); | 363 | extern int ip_ra_control(struct sock *sk, unsigned char on, void (*destructor)(struct sock *)); |
360 | 364 | ||
361 | extern int ip_recv_error(struct sock *sk, struct msghdr *msg, int len); | 365 | extern int ip_recv_error(struct sock *sk, struct msghdr *msg, int len); |
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h index 1f2e428ca364..a398ae5e30f9 100644 --- a/include/net/ip6_route.h +++ b/include/net/ip6_route.h | |||
@@ -7,6 +7,23 @@ | |||
7 | #define IP6_RT_PRIO_KERN 512 | 7 | #define IP6_RT_PRIO_KERN 512 |
8 | #define IP6_RT_FLOW_MASK 0x00ff | 8 | #define IP6_RT_FLOW_MASK 0x00ff |
9 | 9 | ||
10 | struct route_info { | ||
11 | __u8 type; | ||
12 | __u8 length; | ||
13 | __u8 prefix_len; | ||
14 | #if defined(__BIG_ENDIAN_BITFIELD) | ||
15 | __u8 reserved_h:3, | ||
16 | route_pref:2, | ||
17 | reserved_l:3; | ||
18 | #elif defined(__LITTLE_ENDIAN_BITFIELD) | ||
19 | __u8 reserved_l:3, | ||
20 | route_pref:2, | ||
21 | reserved_h:3; | ||
22 | #endif | ||
23 | __u32 lifetime; | ||
24 | __u8 prefix[0]; /* 0,8 or 16 */ | ||
25 | }; | ||
26 | |||
10 | #ifdef __KERNEL__ | 27 | #ifdef __KERNEL__ |
11 | 28 | ||
12 | #include <net/flow.h> | 29 | #include <net/flow.h> |
@@ -87,11 +104,14 @@ extern struct rt6_info *addrconf_dst_alloc(struct inet6_dev *idev, | |||
87 | extern struct rt6_info * rt6_get_dflt_router(struct in6_addr *addr, | 104 | extern struct rt6_info * rt6_get_dflt_router(struct in6_addr *addr, |
88 | struct net_device *dev); | 105 | struct net_device *dev); |
89 | extern struct rt6_info * rt6_add_dflt_router(struct in6_addr *gwaddr, | 106 | extern struct rt6_info * rt6_add_dflt_router(struct in6_addr *gwaddr, |
90 | struct net_device *dev); | 107 | struct net_device *dev, |
108 | unsigned int pref); | ||
91 | 109 | ||
92 | extern void rt6_purge_dflt_routers(void); | 110 | extern void rt6_purge_dflt_routers(void); |
93 | 111 | ||
94 | extern void rt6_reset_dflt_pointer(struct rt6_info *rt); | 112 | extern int rt6_route_rcv(struct net_device *dev, |
113 | u8 *opt, int len, | ||
114 | struct in6_addr *gwaddr); | ||
95 | 115 | ||
96 | extern void rt6_redirect(struct in6_addr *dest, | 116 | extern void rt6_redirect(struct in6_addr *dest, |
97 | struct in6_addr *saddr, | 117 | struct in6_addr *saddr, |
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index 3b1d963d396c..6d6f0634ae41 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h | |||
@@ -282,6 +282,18 @@ static inline int ipv6_addr_cmp(const struct in6_addr *a1, const struct in6_addr | |||
282 | return memcmp((const void *) a1, (const void *) a2, sizeof(struct in6_addr)); | 282 | return memcmp((const void *) a1, (const void *) a2, sizeof(struct in6_addr)); |
283 | } | 283 | } |
284 | 284 | ||
285 | static inline int | ||
286 | ipv6_masked_addr_cmp(const struct in6_addr *a1, const struct in6_addr *m, | ||
287 | const struct in6_addr *a2) | ||
288 | { | ||
289 | unsigned int i; | ||
290 | |||
291 | for (i = 0; i < 4; i++) | ||
292 | if ((a1->s6_addr32[i] ^ a2->s6_addr32[i]) & m->s6_addr32[i]) | ||
293 | return 1; | ||
294 | return 0; | ||
295 | } | ||
296 | |||
285 | static inline void ipv6_addr_copy(struct in6_addr *a1, const struct in6_addr *a2) | 297 | static inline void ipv6_addr_copy(struct in6_addr *a1, const struct in6_addr *a2) |
286 | { | 298 | { |
287 | memcpy((void *) a1, (const void *) a2, sizeof(struct in6_addr)); | 299 | memcpy((void *) a1, (const void *) a2, sizeof(struct in6_addr)); |
@@ -508,6 +520,16 @@ extern int ipv6_getsockopt(struct sock *sk, int level, | |||
508 | int optname, | 520 | int optname, |
509 | char __user *optval, | 521 | char __user *optval, |
510 | int __user *optlen); | 522 | int __user *optlen); |
523 | extern int compat_ipv6_setsockopt(struct sock *sk, | ||
524 | int level, | ||
525 | int optname, | ||
526 | char __user *optval, | ||
527 | int optlen); | ||
528 | extern int compat_ipv6_getsockopt(struct sock *sk, | ||
529 | int level, | ||
530 | int optname, | ||
531 | char __user *optval, | ||
532 | int __user *optlen); | ||
511 | 533 | ||
512 | extern void ipv6_packet_init(void); | 534 | extern void ipv6_packet_init(void); |
513 | 535 | ||
diff --git a/include/net/llc.h b/include/net/llc.h index 1adb2ef3f6f7..f5024583fc8b 100644 --- a/include/net/llc.h +++ b/include/net/llc.h | |||
@@ -71,7 +71,7 @@ extern int llc_rcv(struct sk_buff *skb, struct net_device *dev, | |||
71 | struct packet_type *pt, struct net_device *orig_dev); | 71 | struct packet_type *pt, struct net_device *orig_dev); |
72 | 72 | ||
73 | extern int llc_mac_hdr_init(struct sk_buff *skb, | 73 | extern int llc_mac_hdr_init(struct sk_buff *skb, |
74 | unsigned char *sa, unsigned char *da); | 74 | const unsigned char *sa, const unsigned char *da); |
75 | 75 | ||
76 | extern void llc_add_pack(int type, void (*handler)(struct llc_sap *sap, | 76 | extern void llc_add_pack(int type, void (*handler)(struct llc_sap *sap, |
77 | struct sk_buff *skb)); | 77 | struct sk_buff *skb)); |
diff --git a/include/net/ndisc.h b/include/net/ndisc.h index bbac87eeb422..91fa271a0064 100644 --- a/include/net/ndisc.h +++ b/include/net/ndisc.h | |||
@@ -22,6 +22,8 @@ enum { | |||
22 | ND_OPT_PREFIX_INFO = 3, /* RFC2461 */ | 22 | ND_OPT_PREFIX_INFO = 3, /* RFC2461 */ |
23 | ND_OPT_REDIRECT_HDR = 4, /* RFC2461 */ | 23 | ND_OPT_REDIRECT_HDR = 4, /* RFC2461 */ |
24 | ND_OPT_MTU = 5, /* RFC2461 */ | 24 | ND_OPT_MTU = 5, /* RFC2461 */ |
25 | __ND_OPT_ARRAY_MAX, | ||
26 | ND_OPT_ROUTE_INFO = 24, /* RFC4191 */ | ||
25 | __ND_OPT_MAX | 27 | __ND_OPT_MAX |
26 | }; | 28 | }; |
27 | 29 | ||
diff --git a/include/net/neighbour.h b/include/net/neighbour.h index 6fa9ae190741..b0666d66293f 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h | |||
@@ -68,6 +68,7 @@ struct neigh_parms | |||
68 | struct net_device *dev; | 68 | struct net_device *dev; |
69 | struct neigh_parms *next; | 69 | struct neigh_parms *next; |
70 | int (*neigh_setup)(struct neighbour *); | 70 | int (*neigh_setup)(struct neighbour *); |
71 | void (*neigh_destructor)(struct neighbour *); | ||
71 | struct neigh_table *tbl; | 72 | struct neigh_table *tbl; |
72 | 73 | ||
73 | void *sysctl_table; | 74 | void *sysctl_table; |
@@ -145,7 +146,6 @@ struct neighbour | |||
145 | struct neigh_ops | 146 | struct neigh_ops |
146 | { | 147 | { |
147 | int family; | 148 | int family; |
148 | void (*destructor)(struct neighbour *); | ||
149 | void (*solicit)(struct neighbour *, struct sk_buff*); | 149 | void (*solicit)(struct neighbour *, struct sk_buff*); |
150 | void (*error_report)(struct neighbour *, struct sk_buff*); | 150 | void (*error_report)(struct neighbour *, struct sk_buff*); |
151 | int (*output)(struct sk_buff*); | 151 | int (*output)(struct sk_buff*); |
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h index 6d075ca16e6e..2743c156caa0 100644 --- a/include/net/netfilter/nf_conntrack.h +++ b/include/net/netfilter/nf_conntrack.h | |||
@@ -67,6 +67,18 @@ do { \ | |||
67 | 67 | ||
68 | struct nf_conntrack_helper; | 68 | struct nf_conntrack_helper; |
69 | 69 | ||
70 | /* nf_conn feature for connections that have a helper */ | ||
71 | struct nf_conn_help { | ||
72 | /* Helper. if any */ | ||
73 | struct nf_conntrack_helper *helper; | ||
74 | |||
75 | union nf_conntrack_help help; | ||
76 | |||
77 | /* Current number of expected connections */ | ||
78 | unsigned int expecting; | ||
79 | }; | ||
80 | |||
81 | |||
70 | #include <net/netfilter/ipv4/nf_conntrack_ipv4.h> | 82 | #include <net/netfilter/ipv4/nf_conntrack_ipv4.h> |
71 | struct nf_conn | 83 | struct nf_conn |
72 | { | 84 | { |
@@ -81,6 +93,9 @@ struct nf_conn | |||
81 | /* Have we seen traffic both ways yet? (bitset) */ | 93 | /* Have we seen traffic both ways yet? (bitset) */ |
82 | unsigned long status; | 94 | unsigned long status; |
83 | 95 | ||
96 | /* If we were expected by an expectation, this will be it */ | ||
97 | struct nf_conn *master; | ||
98 | |||
84 | /* Timer function; drops refcnt when it goes off. */ | 99 | /* Timer function; drops refcnt when it goes off. */ |
85 | struct timer_list timeout; | 100 | struct timer_list timeout; |
86 | 101 | ||
@@ -88,38 +103,22 @@ struct nf_conn | |||
88 | /* Accounting Information (same cache line as other written members) */ | 103 | /* Accounting Information (same cache line as other written members) */ |
89 | struct ip_conntrack_counter counters[IP_CT_DIR_MAX]; | 104 | struct ip_conntrack_counter counters[IP_CT_DIR_MAX]; |
90 | #endif | 105 | #endif |
91 | /* If we were expected by an expectation, this will be it */ | ||
92 | struct nf_conn *master; | ||
93 | |||
94 | /* Current number of expected connections */ | ||
95 | unsigned int expecting; | ||
96 | 106 | ||
97 | /* Unique ID that identifies this conntrack*/ | 107 | /* Unique ID that identifies this conntrack*/ |
98 | unsigned int id; | 108 | unsigned int id; |
99 | 109 | ||
100 | /* Helper. if any */ | ||
101 | struct nf_conntrack_helper *helper; | ||
102 | |||
103 | /* features - nat, helper, ... used by allocating system */ | 110 | /* features - nat, helper, ... used by allocating system */ |
104 | u_int32_t features; | 111 | u_int32_t features; |
105 | 112 | ||
106 | /* Storage reserved for other modules: */ | ||
107 | |||
108 | union nf_conntrack_proto proto; | ||
109 | |||
110 | #if defined(CONFIG_NF_CONNTRACK_MARK) | 113 | #if defined(CONFIG_NF_CONNTRACK_MARK) |
111 | u_int32_t mark; | 114 | u_int32_t mark; |
112 | #endif | 115 | #endif |
113 | 116 | ||
114 | /* These members are dynamically allocated. */ | 117 | /* Storage reserved for other modules: */ |
115 | 118 | union nf_conntrack_proto proto; | |
116 | union nf_conntrack_help *help; | ||
117 | 119 | ||
118 | /* Layer 3 dependent members. (ex: NAT) */ | 120 | /* features dynamically at the end: helper, nat (both optional) */ |
119 | union { | 121 | char data[0]; |
120 | struct nf_conntrack_ipv4 *ipv4; | ||
121 | } l3proto; | ||
122 | void *data[0]; | ||
123 | }; | 122 | }; |
124 | 123 | ||
125 | struct nf_conntrack_expect | 124 | struct nf_conntrack_expect |
@@ -373,10 +372,23 @@ nf_conntrack_expect_event(enum ip_conntrack_expect_events event, | |||
373 | #define NF_CT_F_NUM 4 | 372 | #define NF_CT_F_NUM 4 |
374 | 373 | ||
375 | extern int | 374 | extern int |
376 | nf_conntrack_register_cache(u_int32_t features, const char *name, size_t size, | 375 | nf_conntrack_register_cache(u_int32_t features, const char *name, size_t size); |
377 | int (*init_conntrack)(struct nf_conn *, u_int32_t)); | ||
378 | extern void | 376 | extern void |
379 | nf_conntrack_unregister_cache(u_int32_t features); | 377 | nf_conntrack_unregister_cache(u_int32_t features); |
380 | 378 | ||
379 | /* valid combinations: | ||
380 | * basic: nf_conn, nf_conn .. nf_conn_help | ||
381 | * nat: nf_conn .. nf_conn_nat, nf_conn .. nf_conn_nat, nf_conn help | ||
382 | */ | ||
383 | static inline struct nf_conn_help *nfct_help(const struct nf_conn *ct) | ||
384 | { | ||
385 | unsigned int offset = sizeof(struct nf_conn); | ||
386 | |||
387 | if (!(ct->features & NF_CT_F_HELP)) | ||
388 | return NULL; | ||
389 | |||
390 | return (struct nf_conn_help *) ((void *)ct + offset); | ||
391 | } | ||
392 | |||
381 | #endif /* __KERNEL__ */ | 393 | #endif /* __KERNEL__ */ |
382 | #endif /* _NF_CONNTRACK_H */ | 394 | #endif /* _NF_CONNTRACK_H */ |
diff --git a/include/net/scm.h b/include/net/scm.h index c3fa3d5ab606..540619cb7160 100644 --- a/include/net/scm.h +++ b/include/net/scm.h | |||
@@ -37,10 +37,12 @@ static __inline__ void scm_destroy(struct scm_cookie *scm) | |||
37 | static __inline__ int scm_send(struct socket *sock, struct msghdr *msg, | 37 | static __inline__ int scm_send(struct socket *sock, struct msghdr *msg, |
38 | struct scm_cookie *scm) | 38 | struct scm_cookie *scm) |
39 | { | 39 | { |
40 | memset(scm, 0, sizeof(*scm)); | 40 | struct task_struct *p = current; |
41 | scm->creds.uid = current->uid; | 41 | scm->creds.uid = p->uid; |
42 | scm->creds.gid = current->gid; | 42 | scm->creds.gid = p->gid; |
43 | scm->creds.pid = current->tgid; | 43 | scm->creds.pid = p->tgid; |
44 | scm->fp = NULL; | ||
45 | scm->seq = 0; | ||
44 | if (msg->msg_controllen <= 0) | 46 | if (msg->msg_controllen <= 0) |
45 | return 0; | 47 | return 0; |
46 | return __scm_send(sock, msg, scm); | 48 | return __scm_send(sock, msg, scm); |
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index 072f407848a6..eba99f375517 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
@@ -514,6 +514,16 @@ struct sctp_af { | |||
514 | int optname, | 514 | int optname, |
515 | char __user *optval, | 515 | char __user *optval, |
516 | int __user *optlen); | 516 | int __user *optlen); |
517 | int (*compat_setsockopt) (struct sock *sk, | ||
518 | int level, | ||
519 | int optname, | ||
520 | char __user *optval, | ||
521 | int optlen); | ||
522 | int (*compat_getsockopt) (struct sock *sk, | ||
523 | int level, | ||
524 | int optname, | ||
525 | char __user *optval, | ||
526 | int __user *optlen); | ||
517 | struct dst_entry *(*get_dst) (struct sctp_association *asoc, | 527 | struct dst_entry *(*get_dst) (struct sctp_association *asoc, |
518 | union sctp_addr *daddr, | 528 | union sctp_addr *daddr, |
519 | union sctp_addr *saddr); | 529 | union sctp_addr *saddr); |
diff --git a/include/net/sock.h b/include/net/sock.h index f63d0d56712c..ec226f31dc2a 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -520,6 +520,14 @@ struct proto { | |||
520 | int (*getsockopt)(struct sock *sk, int level, | 520 | int (*getsockopt)(struct sock *sk, int level, |
521 | int optname, char __user *optval, | 521 | int optname, char __user *optval, |
522 | int __user *option); | 522 | int __user *option); |
523 | int (*compat_setsockopt)(struct sock *sk, | ||
524 | int level, | ||
525 | int optname, char __user *optval, | ||
526 | int optlen); | ||
527 | int (*compat_getsockopt)(struct sock *sk, | ||
528 | int level, | ||
529 | int optname, char __user *optval, | ||
530 | int __user *option); | ||
523 | int (*sendmsg)(struct kiocb *iocb, struct sock *sk, | 531 | int (*sendmsg)(struct kiocb *iocb, struct sock *sk, |
524 | struct msghdr *msg, size_t len); | 532 | struct msghdr *msg, size_t len); |
525 | int (*recvmsg)(struct kiocb *iocb, struct sock *sk, | 533 | int (*recvmsg)(struct kiocb *iocb, struct sock *sk, |
@@ -816,6 +824,10 @@ extern int sock_common_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
816 | struct msghdr *msg, size_t size, int flags); | 824 | struct msghdr *msg, size_t size, int flags); |
817 | extern int sock_common_setsockopt(struct socket *sock, int level, int optname, | 825 | extern int sock_common_setsockopt(struct socket *sock, int level, int optname, |
818 | char __user *optval, int optlen); | 826 | char __user *optval, int optlen); |
827 | extern int compat_sock_common_getsockopt(struct socket *sock, int level, | ||
828 | int optname, char __user *optval, int __user *optlen); | ||
829 | extern int compat_sock_common_setsockopt(struct socket *sock, int level, | ||
830 | int optname, char __user *optval, int optlen); | ||
819 | 831 | ||
820 | extern void sk_common_release(struct sock *sk); | 832 | extern void sk_common_release(struct sock *sk); |
821 | 833 | ||
diff --git a/include/net/tcp.h b/include/net/tcp.h index 77f21c65bbca..9418f4d1afbb 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -60,6 +60,9 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo); | |||
60 | /* Minimal RCV_MSS. */ | 60 | /* Minimal RCV_MSS. */ |
61 | #define TCP_MIN_RCVMSS 536U | 61 | #define TCP_MIN_RCVMSS 536U |
62 | 62 | ||
63 | /* The least MTU to use for probing */ | ||
64 | #define TCP_BASE_MSS 512 | ||
65 | |||
63 | /* After receiving this amount of duplicate ACKs fast retransmit starts. */ | 66 | /* After receiving this amount of duplicate ACKs fast retransmit starts. */ |
64 | #define TCP_FASTRETRANS_THRESH 3 | 67 | #define TCP_FASTRETRANS_THRESH 3 |
65 | 68 | ||
@@ -219,6 +222,9 @@ extern int sysctl_tcp_nometrics_save; | |||
219 | extern int sysctl_tcp_moderate_rcvbuf; | 222 | extern int sysctl_tcp_moderate_rcvbuf; |
220 | extern int sysctl_tcp_tso_win_divisor; | 223 | extern int sysctl_tcp_tso_win_divisor; |
221 | extern int sysctl_tcp_abc; | 224 | extern int sysctl_tcp_abc; |
225 | extern int sysctl_tcp_mtu_probing; | ||
226 | extern int sysctl_tcp_base_mss; | ||
227 | extern int sysctl_tcp_workaround_signed_windows; | ||
222 | 228 | ||
223 | extern atomic_t tcp_memory_allocated; | 229 | extern atomic_t tcp_memory_allocated; |
224 | extern atomic_t tcp_sockets_allocated; | 230 | extern atomic_t tcp_sockets_allocated; |
@@ -347,6 +353,12 @@ extern int tcp_getsockopt(struct sock *sk, int level, | |||
347 | extern int tcp_setsockopt(struct sock *sk, int level, | 353 | extern int tcp_setsockopt(struct sock *sk, int level, |
348 | int optname, char __user *optval, | 354 | int optname, char __user *optval, |
349 | int optlen); | 355 | int optlen); |
356 | extern int compat_tcp_getsockopt(struct sock *sk, | ||
357 | int level, int optname, | ||
358 | char __user *optval, int __user *optlen); | ||
359 | extern int compat_tcp_setsockopt(struct sock *sk, | ||
360 | int level, int optname, | ||
361 | char __user *optval, int optlen); | ||
350 | extern void tcp_set_keepalive(struct sock *sk, int val); | 362 | extern void tcp_set_keepalive(struct sock *sk, int val); |
351 | extern int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, | 363 | extern int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, |
352 | struct msghdr *msg, | 364 | struct msghdr *msg, |
@@ -447,6 +459,10 @@ extern int tcp_read_sock(struct sock *sk, read_descriptor_t *desc, | |||
447 | 459 | ||
448 | extern void tcp_initialize_rcv_mss(struct sock *sk); | 460 | extern void tcp_initialize_rcv_mss(struct sock *sk); |
449 | 461 | ||
462 | extern int tcp_mtu_to_mss(struct sock *sk, int pmtu); | ||
463 | extern int tcp_mss_to_mtu(struct sock *sk, int mss); | ||
464 | extern void tcp_mtup_init(struct sock *sk); | ||
465 | |||
450 | static inline void __tcp_fast_path_on(struct tcp_sock *tp, u32 snd_wnd) | 466 | static inline void __tcp_fast_path_on(struct tcp_sock *tp, u32 snd_wnd) |
451 | { | 467 | { |
452 | tp->pred_flags = htonl((tp->tcp_header_len << 26) | | 468 | tp->pred_flags = htonl((tp->tcp_header_len << 26) | |
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 8d362c49b8a9..61b7504fc2ba 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/crypto.h> | 11 | #include <linux/crypto.h> |
12 | #include <linux/pfkeyv2.h> | 12 | #include <linux/pfkeyv2.h> |
13 | #include <linux/in6.h> | 13 | #include <linux/in6.h> |
14 | #include <linux/mutex.h> | ||
14 | 15 | ||
15 | #include <net/sock.h> | 16 | #include <net/sock.h> |
16 | #include <net/dst.h> | 17 | #include <net/dst.h> |
@@ -20,7 +21,11 @@ | |||
20 | 21 | ||
21 | #define XFRM_ALIGN8(len) (((len) + 7) & ~7) | 22 | #define XFRM_ALIGN8(len) (((len) + 7) & ~7) |
22 | 23 | ||
23 | extern struct semaphore xfrm_cfg_sem; | 24 | extern struct sock *xfrm_nl; |
25 | extern u32 sysctl_xfrm_aevent_etime; | ||
26 | extern u32 sysctl_xfrm_aevent_rseqth; | ||
27 | |||
28 | extern struct mutex xfrm_cfg_mutex; | ||
24 | 29 | ||
25 | /* Organization of SPD aka "XFRM rules" | 30 | /* Organization of SPD aka "XFRM rules" |
26 | ------------------------------------ | 31 | ------------------------------------ |
@@ -135,6 +140,16 @@ struct xfrm_state | |||
135 | /* State for replay detection */ | 140 | /* State for replay detection */ |
136 | struct xfrm_replay_state replay; | 141 | struct xfrm_replay_state replay; |
137 | 142 | ||
143 | /* Replay detection state at the time we sent the last notification */ | ||
144 | struct xfrm_replay_state preplay; | ||
145 | |||
146 | /* Replay detection notification settings */ | ||
147 | u32 replay_maxage; | ||
148 | u32 replay_maxdiff; | ||
149 | |||
150 | /* Replay detection notification timer */ | ||
151 | struct timer_list rtimer; | ||
152 | |||
138 | /* Statistics */ | 153 | /* Statistics */ |
139 | struct xfrm_stats stats; | 154 | struct xfrm_stats stats; |
140 | 155 | ||
@@ -169,6 +184,7 @@ struct km_event | |||
169 | u32 hard; | 184 | u32 hard; |
170 | u32 proto; | 185 | u32 proto; |
171 | u32 byid; | 186 | u32 byid; |
187 | u32 aevent; | ||
172 | } data; | 188 | } data; |
173 | 189 | ||
174 | u32 seq; | 190 | u32 seq; |
@@ -199,10 +215,13 @@ extern int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo); | |||
199 | extern int xfrm_policy_unregister_afinfo(struct xfrm_policy_afinfo *afinfo); | 215 | extern int xfrm_policy_unregister_afinfo(struct xfrm_policy_afinfo *afinfo); |
200 | extern void km_policy_notify(struct xfrm_policy *xp, int dir, struct km_event *c); | 216 | extern void km_policy_notify(struct xfrm_policy *xp, int dir, struct km_event *c); |
201 | extern void km_state_notify(struct xfrm_state *x, struct km_event *c); | 217 | extern void km_state_notify(struct xfrm_state *x, struct km_event *c); |
202 | |||
203 | #define XFRM_ACQ_EXPIRES 30 | 218 | #define XFRM_ACQ_EXPIRES 30 |
204 | 219 | ||
205 | struct xfrm_tmpl; | 220 | struct xfrm_tmpl; |
221 | extern int km_query(struct xfrm_state *x, struct xfrm_tmpl *t, struct xfrm_policy *pol); | ||
222 | extern void km_state_expired(struct xfrm_state *x, int hard, u32 pid); | ||
223 | extern int __xfrm_state_delete(struct xfrm_state *x); | ||
224 | |||
206 | struct xfrm_state_afinfo { | 225 | struct xfrm_state_afinfo { |
207 | unsigned short family; | 226 | unsigned short family; |
208 | rwlock_t lock; | 227 | rwlock_t lock; |
@@ -305,7 +324,21 @@ struct xfrm_policy | |||
305 | struct xfrm_tmpl xfrm_vec[XFRM_MAX_DEPTH]; | 324 | struct xfrm_tmpl xfrm_vec[XFRM_MAX_DEPTH]; |
306 | }; | 325 | }; |
307 | 326 | ||
308 | #define XFRM_KM_TIMEOUT 30 | 327 | #define XFRM_KM_TIMEOUT 30 |
328 | /* which seqno */ | ||
329 | #define XFRM_REPLAY_SEQ 1 | ||
330 | #define XFRM_REPLAY_OSEQ 2 | ||
331 | #define XFRM_REPLAY_SEQ_MASK 3 | ||
332 | /* what happened */ | ||
333 | #define XFRM_REPLAY_UPDATE XFRM_AE_CR | ||
334 | #define XFRM_REPLAY_TIMEOUT XFRM_AE_CE | ||
335 | |||
336 | /* default aevent timeout in units of 100ms */ | ||
337 | #define XFRM_AE_ETIME 10 | ||
338 | /* Async Event timer multiplier */ | ||
339 | #define XFRM_AE_ETH_M 10 | ||
340 | /* default seq threshold size */ | ||
341 | #define XFRM_AE_SEQT_SIZE 2 | ||
309 | 342 | ||
310 | struct xfrm_mgr | 343 | struct xfrm_mgr |
311 | { | 344 | { |
@@ -865,6 +898,7 @@ extern int xfrm_state_delete(struct xfrm_state *x); | |||
865 | extern void xfrm_state_flush(u8 proto); | 898 | extern void xfrm_state_flush(u8 proto); |
866 | extern int xfrm_replay_check(struct xfrm_state *x, u32 seq); | 899 | extern int xfrm_replay_check(struct xfrm_state *x, u32 seq); |
867 | extern void xfrm_replay_advance(struct xfrm_state *x, u32 seq); | 900 | extern void xfrm_replay_advance(struct xfrm_state *x, u32 seq); |
901 | extern void xfrm_replay_notify(struct xfrm_state *x, int event); | ||
868 | extern int xfrm_state_check(struct xfrm_state *x, struct sk_buff *skb); | 902 | extern int xfrm_state_check(struct xfrm_state *x, struct sk_buff *skb); |
869 | extern int xfrm_state_mtu(struct xfrm_state *x, int mtu); | 903 | extern int xfrm_state_mtu(struct xfrm_state *x, int mtu); |
870 | extern int xfrm_init_state(struct xfrm_state *x); | 904 | extern int xfrm_init_state(struct xfrm_state *x); |
@@ -924,7 +958,7 @@ extern void xfrm_init_pmtu(struct dst_entry *dst); | |||
924 | 958 | ||
925 | extern wait_queue_head_t km_waitq; | 959 | extern wait_queue_head_t km_waitq; |
926 | extern int km_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, u16 sport); | 960 | extern int km_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, u16 sport); |
927 | extern void km_policy_expired(struct xfrm_policy *pol, int dir, int hard); | 961 | extern void km_policy_expired(struct xfrm_policy *pol, int dir, int hard, u32 pid); |
928 | 962 | ||
929 | extern void xfrm_input_init(void); | 963 | extern void xfrm_input_init(void); |
930 | extern int xfrm_parse_spi(struct sk_buff *skb, u8 nexthdr, u32 *spi, u32 *seq); | 964 | extern int xfrm_parse_spi(struct sk_buff *skb, u8 nexthdr, u32 *spi, u32 *seq); |
@@ -965,4 +999,24 @@ static inline int xfrm_policy_id2dir(u32 index) | |||
965 | return index & 7; | 999 | return index & 7; |
966 | } | 1000 | } |
967 | 1001 | ||
1002 | static inline int xfrm_aevent_is_on(void) | ||
1003 | { | ||
1004 | struct sock *nlsk; | ||
1005 | int ret = 0; | ||
1006 | |||
1007 | rcu_read_lock(); | ||
1008 | nlsk = rcu_dereference(xfrm_nl); | ||
1009 | if (nlsk) | ||
1010 | ret = netlink_has_listeners(nlsk, XFRMNLGRP_AEVENTS); | ||
1011 | rcu_read_unlock(); | ||
1012 | return ret; | ||
1013 | } | ||
1014 | |||
1015 | static inline void xfrm_aevent_doreplay(struct xfrm_state *x) | ||
1016 | { | ||
1017 | if (xfrm_aevent_is_on()) | ||
1018 | xfrm_replay_notify(x, XFRM_REPLAY_UPDATE); | ||
1019 | } | ||
1020 | |||
1021 | |||
968 | #endif /* _NET_XFRM_H */ | 1022 | #endif /* _NET_XFRM_H */ |