aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
Diffstat (limited to 'include/net')
-rw-r--r--include/net/9p/9p.h417
-rw-r--r--include/net/9p/client.h80
-rw-r--r--include/net/9p/conn.h57
-rw-r--r--include/net/9p/transport.h49
-rw-r--r--include/net/act_api.h32
-rw-r--r--include/net/addrconf.h2
-rw-r--r--include/net/af_unix.h11
-rw-r--r--include/net/ax88796.h27
-rw-r--r--include/net/bluetooth/hci.h18
-rw-r--r--include/net/bluetooth/hci_core.h5
-rw-r--r--include/net/bluetooth/rfcomm.h1
-rw-r--r--include/net/cfg80211.h38
-rw-r--r--include/net/cipso_ipv4.h20
-rw-r--r--include/net/dn.h1
-rw-r--r--include/net/dst.h1
-rw-r--r--include/net/fib_rules.h2
-rw-r--r--include/net/flow.h4
-rw-r--r--include/net/genetlink.h24
-rw-r--r--include/net/inet_timewait_sock.h3
-rw-r--r--include/net/ip.h1
-rw-r--r--include/net/ip_fib.h18
-rw-r--r--include/net/ip_mp_alg.h96
-rw-r--r--include/net/ipv6.h4
-rw-r--r--include/net/irda/irda.h3
-rw-r--r--include/net/irda/irlap.h19
-rw-r--r--include/net/iucv/af_iucv.h1
-rw-r--r--include/net/mac80211.h22
-rw-r--r--include/net/mip6.h4
-rw-r--r--include/net/netfilter/ipv4/nf_conntrack_ipv4.h25
-rw-r--r--include/net/netfilter/ipv6/nf_conntrack_ipv6.h2
-rw-r--r--include/net/netfilter/nf_conntrack.h70
-rw-r--r--include/net/netfilter/nf_conntrack_core.h11
-rw-r--r--include/net/netfilter/nf_conntrack_ecache.h17
-rw-r--r--include/net/netfilter/nf_conntrack_expect.h42
-rw-r--r--include/net/netfilter/nf_conntrack_extend.h85
-rw-r--r--include/net/netfilter/nf_conntrack_helper.h16
-rw-r--r--include/net/netfilter/nf_conntrack_l3proto.h10
-rw-r--r--include/net/netfilter/nf_conntrack_tuple.h78
-rw-r--r--include/net/netfilter/nf_nat.h28
-rw-r--r--include/net/netfilter/nf_nat_core.h1
-rw-r--r--include/net/netlabel.h72
-rw-r--r--include/net/netlink.h96
-rw-r--r--include/net/pkt_cls.h10
-rw-r--r--include/net/pkt_sched.h4
-rw-r--r--include/net/rawv6.h9
-rw-r--r--include/net/route.h3
-rw-r--r--include/net/rtnetlink.h58
-rw-r--r--include/net/sch_generic.h2
-rw-r--r--include/net/scm.h2
-rw-r--r--include/net/sctp/sctp.h7
-rw-r--r--include/net/sctp/structs.h7
-rw-r--r--include/net/tcp.h6
-rw-r--r--include/net/tipc/tipc_port.h6
-rw-r--r--include/net/udp.h9
-rw-r--r--include/net/udplite.h2
-rw-r--r--include/net/xfrm.h28
56 files changed, 1224 insertions, 442 deletions
diff --git a/include/net/9p/9p.h b/include/net/9p/9p.h
new file mode 100644
index 000000000000..88884d39f28f
--- /dev/null
+++ b/include/net/9p/9p.h
@@ -0,0 +1,417 @@
1/*
2 * include/net/9p/9p.h
3 *
4 * 9P protocol definitions.
5 *
6 * Copyright (C) 2005 by Latchesar Ionkov <lucho@ionkov.net>
7 * Copyright (C) 2004 by Eric Van Hensbergen <ericvh@gmail.com>
8 * Copyright (C) 2002 by Ron Minnich <rminnich@lanl.gov>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2
12 * as published by the Free Software Foundation.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to:
21 * Free Software Foundation
22 * 51 Franklin Street, Fifth Floor
23 * Boston, MA 02111-1301 USA
24 *
25 */
26
27#ifndef NET_9P_H
28#define NET_9P_H
29
30#ifdef CONFIG_NET_9P_DEBUG
31
32#define P9_DEBUG_ERROR (1<<0)
33#define P9_DEBUG_9P (1<<2)
34#define P9_DEBUG_VFS (1<<3)
35#define P9_DEBUG_CONV (1<<4)
36#define P9_DEBUG_MUX (1<<5)
37#define P9_DEBUG_TRANS (1<<6)
38#define P9_DEBUG_SLABS (1<<7)
39#define P9_DEBUG_FCALL (1<<8)
40
41extern unsigned int p9_debug_level;
42
43#define P9_DPRINTK(level, format, arg...) \
44do { \
45 if ((p9_debug_level & level) == level) \
46 printk(KERN_NOTICE "-- %s (%d): " \
47 format , __FUNCTION__, current->pid , ## arg); \
48} while (0)
49
50#define PRINT_FCALL_ERROR(s, fcall) P9_DPRINTK(P9_DEBUG_ERROR, \
51 "%s: %.*s\n", s, fcall?fcall->params.rerror.error.len:0, \
52 fcall?fcall->params.rerror.error.str:"");
53
54#else
55#define P9_DPRINTK(level, format, arg...) do { } while (0)
56#define PRINT_FCALL_ERROR(s, fcall) do { } while (0)
57#endif
58
59#define P9_EPRINTK(level, format, arg...) \
60do { \
61 printk(level "9p: %s (%d): " \
62 format , __FUNCTION__, current->pid , ## arg); \
63} while (0)
64
65
66/* Message Types */
67enum {
68 P9_TVERSION = 100,
69 P9_RVERSION,
70 P9_TAUTH = 102,
71 P9_RAUTH,
72 P9_TATTACH = 104,
73 P9_RATTACH,
74 P9_TERROR = 106,
75 P9_RERROR,
76 P9_TFLUSH = 108,
77 P9_RFLUSH,
78 P9_TWALK = 110,
79 P9_RWALK,
80 P9_TOPEN = 112,
81 P9_ROPEN,
82 P9_TCREATE = 114,
83 P9_RCREATE,
84 P9_TREAD = 116,
85 P9_RREAD,
86 P9_TWRITE = 118,
87 P9_RWRITE,
88 P9_TCLUNK = 120,
89 P9_RCLUNK,
90 P9_TREMOVE = 122,
91 P9_RREMOVE,
92 P9_TSTAT = 124,
93 P9_RSTAT,
94 P9_TWSTAT = 126,
95 P9_RWSTAT,
96};
97
98/* open modes */
99enum {
100 P9_OREAD = 0x00,
101 P9_OWRITE = 0x01,
102 P9_ORDWR = 0x02,
103 P9_OEXEC = 0x03,
104 P9_OEXCL = 0x04,
105 P9_OTRUNC = 0x10,
106 P9_OREXEC = 0x20,
107 P9_ORCLOSE = 0x40,
108 P9_OAPPEND = 0x80,
109};
110
111/* permissions */
112enum {
113 P9_DMDIR = 0x80000000,
114 P9_DMAPPEND = 0x40000000,
115 P9_DMEXCL = 0x20000000,
116 P9_DMMOUNT = 0x10000000,
117 P9_DMAUTH = 0x08000000,
118 P9_DMTMP = 0x04000000,
119 P9_DMSYMLINK = 0x02000000,
120 P9_DMLINK = 0x01000000,
121 /* 9P2000.u extensions */
122 P9_DMDEVICE = 0x00800000,
123 P9_DMNAMEDPIPE = 0x00200000,
124 P9_DMSOCKET = 0x00100000,
125 P9_DMSETUID = 0x00080000,
126 P9_DMSETGID = 0x00040000,
127};
128
129/* qid.types */
130enum {
131 P9_QTDIR = 0x80,
132 P9_QTAPPEND = 0x40,
133 P9_QTEXCL = 0x20,
134 P9_QTMOUNT = 0x10,
135 P9_QTAUTH = 0x08,
136 P9_QTTMP = 0x04,
137 P9_QTSYMLINK = 0x02,
138 P9_QTLINK = 0x01,
139 P9_QTFILE = 0x00,
140};
141
142#define P9_NOTAG (u16)(~0)
143#define P9_NOFID (u32)(~0)
144#define P9_MAXWELEM 16
145
146/* ample room for Twrite/Rread header */
147#define P9_IOHDRSZ 24
148
149struct p9_str {
150 u16 len;
151 char *str;
152};
153
154/* qids are the unique ID for a file (like an inode */
155struct p9_qid {
156 u8 type;
157 u32 version;
158 u64 path;
159};
160
161/* Plan 9 file metadata (stat) structure */
162struct p9_stat {
163 u16 size;
164 u16 type;
165 u32 dev;
166 struct p9_qid qid;
167 u32 mode;
168 u32 atime;
169 u32 mtime;
170 u64 length;
171 struct p9_str name;
172 struct p9_str uid;
173 struct p9_str gid;
174 struct p9_str muid;
175 struct p9_str extension; /* 9p2000.u extensions */
176 u32 n_uid; /* 9p2000.u extensions */
177 u32 n_gid; /* 9p2000.u extensions */
178 u32 n_muid; /* 9p2000.u extensions */
179};
180
181/* file metadata (stat) structure used to create Twstat message
182 The is similar to p9_stat, but the strings don't point to
183 the same memory block and should be freed separately
184*/
185struct p9_wstat {
186 u16 size;
187 u16 type;
188 u32 dev;
189 struct p9_qid qid;
190 u32 mode;
191 u32 atime;
192 u32 mtime;
193 u64 length;
194 char *name;
195 char *uid;
196 char *gid;
197 char *muid;
198 char *extension; /* 9p2000.u extensions */
199 u32 n_uid; /* 9p2000.u extensions */
200 u32 n_gid; /* 9p2000.u extensions */
201 u32 n_muid; /* 9p2000.u extensions */
202};
203
204/* Structures for Protocol Operations */
205struct p9_tversion {
206 u32 msize;
207 struct p9_str version;
208};
209
210struct p9_rversion {
211 u32 msize;
212 struct p9_str version;
213};
214
215struct p9_tauth {
216 u32 afid;
217 struct p9_str uname;
218 struct p9_str aname;
219};
220
221struct p9_rauth {
222 struct p9_qid qid;
223};
224
225struct p9_rerror {
226 struct p9_str error;
227 u32 errno; /* 9p2000.u extension */
228};
229
230struct p9_tflush {
231 u16 oldtag;
232};
233
234struct p9_rflush {
235};
236
237struct p9_tattach {
238 u32 fid;
239 u32 afid;
240 struct p9_str uname;
241 struct p9_str aname;
242};
243
244struct p9_rattach {
245 struct p9_qid qid;
246};
247
248struct p9_twalk {
249 u32 fid;
250 u32 newfid;
251 u16 nwname;
252 struct p9_str wnames[16];
253};
254
255struct p9_rwalk {
256 u16 nwqid;
257 struct p9_qid wqids[16];
258};
259
260struct p9_topen {
261 u32 fid;
262 u8 mode;
263};
264
265struct p9_ropen {
266 struct p9_qid qid;
267 u32 iounit;
268};
269
270struct p9_tcreate {
271 u32 fid;
272 struct p9_str name;
273 u32 perm;
274 u8 mode;
275 struct p9_str extension;
276};
277
278struct p9_rcreate {
279 struct p9_qid qid;
280 u32 iounit;
281};
282
283struct p9_tread {
284 u32 fid;
285 u64 offset;
286 u32 count;
287};
288
289struct p9_rread {
290 u32 count;
291 u8 *data;
292};
293
294struct p9_twrite {
295 u32 fid;
296 u64 offset;
297 u32 count;
298 u8 *data;
299};
300
301struct p9_rwrite {
302 u32 count;
303};
304
305struct p9_tclunk {
306 u32 fid;
307};
308
309struct p9_rclunk {
310};
311
312struct p9_tremove {
313 u32 fid;
314};
315
316struct p9_rremove {
317};
318
319struct p9_tstat {
320 u32 fid;
321};
322
323struct p9_rstat {
324 struct p9_stat stat;
325};
326
327struct p9_twstat {
328 u32 fid;
329 struct p9_stat stat;
330};
331
332struct p9_rwstat {
333};
334
335/*
336 * fcall is the primary packet structure
337 *
338 */
339
340struct p9_fcall {
341 u32 size;
342 u8 id;
343 u16 tag;
344 void *sdata;
345
346 union {
347 struct p9_tversion tversion;
348 struct p9_rversion rversion;
349 struct p9_tauth tauth;
350 struct p9_rauth rauth;
351 struct p9_rerror rerror;
352 struct p9_tflush tflush;
353 struct p9_rflush rflush;
354 struct p9_tattach tattach;
355 struct p9_rattach rattach;
356 struct p9_twalk twalk;
357 struct p9_rwalk rwalk;
358 struct p9_topen topen;
359 struct p9_ropen ropen;
360 struct p9_tcreate tcreate;
361 struct p9_rcreate rcreate;
362 struct p9_tread tread;
363 struct p9_rread rread;
364 struct p9_twrite twrite;
365 struct p9_rwrite rwrite;
366 struct p9_tclunk tclunk;
367 struct p9_rclunk rclunk;
368 struct p9_tremove tremove;
369 struct p9_rremove rremove;
370 struct p9_tstat tstat;
371 struct p9_rstat rstat;
372 struct p9_twstat twstat;
373 struct p9_rwstat rwstat;
374 } params;
375};
376
377struct p9_idpool;
378
379int p9_deserialize_stat(void *buf, u32 buflen, struct p9_stat *stat,
380 int dotu);
381int p9_deserialize_fcall(void *buf, u32 buflen, struct p9_fcall *fc, int dotu);
382void p9_set_tag(struct p9_fcall *fc, u16 tag);
383struct p9_fcall *p9_create_tversion(u32 msize, char *version);
384struct p9_fcall *p9_create_tattach(u32 fid, u32 afid, char *uname,
385 char *aname);
386struct p9_fcall *p9_create_tauth(u32 afid, char *uname, char *aname);
387struct p9_fcall *p9_create_tflush(u16 oldtag);
388struct p9_fcall *p9_create_twalk(u32 fid, u32 newfid, u16 nwname,
389 char **wnames);
390struct p9_fcall *p9_create_topen(u32 fid, u8 mode);
391struct p9_fcall *p9_create_tcreate(u32 fid, char *name, u32 perm, u8 mode,
392 char *extension, int dotu);
393struct p9_fcall *p9_create_tread(u32 fid, u64 offset, u32 count);
394struct p9_fcall *p9_create_twrite(u32 fid, u64 offset, u32 count,
395 const char *data);
396struct p9_fcall *p9_create_twrite_u(u32 fid, u64 offset, u32 count,
397 const char __user *data);
398struct p9_fcall *p9_create_tclunk(u32 fid);
399struct p9_fcall *p9_create_tremove(u32 fid);
400struct p9_fcall *p9_create_tstat(u32 fid);
401struct p9_fcall *p9_create_twstat(u32 fid, struct p9_wstat *wstat,
402 int dotu);
403
404int p9_printfcall(char *buf, int buflen, struct p9_fcall *fc, int dotu);
405int p9_errstr2errno(char *errstr, int len);
406
407struct p9_idpool *p9_idpool_create(void);
408void p9_idpool_destroy(struct p9_idpool *);
409int p9_idpool_get(struct p9_idpool *p);
410void p9_idpool_put(int id, struct p9_idpool *p);
411int p9_idpool_check(int id, struct p9_idpool *p);
412
413int p9_error_init(void);
414int p9_errstr2errno(char *, int);
415int __init p9_sysctl_register(void);
416void __exit p9_sysctl_unregister(void);
417#endif /* NET_9P_H */
diff --git a/include/net/9p/client.h b/include/net/9p/client.h
new file mode 100644
index 000000000000..d65ed7c69063
--- /dev/null
+++ b/include/net/9p/client.h
@@ -0,0 +1,80 @@
1/*
2 * include/net/9p/client.h
3 *
4 * 9P Client Definitions
5 *
6 * Copyright (C) 2007 by Latchesar Ionkov <lucho@ionkov.net>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2
10 * as published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to:
19 * Free Software Foundation
20 * 51 Franklin Street, Fifth Floor
21 * Boston, MA 02111-1301 USA
22 *
23 */
24
25#ifndef NET_9P_CLIENT_H
26#define NET_9P_CLIENT_H
27
28struct p9_client {
29 spinlock_t lock; /* protect client structure */
30 int msize;
31 unsigned char dotu;
32 struct p9_transport *trans;
33 struct p9_conn *conn;
34
35 struct p9_idpool *fidpool;
36 struct list_head fidlist;
37};
38
39struct p9_fid {
40 struct p9_client *clnt;
41 u32 fid;
42 int mode;
43 struct p9_qid qid;
44 u32 iounit;
45 uid_t uid;
46 void *aux;
47
48 int rdir_fpos;
49 int rdir_pos;
50 struct p9_fcall *rdir_fcall;
51 struct list_head flist;
52 struct list_head dlist; /* list of all fids attached to a dentry */
53};
54
55struct p9_client *p9_client_create(struct p9_transport *trans, int msize,
56 int dotu);
57void p9_client_destroy(struct p9_client *clnt);
58void p9_client_disconnect(struct p9_client *clnt);
59struct p9_fid *p9_client_attach(struct p9_client *clnt, struct p9_fid *afid,
60 char *uname, char *aname);
61struct p9_fid *p9_client_auth(struct p9_client *clnt, char *uname, char *aname);
62struct p9_fid *p9_client_walk(struct p9_fid *oldfid, int nwname, char **wnames,
63 int clone);
64int p9_client_open(struct p9_fid *fid, int mode);
65int p9_client_fcreate(struct p9_fid *fid, char *name, u32 perm, int mode,
66 char *extension);
67int p9_client_clunk(struct p9_fid *fid);
68int p9_client_remove(struct p9_fid *fid);
69int p9_client_read(struct p9_fid *fid, char *data, u64 offset, u32 count);
70int p9_client_readn(struct p9_fid *fid, char *data, u64 offset, u32 count);
71int p9_client_write(struct p9_fid *fid, char *data, u64 offset, u32 count);
72int p9_client_uread(struct p9_fid *fid, char __user *data, u64 offset,
73 u32 count);
74int p9_client_uwrite(struct p9_fid *fid, const char __user *data, u64 offset,
75 u32 count);
76struct p9_stat *p9_client_stat(struct p9_fid *fid);
77int p9_client_wstat(struct p9_fid *fid, struct p9_wstat *wst);
78struct p9_stat *p9_client_dirread(struct p9_fid *fid, u64 offset);
79
80#endif /* NET_9P_CLIENT_H */
diff --git a/include/net/9p/conn.h b/include/net/9p/conn.h
new file mode 100644
index 000000000000..583b6a2cb3df
--- /dev/null
+++ b/include/net/9p/conn.h
@@ -0,0 +1,57 @@
1/*
2 * include/net/9p/conn.h
3 *
4 * Connection Definitions
5 *
6 * Copyright (C) 2005 by Latchesar Ionkov <lucho@ionkov.net>
7 * Copyright (C) 2004 by Eric Van Hensbergen <ericvh@gmail.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2
11 * as published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to:
20 * Free Software Foundation
21 * 51 Franklin Street, Fifth Floor
22 * Boston, MA 02111-1301 USA
23 *
24 */
25
26#ifndef NET_9P_CONN_H
27#define NET_9P_CONN_H
28
29#undef P9_NONBLOCK
30
31struct p9_conn;
32struct p9_req;
33
34/**
35 * p9_mux_req_callback - callback function that is called when the
36 * response of a request is received. The callback is called from
37 * a workqueue and shouldn't block.
38 *
39 * @req - request
40 * @a - the pointer that was specified when the request was send to be
41 * passed to the callback
42 */
43typedef void (*p9_conn_req_callback)(struct p9_req *req, void *a);
44
45struct p9_conn *p9_conn_create(struct p9_transport *trans, int msize,
46 unsigned char *dotu);
47void p9_conn_destroy(struct p9_conn *);
48int p9_conn_rpc(struct p9_conn *m, struct p9_fcall *tc, struct p9_fcall **rc);
49
50#ifdef P9_NONBLOCK
51int p9_conn_rpcnb(struct p9_conn *m, struct p9_fcall *tc,
52 p9_conn_req_callback cb, void *a);
53#endif /* P9_NONBLOCK */
54
55void p9_conn_cancel(struct p9_conn *m, int err);
56
57#endif /* NET_9P_CONN_H */
diff --git a/include/net/9p/transport.h b/include/net/9p/transport.h
new file mode 100644
index 000000000000..462d42279fb0
--- /dev/null
+++ b/include/net/9p/transport.h
@@ -0,0 +1,49 @@
1/*
2 * include/net/9p/transport.h
3 *
4 * Transport Definition
5 *
6 * Copyright (C) 2005 by Latchesar Ionkov <lucho@ionkov.net>
7 * Copyright (C) 2004 by Eric Van Hensbergen <ericvh@gmail.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2
11 * as published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to:
20 * Free Software Foundation
21 * 51 Franklin Street, Fifth Floor
22 * Boston, MA 02111-1301 USA
23 *
24 */
25
26#ifndef NET_9P_TRANSPORT_H
27#define NET_9P_TRANSPORT_H
28
29enum p9_transport_status {
30 Connected,
31 Disconnected,
32 Hung,
33};
34
35struct p9_transport {
36 enum p9_transport_status status;
37 void *priv;
38
39 int (*write) (struct p9_transport *, void *, int);
40 int (*read) (struct p9_transport *, void *, int);
41 void (*close) (struct p9_transport *);
42 unsigned int (*poll)(struct p9_transport *, struct poll_table_struct *);
43};
44
45struct p9_transport *p9_trans_create_tcp(const char *addr, int port);
46struct p9_transport *p9_trans_create_unix(const char *addr);
47struct p9_transport *p9_trans_create_fd(int rfd, int wfd);
48
49#endif /* NET_9P_TRANSPORT_H */
diff --git a/include/net/act_api.h b/include/net/act_api.h
index 8b06c2f3657f..68b4eaf7719d 100644
--- a/include/net/act_api.h
+++ b/include/net/act_api.h
@@ -19,7 +19,6 @@ struct tcf_common {
19 struct gnet_stats_basic tcfc_bstats; 19 struct gnet_stats_basic tcfc_bstats;
20 struct gnet_stats_queue tcfc_qstats; 20 struct gnet_stats_queue tcfc_qstats;
21 struct gnet_stats_rate_est tcfc_rate_est; 21 struct gnet_stats_rate_est tcfc_rate_est;
22 spinlock_t *tcfc_stats_lock;
23 spinlock_t tcfc_lock; 22 spinlock_t tcfc_lock;
24}; 23};
25#define tcf_next common.tcfc_next 24#define tcf_next common.tcfc_next
@@ -32,7 +31,6 @@ struct tcf_common {
32#define tcf_bstats common.tcfc_bstats 31#define tcf_bstats common.tcfc_bstats
33#define tcf_qstats common.tcfc_qstats 32#define tcf_qstats common.tcfc_qstats
34#define tcf_rate_est common.tcfc_rate_est 33#define tcf_rate_est common.tcfc_rate_est
35#define tcf_stats_lock common.tcfc_stats_lock
36#define tcf_lock common.tcfc_lock 34#define tcf_lock common.tcfc_lock
37 35
38struct tcf_police { 36struct tcf_police {
@@ -123,34 +121,4 @@ extern int tcf_action_dump_old(struct sk_buff *skb, struct tc_action *a, int, in
123extern int tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int, int); 121extern int tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int, int);
124extern int tcf_action_copy_stats (struct sk_buff *,struct tc_action *, int); 122extern int tcf_action_copy_stats (struct sk_buff *,struct tc_action *, int);
125#endif /* CONFIG_NET_CLS_ACT */ 123#endif /* CONFIG_NET_CLS_ACT */
126
127extern int tcf_police(struct sk_buff *skb, struct tcf_police *p);
128extern void tcf_police_destroy(struct tcf_police *p);
129extern struct tcf_police * tcf_police_locate(struct rtattr *rta, struct rtattr *est);
130extern int tcf_police_dump(struct sk_buff *skb, struct tcf_police *p);
131extern int tcf_police_dump_stats(struct sk_buff *skb, struct tcf_police *p);
132
133static inline int
134tcf_police_release(struct tcf_police *p, int bind)
135{
136 int ret = 0;
137#ifdef CONFIG_NET_CLS_ACT
138 if (p) {
139 if (bind)
140 p->tcf_bindcnt--;
141
142 p->tcf_refcnt--;
143 if (p->tcf_refcnt <= 0 && !p->tcf_bindcnt) {
144 tcf_police_destroy(p);
145 ret = 1;
146 }
147 }
148#else
149 if (p && --p->tcf_refcnt == 0)
150 tcf_police_destroy(p);
151
152#endif /* CONFIG_NET_CLS_ACT */
153 return ret;
154}
155
156#endif 124#endif
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index f3531d0bcd05..33b593e17441 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -61,7 +61,7 @@ extern int addrconf_set_dstaddr(void __user *arg);
61extern int ipv6_chk_addr(struct in6_addr *addr, 61extern int ipv6_chk_addr(struct in6_addr *addr,
62 struct net_device *dev, 62 struct net_device *dev,
63 int strict); 63 int strict);
64#ifdef CONFIG_IPV6_MIP6 64#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
65extern int ipv6_chk_home_addr(struct in6_addr *addr); 65extern int ipv6_chk_home_addr(struct in6_addr *addr);
66#endif 66#endif
67extern struct inet6_ifaddr * ipv6_get_ifaddr(struct in6_addr *addr, 67extern struct inet6_ifaddr * ipv6_get_ifaddr(struct in6_addr *addr,
diff --git a/include/net/af_unix.h b/include/net/af_unix.h
index c0398f5a8cb9..6de1e9e35c73 100644
--- a/include/net/af_unix.h
+++ b/include/net/af_unix.h
@@ -62,13 +62,11 @@ struct unix_skb_parms {
62#define UNIXCREDS(skb) (&UNIXCB((skb)).creds) 62#define UNIXCREDS(skb) (&UNIXCB((skb)).creds)
63#define UNIXSID(skb) (&UNIXCB((skb)).secid) 63#define UNIXSID(skb) (&UNIXCB((skb)).secid)
64 64
65#define unix_state_rlock(s) spin_lock(&unix_sk(s)->lock) 65#define unix_state_lock(s) spin_lock(&unix_sk(s)->lock)
66#define unix_state_runlock(s) spin_unlock(&unix_sk(s)->lock) 66#define unix_state_unlock(s) spin_unlock(&unix_sk(s)->lock)
67#define unix_state_wlock(s) spin_lock(&unix_sk(s)->lock) 67#define unix_state_lock_nested(s) \
68#define unix_state_wlock_nested(s) \
69 spin_lock_nested(&unix_sk(s)->lock, \ 68 spin_lock_nested(&unix_sk(s)->lock, \
70 SINGLE_DEPTH_NESTING) 69 SINGLE_DEPTH_NESTING)
71#define unix_state_wunlock(s) spin_unlock(&unix_sk(s)->lock)
72 70
73#ifdef __KERNEL__ 71#ifdef __KERNEL__
74/* The AF_UNIX socket */ 72/* The AF_UNIX socket */
@@ -81,9 +79,10 @@ struct unix_sock {
81 struct mutex readlock; 79 struct mutex readlock;
82 struct sock *peer; 80 struct sock *peer;
83 struct sock *other; 81 struct sock *other;
84 struct sock *gc_tree; 82 struct list_head link;
85 atomic_t inflight; 83 atomic_t inflight;
86 spinlock_t lock; 84 spinlock_t lock;
85 unsigned int gc_candidate : 1;
87 wait_queue_head_t peer_wait; 86 wait_queue_head_t peer_wait;
88}; 87};
89#define unix_sk(__sk) ((struct unix_sock *)__sk) 88#define unix_sk(__sk) ((struct unix_sock *)__sk)
diff --git a/include/net/ax88796.h b/include/net/ax88796.h
new file mode 100644
index 000000000000..ee786a043b3d
--- /dev/null
+++ b/include/net/ax88796.h
@@ -0,0 +1,27 @@
1/* include/net/ax88796.h
2 *
3 * Copyright 2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10*/
11
12#ifndef __NET_AX88796_PLAT_H
13#define __NET_AX88796_PLAT_H
14
15#define AXFLG_HAS_EEPROM (1<<0)
16#define AXFLG_MAC_FROMDEV (1<<1) /* device already has MAC */
17
18struct ax_plat_data {
19 unsigned int flags;
20 unsigned char wordlength; /* 1 or 2 */
21 unsigned char dcr_val; /* default value for DCR */
22 unsigned char rcr_val; /* default value for RCR */
23 unsigned char gpoc_val; /* default value for GPOC */
24 u32 *reg_offsets; /* register offsets */
25};
26
27#endif /* __NET_AX88796_PLAT_H */
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 93ce272a5d27..ebfb96b41106 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -107,14 +107,14 @@ enum {
107#define HCI_IDLE_TIMEOUT (6000) /* 6 seconds */ 107#define HCI_IDLE_TIMEOUT (6000) /* 6 seconds */
108#define HCI_INIT_TIMEOUT (10000) /* 10 seconds */ 108#define HCI_INIT_TIMEOUT (10000) /* 10 seconds */
109 109
110/* HCI Packet types */ 110/* HCI data types */
111#define HCI_COMMAND_PKT 0x01 111#define HCI_COMMAND_PKT 0x01
112#define HCI_ACLDATA_PKT 0x02 112#define HCI_ACLDATA_PKT 0x02
113#define HCI_SCODATA_PKT 0x03 113#define HCI_SCODATA_PKT 0x03
114#define HCI_EVENT_PKT 0x04 114#define HCI_EVENT_PKT 0x04
115#define HCI_VENDOR_PKT 0xff 115#define HCI_VENDOR_PKT 0xff
116 116
117/* HCI Packet types */ 117/* HCI packet types */
118#define HCI_DM1 0x0008 118#define HCI_DM1 0x0008
119#define HCI_DM3 0x0400 119#define HCI_DM3 0x0400
120#define HCI_DM5 0x4000 120#define HCI_DM5 0x4000
@@ -129,6 +129,14 @@ enum {
129#define SCO_PTYPE_MASK (HCI_HV1 | HCI_HV2 | HCI_HV3) 129#define SCO_PTYPE_MASK (HCI_HV1 | HCI_HV2 | HCI_HV3)
130#define ACL_PTYPE_MASK (~SCO_PTYPE_MASK) 130#define ACL_PTYPE_MASK (~SCO_PTYPE_MASK)
131 131
132/* eSCO packet types */
133#define ESCO_HV1 0x0001
134#define ESCO_HV2 0x0002
135#define ESCO_HV3 0x0004
136#define ESCO_EV3 0x0008
137#define ESCO_EV4 0x0010
138#define ESCO_EV5 0x0020
139
132/* ACL flags */ 140/* ACL flags */
133#define ACL_CONT 0x01 141#define ACL_CONT 0x01
134#define ACL_START 0x02 142#define ACL_START 0x02
@@ -138,6 +146,7 @@ enum {
138/* Baseband links */ 146/* Baseband links */
139#define SCO_LINK 0x00 147#define SCO_LINK 0x00
140#define ACL_LINK 0x01 148#define ACL_LINK 0x01
149#define ESCO_LINK 0x02
141 150
142/* LMP features */ 151/* LMP features */
143#define LMP_3SLOT 0x01 152#define LMP_3SLOT 0x01
@@ -162,6 +171,11 @@ enum {
162#define LMP_PSCHEME 0x02 171#define LMP_PSCHEME 0x02
163#define LMP_PCONTROL 0x04 172#define LMP_PCONTROL 0x04
164 173
174#define LMP_ESCO 0x80
175
176#define LMP_EV4 0x01
177#define LMP_EV5 0x02
178
165#define LMP_SNIFF_SUBR 0x02 179#define LMP_SNIFF_SUBR 0x02
166 180
167/* Connection modes */ 181/* Connection modes */
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index c0fc39620f36..8f67c8a7169b 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -78,6 +78,7 @@ struct hci_dev {
78 __u16 voice_setting; 78 __u16 voice_setting;
79 79
80 __u16 pkt_type; 80 __u16 pkt_type;
81 __u16 esco_type;
81 __u16 link_policy; 82 __u16 link_policy;
82 __u16 link_mode; 83 __u16 link_mode;
83 84
@@ -109,6 +110,7 @@ struct hci_dev {
109 struct sk_buff_head cmd_q; 110 struct sk_buff_head cmd_q;
110 111
111 struct sk_buff *sent_cmd; 112 struct sk_buff *sent_cmd;
113 struct sk_buff *reassembly[3];
112 114
113 struct semaphore req_lock; 115 struct semaphore req_lock;
114 wait_queue_head_t req_wait_q; 116 wait_queue_head_t req_wait_q;
@@ -437,6 +439,8 @@ static inline int hci_recv_frame(struct sk_buff *skb)
437 return 0; 439 return 0;
438} 440}
439 441
442int hci_recv_fragment(struct hci_dev *hdev, int type, void *data, int count);
443
440int hci_register_sysfs(struct hci_dev *hdev); 444int hci_register_sysfs(struct hci_dev *hdev);
441void hci_unregister_sysfs(struct hci_dev *hdev); 445void hci_unregister_sysfs(struct hci_dev *hdev);
442void hci_conn_add_sysfs(struct hci_conn *conn); 446void hci_conn_add_sysfs(struct hci_conn *conn);
@@ -449,6 +453,7 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
449#define lmp_encrypt_capable(dev) ((dev)->features[0] & LMP_ENCRYPT) 453#define lmp_encrypt_capable(dev) ((dev)->features[0] & LMP_ENCRYPT)
450#define lmp_sniff_capable(dev) ((dev)->features[0] & LMP_SNIFF) 454#define lmp_sniff_capable(dev) ((dev)->features[0] & LMP_SNIFF)
451#define lmp_sniffsubr_capable(dev) ((dev)->features[5] & LMP_SNIFF_SUBR) 455#define lmp_sniffsubr_capable(dev) ((dev)->features[5] & LMP_SNIFF_SUBR)
456#define lmp_esco_capable(dev) ((dev)->features[3] & LMP_ESCO)
452 457
453/* ----- HCI protocols ----- */ 458/* ----- HCI protocols ----- */
454struct hci_proto { 459struct hci_proto {
diff --git a/include/net/bluetooth/rfcomm.h b/include/net/bluetooth/rfcomm.h
index 3c563f02907c..25aa575db807 100644
--- a/include/net/bluetooth/rfcomm.h
+++ b/include/net/bluetooth/rfcomm.h
@@ -323,6 +323,7 @@ int rfcomm_connect_ind(struct rfcomm_session *s, u8 channel, struct rfcomm_dlc
323#define RFCOMM_RELEASE_ONHUP 1 323#define RFCOMM_RELEASE_ONHUP 1
324#define RFCOMM_HANGUP_NOW 2 324#define RFCOMM_HANGUP_NOW 2
325#define RFCOMM_TTY_ATTACHED 3 325#define RFCOMM_TTY_ATTACHED 3
326#define RFCOMM_TTY_RELEASED 4
326 327
327struct rfcomm_dev_req { 328struct rfcomm_dev_req {
328 s16 dev_id; 329 s16 dev_id;
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 88171f8ce58a..7edaef6b29d6 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -11,6 +11,44 @@
11 * Copyright 2006 Johannes Berg <johannes@sipsolutions.net> 11 * Copyright 2006 Johannes Berg <johannes@sipsolutions.net>
12 */ 12 */
13 13
14
15/* Radiotap header iteration
16 * implemented in net/wireless/radiotap.c
17 * docs in Documentation/networking/radiotap-headers.txt
18 */
19/**
20 * struct ieee80211_radiotap_iterator - tracks walk thru present radiotap args
21 * @rtheader: pointer to the radiotap header we are walking through
22 * @max_length: length of radiotap header in cpu byte ordering
23 * @this_arg_index: IEEE80211_RADIOTAP_... index of current arg
24 * @this_arg: pointer to current radiotap arg
25 * @arg_index: internal next argument index
26 * @arg: internal next argument pointer
27 * @next_bitmap: internal pointer to next present u32
28 * @bitmap_shifter: internal shifter for curr u32 bitmap, b0 set == arg present
29 */
30
31struct ieee80211_radiotap_iterator {
32 struct ieee80211_radiotap_header *rtheader;
33 int max_length;
34 int this_arg_index;
35 u8 *this_arg;
36
37 int arg_index;
38 u8 *arg;
39 __le32 *next_bitmap;
40 u32 bitmap_shifter;
41};
42
43extern int ieee80211_radiotap_iterator_init(
44 struct ieee80211_radiotap_iterator *iterator,
45 struct ieee80211_radiotap_header *radiotap_header,
46 int max_length);
47
48extern int ieee80211_radiotap_iterator_next(
49 struct ieee80211_radiotap_iterator *iterator);
50
51
14/* from net/wireless.h */ 52/* from net/wireless.h */
15struct wiphy; 53struct wiphy;
16 54
diff --git a/include/net/cipso_ipv4.h b/include/net/cipso_ipv4.h
index 4f90f5554fac..a6bb94530cfd 100644
--- a/include/net/cipso_ipv4.h
+++ b/include/net/cipso_ipv4.h
@@ -203,12 +203,10 @@ static inline int cipso_v4_cache_add(const struct sk_buff *skb,
203 203
204#ifdef CONFIG_NETLABEL 204#ifdef CONFIG_NETLABEL
205void cipso_v4_error(struct sk_buff *skb, int error, u32 gateway); 205void cipso_v4_error(struct sk_buff *skb, int error, u32 gateway);
206int cipso_v4_socket_setattr(const struct socket *sock, 206int cipso_v4_sock_setattr(struct sock *sk,
207 const struct cipso_v4_doi *doi_def, 207 const struct cipso_v4_doi *doi_def,
208 const struct netlbl_lsm_secattr *secattr); 208 const struct netlbl_lsm_secattr *secattr);
209int cipso_v4_sock_getattr(struct sock *sk, struct netlbl_lsm_secattr *secattr); 209int cipso_v4_sock_getattr(struct sock *sk, struct netlbl_lsm_secattr *secattr);
210int cipso_v4_socket_getattr(const struct socket *sock,
211 struct netlbl_lsm_secattr *secattr);
212int cipso_v4_skbuff_getattr(const struct sk_buff *skb, 210int cipso_v4_skbuff_getattr(const struct sk_buff *skb,
213 struct netlbl_lsm_secattr *secattr); 211 struct netlbl_lsm_secattr *secattr);
214int cipso_v4_validate(unsigned char **option); 212int cipso_v4_validate(unsigned char **option);
@@ -220,9 +218,9 @@ static inline void cipso_v4_error(struct sk_buff *skb,
220 return; 218 return;
221} 219}
222 220
223static inline int cipso_v4_socket_setattr(const struct socket *sock, 221static inline int cipso_v4_sock_setattr(struct sock *sk,
224 const struct cipso_v4_doi *doi_def, 222 const struct cipso_v4_doi *doi_def,
225 const struct netlbl_lsm_secattr *secattr) 223 const struct netlbl_lsm_secattr *secattr)
226{ 224{
227 return -ENOSYS; 225 return -ENOSYS;
228} 226}
@@ -233,12 +231,6 @@ static inline int cipso_v4_sock_getattr(struct sock *sk,
233 return -ENOSYS; 231 return -ENOSYS;
234} 232}
235 233
236static inline int cipso_v4_socket_getattr(const struct socket *sock,
237 struct netlbl_lsm_secattr *secattr)
238{
239 return -ENOSYS;
240}
241
242static inline int cipso_v4_skbuff_getattr(const struct sk_buff *skb, 234static inline int cipso_v4_skbuff_getattr(const struct sk_buff *skb,
243 struct netlbl_lsm_secattr *secattr) 235 struct netlbl_lsm_secattr *secattr)
244{ 236{
diff --git a/include/net/dn.h b/include/net/dn.h
index ac4ce9091747..627778384c84 100644
--- a/include/net/dn.h
+++ b/include/net/dn.h
@@ -3,7 +3,6 @@
3 3
4#include <linux/dn.h> 4#include <linux/dn.h>
5#include <net/sock.h> 5#include <net/sock.h>
6#include <net/tcp.h>
7#include <asm/byteorder.h> 6#include <asm/byteorder.h>
8 7
9#define dn_ntohs(x) le16_to_cpu(x) 8#define dn_ntohs(x) le16_to_cpu(x)
diff --git a/include/net/dst.h b/include/net/dst.h
index 82270f9332db..e9ff4a4caef9 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -47,7 +47,6 @@ struct dst_entry
47#define DST_NOXFRM 2 47#define DST_NOXFRM 2
48#define DST_NOPOLICY 4 48#define DST_NOPOLICY 4
49#define DST_NOHASH 8 49#define DST_NOHASH 8
50#define DST_BALANCED 0x10
51 unsigned long expires; 50 unsigned long expires;
52 51
53 unsigned short header_len; /* more space at head required */ 52 unsigned short header_len; /* more space at head required */
diff --git a/include/net/fib_rules.h b/include/net/fib_rules.h
index ed3a8872c6ca..83e41dd15ccd 100644
--- a/include/net/fib_rules.h
+++ b/include/net/fib_rules.h
@@ -64,7 +64,7 @@ struct fib_rules_ops
64 void (*flush_cache)(void); 64 void (*flush_cache)(void);
65 65
66 int nlgroup; 66 int nlgroup;
67 struct nla_policy *policy; 67 const struct nla_policy *policy;
68 struct list_head *rules_list; 68 struct list_head *rules_list;
69 struct module *owner; 69 struct module *owner;
70}; 70};
diff --git a/include/net/flow.h b/include/net/flow.h
index f3cc1f812619..af59fa5cc1f8 100644
--- a/include/net/flow.h
+++ b/include/net/flow.h
@@ -67,20 +67,16 @@ struct flowi {
67 67
68 __be32 spi; 68 __be32 spi;
69 69
70#ifdef CONFIG_IPV6_MIP6
71 struct { 70 struct {
72 __u8 type; 71 __u8 type;
73 } mht; 72 } mht;
74#endif
75 } uli_u; 73 } uli_u;
76#define fl_ip_sport uli_u.ports.sport 74#define fl_ip_sport uli_u.ports.sport
77#define fl_ip_dport uli_u.ports.dport 75#define fl_ip_dport uli_u.ports.dport
78#define fl_icmp_type uli_u.icmpt.type 76#define fl_icmp_type uli_u.icmpt.type
79#define fl_icmp_code uli_u.icmpt.code 77#define fl_icmp_code uli_u.icmpt.code
80#define fl_ipsec_spi uli_u.spi 78#define fl_ipsec_spi uli_u.spi
81#ifdef CONFIG_IPV6_MIP6
82#define fl_mh_type uli_u.mht.type 79#define fl_mh_type uli_u.mht.type
83#endif
84 __u32 secid; /* used by xfrm; see secid.txt */ 80 __u32 secid; /* used by xfrm; see secid.txt */
85} __attribute__((__aligned__(BITS_PER_LONG/8))); 81} __attribute__((__aligned__(BITS_PER_LONG/8)));
86 82
diff --git a/include/net/genetlink.h b/include/net/genetlink.h
index adff4c898d50..decdda546829 100644
--- a/include/net/genetlink.h
+++ b/include/net/genetlink.h
@@ -5,6 +5,22 @@
5#include <net/netlink.h> 5#include <net/netlink.h>
6 6
7/** 7/**
8 * struct genl_multicast_group - generic netlink multicast group
9 * @name: name of the multicast group, names are per-family
10 * @id: multicast group ID, assigned by the core, to use with
11 * genlmsg_multicast().
12 * @list: list entry for linking
13 * @family: pointer to family, need not be set before registering
14 */
15struct genl_multicast_group
16{
17 struct genl_family *family; /* private */
18 struct list_head list; /* private */
19 char name[GENL_NAMSIZ];
20 u32 id;
21};
22
23/**
8 * struct genl_family - generic netlink family 24 * struct genl_family - generic netlink family
9 * @id: protocol family idenfitier 25 * @id: protocol family idenfitier
10 * @hdrsize: length of user specific header in bytes 26 * @hdrsize: length of user specific header in bytes
@@ -14,6 +30,7 @@
14 * @attrbuf: buffer to store parsed attributes 30 * @attrbuf: buffer to store parsed attributes
15 * @ops_list: list of all assigned operations 31 * @ops_list: list of all assigned operations
16 * @family_list: family list 32 * @family_list: family list
33 * @mcast_groups: multicast groups list
17 */ 34 */
18struct genl_family 35struct genl_family
19{ 36{
@@ -25,6 +42,7 @@ struct genl_family
25 struct nlattr ** attrbuf; /* private */ 42 struct nlattr ** attrbuf; /* private */
26 struct list_head ops_list; /* private */ 43 struct list_head ops_list; /* private */
27 struct list_head family_list; /* private */ 44 struct list_head family_list; /* private */
45 struct list_head mcast_groups; /* private */
28}; 46};
29 47
30/** 48/**
@@ -60,7 +78,7 @@ struct genl_ops
60{ 78{
61 u8 cmd; 79 u8 cmd;
62 unsigned int flags; 80 unsigned int flags;
63 struct nla_policy *policy; 81 const struct nla_policy *policy;
64 int (*doit)(struct sk_buff *skb, 82 int (*doit)(struct sk_buff *skb,
65 struct genl_info *info); 83 struct genl_info *info);
66 int (*dumpit)(struct sk_buff *skb, 84 int (*dumpit)(struct sk_buff *skb,
@@ -73,6 +91,10 @@ extern int genl_register_family(struct genl_family *family);
73extern int genl_unregister_family(struct genl_family *family); 91extern int genl_unregister_family(struct genl_family *family);
74extern int genl_register_ops(struct genl_family *, struct genl_ops *ops); 92extern int genl_register_ops(struct genl_family *, struct genl_ops *ops);
75extern int genl_unregister_ops(struct genl_family *, struct genl_ops *ops); 93extern int genl_unregister_ops(struct genl_family *, struct genl_ops *ops);
94extern int genl_register_mc_group(struct genl_family *family,
95 struct genl_multicast_group *grp);
96extern void genl_unregister_mc_group(struct genl_family *family,
97 struct genl_multicast_group *grp);
76 98
77extern struct sock *genl_sock; 99extern struct sock *genl_sock;
78 100
diff --git a/include/net/inet_timewait_sock.h b/include/net/inet_timewait_sock.h
index 09a2532699b2..47d52b2414db 100644
--- a/include/net/inet_timewait_sock.h
+++ b/include/net/inet_timewait_sock.h
@@ -209,9 +209,6 @@ static inline void inet_twsk_put(struct inet_timewait_sock *tw)
209extern struct inet_timewait_sock *inet_twsk_alloc(const struct sock *sk, 209extern struct inet_timewait_sock *inet_twsk_alloc(const struct sock *sk,
210 const int state); 210 const int state);
211 211
212extern void __inet_twsk_kill(struct inet_timewait_sock *tw,
213 struct inet_hashinfo *hashinfo);
214
215extern void __inet_twsk_hashdance(struct inet_timewait_sock *tw, 212extern void __inet_twsk_hashdance(struct inet_timewait_sock *tw,
216 struct sock *sk, 213 struct sock *sk,
217 struct inet_hashinfo *hashinfo); 214 struct inet_hashinfo *hashinfo);
diff --git a/include/net/ip.h b/include/net/ip.h
index bb207db03675..abf2820a1125 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -143,6 +143,7 @@ struct ip_reply_arg {
143 __wsum csum; 143 __wsum csum;
144 int csumoffset; /* u16 offset of csum in iov[0].iov_base */ 144 int csumoffset; /* u16 offset of csum in iov[0].iov_base */
145 /* -1 if not needed */ 145 /* -1 if not needed */
146 int bound_dev_if;
146}; 147};
147 148
148void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *arg, 149void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *arg,
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h
index 5a4a0366c24f..8cadc77c7df4 100644
--- a/include/net/ip_fib.h
+++ b/include/net/ip_fib.h
@@ -39,7 +39,6 @@ struct fib_config {
39 int fc_mx_len; 39 int fc_mx_len;
40 int fc_mp_len; 40 int fc_mp_len;
41 u32 fc_flow; 41 u32 fc_flow;
42 u32 fc_mp_alg;
43 u32 fc_nlflags; 42 u32 fc_nlflags;
44 struct nl_info fc_nlinfo; 43 struct nl_info fc_nlinfo;
45 }; 44 };
@@ -86,9 +85,6 @@ struct fib_info {
86#ifdef CONFIG_IP_ROUTE_MULTIPATH 85#ifdef CONFIG_IP_ROUTE_MULTIPATH
87 int fib_power; 86 int fib_power;
88#endif 87#endif
89#ifdef CONFIG_IP_ROUTE_MULTIPATH_CACHED
90 u32 fib_mp_alg;
91#endif
92 struct fib_nh fib_nh[0]; 88 struct fib_nh fib_nh[0];
93#define fib_dev fib_nh[0].nh_dev 89#define fib_dev fib_nh[0].nh_dev
94}; 90};
@@ -103,10 +99,6 @@ struct fib_result {
103 unsigned char nh_sel; 99 unsigned char nh_sel;
104 unsigned char type; 100 unsigned char type;
105 unsigned char scope; 101 unsigned char scope;
106#ifdef CONFIG_IP_ROUTE_MULTIPATH_CACHED
107 __be32 network;
108 __be32 netmask;
109#endif
110 struct fib_info *fi; 102 struct fib_info *fi;
111#ifdef CONFIG_IP_MULTIPLE_TABLES 103#ifdef CONFIG_IP_MULTIPLE_TABLES
112 struct fib_rule *r; 104 struct fib_rule *r;
@@ -145,14 +137,6 @@ struct fib_result_nl {
145#define FIB_RES_DEV(res) (FIB_RES_NH(res).nh_dev) 137#define FIB_RES_DEV(res) (FIB_RES_NH(res).nh_dev)
146#define FIB_RES_OIF(res) (FIB_RES_NH(res).nh_oif) 138#define FIB_RES_OIF(res) (FIB_RES_NH(res).nh_oif)
147 139
148#ifdef CONFIG_IP_ROUTE_MULTIPATH_CACHED
149#define FIB_RES_NETWORK(res) ((res).network)
150#define FIB_RES_NETMASK(res) ((res).netmask)
151#else /* CONFIG_IP_ROUTE_MULTIPATH_CACHED */
152#define FIB_RES_NETWORK(res) (0)
153#define FIB_RES_NETMASK(res) (0)
154#endif /* CONFIG_IP_ROUTE_MULTIPATH_WRANDOM */
155
156struct fib_table { 140struct fib_table {
157 struct hlist_node tb_hlist; 141 struct hlist_node tb_hlist;
158 u32 tb_id; 142 u32 tb_id;
@@ -213,7 +197,7 @@ extern void fib_select_default(const struct flowi *flp, struct fib_result *res);
213#endif /* CONFIG_IP_MULTIPLE_TABLES */ 197#endif /* CONFIG_IP_MULTIPLE_TABLES */
214 198
215/* Exported by fib_frontend.c */ 199/* Exported by fib_frontend.c */
216extern struct nla_policy rtm_ipv4_policy[]; 200extern const struct nla_policy rtm_ipv4_policy[];
217extern void ip_fib_init(void); 201extern void ip_fib_init(void);
218extern int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif, 202extern int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif,
219 struct net_device *dev, __be32 *spec_dst, u32 *itag); 203 struct net_device *dev, __be32 *spec_dst, u32 *itag);
diff --git a/include/net/ip_mp_alg.h b/include/net/ip_mp_alg.h
deleted file mode 100644
index 25b56571e54b..000000000000
--- a/include/net/ip_mp_alg.h
+++ /dev/null
@@ -1,96 +0,0 @@
1/* ip_mp_alg.h: IPV4 multipath algorithm support.
2 *
3 * Copyright (C) 2004, 2005 Einar Lueck <elueck@de.ibm.com>
4 * Copyright (C) 2005 David S. Miller <davem@davemloft.net>
5 */
6
7#ifndef _NET_IP_MP_ALG_H
8#define _NET_IP_MP_ALG_H
9
10#include <linux/ip_mp_alg.h>
11#include <net/flow.h>
12#include <net/route.h>
13
14struct fib_nh;
15
16struct ip_mp_alg_ops {
17 void (*mp_alg_select_route)(const struct flowi *flp,
18 struct rtable *rth, struct rtable **rp);
19 void (*mp_alg_flush)(void);
20 void (*mp_alg_set_nhinfo)(__be32 network, __be32 netmask,
21 unsigned char prefixlen,
22 const struct fib_nh *nh);
23 void (*mp_alg_remove)(struct rtable *rth);
24};
25
26extern int multipath_alg_register(struct ip_mp_alg_ops *, enum ip_mp_alg);
27extern void multipath_alg_unregister(struct ip_mp_alg_ops *, enum ip_mp_alg);
28
29extern struct ip_mp_alg_ops *ip_mp_alg_table[];
30
31static inline int multipath_select_route(const struct flowi *flp,
32 struct rtable *rth,
33 struct rtable **rp)
34{
35#ifdef CONFIG_IP_ROUTE_MULTIPATH_CACHED
36 struct ip_mp_alg_ops *ops = ip_mp_alg_table[rth->rt_multipath_alg];
37
38 /* mp_alg_select_route _MUST_ be implemented */
39 if (ops && (rth->u.dst.flags & DST_BALANCED)) {
40 ops->mp_alg_select_route(flp, rth, rp);
41 return 1;
42 }
43#endif
44 return 0;
45}
46
47static inline void multipath_flush(void)
48{
49#ifdef CONFIG_IP_ROUTE_MULTIPATH_CACHED
50 int i;
51
52 for (i = IP_MP_ALG_NONE; i <= IP_MP_ALG_MAX; i++) {
53 struct ip_mp_alg_ops *ops = ip_mp_alg_table[i];
54
55 if (ops && ops->mp_alg_flush)
56 ops->mp_alg_flush();
57 }
58#endif
59}
60
61static inline void multipath_set_nhinfo(struct rtable *rth,
62 __be32 network, __be32 netmask,
63 unsigned char prefixlen,
64 const struct fib_nh *nh)
65{
66#ifdef CONFIG_IP_ROUTE_MULTIPATH_CACHED
67 struct ip_mp_alg_ops *ops = ip_mp_alg_table[rth->rt_multipath_alg];
68
69 if (ops && ops->mp_alg_set_nhinfo)
70 ops->mp_alg_set_nhinfo(network, netmask, prefixlen, nh);
71#endif
72}
73
74static inline void multipath_remove(struct rtable *rth)
75{
76#ifdef CONFIG_IP_ROUTE_MULTIPATH_CACHED
77 struct ip_mp_alg_ops *ops = ip_mp_alg_table[rth->rt_multipath_alg];
78
79 if (ops && ops->mp_alg_remove &&
80 (rth->u.dst.flags & DST_BALANCED))
81 ops->mp_alg_remove(rth);
82#endif
83}
84
85static inline int multipath_comparekeys(const struct flowi *flp1,
86 const struct flowi *flp2)
87{
88 return flp1->fl4_dst == flp2->fl4_dst &&
89 flp1->fl4_src == flp2->fl4_src &&
90 flp1->oif == flp2->oif &&
91 flp1->mark == flp2->mark &&
92 !((flp1->fl4_tos ^ flp2->fl4_tos) &
93 (IPTOS_RT_MASK | RTO_ONLINK));
94}
95
96#endif /* _NET_IP_MP_ALG_H */
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 78a0d06d98d5..46b9dce82f6e 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -512,10 +512,6 @@ extern int ipv6_ext_hdr(u8 nexthdr);
512 512
513extern int ipv6_find_tlv(struct sk_buff *skb, int offset, int type); 513extern int ipv6_find_tlv(struct sk_buff *skb, int offset, int type);
514 514
515extern struct ipv6_txoptions * ipv6_invert_rthdr(struct sock *sk,
516 struct ipv6_rt_hdr *hdr);
517
518
519/* 515/*
520 * socket options (ipv6_sockglue.c) 516 * socket options (ipv6_sockglue.c)
521 */ 517 */
diff --git a/include/net/irda/irda.h b/include/net/irda/irda.h
index 36bee441aa56..08387553b57e 100644
--- a/include/net/irda/irda.h
+++ b/include/net/irda/irda.h
@@ -125,6 +125,9 @@ extern void irda_sysctl_unregister(void);
125extern int irsock_init(void); 125extern int irsock_init(void);
126extern void irsock_cleanup(void); 126extern void irsock_cleanup(void);
127 127
128extern int irda_nl_register(void);
129extern void irda_nl_unregister(void);
130
128extern int irlap_driver_rcv(struct sk_buff *skb, struct net_device *dev, 131extern int irlap_driver_rcv(struct sk_buff *skb, struct net_device *dev,
129 struct packet_type *ptype, 132 struct packet_type *ptype,
130 struct net_device *orig_dev); 133 struct net_device *orig_dev);
diff --git a/include/net/irda/irlap.h b/include/net/irda/irlap.h
index f0248fb8e196..9d0c78ea92f5 100644
--- a/include/net/irda/irlap.h
+++ b/include/net/irda/irlap.h
@@ -208,6 +208,8 @@ struct irlap_cb {
208 int xbofs_delay; /* Nr of XBOF's used to MTT */ 208 int xbofs_delay; /* Nr of XBOF's used to MTT */
209 int bofs_count; /* Negotiated extra BOFs */ 209 int bofs_count; /* Negotiated extra BOFs */
210 int next_bofs; /* Negotiated extra BOFs after next frame */ 210 int next_bofs; /* Negotiated extra BOFs after next frame */
211
212 int mode; /* IrLAP mode (primary, secondary or monitor) */
211}; 213};
212 214
213/* 215/*
@@ -289,4 +291,21 @@ static inline void irlap_clear_disconnect(struct irlap_cb *self)
289 self->disconnect_pending = FALSE; 291 self->disconnect_pending = FALSE;
290} 292}
291 293
294/*
295 * Function irlap_next_state (self, state)
296 *
297 * Switches state and provides debug information
298 *
299 */
300static inline void irlap_next_state(struct irlap_cb *self, IRLAP_STATE state)
301{
302 /*
303 if (!self || self->magic != LAP_MAGIC)
304 return;
305
306 IRDA_DEBUG(4, "next LAP state = %s\n", irlap_state[state]);
307 */
308 self->state = state;
309}
310
292#endif 311#endif
diff --git a/include/net/iucv/af_iucv.h b/include/net/iucv/af_iucv.h
index f9bd11be1891..b6c468cd7f5b 100644
--- a/include/net/iucv/af_iucv.h
+++ b/include/net/iucv/af_iucv.h
@@ -60,6 +60,7 @@ struct iucv_sock {
60 char dst_user_id[8]; 60 char dst_user_id[8];
61 char dst_name[8]; 61 char dst_name[8];
62 struct list_head accept_q; 62 struct list_head accept_q;
63 spinlock_t accept_q_lock;
63 struct sock *parent; 64 struct sock *parent;
64 struct iucv_path *path; 65 struct iucv_path *path;
65 struct sk_buff_head send_skb_q; 66 struct sk_buff_head send_skb_q;
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index a7f122b79948..c34fd9a6160a 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -347,9 +347,16 @@ enum ieee80211_if_types {
347 * @mac_addr: pointer to MAC address of the interface. This pointer is valid 347 * @mac_addr: pointer to MAC address of the interface. This pointer is valid
348 * until the interface is removed (i.e. it cannot be used after 348 * until the interface is removed (i.e. it cannot be used after
349 * remove_interface() callback was called for this interface). 349 * remove_interface() callback was called for this interface).
350 * This pointer will be %NULL for monitor interfaces, be careful.
350 * 351 *
351 * This structure is used in add_interface() and remove_interface() 352 * This structure is used in add_interface() and remove_interface()
352 * callbacks of &struct ieee80211_hw. 353 * callbacks of &struct ieee80211_hw.
354 *
355 * When you allow multiple interfaces to be added to your PHY, take care
356 * that the hardware can actually handle multiple MAC addresses. However,
357 * also take care that when there's no interface left with mac_addr != %NULL
358 * you remove the MAC address from the device to avoid acknowledging packets
359 * in pure monitor mode.
353 */ 360 */
354struct ieee80211_if_init_conf { 361struct ieee80211_if_init_conf {
355 int if_id; 362 int if_id;
@@ -574,10 +581,11 @@ struct ieee80211_ops {
574 * to returning zero. By returning non-zero addition of the interface 581 * to returning zero. By returning non-zero addition of the interface
575 * is inhibited. Unless monitor_during_oper is set, it is guaranteed 582 * is inhibited. Unless monitor_during_oper is set, it is guaranteed
576 * that monitor interfaces and normal interfaces are mutually 583 * that monitor interfaces and normal interfaces are mutually
577 * exclusive. The open() handler is called after add_interface() 584 * exclusive. If assigned, the open() handler is called after
578 * if this is the first device added. At least one of the open() 585 * add_interface() if this is the first device added. The
579 * open() and add_interface() callbacks has to be assigned. If 586 * add_interface() callback has to be assigned because it is the only
580 * add_interface() is NULL, one STA interface is permitted only. */ 587 * way to obtain the requested MAC address for any interface.
588 */
581 int (*add_interface)(struct ieee80211_hw *hw, 589 int (*add_interface)(struct ieee80211_hw *hw,
582 struct ieee80211_if_init_conf *conf); 590 struct ieee80211_if_init_conf *conf);
583 591
@@ -921,12 +929,6 @@ struct sk_buff *
921ieee80211_get_buffered_bc(struct ieee80211_hw *hw, int if_id, 929ieee80211_get_buffered_bc(struct ieee80211_hw *hw, int if_id,
922 struct ieee80211_tx_control *control); 930 struct ieee80211_tx_control *control);
923 931
924/* Low level drivers that have their own MLME and MAC indicate
925 * the aid for an associating station with this call */
926int ieee80211_set_aid_for_sta(struct ieee80211_hw *hw,
927 u8 *peer_address, u16 aid);
928
929
930/* Given an sk_buff with a raw 802.11 header at the data pointer this function 932/* Given an sk_buff with a raw 802.11 header at the data pointer this function
931 * returns the 802.11 header length in bytes (not including encryption 933 * returns the 802.11 header length in bytes (not including encryption
932 * headers). If the data in the sk_buff is too short to contain a valid 802.11 934 * headers). If the data in the sk_buff is too short to contain a valid 802.11
diff --git a/include/net/mip6.h b/include/net/mip6.h
index 68263c6d9996..63272610a24a 100644
--- a/include/net/mip6.h
+++ b/include/net/mip6.h
@@ -54,8 +54,4 @@ struct ip6_mh {
54#define IP6_MH_TYPE_BERROR 7 /* Binding Error */ 54#define IP6_MH_TYPE_BERROR 7 /* Binding Error */
55#define IP6_MH_TYPE_MAX IP6_MH_TYPE_BERROR 55#define IP6_MH_TYPE_MAX IP6_MH_TYPE_BERROR
56 56
57extern int mip6_init(void);
58extern void mip6_fini(void);
59extern int mip6_mh_filter(struct sock *sk, struct sk_buff *skb);
60
61#endif 57#endif
diff --git a/include/net/netfilter/ipv4/nf_conntrack_ipv4.h b/include/net/netfilter/ipv4/nf_conntrack_ipv4.h
index 1401ccc051c4..7a671603fca6 100644
--- a/include/net/netfilter/ipv4/nf_conntrack_ipv4.h
+++ b/include/net/netfilter/ipv4/nf_conntrack_ipv4.h
@@ -9,29 +9,10 @@
9#ifndef _NF_CONNTRACK_IPV4_H 9#ifndef _NF_CONNTRACK_IPV4_H
10#define _NF_CONNTRACK_IPV4_H 10#define _NF_CONNTRACK_IPV4_H
11 11
12#ifdef CONFIG_NF_NAT_NEEDED
13#include <net/netfilter/nf_nat.h>
14#include <linux/netfilter/nf_conntrack_pptp.h>
15
16/* per conntrack: nat application helper private data */
17union nf_conntrack_nat_help {
18 /* insert nat helper private data here */
19 struct nf_nat_pptp nat_pptp_info;
20};
21
22struct nf_conn_nat {
23 struct nf_nat_info info;
24 union nf_conntrack_nat_help help;
25#if defined(CONFIG_IP_NF_TARGET_MASQUERADE) || \
26 defined(CONFIG_IP_NF_TARGET_MASQUERADE_MODULE)
27 int masq_index;
28#endif
29};
30#endif /* CONFIG_NF_NAT_NEEDED */
31
32/* Returns new sk_buff, or NULL */ 12/* Returns new sk_buff, or NULL */
33struct sk_buff * 13struct sk_buff *nf_ct_ipv4_ct_gather_frags(struct sk_buff *skb);
34nf_ct_ipv4_ct_gather_frags(struct sk_buff *skb); 14
15extern struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv4;
35 16
36extern struct nf_conntrack_l4proto nf_conntrack_l4proto_tcp4; 17extern struct nf_conntrack_l4proto nf_conntrack_l4proto_tcp4;
37extern struct nf_conntrack_l4proto nf_conntrack_l4proto_udp4; 18extern struct nf_conntrack_l4proto nf_conntrack_l4proto_udp4;
diff --git a/include/net/netfilter/ipv6/nf_conntrack_ipv6.h b/include/net/netfilter/ipv6/nf_conntrack_ipv6.h
index b4b6049e01fa..5a8965904377 100644
--- a/include/net/netfilter/ipv6/nf_conntrack_ipv6.h
+++ b/include/net/netfilter/ipv6/nf_conntrack_ipv6.h
@@ -7,7 +7,7 @@ extern struct nf_conntrack_l4proto nf_conntrack_l4proto_tcp6;
7extern struct nf_conntrack_l4proto nf_conntrack_l4proto_udp6; 7extern struct nf_conntrack_l4proto nf_conntrack_l4proto_udp6;
8extern struct nf_conntrack_l4proto nf_conntrack_l4proto_icmpv6; 8extern struct nf_conntrack_l4proto nf_conntrack_l4proto_icmpv6;
9 9
10extern int nf_ct_ipv6_skip_exthdr(struct sk_buff *skb, int start, 10extern int nf_ct_ipv6_skip_exthdr(const struct sk_buff *skb, int start,
11 u8 *nexthdrp, int len); 11 u8 *nexthdrp, int len);
12 12
13extern int nf_ct_frag6_init(void); 13extern int nf_ct_frag6_init(void);
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h
index 4732432f8eb0..810020ec345d 100644
--- a/include/net/netfilter/nf_conntrack.h
+++ b/include/net/netfilter/nf_conntrack.h
@@ -82,6 +82,8 @@ struct nf_conn_help {
82 82
83 union nf_conntrack_help help; 83 union nf_conntrack_help help;
84 84
85 struct hlist_head expectations;
86
85 /* Current number of expected connections */ 87 /* Current number of expected connections */
86 unsigned int expecting; 88 unsigned int expecting;
87}; 89};
@@ -117,9 +119,6 @@ struct nf_conn
117 /* Unique ID that identifies this conntrack*/ 119 /* Unique ID that identifies this conntrack*/
118 unsigned int id; 120 unsigned int id;
119 121
120 /* features - nat, helper, ... used by allocating system */
121 u_int32_t features;
122
123#if defined(CONFIG_NF_CONNTRACK_MARK) 122#if defined(CONFIG_NF_CONNTRACK_MARK)
124 u_int32_t mark; 123 u_int32_t mark;
125#endif 124#endif
@@ -131,8 +130,8 @@ struct nf_conn
131 /* Storage reserved for other modules: */ 130 /* Storage reserved for other modules: */
132 union nf_conntrack_proto proto; 131 union nf_conntrack_proto proto;
133 132
134 /* features dynamically at the end: helper, nat (both optional) */ 133 /* Extensions */
135 char data[0]; 134 struct nf_ct_ext *ext;
136}; 135};
137 136
138static inline struct nf_conn * 137static inline struct nf_conn *
@@ -175,6 +174,10 @@ static inline void nf_ct_put(struct nf_conn *ct)
175extern int nf_ct_l3proto_try_module_get(unsigned short l3proto); 174extern int nf_ct_l3proto_try_module_get(unsigned short l3proto);
176extern void nf_ct_l3proto_module_put(unsigned short l3proto); 175extern void nf_ct_l3proto_module_put(unsigned short l3proto);
177 176
177extern struct hlist_head *nf_ct_alloc_hashtable(int *sizep, int *vmalloced);
178extern void nf_ct_free_hashtable(struct hlist_head *hash, int vmalloced,
179 int size);
180
178extern struct nf_conntrack_tuple_hash * 181extern struct nf_conntrack_tuple_hash *
179__nf_conntrack_find(const struct nf_conntrack_tuple *tuple, 182__nf_conntrack_find(const struct nf_conntrack_tuple *tuple,
180 const struct nf_conn *ignored_conntrack); 183 const struct nf_conn *ignored_conntrack);
@@ -183,6 +186,10 @@ extern void nf_conntrack_hash_insert(struct nf_conn *ct);
183 186
184extern void nf_conntrack_flush(void); 187extern void nf_conntrack_flush(void);
185 188
189extern int nf_ct_get_tuplepr(const struct sk_buff *skb,
190 unsigned int nhoff,
191 u_int16_t l3num,
192 struct nf_conntrack_tuple *tuple);
186extern int nf_ct_invert_tuplepr(struct nf_conntrack_tuple *inverse, 193extern int nf_ct_invert_tuplepr(struct nf_conntrack_tuple *inverse,
187 const struct nf_conntrack_tuple *orig); 194 const struct nf_conntrack_tuple *orig);
188 195
@@ -216,9 +223,6 @@ extern void nf_conntrack_tcp_update(struct sk_buff *skb,
216 struct nf_conn *conntrack, 223 struct nf_conn *conntrack,
217 int dir); 224 int dir);
218 225
219/* Call me when a conntrack is destroyed. */
220extern void (*nf_conntrack_destroyed)(struct nf_conn *conntrack);
221
222/* Fake conntrack entry for untracked connections */ 226/* Fake conntrack entry for untracked connections */
223extern struct nf_conn nf_conntrack_untracked; 227extern struct nf_conn nf_conntrack_untracked;
224 228
@@ -262,60 +266,10 @@ do { \
262 local_bh_enable(); \ 266 local_bh_enable(); \
263} while (0) 267} while (0)
264 268
265/* no helper, no nat */
266#define NF_CT_F_BASIC 0
267/* for helper */
268#define NF_CT_F_HELP 1
269/* for nat. */
270#define NF_CT_F_NAT 2
271#define NF_CT_F_NUM 4
272
273extern int 269extern int
274nf_conntrack_register_cache(u_int32_t features, const char *name, size_t size); 270nf_conntrack_register_cache(u_int32_t features, const char *name, size_t size);
275extern void 271extern void
276nf_conntrack_unregister_cache(u_int32_t features); 272nf_conntrack_unregister_cache(u_int32_t features);
277 273
278/* valid combinations:
279 * basic: nf_conn, nf_conn .. nf_conn_help
280 * nat: nf_conn .. nf_conn_nat, nf_conn .. nf_conn_nat .. nf_conn help
281 */
282#ifdef CONFIG_NF_NAT_NEEDED
283static inline struct nf_conn_nat *nfct_nat(const struct nf_conn *ct)
284{
285 unsigned int offset = sizeof(struct nf_conn);
286
287 if (!(ct->features & NF_CT_F_NAT))
288 return NULL;
289
290 offset = ALIGN(offset, __alignof__(struct nf_conn_nat));
291 return (struct nf_conn_nat *) ((void *)ct + offset);
292}
293
294static inline struct nf_conn_help *nfct_help(const struct nf_conn *ct)
295{
296 unsigned int offset = sizeof(struct nf_conn);
297
298 if (!(ct->features & NF_CT_F_HELP))
299 return NULL;
300 if (ct->features & NF_CT_F_NAT) {
301 offset = ALIGN(offset, __alignof__(struct nf_conn_nat));
302 offset += sizeof(struct nf_conn_nat);
303 }
304
305 offset = ALIGN(offset, __alignof__(struct nf_conn_help));
306 return (struct nf_conn_help *) ((void *)ct + offset);
307}
308#else /* No NAT */
309static inline struct nf_conn_help *nfct_help(const struct nf_conn *ct)
310{
311 unsigned int offset = sizeof(struct nf_conn);
312
313 if (!(ct->features & NF_CT_F_HELP))
314 return NULL;
315
316 offset = ALIGN(offset, __alignof__(struct nf_conn_help));
317 return (struct nf_conn_help *) ((void *)ct + offset);
318}
319#endif /* CONFIG_NF_NAT_NEEDED */
320#endif /* __KERNEL__ */ 274#endif /* __KERNEL__ */
321#endif /* _NF_CONNTRACK_H */ 275#endif /* _NF_CONNTRACK_H */
diff --git a/include/net/netfilter/nf_conntrack_core.h b/include/net/netfilter/nf_conntrack_core.h
index 9fb906688ffa..4056f5f08da1 100644
--- a/include/net/netfilter/nf_conntrack_core.h
+++ b/include/net/netfilter/nf_conntrack_core.h
@@ -30,6 +30,9 @@ extern void nf_conntrack_cleanup(void);
30extern int nf_conntrack_proto_init(void); 30extern int nf_conntrack_proto_init(void);
31extern void nf_conntrack_proto_fini(void); 31extern void nf_conntrack_proto_fini(void);
32 32
33extern int nf_conntrack_helper_init(void);
34extern void nf_conntrack_helper_fini(void);
35
33struct nf_conntrack_l3proto; 36struct nf_conntrack_l3proto;
34extern struct nf_conntrack_l3proto *nf_ct_find_l3proto(u_int16_t pf); 37extern struct nf_conntrack_l3proto *nf_ct_find_l3proto(u_int16_t pf);
35/* Like above, but you already have conntrack read lock. */ 38/* Like above, but you already have conntrack read lock. */
@@ -55,8 +58,7 @@ nf_ct_invert_tuple(struct nf_conntrack_tuple *inverse,
55 58
56/* Find a connection corresponding to a tuple. */ 59/* Find a connection corresponding to a tuple. */
57extern struct nf_conntrack_tuple_hash * 60extern struct nf_conntrack_tuple_hash *
58nf_conntrack_find_get(const struct nf_conntrack_tuple *tuple, 61nf_conntrack_find_get(const struct nf_conntrack_tuple *tuple);
59 const struct nf_conn *ignored_conntrack);
60 62
61extern int __nf_conntrack_confirm(struct sk_buff **pskb); 63extern int __nf_conntrack_confirm(struct sk_buff **pskb);
62 64
@@ -81,9 +83,8 @@ print_tuple(struct seq_file *s, const struct nf_conntrack_tuple *tuple,
81 struct nf_conntrack_l3proto *l3proto, 83 struct nf_conntrack_l3proto *l3proto,
82 struct nf_conntrack_l4proto *proto); 84 struct nf_conntrack_l4proto *proto);
83 85
84extern struct list_head *nf_conntrack_hash; 86extern struct hlist_head *nf_conntrack_hash;
85extern struct list_head nf_conntrack_expect_list;
86extern rwlock_t nf_conntrack_lock ; 87extern rwlock_t nf_conntrack_lock ;
87extern struct list_head unconfirmed; 88extern struct hlist_head unconfirmed;
88 89
89#endif /* _NF_CONNTRACK_CORE_H */ 90#endif /* _NF_CONNTRACK_CORE_H */
diff --git a/include/net/netfilter/nf_conntrack_ecache.h b/include/net/netfilter/nf_conntrack_ecache.h
index 811c9073c532..f0b9078235c9 100644
--- a/include/net/netfilter/nf_conntrack_ecache.h
+++ b/include/net/netfilter/nf_conntrack_ecache.h
@@ -49,15 +49,15 @@ static inline void nf_conntrack_event(enum ip_conntrack_events event,
49 atomic_notifier_call_chain(&nf_conntrack_chain, event, ct); 49 atomic_notifier_call_chain(&nf_conntrack_chain, event, ct);
50} 50}
51 51
52extern struct atomic_notifier_head nf_conntrack_expect_chain; 52extern struct atomic_notifier_head nf_ct_expect_chain;
53extern int nf_conntrack_expect_register_notifier(struct notifier_block *nb); 53extern int nf_ct_expect_register_notifier(struct notifier_block *nb);
54extern int nf_conntrack_expect_unregister_notifier(struct notifier_block *nb); 54extern int nf_ct_expect_unregister_notifier(struct notifier_block *nb);
55 55
56static inline void 56static inline void
57nf_conntrack_expect_event(enum ip_conntrack_expect_events event, 57nf_ct_expect_event(enum ip_conntrack_expect_events event,
58 struct nf_conntrack_expect *exp) 58 struct nf_conntrack_expect *exp)
59{ 59{
60 atomic_notifier_call_chain(&nf_conntrack_expect_chain, event, exp); 60 atomic_notifier_call_chain(&nf_ct_expect_chain, event, exp);
61} 61}
62 62
63#else /* CONFIG_NF_CONNTRACK_EVENTS */ 63#else /* CONFIG_NF_CONNTRACK_EVENTS */
@@ -67,9 +67,8 @@ static inline void nf_conntrack_event_cache(enum ip_conntrack_events event,
67static inline void nf_conntrack_event(enum ip_conntrack_events event, 67static inline void nf_conntrack_event(enum ip_conntrack_events event,
68 struct nf_conn *ct) {} 68 struct nf_conn *ct) {}
69static inline void nf_ct_deliver_cached_events(const struct nf_conn *ct) {} 69static inline void nf_ct_deliver_cached_events(const struct nf_conn *ct) {}
70static inline void 70static inline void nf_ct_expect_event(enum ip_conntrack_expect_events event,
71nf_conntrack_expect_event(enum ip_conntrack_expect_events event, 71 struct nf_conntrack_expect *exp) {}
72 struct nf_conntrack_expect *exp) {}
73static inline void nf_ct_event_cache_flush(void) {} 72static inline void nf_ct_event_cache_flush(void) {}
74#endif /* CONFIG_NF_CONNTRACK_EVENTS */ 73#endif /* CONFIG_NF_CONNTRACK_EVENTS */
75 74
diff --git a/include/net/netfilter/nf_conntrack_expect.h b/include/net/netfilter/nf_conntrack_expect.h
index 173c7c1eff23..cae1a0dce365 100644
--- a/include/net/netfilter/nf_conntrack_expect.h
+++ b/include/net/netfilter/nf_conntrack_expect.h
@@ -6,17 +6,21 @@
6#define _NF_CONNTRACK_EXPECT_H 6#define _NF_CONNTRACK_EXPECT_H
7#include <net/netfilter/nf_conntrack.h> 7#include <net/netfilter/nf_conntrack.h>
8 8
9extern struct list_head nf_conntrack_expect_list; 9extern struct hlist_head *nf_ct_expect_hash;
10extern struct kmem_cache *nf_conntrack_expect_cachep; 10extern unsigned int nf_ct_expect_hsize;
11extern const struct file_operations exp_file_ops; 11extern unsigned int nf_ct_expect_max;
12 12
13struct nf_conntrack_expect 13struct nf_conntrack_expect
14{ 14{
15 /* Internal linked list (global expectation list) */ 15 /* Conntrack expectation list member */
16 struct list_head list; 16 struct hlist_node lnode;
17
18 /* Hash member */
19 struct hlist_node hnode;
17 20
18 /* We expect this tuple, with the following mask */ 21 /* We expect this tuple, with the following mask */
19 struct nf_conntrack_tuple tuple, mask; 22 struct nf_conntrack_tuple tuple;
23 struct nf_conntrack_tuple_mask mask;
20 24
21 /* Function to call after setup and insertion */ 25 /* Function to call after setup and insertion */
22 void (*expectfn)(struct nf_conn *new, 26 void (*expectfn)(struct nf_conn *new,
@@ -52,29 +56,31 @@ struct nf_conntrack_expect
52 56
53#define NF_CT_EXPECT_PERMANENT 0x1 57#define NF_CT_EXPECT_PERMANENT 0x1
54 58
59int nf_conntrack_expect_init(void);
60void nf_conntrack_expect_fini(void);
55 61
56struct nf_conntrack_expect * 62struct nf_conntrack_expect *
57__nf_conntrack_expect_find(const struct nf_conntrack_tuple *tuple); 63__nf_ct_expect_find(const struct nf_conntrack_tuple *tuple);
58 64
59struct nf_conntrack_expect * 65struct nf_conntrack_expect *
60nf_conntrack_expect_find_get(const struct nf_conntrack_tuple *tuple); 66nf_ct_expect_find_get(const struct nf_conntrack_tuple *tuple);
61 67
62struct nf_conntrack_expect * 68struct nf_conntrack_expect *
63find_expectation(const struct nf_conntrack_tuple *tuple); 69nf_ct_find_expectation(const struct nf_conntrack_tuple *tuple);
64 70
65void nf_ct_unlink_expect(struct nf_conntrack_expect *exp); 71void nf_ct_unlink_expect(struct nf_conntrack_expect *exp);
66void nf_ct_remove_expectations(struct nf_conn *ct); 72void nf_ct_remove_expectations(struct nf_conn *ct);
67void nf_conntrack_unexpect_related(struct nf_conntrack_expect *exp); 73void nf_ct_unexpect_related(struct nf_conntrack_expect *exp);
68 74
69/* Allocate space for an expectation: this is mandatory before calling 75/* Allocate space for an expectation: this is mandatory before calling
70 nf_conntrack_expect_related. You will have to call put afterwards. */ 76 nf_ct_expect_related. You will have to call put afterwards. */
71struct nf_conntrack_expect *nf_conntrack_expect_alloc(struct nf_conn *me); 77struct nf_conntrack_expect *nf_ct_expect_alloc(struct nf_conn *me);
72void nf_conntrack_expect_init(struct nf_conntrack_expect *, int, 78void nf_ct_expect_init(struct nf_conntrack_expect *, int,
73 union nf_conntrack_address *, 79 union nf_conntrack_address *,
74 union nf_conntrack_address *, 80 union nf_conntrack_address *,
75 u_int8_t, __be16 *, __be16 *); 81 u_int8_t, __be16 *, __be16 *);
76void nf_conntrack_expect_put(struct nf_conntrack_expect *exp); 82void nf_ct_expect_put(struct nf_conntrack_expect *exp);
77int nf_conntrack_expect_related(struct nf_conntrack_expect *expect); 83int nf_ct_expect_related(struct nf_conntrack_expect *expect);
78 84
79#endif /*_NF_CONNTRACK_EXPECT_H*/ 85#endif /*_NF_CONNTRACK_EXPECT_H*/
80 86
diff --git a/include/net/netfilter/nf_conntrack_extend.h b/include/net/netfilter/nf_conntrack_extend.h
new file mode 100644
index 000000000000..73b5711faf32
--- /dev/null
+++ b/include/net/netfilter/nf_conntrack_extend.h
@@ -0,0 +1,85 @@
1#ifndef _NF_CONNTRACK_EXTEND_H
2#define _NF_CONNTRACK_EXTEND_H
3
4#include <net/netfilter/nf_conntrack.h>
5
6enum nf_ct_ext_id
7{
8 NF_CT_EXT_HELPER,
9 NF_CT_EXT_NAT,
10 NF_CT_EXT_NUM,
11};
12
13#define NF_CT_EXT_HELPER_TYPE struct nf_conn_help
14#define NF_CT_EXT_NAT_TYPE struct nf_conn_nat
15
16/* Extensions: optional stuff which isn't permanently in struct. */
17struct nf_ct_ext {
18 u8 offset[NF_CT_EXT_NUM];
19 u8 len;
20 u8 real_len;
21 char data[0];
22};
23
24static inline int nf_ct_ext_exist(const struct nf_conn *ct, u8 id)
25{
26 return (ct->ext && ct->ext->offset[id]);
27}
28
29static inline void *__nf_ct_ext_find(const struct nf_conn *ct, u8 id)
30{
31 if (!nf_ct_ext_exist(ct, id))
32 return NULL;
33
34 return (void *)ct->ext + ct->ext->offset[id];
35}
36#define nf_ct_ext_find(ext, id) \
37 ((id##_TYPE *)__nf_ct_ext_find((ext), (id)))
38
39/* Destroy all relationships */
40extern void __nf_ct_ext_destroy(struct nf_conn *ct);
41static inline void nf_ct_ext_destroy(struct nf_conn *ct)
42{
43 if (ct->ext)
44 __nf_ct_ext_destroy(ct);
45}
46
47/* Free operation. If you want to free a object referred from private area,
48 * please implement __nf_ct_ext_free() and call it.
49 */
50static inline void nf_ct_ext_free(struct nf_conn *ct)
51{
52 if (ct->ext)
53 kfree(ct->ext);
54}
55
56/* Add this type, returns pointer to data or NULL. */
57void *
58__nf_ct_ext_add(struct nf_conn *ct, enum nf_ct_ext_id id, gfp_t gfp);
59#define nf_ct_ext_add(ct, id, gfp) \
60 ((id##_TYPE *)__nf_ct_ext_add((ct), (id), (gfp)))
61
62#define NF_CT_EXT_F_PREALLOC 0x0001
63
64struct nf_ct_ext_type
65{
66 /* Destroys relationships (can be NULL). */
67 void (*destroy)(struct nf_conn *ct);
68 /* Called when realloacted (can be NULL).
69 Contents has already been moved. */
70 void (*move)(struct nf_conn *ct, void *old);
71
72 enum nf_ct_ext_id id;
73
74 unsigned int flags;
75
76 /* Length and min alignment. */
77 u8 len;
78 u8 align;
79 /* initial size of nf_ct_ext. */
80 u8 alloc_size;
81};
82
83int nf_ct_extend_register(struct nf_ct_ext_type *type);
84void nf_ct_extend_unregister(struct nf_ct_ext_type *type);
85#endif /* _NF_CONNTRACK_EXTEND_H */
diff --git a/include/net/netfilter/nf_conntrack_helper.h b/include/net/netfilter/nf_conntrack_helper.h
index 8c72ac9f0ab8..d04f99964d94 100644
--- a/include/net/netfilter/nf_conntrack_helper.h
+++ b/include/net/netfilter/nf_conntrack_helper.h
@@ -10,12 +10,13 @@
10#ifndef _NF_CONNTRACK_HELPER_H 10#ifndef _NF_CONNTRACK_HELPER_H
11#define _NF_CONNTRACK_HELPER_H 11#define _NF_CONNTRACK_HELPER_H
12#include <net/netfilter/nf_conntrack.h> 12#include <net/netfilter/nf_conntrack.h>
13#include <net/netfilter/nf_conntrack_extend.h>
13 14
14struct module; 15struct module;
15 16
16struct nf_conntrack_helper 17struct nf_conntrack_helper
17{ 18{
18 struct list_head list; /* Internal use. */ 19 struct hlist_node hnode; /* Internal use. */
19 20
20 const char *name; /* name of the module */ 21 const char *name; /* name of the module */
21 struct module *me; /* pointer to self */ 22 struct module *me; /* pointer to self */
@@ -23,10 +24,9 @@ struct nf_conntrack_helper
23 * expected connections */ 24 * expected connections */
24 unsigned int timeout; /* timeout for expecteds */ 25 unsigned int timeout; /* timeout for expecteds */
25 26
26 /* Mask of things we will help (compared against server response) */ 27 /* Tuple of things we will help (compared against server response) */
27 struct nf_conntrack_tuple tuple; 28 struct nf_conntrack_tuple tuple;
28 struct nf_conntrack_tuple mask; 29
29
30 /* Function to call when data passes; return verdict, or -1 to 30 /* Function to call when data passes; return verdict, or -1 to
31 invalidate. */ 31 invalidate. */
32 int (*help)(struct sk_buff **pskb, 32 int (*help)(struct sk_buff **pskb,
@@ -52,4 +52,10 @@ extern void nf_ct_helper_put(struct nf_conntrack_helper *helper);
52extern int nf_conntrack_helper_register(struct nf_conntrack_helper *); 52extern int nf_conntrack_helper_register(struct nf_conntrack_helper *);
53extern void nf_conntrack_helper_unregister(struct nf_conntrack_helper *); 53extern void nf_conntrack_helper_unregister(struct nf_conntrack_helper *);
54 54
55extern struct nf_conn_help *nf_ct_helper_ext_add(struct nf_conn *ct, gfp_t gfp);
56
57static inline struct nf_conn_help *nfct_help(const struct nf_conn *ct)
58{
59 return nf_ct_ext_find(ct, NF_CT_EXT_HELPER);
60}
55#endif /*_NF_CONNTRACK_HELPER_H*/ 61#endif /*_NF_CONNTRACK_HELPER_H*/
diff --git a/include/net/netfilter/nf_conntrack_l3proto.h b/include/net/netfilter/nf_conntrack_l3proto.h
index 96a58d8e1d3f..3c58a2c4df28 100644
--- a/include/net/netfilter/nf_conntrack_l3proto.h
+++ b/include/net/netfilter/nf_conntrack_l3proto.h
@@ -58,13 +58,11 @@ struct nf_conntrack_l3proto
58 58
59 /* 59 /*
60 * Called before tracking. 60 * Called before tracking.
61 * *dataoff: offset of protocol header (TCP, UDP,...) in *pskb 61 * *dataoff: offset of protocol header (TCP, UDP,...) in skb
62 * *protonum: protocol number 62 * *protonum: protocol number
63 */ 63 */
64 int (*prepare)(struct sk_buff **pskb, unsigned int hooknum, 64 int (*get_l4proto)(const struct sk_buff *skb, unsigned int nhoff,
65 unsigned int *dataoff, u_int8_t *protonum); 65 unsigned int *dataoff, u_int8_t *protonum);
66
67 u_int32_t (*get_features)(const struct nf_conntrack_tuple *tuple);
68 66
69 int (*tuple_to_nfattr)(struct sk_buff *skb, 67 int (*tuple_to_nfattr)(struct sk_buff *skb,
70 const struct nf_conntrack_tuple *t); 68 const struct nf_conntrack_tuple *t);
@@ -91,8 +89,6 @@ extern struct nf_conntrack_l3proto *nf_ct_l3proto_find_get(u_int16_t l3proto);
91extern void nf_ct_l3proto_put(struct nf_conntrack_l3proto *p); 89extern void nf_ct_l3proto_put(struct nf_conntrack_l3proto *p);
92 90
93/* Existing built-in protocols */ 91/* Existing built-in protocols */
94extern struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv4;
95extern struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv6;
96extern struct nf_conntrack_l3proto nf_conntrack_l3proto_generic; 92extern struct nf_conntrack_l3proto nf_conntrack_l3proto_generic;
97 93
98static inline struct nf_conntrack_l3proto * 94static inline struct nf_conntrack_l3proto *
diff --git a/include/net/netfilter/nf_conntrack_tuple.h b/include/net/netfilter/nf_conntrack_tuple.h
index 5d72b16e876f..040dae5f0c9e 100644
--- a/include/net/netfilter/nf_conntrack_tuple.h
+++ b/include/net/netfilter/nf_conntrack_tuple.h
@@ -100,6 +100,14 @@ struct nf_conntrack_tuple
100 } dst; 100 } dst;
101}; 101};
102 102
103struct nf_conntrack_tuple_mask
104{
105 struct {
106 union nf_conntrack_address u3;
107 union nf_conntrack_man_proto u;
108 } src;
109};
110
103/* This is optimized opposed to a memset of the whole structure. Everything we 111/* This is optimized opposed to a memset of the whole structure. Everything we
104 * really care about is the source/destination unions */ 112 * really care about is the source/destination unions */
105#define NF_CT_TUPLE_U_BLANK(tuple) \ 113#define NF_CT_TUPLE_U_BLANK(tuple) \
@@ -112,11 +120,11 @@ struct nf_conntrack_tuple
112 120
113#ifdef __KERNEL__ 121#ifdef __KERNEL__
114 122
115#define NF_CT_DUMP_TUPLE(tp) \ 123#define NF_CT_DUMP_TUPLE(tp) \
116DEBUGP("tuple %p: %u %u " NIP6_FMT " %hu -> " NIP6_FMT " %hu\n", \ 124pr_debug("tuple %p: %u %u " NIP6_FMT " %hu -> " NIP6_FMT " %hu\n", \
117 (tp), (tp)->src.l3num, (tp)->dst.protonum, \ 125 (tp), (tp)->src.l3num, (tp)->dst.protonum, \
118 NIP6(*(struct in6_addr *)(tp)->src.u3.all), ntohs((tp)->src.u.all), \ 126 NIP6(*(struct in6_addr *)(tp)->src.u3.all), ntohs((tp)->src.u.all), \
119 NIP6(*(struct in6_addr *)(tp)->dst.u3.all), ntohs((tp)->dst.u.all)) 127 NIP6(*(struct in6_addr *)(tp)->dst.u3.all), ntohs((tp)->dst.u.all))
120 128
121/* If we're the first tuple, it's the original dir. */ 129/* If we're the first tuple, it's the original dir. */
122#define NF_CT_DIRECTION(h) \ 130#define NF_CT_DIRECTION(h) \
@@ -125,8 +133,7 @@ DEBUGP("tuple %p: %u %u " NIP6_FMT " %hu -> " NIP6_FMT " %hu\n", \
125/* Connections have two entries in the hash table: one for each way */ 133/* Connections have two entries in the hash table: one for each way */
126struct nf_conntrack_tuple_hash 134struct nf_conntrack_tuple_hash
127{ 135{
128 struct list_head list; 136 struct hlist_node hnode;
129
130 struct nf_conntrack_tuple tuple; 137 struct nf_conntrack_tuple tuple;
131}; 138};
132 139
@@ -162,31 +169,44 @@ static inline int nf_ct_tuple_equal(const struct nf_conntrack_tuple *t1,
162 return nf_ct_tuple_src_equal(t1, t2) && nf_ct_tuple_dst_equal(t1, t2); 169 return nf_ct_tuple_src_equal(t1, t2) && nf_ct_tuple_dst_equal(t1, t2);
163} 170}
164 171
172static inline int nf_ct_tuple_mask_equal(const struct nf_conntrack_tuple_mask *m1,
173 const struct nf_conntrack_tuple_mask *m2)
174{
175 return (m1->src.u3.all[0] == m2->src.u3.all[0] &&
176 m1->src.u3.all[1] == m2->src.u3.all[1] &&
177 m1->src.u3.all[2] == m2->src.u3.all[2] &&
178 m1->src.u3.all[3] == m2->src.u3.all[3] &&
179 m1->src.u.all == m2->src.u.all);
180}
181
182static inline int nf_ct_tuple_src_mask_cmp(const struct nf_conntrack_tuple *t1,
183 const struct nf_conntrack_tuple *t2,
184 const struct nf_conntrack_tuple_mask *mask)
185{
186 int count;
187
188 for (count = 0; count < NF_CT_TUPLE_L3SIZE; count++) {
189 if ((t1->src.u3.all[count] ^ t2->src.u3.all[count]) &
190 mask->src.u3.all[count])
191 return 0;
192 }
193
194 if ((t1->src.u.all ^ t2->src.u.all) & mask->src.u.all)
195 return 0;
196
197 if (t1->src.l3num != t2->src.l3num ||
198 t1->dst.protonum != t2->dst.protonum)
199 return 0;
200
201 return 1;
202}
203
165static inline int nf_ct_tuple_mask_cmp(const struct nf_conntrack_tuple *t, 204static inline int nf_ct_tuple_mask_cmp(const struct nf_conntrack_tuple *t,
166 const struct nf_conntrack_tuple *tuple, 205 const struct nf_conntrack_tuple *tuple,
167 const struct nf_conntrack_tuple *mask) 206 const struct nf_conntrack_tuple_mask *mask)
168{ 207{
169 int count = 0; 208 return nf_ct_tuple_src_mask_cmp(t, tuple, mask) &&
170 209 nf_ct_tuple_dst_equal(t, tuple);
171 for (count = 0; count < NF_CT_TUPLE_L3SIZE; count++){
172 if ((t->src.u3.all[count] ^ tuple->src.u3.all[count]) &
173 mask->src.u3.all[count])
174 return 0;
175 }
176
177 for (count = 0; count < NF_CT_TUPLE_L3SIZE; count++){
178 if ((t->dst.u3.all[count] ^ tuple->dst.u3.all[count]) &
179 mask->dst.u3.all[count])
180 return 0;
181 }
182
183 if ((t->src.u.all ^ tuple->src.u.all) & mask->src.u.all ||
184 (t->dst.u.all ^ tuple->dst.u.all) & mask->dst.u.all ||
185 (t->src.l3num ^ tuple->src.l3num) & mask->src.l3num ||
186 (t->dst.protonum ^ tuple->dst.protonum) & mask->dst.protonum)
187 return 0;
188
189 return 1;
190} 210}
191 211
192#endif /* _NF_CONNTRACK_TUPLE_H */ 212#endif /* _NF_CONNTRACK_TUPLE_H */
diff --git a/include/net/netfilter/nf_nat.h b/include/net/netfilter/nf_nat.h
index bc57dd7b9b5c..6ae52f7c9f55 100644
--- a/include/net/netfilter/nf_nat.h
+++ b/include/net/netfilter/nf_nat.h
@@ -51,16 +51,31 @@ struct nf_nat_multi_range_compat
51 51
52#ifdef __KERNEL__ 52#ifdef __KERNEL__
53#include <linux/list.h> 53#include <linux/list.h>
54#include <linux/netfilter/nf_conntrack_pptp.h>
55#include <net/netfilter/nf_conntrack_extend.h>
54 56
55/* The structure embedded in the conntrack structure. */ 57/* per conntrack: nat application helper private data */
56struct nf_nat_info 58union nf_conntrack_nat_help
57{ 59{
58 struct list_head bysource; 60 /* insert nat helper private data here */
59 struct nf_nat_seq seq[IP_CT_DIR_MAX]; 61 struct nf_nat_pptp nat_pptp_info;
60}; 62};
61 63
62struct nf_conn; 64struct nf_conn;
63 65
66/* The structure embedded in the conntrack structure. */
67struct nf_conn_nat
68{
69 struct hlist_node bysource;
70 struct nf_nat_seq seq[IP_CT_DIR_MAX];
71 struct nf_conn *ct;
72 union nf_conntrack_nat_help help;
73#if defined(CONFIG_IP_NF_TARGET_MASQUERADE) || \
74 defined(CONFIG_IP_NF_TARGET_MASQUERADE_MODULE)
75 int masq_index;
76#endif
77};
78
64/* Set up the info structure to map into this range. */ 79/* Set up the info structure to map into this range. */
65extern unsigned int nf_nat_setup_info(struct nf_conn *ct, 80extern unsigned int nf_nat_setup_info(struct nf_conn *ct,
66 const struct nf_nat_range *range, 81 const struct nf_nat_range *range,
@@ -70,7 +85,10 @@ extern unsigned int nf_nat_setup_info(struct nf_conn *ct,
70extern int nf_nat_used_tuple(const struct nf_conntrack_tuple *tuple, 85extern int nf_nat_used_tuple(const struct nf_conntrack_tuple *tuple,
71 const struct nf_conn *ignored_conntrack); 86 const struct nf_conn *ignored_conntrack);
72 87
73extern int nf_nat_module_is_loaded; 88static inline struct nf_conn_nat *nfct_nat(const struct nf_conn *ct)
89{
90 return nf_ct_ext_find(ct, NF_CT_EXT_NAT);
91}
74 92
75#else /* !__KERNEL__: iptables wants this to compile. */ 93#else /* !__KERNEL__: iptables wants this to compile. */
76#define nf_nat_multi_range nf_nat_multi_range_compat 94#define nf_nat_multi_range nf_nat_multi_range_compat
diff --git a/include/net/netfilter/nf_nat_core.h b/include/net/netfilter/nf_nat_core.h
index 9778ffa93440..c3cd127ba4bb 100644
--- a/include/net/netfilter/nf_nat_core.h
+++ b/include/net/netfilter/nf_nat_core.h
@@ -2,6 +2,7 @@
2#define _NF_NAT_CORE_H 2#define _NF_NAT_CORE_H
3#include <linux/list.h> 3#include <linux/list.h>
4#include <net/netfilter/nf_conntrack.h> 4#include <net/netfilter/nf_conntrack.h>
5#include <net/netfilter/nf_nat.h>
5 6
6/* This header used to share core functionality between the standalone 7/* This header used to share core functionality between the standalone
7 NAT module, and the compatibility layer's use of NAT for masquerading. */ 8 NAT module, and the compatibility layer's use of NAT for masquerading. */
diff --git a/include/net/netlabel.h b/include/net/netlabel.h
index 83da7e1f0d3d..ffbc7f28335a 100644
--- a/include/net/netlabel.h
+++ b/include/net/netlabel.h
@@ -144,10 +144,9 @@ struct netlbl_lsm_secattr {
144}; 144};
145 145
146/* 146/*
147 * LSM security attribute operations 147 * LSM security attribute operations (inline)
148 */ 148 */
149 149
150
151/** 150/**
152 * netlbl_secattr_cache_alloc - Allocate and initialize a secattr cache 151 * netlbl_secattr_cache_alloc - Allocate and initialize a secattr cache
153 * @flags: the memory allocation flags 152 * @flags: the memory allocation flags
@@ -283,6 +282,9 @@ static inline void netlbl_secattr_free(struct netlbl_lsm_secattr *secattr)
283} 282}
284 283
285#ifdef CONFIG_NETLABEL 284#ifdef CONFIG_NETLABEL
285/*
286 * LSM security attribute operations
287 */
286int netlbl_secattr_catmap_walk(struct netlbl_lsm_secattr_catmap *catmap, 288int netlbl_secattr_catmap_walk(struct netlbl_lsm_secattr_catmap *catmap,
287 u32 offset); 289 u32 offset);
288int netlbl_secattr_catmap_walk_rng(struct netlbl_lsm_secattr_catmap *catmap, 290int netlbl_secattr_catmap_walk_rng(struct netlbl_lsm_secattr_catmap *catmap,
@@ -294,6 +296,25 @@ int netlbl_secattr_catmap_setrng(struct netlbl_lsm_secattr_catmap *catmap,
294 u32 start, 296 u32 start,
295 u32 end, 297 u32 end,
296 gfp_t flags); 298 gfp_t flags);
299
300/*
301 * LSM protocol operations
302 */
303int netlbl_enabled(void);
304int netlbl_sock_setattr(struct sock *sk,
305 const struct netlbl_lsm_secattr *secattr);
306int netlbl_sock_getattr(struct sock *sk,
307 struct netlbl_lsm_secattr *secattr);
308int netlbl_skbuff_getattr(const struct sk_buff *skb,
309 struct netlbl_lsm_secattr *secattr);
310void netlbl_skbuff_err(struct sk_buff *skb, int error);
311
312/*
313 * LSM label mapping cache operations
314 */
315void netlbl_cache_invalidate(void);
316int netlbl_cache_add(const struct sk_buff *skb,
317 const struct netlbl_lsm_secattr *secattr);
297#else 318#else
298static inline int netlbl_secattr_catmap_walk( 319static inline int netlbl_secattr_catmap_walk(
299 struct netlbl_lsm_secattr_catmap *catmap, 320 struct netlbl_lsm_secattr_catmap *catmap,
@@ -301,14 +322,12 @@ static inline int netlbl_secattr_catmap_walk(
301{ 322{
302 return -ENOENT; 323 return -ENOENT;
303} 324}
304
305static inline int netlbl_secattr_catmap_walk_rng( 325static inline int netlbl_secattr_catmap_walk_rng(
306 struct netlbl_lsm_secattr_catmap *catmap, 326 struct netlbl_lsm_secattr_catmap *catmap,
307 u32 offset) 327 u32 offset)
308{ 328{
309 return -ENOENT; 329 return -ENOENT;
310} 330}
311
312static inline int netlbl_secattr_catmap_setbit( 331static inline int netlbl_secattr_catmap_setbit(
313 struct netlbl_lsm_secattr_catmap *catmap, 332 struct netlbl_lsm_secattr_catmap *catmap,
314 u32 bit, 333 u32 bit,
@@ -316,7 +335,6 @@ static inline int netlbl_secattr_catmap_setbit(
316{ 335{
317 return 0; 336 return 0;
318} 337}
319
320static inline int netlbl_secattr_catmap_setrng( 338static inline int netlbl_secattr_catmap_setrng(
321 struct netlbl_lsm_secattr_catmap *catmap, 339 struct netlbl_lsm_secattr_catmap *catmap,
322 u32 start, 340 u32 start,
@@ -325,67 +343,33 @@ static inline int netlbl_secattr_catmap_setrng(
325{ 343{
326 return 0; 344 return 0;
327} 345}
328#endif 346static inline int netlbl_enabled(void)
329 347{
330/* 348 return 0;
331 * LSM protocol operations 349}
332 */ 350static inline int netlbl_sock_setattr(struct sock *sk,
333
334#ifdef CONFIG_NETLABEL
335int netlbl_socket_setattr(const struct socket *sock,
336 const struct netlbl_lsm_secattr *secattr);
337int netlbl_sock_getattr(struct sock *sk,
338 struct netlbl_lsm_secattr *secattr);
339int netlbl_socket_getattr(const struct socket *sock,
340 struct netlbl_lsm_secattr *secattr);
341int netlbl_skbuff_getattr(const struct sk_buff *skb,
342 struct netlbl_lsm_secattr *secattr);
343void netlbl_skbuff_err(struct sk_buff *skb, int error);
344#else
345static inline int netlbl_socket_setattr(const struct socket *sock,
346 const struct netlbl_lsm_secattr *secattr) 351 const struct netlbl_lsm_secattr *secattr)
347{ 352{
348 return -ENOSYS; 353 return -ENOSYS;
349} 354}
350
351static inline int netlbl_sock_getattr(struct sock *sk, 355static inline int netlbl_sock_getattr(struct sock *sk,
352 struct netlbl_lsm_secattr *secattr) 356 struct netlbl_lsm_secattr *secattr)
353{ 357{
354 return -ENOSYS; 358 return -ENOSYS;
355} 359}
356
357static inline int netlbl_socket_getattr(const struct socket *sock,
358 struct netlbl_lsm_secattr *secattr)
359{
360 return -ENOSYS;
361}
362
363static inline int netlbl_skbuff_getattr(const struct sk_buff *skb, 360static inline int netlbl_skbuff_getattr(const struct sk_buff *skb,
364 struct netlbl_lsm_secattr *secattr) 361 struct netlbl_lsm_secattr *secattr)
365{ 362{
366 return -ENOSYS; 363 return -ENOSYS;
367} 364}
368
369static inline void netlbl_skbuff_err(struct sk_buff *skb, int error) 365static inline void netlbl_skbuff_err(struct sk_buff *skb, int error)
370{ 366{
371 return; 367 return;
372} 368}
373#endif /* CONFIG_NETLABEL */
374
375/*
376 * LSM label mapping cache operations
377 */
378
379#ifdef CONFIG_NETLABEL
380void netlbl_cache_invalidate(void);
381int netlbl_cache_add(const struct sk_buff *skb,
382 const struct netlbl_lsm_secattr *secattr);
383#else
384static inline void netlbl_cache_invalidate(void) 369static inline void netlbl_cache_invalidate(void)
385{ 370{
386 return; 371 return;
387} 372}
388
389static inline int netlbl_cache_add(const struct sk_buff *skb, 373static inline int netlbl_cache_add(const struct sk_buff *skb,
390 const struct netlbl_lsm_secattr *secattr) 374 const struct netlbl_lsm_secattr *secattr)
391{ 375{
diff --git a/include/net/netlink.h b/include/net/netlink.h
index 0bf325c29aff..d7b824be5422 100644
--- a/include/net/netlink.h
+++ b/include/net/netlink.h
@@ -118,6 +118,9 @@
118 * Nested Attributes Construction: 118 * Nested Attributes Construction:
119 * nla_nest_start(skb, type) start a nested attribute 119 * nla_nest_start(skb, type) start a nested attribute
120 * nla_nest_end(skb, nla) finalize a nested attribute 120 * nla_nest_end(skb, nla) finalize a nested attribute
121 * nla_nest_compat_start(skb, type, start a nested compat attribute
122 * len, data)
123 * nla_nest_compat_end(skb, type) finalize a nested compat attribute
121 * nla_nest_cancel(skb, nla) cancel nested attribute construction 124 * nla_nest_cancel(skb, nla) cancel nested attribute construction
122 * 125 *
123 * Attribute Length Calculations: 126 * Attribute Length Calculations:
@@ -152,6 +155,7 @@
152 * nla_find_nested() find attribute in nested attributes 155 * nla_find_nested() find attribute in nested attributes
153 * nla_parse() parse and validate stream of attrs 156 * nla_parse() parse and validate stream of attrs
154 * nla_parse_nested() parse nested attribuets 157 * nla_parse_nested() parse nested attribuets
158 * nla_parse_nested_compat() parse nested compat attributes
155 * nla_for_each_attr() loop over all attributes 159 * nla_for_each_attr() loop over all attributes
156 * nla_for_each_nested() loop over the nested attributes 160 * nla_for_each_nested() loop over the nested attributes
157 *========================================================================= 161 *=========================================================================
@@ -170,6 +174,7 @@ enum {
170 NLA_FLAG, 174 NLA_FLAG,
171 NLA_MSECS, 175 NLA_MSECS,
172 NLA_NESTED, 176 NLA_NESTED,
177 NLA_NESTED_COMPAT,
173 NLA_NUL_STRING, 178 NLA_NUL_STRING,
174 NLA_BINARY, 179 NLA_BINARY,
175 __NLA_TYPE_MAX, 180 __NLA_TYPE_MAX,
@@ -190,6 +195,7 @@ enum {
190 * NLA_NUL_STRING Maximum length of string (excluding NUL) 195 * NLA_NUL_STRING Maximum length of string (excluding NUL)
191 * NLA_FLAG Unused 196 * NLA_FLAG Unused
192 * NLA_BINARY Maximum length of attribute payload 197 * NLA_BINARY Maximum length of attribute payload
198 * NLA_NESTED_COMPAT Exact length of structure payload
193 * All other Exact length of attribute payload 199 * All other Exact length of attribute payload
194 * 200 *
195 * Example: 201 * Example:
@@ -222,10 +228,10 @@ extern int nlmsg_notify(struct sock *sk, struct sk_buff *skb,
222 gfp_t flags); 228 gfp_t flags);
223 229
224extern int nla_validate(struct nlattr *head, int len, int maxtype, 230extern int nla_validate(struct nlattr *head, int len, int maxtype,
225 struct nla_policy *policy); 231 const struct nla_policy *policy);
226extern int nla_parse(struct nlattr *tb[], int maxtype, 232extern int nla_parse(struct nlattr *tb[], int maxtype,
227 struct nlattr *head, int len, 233 struct nlattr *head, int len,
228 struct nla_policy *policy); 234 const struct nla_policy *policy);
229extern struct nlattr * nla_find(struct nlattr *head, int len, int attrtype); 235extern struct nlattr * nla_find(struct nlattr *head, int len, int attrtype);
230extern size_t nla_strlcpy(char *dst, const struct nlattr *nla, 236extern size_t nla_strlcpy(char *dst, const struct nlattr *nla,
231 size_t dstsize); 237 size_t dstsize);
@@ -360,7 +366,7 @@ static inline struct nlmsghdr *nlmsg_next(struct nlmsghdr *nlh, int *remaining)
360 */ 366 */
361static inline int nlmsg_parse(struct nlmsghdr *nlh, int hdrlen, 367static inline int nlmsg_parse(struct nlmsghdr *nlh, int hdrlen,
362 struct nlattr *tb[], int maxtype, 368 struct nlattr *tb[], int maxtype,
363 struct nla_policy *policy) 369 const struct nla_policy *policy)
364{ 370{
365 if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen)) 371 if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen))
366 return -EINVAL; 372 return -EINVAL;
@@ -392,7 +398,7 @@ static inline struct nlattr *nlmsg_find_attr(struct nlmsghdr *nlh,
392 * @policy: validation policy 398 * @policy: validation policy
393 */ 399 */
394static inline int nlmsg_validate(struct nlmsghdr *nlh, int hdrlen, int maxtype, 400static inline int nlmsg_validate(struct nlmsghdr *nlh, int hdrlen, int maxtype,
395 struct nla_policy *policy) 401 const struct nla_policy *policy)
396{ 402{
397 if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen)) 403 if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen))
398 return -EINVAL; 404 return -EINVAL;
@@ -729,10 +735,43 @@ static inline struct nlattr *nla_find_nested(struct nlattr *nla, int attrtype)
729 */ 735 */
730static inline int nla_parse_nested(struct nlattr *tb[], int maxtype, 736static inline int nla_parse_nested(struct nlattr *tb[], int maxtype,
731 struct nlattr *nla, 737 struct nlattr *nla,
732 struct nla_policy *policy) 738 const struct nla_policy *policy)
733{ 739{
734 return nla_parse(tb, maxtype, nla_data(nla), nla_len(nla), policy); 740 return nla_parse(tb, maxtype, nla_data(nla), nla_len(nla), policy);
735} 741}
742
743/**
744 * nla_parse_nested_compat - parse nested compat attributes
745 * @tb: destination array with maxtype+1 elements
746 * @maxtype: maximum attribute type to be expected
747 * @nla: attribute containing the nested attributes
748 * @data: pointer to point to contained structure
749 * @len: length of contained structure
750 * @policy: validation policy
751 *
752 * Parse a nested compat attribute. The compat attribute contains a structure
753 * and optionally a set of nested attributes. On success the data pointer
754 * points to the nested data and tb contains the parsed attributes
755 * (see nla_parse).
756 */
757static inline int __nla_parse_nested_compat(struct nlattr *tb[], int maxtype,
758 struct nlattr *nla,
759 const struct nla_policy *policy,
760 int len)
761{
762 if (nla_len(nla) < len)
763 return -1;
764 if (nla_len(nla) >= NLA_ALIGN(len) + sizeof(struct nlattr))
765 return nla_parse_nested(tb, maxtype,
766 nla_data(nla) + NLA_ALIGN(len),
767 policy);
768 memset(tb, 0, sizeof(struct nlattr *) * (maxtype + 1));
769 return 0;
770}
771
772#define nla_parse_nested_compat(tb, maxtype, nla, policy, data, len) \
773({ data = nla_len(nla) >= len ? nla_data(nla) : NULL; \
774 __nla_parse_nested_compat(tb, maxtype, nla, policy, len); })
736/** 775/**
737 * nla_put_u8 - Add a u16 netlink attribute to a socket buffer 776 * nla_put_u8 - Add a u16 netlink attribute to a socket buffer
738 * @skb: socket buffer to add attribute to 777 * @skb: socket buffer to add attribute to
@@ -965,6 +1004,51 @@ static inline int nla_nest_end(struct sk_buff *skb, struct nlattr *start)
965} 1004}
966 1005
967/** 1006/**
1007 * nla_nest_compat_start - Start a new level of nested compat attributes
1008 * @skb: socket buffer to add attributes to
1009 * @attrtype: attribute type of container
1010 * @attrlen: length of structure
1011 * @data: pointer to structure
1012 *
1013 * Start a nested compat attribute that contains both a structure and
1014 * a set of nested attributes.
1015 *
1016 * Returns the container attribute
1017 */
1018static inline struct nlattr *nla_nest_compat_start(struct sk_buff *skb,
1019 int attrtype, int attrlen,
1020 const void *data)
1021{
1022 struct nlattr *start = (struct nlattr *)skb_tail_pointer(skb);
1023
1024 if (nla_put(skb, attrtype, attrlen, data) < 0)
1025 return NULL;
1026 if (nla_nest_start(skb, attrtype) == NULL) {
1027 nlmsg_trim(skb, start);
1028 return NULL;
1029 }
1030 return start;
1031}
1032
1033/**
1034 * nla_nest_compat_end - Finalize nesting of compat attributes
1035 * @skb: socket buffer the attribtues are stored in
1036 * @start: container attribute
1037 *
1038 * Corrects the container attribute header to include the all
1039 * appeneded attributes.
1040 *
1041 * Returns the total data length of the skb.
1042 */
1043static inline int nla_nest_compat_end(struct sk_buff *skb, struct nlattr *start)
1044{
1045 struct nlattr *nest = (void *)start + NLMSG_ALIGN(start->nla_len);
1046
1047 start->nla_len = skb_tail_pointer(skb) - (unsigned char *)start;
1048 return nla_nest_end(skb, nest);
1049}
1050
1051/**
968 * nla_nest_cancel - Cancel nesting of attributes 1052 * nla_nest_cancel - Cancel nesting of attributes
969 * @skb: socket buffer the message is stored in 1053 * @skb: socket buffer the message is stored in
970 * @start: container attribute 1054 * @start: container attribute
@@ -990,7 +1074,7 @@ static inline int nla_nest_cancel(struct sk_buff *skb, struct nlattr *start)
990 * Returns 0 on success or a negative error code. 1074 * Returns 0 on success or a negative error code.
991 */ 1075 */
992static inline int nla_validate_nested(struct nlattr *start, int maxtype, 1076static inline int nla_validate_nested(struct nlattr *start, int maxtype,
993 struct nla_policy *policy) 1077 const struct nla_policy *policy)
994{ 1078{
995 return nla_validate(nla_data(start), nla_len(start), maxtype, policy); 1079 return nla_validate(nla_data(start), nla_len(start), maxtype, policy);
996} 1080}
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
index 4129df708079..7968b1d66369 100644
--- a/include/net/pkt_cls.h
+++ b/include/net/pkt_cls.h
@@ -65,8 +65,6 @@ struct tcf_exts
65{ 65{
66#ifdef CONFIG_NET_CLS_ACT 66#ifdef CONFIG_NET_CLS_ACT
67 struct tc_action *action; 67 struct tc_action *action;
68#elif defined CONFIG_NET_CLS_POLICE
69 struct tcf_police *police;
70#endif 68#endif
71}; 69};
72 70
@@ -91,8 +89,6 @@ tcf_exts_is_predicative(struct tcf_exts *exts)
91{ 89{
92#ifdef CONFIG_NET_CLS_ACT 90#ifdef CONFIG_NET_CLS_ACT
93 return !!exts->action; 91 return !!exts->action;
94#elif defined CONFIG_NET_CLS_POLICE
95 return !!exts->police;
96#else 92#else
97 return 0; 93 return 0;
98#endif 94#endif
@@ -129,11 +125,7 @@ tcf_exts_exec(struct sk_buff *skb, struct tcf_exts *exts,
129#ifdef CONFIG_NET_CLS_ACT 125#ifdef CONFIG_NET_CLS_ACT
130 if (exts->action) 126 if (exts->action)
131 return tcf_action_exec(skb, exts->action, res); 127 return tcf_action_exec(skb, exts->action, res);
132#elif defined CONFIG_NET_CLS_POLICE
133 if (exts->police)
134 return tcf_police(skb, exts->police);
135#endif 128#endif
136
137 return 0; 129 return 0;
138} 130}
139 131
@@ -306,6 +298,8 @@ static inline int tcf_em_tree_match(struct sk_buff *skb,
306 return 1; 298 return 1;
307} 299}
308 300
301#define MODULE_ALIAS_TCF_EMATCH(kind) MODULE_ALIAS("ematch-kind-" __stringify(kind))
302
309#else /* CONFIG_NET_EMATCH */ 303#else /* CONFIG_NET_EMATCH */
310 304
311struct tcf_ematch_tree 305struct tcf_ematch_tree
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index 5754d53d9efc..9e22526e80e7 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -89,8 +89,10 @@ static inline void qdisc_run(struct net_device *dev)
89 __qdisc_run(dev); 89 __qdisc_run(dev);
90} 90}
91 91
92extern int tc_classify_compat(struct sk_buff *skb, struct tcf_proto *tp,
93 struct tcf_result *res);
92extern int tc_classify(struct sk_buff *skb, struct tcf_proto *tp, 94extern int tc_classify(struct sk_buff *skb, struct tcf_proto *tp,
93 struct tcf_result *res); 95 struct tcf_result *res);
94 96
95/* Calculate maximal size of packet seen by hard_start_xmit 97/* Calculate maximal size of packet seen by hard_start_xmit
96 routine of this device. 98 routine of this device.
diff --git a/include/net/rawv6.h b/include/net/rawv6.h
index af8960878ef4..a5819891d525 100644
--- a/include/net/rawv6.h
+++ b/include/net/rawv6.h
@@ -3,6 +3,8 @@
3 3
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5 5
6#include <net/protocol.h>
7
6#define RAWV6_HTABLE_SIZE MAX_INET_PROTOS 8#define RAWV6_HTABLE_SIZE MAX_INET_PROTOS
7extern struct hlist_head raw_v6_htable[RAWV6_HTABLE_SIZE]; 9extern struct hlist_head raw_v6_htable[RAWV6_HTABLE_SIZE];
8extern rwlock_t raw_v6_lock; 10extern rwlock_t raw_v6_lock;
@@ -23,6 +25,13 @@ extern void rawv6_err(struct sock *sk,
23 int type, int code, 25 int type, int code,
24 int offset, __be32 info); 26 int offset, __be32 info);
25 27
28#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
29int rawv6_mh_filter_register(int (*filter)(struct sock *sock,
30 struct sk_buff *skb));
31int rawv6_mh_filter_unregister(int (*filter)(struct sock *sock,
32 struct sk_buff *skb));
33#endif
34
26#endif 35#endif
27 36
28#endif 37#endif
diff --git a/include/net/route.h b/include/net/route.h
index 749e4dfe5ff3..f7ce6259f86f 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -62,7 +62,6 @@ struct rtable
62 62
63 unsigned rt_flags; 63 unsigned rt_flags;
64 __u16 rt_type; 64 __u16 rt_type;
65 __u16 rt_multipath_alg;
66 65
67 __be32 rt_dst; /* Path destination */ 66 __be32 rt_dst; /* Path destination */
68 __be32 rt_src; /* Path source */ 67 __be32 rt_src; /* Path source */
@@ -136,7 +135,7 @@ static inline void ip_rt_put(struct rtable * rt)
136 135
137#define IPTOS_RT_MASK (IPTOS_TOS_MASK & ~3) 136#define IPTOS_RT_MASK (IPTOS_TOS_MASK & ~3)
138 137
139extern __u8 ip_tos2prio[16]; 138extern const __u8 ip_tos2prio[16];
140 139
141static inline char rt_tos2priority(u8 tos) 140static inline char rt_tos2priority(u8 tos)
142{ 141{
diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h
index 3b3d4745618d..3861c05cdf0f 100644
--- a/include/net/rtnetlink.h
+++ b/include/net/rtnetlink.h
@@ -22,4 +22,62 @@ static inline int rtnl_msg_family(struct nlmsghdr *nlh)
22 return AF_UNSPEC; 22 return AF_UNSPEC;
23} 23}
24 24
25/**
26 * struct rtnl_link_ops - rtnetlink link operations
27 *
28 * @list: Used internally
29 * @kind: Identifier
30 * @maxtype: Highest device specific netlink attribute number
31 * @policy: Netlink policy for device specific attribute validation
32 * @validate: Optional validation function for netlink/changelink parameters
33 * @priv_size: sizeof net_device private space
34 * @setup: net_device setup function
35 * @newlink: Function for configuring and registering a new device
36 * @changelink: Function for changing parameters of an existing device
37 * @dellink: Function to remove a device
38 * @get_size: Function to calculate required room for dumping device
39 * specific netlink attributes
40 * @fill_info: Function to dump device specific netlink attributes
41 * @get_xstats_size: Function to calculate required room for dumping devic
42 * specific statistics
43 * @fill_xstats: Function to dump device specific statistics
44 */
45struct rtnl_link_ops {
46 struct list_head list;
47
48 const char *kind;
49
50 size_t priv_size;
51 void (*setup)(struct net_device *dev);
52
53 int maxtype;
54 const struct nla_policy *policy;
55 int (*validate)(struct nlattr *tb[],
56 struct nlattr *data[]);
57
58 int (*newlink)(struct net_device *dev,
59 struct nlattr *tb[],
60 struct nlattr *data[]);
61 int (*changelink)(struct net_device *dev,
62 struct nlattr *tb[],
63 struct nlattr *data[]);
64 void (*dellink)(struct net_device *dev);
65
66 size_t (*get_size)(const struct net_device *dev);
67 int (*fill_info)(struct sk_buff *skb,
68 const struct net_device *dev);
69
70 size_t (*get_xstats_size)(const struct net_device *dev);
71 int (*fill_xstats)(struct sk_buff *skb,
72 const struct net_device *dev);
73};
74
75extern int __rtnl_link_register(struct rtnl_link_ops *ops);
76extern void __rtnl_link_unregister(struct rtnl_link_ops *ops);
77
78extern int rtnl_link_register(struct rtnl_link_ops *ops);
79extern void rtnl_link_unregister(struct rtnl_link_ops *ops);
80
81#define MODULE_ALIAS_RTNL_LINK(kind) MODULE_ALIAS("rtnl-link-" kind)
82
25#endif 83#endif
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 1b8e35197ebe..8a67f24cbe02 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -290,7 +290,7 @@ static inline int qdisc_reshape_fail(struct sk_buff *skb, struct Qdisc *sch)
290{ 290{
291 sch->qstats.drops++; 291 sch->qstats.drops++;
292 292
293#ifdef CONFIG_NET_CLS_POLICE 293#ifdef CONFIG_NET_CLS_ACT
294 if (sch->reshape_fail == NULL || sch->reshape_fail(skb, sch)) 294 if (sch->reshape_fail == NULL || sch->reshape_fail(skb, sch))
295 goto drop; 295 goto drop;
296 296
diff --git a/include/net/scm.h b/include/net/scm.h
index 5637d5e22d5f..423cb1d5ac25 100644
--- a/include/net/scm.h
+++ b/include/net/scm.h
@@ -8,7 +8,7 @@
8/* Well, we should have at least one descriptor open 8/* Well, we should have at least one descriptor open
9 * to accept passed FDs 8) 9 * to accept passed FDs 8)
10 */ 10 */
11#define SCM_MAX_FD (OPEN_MAX-1) 11#define SCM_MAX_FD 255
12 12
13struct scm_fp_list 13struct scm_fp_list
14{ 14{
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index dda72bf5b9b4..16baef4dab7e 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -503,6 +503,13 @@ static inline int sctp_frag_point(const struct sctp_sock *sp, int pmtu)
503 return frag; 503 return frag;
504} 504}
505 505
506static inline void sctp_assoc_pending_pmtu(struct sctp_association *asoc)
507{
508
509 sctp_assoc_sync_pmtu(asoc);
510 asoc->pmtu_pending = 0;
511}
512
506/* Walk through a list of TLV parameters. Don't trust the 513/* Walk through a list of TLV parameters. Don't trust the
507 * individual parameter lengths and instead depend on 514 * individual parameter lengths and instead depend on
508 * the chunk length to indicate when to stop. Make sure 515 * the chunk length to indicate when to stop. Make sure
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 5e81984b8478..ee4559b11302 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -912,6 +912,9 @@ struct sctp_transport {
912 */ 912 */
913 __u16 pathmaxrxt; 913 __u16 pathmaxrxt;
914 914
915 /* is the Path MTU update pending on this tranport */
916 __u8 pmtu_pending;
917
915 /* PMTU : The current known path MTU. */ 918 /* PMTU : The current known path MTU. */
916 __u32 pathmtu; 919 __u32 pathmtu;
917 920
@@ -1006,6 +1009,7 @@ void sctp_transport_raise_cwnd(struct sctp_transport *, __u32, __u32);
1006void sctp_transport_lower_cwnd(struct sctp_transport *, sctp_lower_cwnd_t); 1009void sctp_transport_lower_cwnd(struct sctp_transport *, sctp_lower_cwnd_t);
1007unsigned long sctp_transport_timeout(struct sctp_transport *); 1010unsigned long sctp_transport_timeout(struct sctp_transport *);
1008void sctp_transport_reset(struct sctp_transport *); 1011void sctp_transport_reset(struct sctp_transport *);
1012void sctp_transport_update_pmtu(struct sctp_transport *, u32);
1009 1013
1010 1014
1011/* This is the structure we use to queue packets as they come into 1015/* This is the structure we use to queue packets as they come into
@@ -1565,6 +1569,9 @@ struct sctp_association {
1565 */ 1569 */
1566 __u16 pathmaxrxt; 1570 __u16 pathmaxrxt;
1567 1571
1572 /* Flag that path mtu update is pending */
1573 __u8 pmtu_pending;
1574
1568 /* Association : The smallest PMTU discovered for all of the 1575 /* Association : The smallest PMTU discovered for all of the
1569 * PMTU : peer's transport addresses. 1576 * PMTU : peer's transport addresses.
1570 */ 1577 */
diff --git a/include/net/tcp.h b/include/net/tcp.h
index a8af9ae00177..8b404b1ef7c8 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -652,8 +652,7 @@ struct tcp_congestion_ops {
652 /* lower bound for congestion window (optional) */ 652 /* lower bound for congestion window (optional) */
653 u32 (*min_cwnd)(const struct sock *sk); 653 u32 (*min_cwnd)(const struct sock *sk);
654 /* do new cwnd calculation (required) */ 654 /* do new cwnd calculation (required) */
655 void (*cong_avoid)(struct sock *sk, u32 ack, 655 void (*cong_avoid)(struct sock *sk, u32 ack, u32 in_flight, int good_ack);
656 u32 rtt, u32 in_flight, int good_ack);
657 /* call before changing ca_state (optional) */ 656 /* call before changing ca_state (optional) */
658 void (*set_state)(struct sock *sk, u8 new_state); 657 void (*set_state)(struct sock *sk, u8 new_state);
659 /* call when cwnd event occurs (optional) */ 658 /* call when cwnd event occurs (optional) */
@@ -684,8 +683,7 @@ extern void tcp_slow_start(struct tcp_sock *tp);
684 683
685extern struct tcp_congestion_ops tcp_init_congestion_ops; 684extern struct tcp_congestion_ops tcp_init_congestion_ops;
686extern u32 tcp_reno_ssthresh(struct sock *sk); 685extern u32 tcp_reno_ssthresh(struct sock *sk);
687extern void tcp_reno_cong_avoid(struct sock *sk, u32 ack, 686extern void tcp_reno_cong_avoid(struct sock *sk, u32 ack, u32 in_flight, int flag);
688 u32 rtt, u32 in_flight, int flag);
689extern u32 tcp_reno_min_cwnd(const struct sock *sk); 687extern u32 tcp_reno_min_cwnd(const struct sock *sk);
690extern struct tcp_congestion_ops tcp_reno; 688extern struct tcp_congestion_ops tcp_reno;
691 689
diff --git a/include/net/tipc/tipc_port.h b/include/net/tipc/tipc_port.h
index 333bba6dc522..cfc4ba46de8f 100644
--- a/include/net/tipc/tipc_port.h
+++ b/include/net/tipc/tipc_port.h
@@ -1,8 +1,8 @@
1/* 1/*
2 * include/net/tipc/tipc_port.h: Include file for privileged access to TIPC ports 2 * include/net/tipc/tipc_port.h: Include file for privileged access to TIPC ports
3 * 3 *
4 * Copyright (c) 1994-2006, Ericsson AB 4 * Copyright (c) 1994-2007, Ericsson AB
5 * Copyright (c) 2005, Wind River Systems 5 * Copyright (c) 2005-2007, Wind River Systems
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
@@ -55,6 +55,7 @@
55 * @conn_unacked: number of unacknowledged messages received from peer port 55 * @conn_unacked: number of unacknowledged messages received from peer port
56 * @published: non-zero if port has one or more associated names 56 * @published: non-zero if port has one or more associated names
57 * @congested: non-zero if cannot send because of link or port congestion 57 * @congested: non-zero if cannot send because of link or port congestion
58 * @max_pkt: maximum packet size "hint" used when building messages sent by port
58 * @ref: unique reference to port in TIPC object registry 59 * @ref: unique reference to port in TIPC object registry
59 * @phdr: preformatted message header used when sending messages 60 * @phdr: preformatted message header used when sending messages
60 */ 61 */
@@ -68,6 +69,7 @@ struct tipc_port {
68 u32 conn_unacked; 69 u32 conn_unacked;
69 int published; 70 int published;
70 u32 congested; 71 u32 congested;
72 u32 max_pkt;
71 u32 ref; 73 u32 ref;
72 struct tipc_msg phdr; 74 struct tipc_msg phdr;
73}; 75};
diff --git a/include/net/udp.h b/include/net/udp.h
index 496f89d45c8b..98755ebaf163 100644
--- a/include/net/udp.h
+++ b/include/net/udp.h
@@ -119,16 +119,9 @@ static inline void udp_lib_close(struct sock *sk, long timeout)
119} 119}
120 120
121 121
122struct udp_get_port_ops {
123 int (*saddr_cmp)(const struct sock *sk1, const struct sock *sk2);
124 int (*saddr_any)(const struct sock *sk);
125 unsigned int (*hash_port_and_rcv_saddr)(__u16 port,
126 const struct sock *sk);
127};
128
129/* net/ipv4/udp.c */ 122/* net/ipv4/udp.c */
130extern int udp_get_port(struct sock *sk, unsigned short snum, 123extern int udp_get_port(struct sock *sk, unsigned short snum,
131 const struct udp_get_port_ops *ops); 124 int (*saddr_cmp)(const struct sock *, const struct sock *));
132extern void udp_err(struct sk_buff *, u32); 125extern void udp_err(struct sk_buff *, u32);
133 126
134extern int udp_sendmsg(struct kiocb *iocb, struct sock *sk, 127extern int udp_sendmsg(struct kiocb *iocb, struct sock *sk,
diff --git a/include/net/udplite.h b/include/net/udplite.h
index 50b4b424d1ca..635b0eafca95 100644
--- a/include/net/udplite.h
+++ b/include/net/udplite.h
@@ -120,5 +120,5 @@ static inline __wsum udplite_csum_outgoing(struct sock *sk, struct sk_buff *skb)
120 120
121extern void udplite4_register(void); 121extern void udplite4_register(void);
122extern int udplite_get_port(struct sock *sk, unsigned short snum, 122extern int udplite_get_port(struct sock *sk, unsigned short snum,
123 const struct udp_get_port_ops *ops); 123 int (*scmp)(const struct sock *, const struct sock *));
124#endif /* _UDPLITE_H */ 124#endif /* _UDPLITE_H */
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 90185e8b335e..a5f80bfbaaa4 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -19,9 +19,19 @@
19#include <net/ipv6.h> 19#include <net/ipv6.h>
20#include <net/ip6_fib.h> 20#include <net/ip6_fib.h>
21 21
22#define XFRM_PROTO_ESP 50
23#define XFRM_PROTO_AH 51
24#define XFRM_PROTO_COMP 108
25#define XFRM_PROTO_IPIP 4
26#define XFRM_PROTO_IPV6 41
27#define XFRM_PROTO_ROUTING IPPROTO_ROUTING
28#define XFRM_PROTO_DSTOPTS IPPROTO_DSTOPTS
29
22#define XFRM_ALIGN8(len) (((len) + 7) & ~7) 30#define XFRM_ALIGN8(len) (((len) + 7) & ~7)
23#define MODULE_ALIAS_XFRM_MODE(family, encap) \ 31#define MODULE_ALIAS_XFRM_MODE(family, encap) \
24 MODULE_ALIAS("xfrm-mode-" __stringify(family) "-" __stringify(encap)) 32 MODULE_ALIAS("xfrm-mode-" __stringify(family) "-" __stringify(encap))
33#define MODULE_ALIAS_XFRM_TYPE(family, proto) \
34 MODULE_ALIAS("xfrm-type-" __stringify(family) "-" __stringify(proto))
25 35
26extern struct sock *xfrm_nl; 36extern struct sock *xfrm_nl;
27extern u32 sysctl_xfrm_aevent_etime; 37extern u32 sysctl_xfrm_aevent_etime;
@@ -509,11 +519,9 @@ __be16 xfrm_flowi_sport(struct flowi *fl)
509 case IPPROTO_ICMPV6: 519 case IPPROTO_ICMPV6:
510 port = htons(fl->fl_icmp_type); 520 port = htons(fl->fl_icmp_type);
511 break; 521 break;
512#ifdef CONFIG_IPV6_MIP6
513 case IPPROTO_MH: 522 case IPPROTO_MH:
514 port = htons(fl->fl_mh_type); 523 port = htons(fl->fl_mh_type);
515 break; 524 break;
516#endif
517 default: 525 default:
518 port = 0; /*XXX*/ 526 port = 0; /*XXX*/
519 } 527 }
@@ -577,7 +585,6 @@ static inline int xfrm_sec_ctx_match(struct xfrm_sec_ctx *s1, struct xfrm_sec_ct
577struct xfrm_dst 585struct xfrm_dst
578{ 586{
579 union { 587 union {
580 struct xfrm_dst *next;
581 struct dst_entry dst; 588 struct dst_entry dst;
582 struct rtable rt; 589 struct rtable rt;
583 struct rt6_info rt6; 590 struct rt6_info rt6;
@@ -920,6 +927,10 @@ extern struct xfrm_state *xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t
920 struct flowi *fl, struct xfrm_tmpl *tmpl, 927 struct flowi *fl, struct xfrm_tmpl *tmpl,
921 struct xfrm_policy *pol, int *err, 928 struct xfrm_policy *pol, int *err,
922 unsigned short family); 929 unsigned short family);
930extern struct xfrm_state * xfrm_stateonly_find(xfrm_address_t *daddr,
931 xfrm_address_t *saddr,
932 unsigned short family,
933 u8 mode, u8 proto, u32 reqid);
923extern int xfrm_state_check_expire(struct xfrm_state *x); 934extern int xfrm_state_check_expire(struct xfrm_state *x);
924extern void xfrm_state_insert(struct xfrm_state *x); 935extern void xfrm_state_insert(struct xfrm_state *x);
925extern int xfrm_state_add(struct xfrm_state *x); 936extern int xfrm_state_add(struct xfrm_state *x);
@@ -964,7 +975,7 @@ struct xfrmk_spdinfo {
964 975
965extern struct xfrm_state *xfrm_find_acq_byseq(u32 seq); 976extern struct xfrm_state *xfrm_find_acq_byseq(u32 seq);
966extern int xfrm_state_delete(struct xfrm_state *x); 977extern int xfrm_state_delete(struct xfrm_state *x);
967extern void xfrm_state_flush(u8 proto, struct xfrm_audit *audit_info); 978extern int xfrm_state_flush(u8 proto, struct xfrm_audit *audit_info);
968extern void xfrm_sad_getinfo(struct xfrmk_sadinfo *si); 979extern void xfrm_sad_getinfo(struct xfrmk_sadinfo *si);
969extern void xfrm_spd_getinfo(struct xfrmk_spdinfo *si); 980extern void xfrm_spd_getinfo(struct xfrmk_spdinfo *si);
970extern int xfrm_replay_check(struct xfrm_state *x, __be32 seq); 981extern int xfrm_replay_check(struct xfrm_state *x, __be32 seq);
@@ -991,7 +1002,7 @@ extern int xfrm6_find_1stfragopt(struct xfrm_state *x, struct sk_buff *skb,
991 u8 **prevhdr); 1002 u8 **prevhdr);
992 1003
993#ifdef CONFIG_XFRM 1004#ifdef CONFIG_XFRM
994extern int xfrm4_rcv_encap(struct sk_buff *skb, __u16 encap_type); 1005extern int xfrm4_udp_encap_rcv(struct sock *sk, struct sk_buff *skb);
995extern int xfrm_user_policy(struct sock *sk, int optname, u8 __user *optval, int optlen); 1006extern int xfrm_user_policy(struct sock *sk, int optname, u8 __user *optval, int optlen);
996extern int xfrm_dst_lookup(struct xfrm_dst **dst, struct flowi *fl, unsigned short family); 1007extern int xfrm_dst_lookup(struct xfrm_dst **dst, struct flowi *fl, unsigned short family);
997#else 1008#else
@@ -1000,12 +1011,13 @@ static inline int xfrm_user_policy(struct sock *sk, int optname, u8 __user *optv
1000 return -ENOPROTOOPT; 1011 return -ENOPROTOOPT;
1001} 1012}
1002 1013
1003static inline int xfrm4_rcv_encap(struct sk_buff *skb, __u16 encap_type) 1014static inline int xfrm4_udp_encap_rcv(struct sock *sk, struct sk_buff *skb)
1004{ 1015{
1005 /* should not happen */ 1016 /* should not happen */
1006 kfree_skb(skb); 1017 kfree_skb(skb);
1007 return 0; 1018 return 0;
1008} 1019}
1020
1009static inline int xfrm_dst_lookup(struct xfrm_dst **dst, struct flowi *fl, unsigned short family) 1021static inline int xfrm_dst_lookup(struct xfrm_dst **dst, struct flowi *fl, unsigned short family)
1010{ 1022{
1011 return -EINVAL; 1023 return -EINVAL;
@@ -1020,13 +1032,13 @@ struct xfrm_policy *xfrm_policy_bysel_ctx(u8 type, int dir,
1020 struct xfrm_sec_ctx *ctx, int delete, 1032 struct xfrm_sec_ctx *ctx, int delete,
1021 int *err); 1033 int *err);
1022struct xfrm_policy *xfrm_policy_byid(u8, int dir, u32 id, int delete, int *err); 1034struct xfrm_policy *xfrm_policy_byid(u8, int dir, u32 id, int delete, int *err);
1023void xfrm_policy_flush(u8 type, struct xfrm_audit *audit_info); 1035int xfrm_policy_flush(u8 type, struct xfrm_audit *audit_info);
1024u32 xfrm_get_acqseq(void); 1036u32 xfrm_get_acqseq(void);
1025void xfrm_alloc_spi(struct xfrm_state *x, __be32 minspi, __be32 maxspi); 1037void xfrm_alloc_spi(struct xfrm_state *x, __be32 minspi, __be32 maxspi);
1026struct xfrm_state * xfrm_find_acq(u8 mode, u32 reqid, u8 proto, 1038struct xfrm_state * xfrm_find_acq(u8 mode, u32 reqid, u8 proto,
1027 xfrm_address_t *daddr, xfrm_address_t *saddr, 1039 xfrm_address_t *daddr, xfrm_address_t *saddr,
1028 int create, unsigned short family); 1040 int create, unsigned short family);
1029extern void xfrm_policy_flush(u8 type, struct xfrm_audit *audit_info); 1041extern int xfrm_policy_flush(u8 type, struct xfrm_audit *audit_info);
1030extern int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol); 1042extern int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol);
1031extern int xfrm_bundle_ok(struct xfrm_policy *pol, struct xfrm_dst *xdst, 1043extern int xfrm_bundle_ok(struct xfrm_policy *pol, struct xfrm_dst *xdst,
1032 struct flowi *fl, int family, int strict); 1044 struct flowi *fl, int family, int strict);