diff options
Diffstat (limited to 'include/net')
44 files changed, 1089 insertions, 352 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 | |||
41 | extern unsigned int p9_debug_level; | ||
42 | |||
43 | #define P9_DPRINTK(level, format, arg...) \ | ||
44 | do { \ | ||
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...) \ | ||
60 | do { \ | ||
61 | printk(level "9p: %s (%d): " \ | ||
62 | format , __FUNCTION__, current->pid , ## arg); \ | ||
63 | } while (0) | ||
64 | |||
65 | |||
66 | /* Message Types */ | ||
67 | enum { | ||
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 */ | ||
99 | enum { | ||
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 */ | ||
112 | enum { | ||
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 */ | ||
130 | enum { | ||
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 | |||
149 | struct p9_str { | ||
150 | u16 len; | ||
151 | char *str; | ||
152 | }; | ||
153 | |||
154 | /* qids are the unique ID for a file (like an inode */ | ||
155 | struct p9_qid { | ||
156 | u8 type; | ||
157 | u32 version; | ||
158 | u64 path; | ||
159 | }; | ||
160 | |||
161 | /* Plan 9 file metadata (stat) structure */ | ||
162 | struct 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 | */ | ||
185 | struct 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 */ | ||
205 | struct p9_tversion { | ||
206 | u32 msize; | ||
207 | struct p9_str version; | ||
208 | }; | ||
209 | |||
210 | struct p9_rversion { | ||
211 | u32 msize; | ||
212 | struct p9_str version; | ||
213 | }; | ||
214 | |||
215 | struct p9_tauth { | ||
216 | u32 afid; | ||
217 | struct p9_str uname; | ||
218 | struct p9_str aname; | ||
219 | }; | ||
220 | |||
221 | struct p9_rauth { | ||
222 | struct p9_qid qid; | ||
223 | }; | ||
224 | |||
225 | struct p9_rerror { | ||
226 | struct p9_str error; | ||
227 | u32 errno; /* 9p2000.u extension */ | ||
228 | }; | ||
229 | |||
230 | struct p9_tflush { | ||
231 | u16 oldtag; | ||
232 | }; | ||
233 | |||
234 | struct p9_rflush { | ||
235 | }; | ||
236 | |||
237 | struct p9_tattach { | ||
238 | u32 fid; | ||
239 | u32 afid; | ||
240 | struct p9_str uname; | ||
241 | struct p9_str aname; | ||
242 | }; | ||
243 | |||
244 | struct p9_rattach { | ||
245 | struct p9_qid qid; | ||
246 | }; | ||
247 | |||
248 | struct p9_twalk { | ||
249 | u32 fid; | ||
250 | u32 newfid; | ||
251 | u16 nwname; | ||
252 | struct p9_str wnames[16]; | ||
253 | }; | ||
254 | |||
255 | struct p9_rwalk { | ||
256 | u16 nwqid; | ||
257 | struct p9_qid wqids[16]; | ||
258 | }; | ||
259 | |||
260 | struct p9_topen { | ||
261 | u32 fid; | ||
262 | u8 mode; | ||
263 | }; | ||
264 | |||
265 | struct p9_ropen { | ||
266 | struct p9_qid qid; | ||
267 | u32 iounit; | ||
268 | }; | ||
269 | |||
270 | struct p9_tcreate { | ||
271 | u32 fid; | ||
272 | struct p9_str name; | ||
273 | u32 perm; | ||
274 | u8 mode; | ||
275 | struct p9_str extension; | ||
276 | }; | ||
277 | |||
278 | struct p9_rcreate { | ||
279 | struct p9_qid qid; | ||
280 | u32 iounit; | ||
281 | }; | ||
282 | |||
283 | struct p9_tread { | ||
284 | u32 fid; | ||
285 | u64 offset; | ||
286 | u32 count; | ||
287 | }; | ||
288 | |||
289 | struct p9_rread { | ||
290 | u32 count; | ||
291 | u8 *data; | ||
292 | }; | ||
293 | |||
294 | struct p9_twrite { | ||
295 | u32 fid; | ||
296 | u64 offset; | ||
297 | u32 count; | ||
298 | u8 *data; | ||
299 | }; | ||
300 | |||
301 | struct p9_rwrite { | ||
302 | u32 count; | ||
303 | }; | ||
304 | |||
305 | struct p9_tclunk { | ||
306 | u32 fid; | ||
307 | }; | ||
308 | |||
309 | struct p9_rclunk { | ||
310 | }; | ||
311 | |||
312 | struct p9_tremove { | ||
313 | u32 fid; | ||
314 | }; | ||
315 | |||
316 | struct p9_rremove { | ||
317 | }; | ||
318 | |||
319 | struct p9_tstat { | ||
320 | u32 fid; | ||
321 | }; | ||
322 | |||
323 | struct p9_rstat { | ||
324 | struct p9_stat stat; | ||
325 | }; | ||
326 | |||
327 | struct p9_twstat { | ||
328 | u32 fid; | ||
329 | struct p9_stat stat; | ||
330 | }; | ||
331 | |||
332 | struct p9_rwstat { | ||
333 | }; | ||
334 | |||
335 | /* | ||
336 | * fcall is the primary packet structure | ||
337 | * | ||
338 | */ | ||
339 | |||
340 | struct 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 | |||
377 | struct p9_idpool; | ||
378 | |||
379 | int p9_deserialize_stat(void *buf, u32 buflen, struct p9_stat *stat, | ||
380 | int dotu); | ||
381 | int p9_deserialize_fcall(void *buf, u32 buflen, struct p9_fcall *fc, int dotu); | ||
382 | void p9_set_tag(struct p9_fcall *fc, u16 tag); | ||
383 | struct p9_fcall *p9_create_tversion(u32 msize, char *version); | ||
384 | struct p9_fcall *p9_create_tattach(u32 fid, u32 afid, char *uname, | ||
385 | char *aname); | ||
386 | struct p9_fcall *p9_create_tauth(u32 afid, char *uname, char *aname); | ||
387 | struct p9_fcall *p9_create_tflush(u16 oldtag); | ||
388 | struct p9_fcall *p9_create_twalk(u32 fid, u32 newfid, u16 nwname, | ||
389 | char **wnames); | ||
390 | struct p9_fcall *p9_create_topen(u32 fid, u8 mode); | ||
391 | struct p9_fcall *p9_create_tcreate(u32 fid, char *name, u32 perm, u8 mode, | ||
392 | char *extension, int dotu); | ||
393 | struct p9_fcall *p9_create_tread(u32 fid, u64 offset, u32 count); | ||
394 | struct p9_fcall *p9_create_twrite(u32 fid, u64 offset, u32 count, | ||
395 | const char *data); | ||
396 | struct p9_fcall *p9_create_twrite_u(u32 fid, u64 offset, u32 count, | ||
397 | const char __user *data); | ||
398 | struct p9_fcall *p9_create_tclunk(u32 fid); | ||
399 | struct p9_fcall *p9_create_tremove(u32 fid); | ||
400 | struct p9_fcall *p9_create_tstat(u32 fid); | ||
401 | struct p9_fcall *p9_create_twstat(u32 fid, struct p9_wstat *wstat, | ||
402 | int dotu); | ||
403 | |||
404 | int p9_printfcall(char *buf, int buflen, struct p9_fcall *fc, int dotu); | ||
405 | int p9_errstr2errno(char *errstr, int len); | ||
406 | |||
407 | struct p9_idpool *p9_idpool_create(void); | ||
408 | void p9_idpool_destroy(struct p9_idpool *); | ||
409 | int p9_idpool_get(struct p9_idpool *p); | ||
410 | void p9_idpool_put(int id, struct p9_idpool *p); | ||
411 | int p9_idpool_check(int id, struct p9_idpool *p); | ||
412 | |||
413 | int p9_error_init(void); | ||
414 | int p9_errstr2errno(char *, int); | ||
415 | int __init p9_sysctl_register(void); | ||
416 | void __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 | |||
28 | struct 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 | |||
39 | struct 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 | |||
55 | struct p9_client *p9_client_create(struct p9_transport *trans, int msize, | ||
56 | int dotu); | ||
57 | void p9_client_destroy(struct p9_client *clnt); | ||
58 | void p9_client_disconnect(struct p9_client *clnt); | ||
59 | struct p9_fid *p9_client_attach(struct p9_client *clnt, struct p9_fid *afid, | ||
60 | char *uname, char *aname); | ||
61 | struct p9_fid *p9_client_auth(struct p9_client *clnt, char *uname, char *aname); | ||
62 | struct p9_fid *p9_client_walk(struct p9_fid *oldfid, int nwname, char **wnames, | ||
63 | int clone); | ||
64 | int p9_client_open(struct p9_fid *fid, int mode); | ||
65 | int p9_client_fcreate(struct p9_fid *fid, char *name, u32 perm, int mode, | ||
66 | char *extension); | ||
67 | int p9_client_clunk(struct p9_fid *fid); | ||
68 | int p9_client_remove(struct p9_fid *fid); | ||
69 | int p9_client_read(struct p9_fid *fid, char *data, u64 offset, u32 count); | ||
70 | int p9_client_readn(struct p9_fid *fid, char *data, u64 offset, u32 count); | ||
71 | int p9_client_write(struct p9_fid *fid, char *data, u64 offset, u32 count); | ||
72 | int p9_client_uread(struct p9_fid *fid, char __user *data, u64 offset, | ||
73 | u32 count); | ||
74 | int p9_client_uwrite(struct p9_fid *fid, const char __user *data, u64 offset, | ||
75 | u32 count); | ||
76 | struct p9_stat *p9_client_stat(struct p9_fid *fid); | ||
77 | int p9_client_wstat(struct p9_fid *fid, struct p9_wstat *wst); | ||
78 | struct 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 | |||
31 | struct p9_conn; | ||
32 | struct 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 | */ | ||
43 | typedef void (*p9_conn_req_callback)(struct p9_req *req, void *a); | ||
44 | |||
45 | struct p9_conn *p9_conn_create(struct p9_transport *trans, int msize, | ||
46 | unsigned char *dotu); | ||
47 | void p9_conn_destroy(struct p9_conn *); | ||
48 | int p9_conn_rpc(struct p9_conn *m, struct p9_fcall *tc, struct p9_fcall **rc); | ||
49 | |||
50 | #ifdef P9_NONBLOCK | ||
51 | int p9_conn_rpcnb(struct p9_conn *m, struct p9_fcall *tc, | ||
52 | p9_conn_req_callback cb, void *a); | ||
53 | #endif /* P9_NONBLOCK */ | ||
54 | |||
55 | void 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 | |||
29 | enum p9_transport_status { | ||
30 | Connected, | ||
31 | Disconnected, | ||
32 | Hung, | ||
33 | }; | ||
34 | |||
35 | struct 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 | |||
45 | struct p9_transport *p9_trans_create_tcp(const char *addr, int port); | ||
46 | struct p9_transport *p9_trans_create_unix(const char *addr); | ||
47 | struct 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 | ||
38 | struct tcf_police { | 36 | struct tcf_police { |
@@ -123,34 +121,4 @@ extern int tcf_action_dump_old(struct sk_buff *skb, struct tc_action *a, int, in | |||
123 | extern int tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int, int); | 121 | extern int tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int, int); |
124 | extern int tcf_action_copy_stats (struct sk_buff *,struct tc_action *, int); | 122 | extern 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 | |||
127 | extern int tcf_police(struct sk_buff *skb, struct tcf_police *p); | ||
128 | extern void tcf_police_destroy(struct tcf_police *p); | ||
129 | extern struct tcf_police * tcf_police_locate(struct rtattr *rta, struct rtattr *est); | ||
130 | extern int tcf_police_dump(struct sk_buff *skb, struct tcf_police *p); | ||
131 | extern int tcf_police_dump_stats(struct sk_buff *skb, struct tcf_police *p); | ||
132 | |||
133 | static inline int | ||
134 | tcf_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); | |||
61 | extern int ipv6_chk_addr(struct in6_addr *addr, | 61 | extern 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) |
65 | extern int ipv6_chk_home_addr(struct in6_addr *addr); | 65 | extern int ipv6_chk_home_addr(struct in6_addr *addr); |
66 | #endif | 66 | #endif |
67 | extern struct inet6_ifaddr * ipv6_get_ifaddr(struct in6_addr *addr, | 67 | extern 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 65f49fd7deff..6de1e9e35c73 100644 --- a/include/net/af_unix.h +++ b/include/net/af_unix.h | |||
@@ -79,9 +79,10 @@ struct unix_sock { | |||
79 | struct mutex readlock; | 79 | struct mutex readlock; |
80 | struct sock *peer; | 80 | struct sock *peer; |
81 | struct sock *other; | 81 | struct sock *other; |
82 | struct sock *gc_tree; | 82 | struct list_head link; |
83 | atomic_t inflight; | 83 | atomic_t inflight; |
84 | spinlock_t lock; | 84 | spinlock_t lock; |
85 | unsigned int gc_candidate : 1; | ||
85 | wait_queue_head_t peer_wait; | 86 | wait_queue_head_t peer_wait; |
86 | }; | 87 | }; |
87 | #define unix_sk(__sk) ((struct unix_sock *)__sk) | 88 | #define unix_sk(__sk) ((struct unix_sock *)__sk) |
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 | ||
442 | int hci_recv_fragment(struct hci_dev *hdev, int type, void *data, int count); | ||
443 | |||
440 | int hci_register_sysfs(struct hci_dev *hdev); | 444 | int hci_register_sysfs(struct hci_dev *hdev); |
441 | void hci_unregister_sysfs(struct hci_dev *hdev); | 445 | void hci_unregister_sysfs(struct hci_dev *hdev); |
442 | void hci_conn_add_sysfs(struct hci_conn *conn); | 446 | void 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 ----- */ |
454 | struct hci_proto { | 459 | struct 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 | ||
327 | struct rfcomm_dev_req { | 328 | struct 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 | |||
31 | struct 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 | |||
43 | extern int ieee80211_radiotap_iterator_init( | ||
44 | struct ieee80211_radiotap_iterator *iterator, | ||
45 | struct ieee80211_radiotap_header *radiotap_header, | ||
46 | int max_length); | ||
47 | |||
48 | extern int ieee80211_radiotap_iterator_next( | ||
49 | struct ieee80211_radiotap_iterator *iterator); | ||
50 | |||
51 | |||
14 | /* from net/wireless.h */ | 52 | /* from net/wireless.h */ |
15 | struct wiphy; | 53 | struct wiphy; |
16 | 54 | ||
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/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/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) | |||
209 | extern struct inet_timewait_sock *inet_twsk_alloc(const struct sock *sk, | 209 | extern struct inet_timewait_sock *inet_twsk_alloc(const struct sock *sk, |
210 | const int state); | 210 | const int state); |
211 | 211 | ||
212 | extern void __inet_twsk_kill(struct inet_timewait_sock *tw, | ||
213 | struct inet_hashinfo *hashinfo); | ||
214 | |||
215 | extern void __inet_twsk_hashdance(struct inet_timewait_sock *tw, | 212 | extern 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_fib.h b/include/net/ip_fib.h index 69252cbe05b0..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 | |||
156 | struct fib_table { | 140 | struct fib_table { |
157 | struct hlist_node tb_hlist; | 141 | struct hlist_node tb_hlist; |
158 | u32 tb_id; | 142 | u32 tb_id; |
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 | |||
14 | struct fib_nh; | ||
15 | |||
16 | struct 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 | |||
26 | extern int multipath_alg_register(struct ip_mp_alg_ops *, enum ip_mp_alg); | ||
27 | extern void multipath_alg_unregister(struct ip_mp_alg_ops *, enum ip_mp_alg); | ||
28 | |||
29 | extern struct ip_mp_alg_ops *ip_mp_alg_table[]; | ||
30 | |||
31 | static 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 | |||
47 | static 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 | |||
61 | static 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 | |||
74 | static 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 | |||
85 | static 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 | ||
513 | extern int ipv6_find_tlv(struct sk_buff *skb, int offset, int type); | 513 | extern int ipv6_find_tlv(struct sk_buff *skb, int offset, int type); |
514 | 514 | ||
515 | extern 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); | |||
125 | extern int irsock_init(void); | 125 | extern int irsock_init(void); |
126 | extern void irsock_cleanup(void); | 126 | extern void irsock_cleanup(void); |
127 | 127 | ||
128 | extern int irda_nl_register(void); | ||
129 | extern void irda_nl_unregister(void); | ||
130 | |||
128 | extern int irlap_driver_rcv(struct sk_buff *skb, struct net_device *dev, | 131 | extern 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 a3d370efb903..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 | /* |
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 | */ |
354 | struct ieee80211_if_init_conf { | 361 | struct 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 * | |||
921 | ieee80211_get_buffered_bc(struct ieee80211_hw *hw, int if_id, | 929 | ieee80211_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 */ | ||
926 | int 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 | ||
57 | extern int mip6_init(void); | ||
58 | extern void mip6_fini(void); | ||
59 | extern 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 */ | ||
17 | union nf_conntrack_nat_help { | ||
18 | /* insert nat helper private data here */ | ||
19 | struct nf_nat_pptp nat_pptp_info; | ||
20 | }; | ||
21 | |||
22 | struct 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 */ |
33 | struct sk_buff * | 13 | struct sk_buff *nf_ct_ipv4_ct_gather_frags(struct sk_buff *skb); |
34 | nf_ct_ipv4_ct_gather_frags(struct sk_buff *skb); | 14 | |
15 | extern struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv4; | ||
35 | 16 | ||
36 | extern struct nf_conntrack_l4proto nf_conntrack_l4proto_tcp4; | 17 | extern struct nf_conntrack_l4proto nf_conntrack_l4proto_tcp4; |
37 | extern struct nf_conntrack_l4proto nf_conntrack_l4proto_udp4; | 18 | extern 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; | |||
7 | extern struct nf_conntrack_l4proto nf_conntrack_l4proto_udp6; | 7 | extern struct nf_conntrack_l4proto nf_conntrack_l4proto_udp6; |
8 | extern struct nf_conntrack_l4proto nf_conntrack_l4proto_icmpv6; | 8 | extern struct nf_conntrack_l4proto nf_conntrack_l4proto_icmpv6; |
9 | 9 | ||
10 | extern int nf_ct_ipv6_skip_exthdr(struct sk_buff *skb, int start, | 10 | extern 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 | ||
13 | extern int nf_ct_frag6_init(void); | 13 | extern 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 | ||
138 | static inline struct nf_conn * | 137 | static inline struct nf_conn * |
@@ -175,6 +174,10 @@ static inline void nf_ct_put(struct nf_conn *ct) | |||
175 | extern int nf_ct_l3proto_try_module_get(unsigned short l3proto); | 174 | extern int nf_ct_l3proto_try_module_get(unsigned short l3proto); |
176 | extern void nf_ct_l3proto_module_put(unsigned short l3proto); | 175 | extern void nf_ct_l3proto_module_put(unsigned short l3proto); |
177 | 176 | ||
177 | extern struct hlist_head *nf_ct_alloc_hashtable(int *sizep, int *vmalloced); | ||
178 | extern void nf_ct_free_hashtable(struct hlist_head *hash, int vmalloced, | ||
179 | int size); | ||
180 | |||
178 | extern struct nf_conntrack_tuple_hash * | 181 | extern 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 | ||
184 | extern void nf_conntrack_flush(void); | 187 | extern void nf_conntrack_flush(void); |
185 | 188 | ||
189 | extern 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); | ||
186 | extern int nf_ct_invert_tuplepr(struct nf_conntrack_tuple *inverse, | 193 | extern 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. */ | ||
220 | extern void (*nf_conntrack_destroyed)(struct nf_conn *conntrack); | ||
221 | |||
222 | /* Fake conntrack entry for untracked connections */ | 226 | /* Fake conntrack entry for untracked connections */ |
223 | extern struct nf_conn nf_conntrack_untracked; | 227 | extern 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 | |||
273 | extern int | 269 | extern int |
274 | nf_conntrack_register_cache(u_int32_t features, const char *name, size_t size); | 270 | nf_conntrack_register_cache(u_int32_t features, const char *name, size_t size); |
275 | extern void | 271 | extern void |
276 | nf_conntrack_unregister_cache(u_int32_t features); | 272 | nf_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 | ||
283 | static 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 | |||
294 | static 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 */ | ||
309 | static 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); | |||
30 | extern int nf_conntrack_proto_init(void); | 30 | extern int nf_conntrack_proto_init(void); |
31 | extern void nf_conntrack_proto_fini(void); | 31 | extern void nf_conntrack_proto_fini(void); |
32 | 32 | ||
33 | extern int nf_conntrack_helper_init(void); | ||
34 | extern void nf_conntrack_helper_fini(void); | ||
35 | |||
33 | struct nf_conntrack_l3proto; | 36 | struct nf_conntrack_l3proto; |
34 | extern struct nf_conntrack_l3proto *nf_ct_find_l3proto(u_int16_t pf); | 37 | extern 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. */ |
57 | extern struct nf_conntrack_tuple_hash * | 60 | extern struct nf_conntrack_tuple_hash * |
58 | nf_conntrack_find_get(const struct nf_conntrack_tuple *tuple, | 61 | nf_conntrack_find_get(const struct nf_conntrack_tuple *tuple); |
59 | const struct nf_conn *ignored_conntrack); | ||
60 | 62 | ||
61 | extern int __nf_conntrack_confirm(struct sk_buff **pskb); | 63 | extern 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 | ||
84 | extern struct list_head *nf_conntrack_hash; | 86 | extern struct hlist_head *nf_conntrack_hash; |
85 | extern struct list_head nf_conntrack_expect_list; | ||
86 | extern rwlock_t nf_conntrack_lock ; | 87 | extern rwlock_t nf_conntrack_lock ; |
87 | extern struct list_head unconfirmed; | 88 | extern 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 | ||
52 | extern struct atomic_notifier_head nf_conntrack_expect_chain; | 52 | extern struct atomic_notifier_head nf_ct_expect_chain; |
53 | extern int nf_conntrack_expect_register_notifier(struct notifier_block *nb); | 53 | extern int nf_ct_expect_register_notifier(struct notifier_block *nb); |
54 | extern int nf_conntrack_expect_unregister_notifier(struct notifier_block *nb); | 54 | extern int nf_ct_expect_unregister_notifier(struct notifier_block *nb); |
55 | 55 | ||
56 | static inline void | 56 | static inline void |
57 | nf_conntrack_expect_event(enum ip_conntrack_expect_events event, | 57 | nf_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, | |||
67 | static inline void nf_conntrack_event(enum ip_conntrack_events event, | 67 | static inline void nf_conntrack_event(enum ip_conntrack_events event, |
68 | struct nf_conn *ct) {} | 68 | struct nf_conn *ct) {} |
69 | static inline void nf_ct_deliver_cached_events(const struct nf_conn *ct) {} | 69 | static inline void nf_ct_deliver_cached_events(const struct nf_conn *ct) {} |
70 | static inline void | 70 | static inline void nf_ct_expect_event(enum ip_conntrack_expect_events event, |
71 | nf_conntrack_expect_event(enum ip_conntrack_expect_events event, | 71 | struct nf_conntrack_expect *exp) {} |
72 | struct nf_conntrack_expect *exp) {} | ||
73 | static inline void nf_ct_event_cache_flush(void) {} | 72 | static 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 | ||
9 | extern struct list_head nf_conntrack_expect_list; | 9 | extern struct hlist_head *nf_ct_expect_hash; |
10 | extern struct kmem_cache *nf_conntrack_expect_cachep; | 10 | extern unsigned int nf_ct_expect_hsize; |
11 | extern const struct file_operations exp_file_ops; | 11 | extern unsigned int nf_ct_expect_max; |
12 | 12 | ||
13 | struct nf_conntrack_expect | 13 | struct 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 | ||
59 | int nf_conntrack_expect_init(void); | ||
60 | void nf_conntrack_expect_fini(void); | ||
55 | 61 | ||
56 | struct nf_conntrack_expect * | 62 | struct 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 | ||
59 | struct nf_conntrack_expect * | 65 | struct nf_conntrack_expect * |
60 | nf_conntrack_expect_find_get(const struct nf_conntrack_tuple *tuple); | 66 | nf_ct_expect_find_get(const struct nf_conntrack_tuple *tuple); |
61 | 67 | ||
62 | struct nf_conntrack_expect * | 68 | struct nf_conntrack_expect * |
63 | find_expectation(const struct nf_conntrack_tuple *tuple); | 69 | nf_ct_find_expectation(const struct nf_conntrack_tuple *tuple); |
64 | 70 | ||
65 | void nf_ct_unlink_expect(struct nf_conntrack_expect *exp); | 71 | void nf_ct_unlink_expect(struct nf_conntrack_expect *exp); |
66 | void nf_ct_remove_expectations(struct nf_conn *ct); | 72 | void nf_ct_remove_expectations(struct nf_conn *ct); |
67 | void nf_conntrack_unexpect_related(struct nf_conntrack_expect *exp); | 73 | void 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. */ |
71 | struct nf_conntrack_expect *nf_conntrack_expect_alloc(struct nf_conn *me); | 77 | struct nf_conntrack_expect *nf_ct_expect_alloc(struct nf_conn *me); |
72 | void nf_conntrack_expect_init(struct nf_conntrack_expect *, int, | 78 | void 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 *); |
76 | void nf_conntrack_expect_put(struct nf_conntrack_expect *exp); | 82 | void nf_ct_expect_put(struct nf_conntrack_expect *exp); |
77 | int nf_conntrack_expect_related(struct nf_conntrack_expect *expect); | 83 | int 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 | |||
6 | enum 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. */ | ||
17 | struct nf_ct_ext { | ||
18 | u8 offset[NF_CT_EXT_NUM]; | ||
19 | u8 len; | ||
20 | u8 real_len; | ||
21 | char data[0]; | ||
22 | }; | ||
23 | |||
24 | static inline int nf_ct_ext_exist(const struct nf_conn *ct, u8 id) | ||
25 | { | ||
26 | return (ct->ext && ct->ext->offset[id]); | ||
27 | } | ||
28 | |||
29 | static 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 */ | ||
40 | extern void __nf_ct_ext_destroy(struct nf_conn *ct); | ||
41 | static 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 | */ | ||
50 | static 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. */ | ||
57 | void * | ||
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 | |||
64 | struct 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 | |||
83 | int nf_ct_extend_register(struct nf_ct_ext_type *type); | ||
84 | void 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 | ||
14 | struct module; | 15 | struct module; |
15 | 16 | ||
16 | struct nf_conntrack_helper | 17 | struct 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); | |||
52 | extern int nf_conntrack_helper_register(struct nf_conntrack_helper *); | 52 | extern int nf_conntrack_helper_register(struct nf_conntrack_helper *); |
53 | extern void nf_conntrack_helper_unregister(struct nf_conntrack_helper *); | 53 | extern void nf_conntrack_helper_unregister(struct nf_conntrack_helper *); |
54 | 54 | ||
55 | extern struct nf_conn_help *nf_ct_helper_ext_add(struct nf_conn *ct, gfp_t gfp); | ||
56 | |||
57 | static 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); | |||
91 | extern void nf_ct_l3proto_put(struct nf_conntrack_l3proto *p); | 89 | extern void nf_ct_l3proto_put(struct nf_conntrack_l3proto *p); |
92 | 90 | ||
93 | /* Existing built-in protocols */ | 91 | /* Existing built-in protocols */ |
94 | extern struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv4; | ||
95 | extern struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv6; | ||
96 | extern struct nf_conntrack_l3proto nf_conntrack_l3proto_generic; | 92 | extern struct nf_conntrack_l3proto nf_conntrack_l3proto_generic; |
97 | 93 | ||
98 | static inline struct nf_conntrack_l3proto * | 94 | static 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 | ||
103 | struct 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) \ |
116 | DEBUGP("tuple %p: %u %u " NIP6_FMT " %hu -> " NIP6_FMT " %hu\n", \ | 124 | pr_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 */ |
126 | struct nf_conntrack_tuple_hash | 134 | struct 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 | ||
172 | static 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 | |||
182 | static 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 | |||
165 | static inline int nf_ct_tuple_mask_cmp(const struct nf_conntrack_tuple *t, | 204 | static 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 */ |
56 | struct nf_nat_info | 58 | union 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 | ||
62 | struct nf_conn; | 64 | struct nf_conn; |
63 | 65 | ||
66 | /* The structure embedded in the conntrack structure. */ | ||
67 | struct 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. */ |
65 | extern unsigned int nf_nat_setup_info(struct nf_conn *ct, | 80 | extern 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, | |||
70 | extern int nf_nat_used_tuple(const struct nf_conntrack_tuple *tuple, | 85 | extern 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 | ||
73 | extern int nf_nat_module_is_loaded; | 88 | static 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/netlink.h b/include/net/netlink.h index 7b510a9edb91..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: |
@@ -733,6 +739,39 @@ static inline int nla_parse_nested(struct nlattr *tb[], int maxtype, | |||
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 | */ | ||
757 | static 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 | */ | ||
1018 | static 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 | */ | ||
1043 | static 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 |
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 | ||
311 | struct tcf_ematch_tree | 305 | struct 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 | ||
92 | extern int tc_classify_compat(struct sk_buff *skb, struct tcf_proto *tp, | ||
93 | struct tcf_result *res); | ||
92 | extern int tc_classify(struct sk_buff *skb, struct tcf_proto *tp, | 94 | extern 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 |
7 | extern struct hlist_head raw_v6_htable[RAWV6_HTABLE_SIZE]; | 9 | extern struct hlist_head raw_v6_htable[RAWV6_HTABLE_SIZE]; |
8 | extern rwlock_t raw_v6_lock; | 10 | extern 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) | ||
29 | int rawv6_mh_filter_register(int (*filter)(struct sock *sock, | ||
30 | struct sk_buff *skb)); | ||
31 | int 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 | ||
139 | extern __u8 ip_tos2prio[16]; | 138 | extern const __u8 ip_tos2prio[16]; |
140 | 139 | ||
141 | static inline char rt_tos2priority(u8 tos) | 140 | static 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 | */ | ||
45 | struct 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 | |||
75 | extern int __rtnl_link_register(struct rtnl_link_ops *ops); | ||
76 | extern void __rtnl_link_unregister(struct rtnl_link_ops *ops); | ||
77 | |||
78 | extern int rtnl_link_register(struct rtnl_link_ops *ops); | ||
79 | extern 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/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/xfrm.h b/include/net/xfrm.h index 311f25af5e1a..ae959e950174 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 | ||
26 | extern struct sock *xfrm_nl; | 36 | extern struct sock *xfrm_nl; |
27 | extern u32 sysctl_xfrm_aevent_etime; | 37 | extern 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 | } |
@@ -920,6 +928,10 @@ extern struct xfrm_state *xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t | |||
920 | struct flowi *fl, struct xfrm_tmpl *tmpl, | 928 | struct flowi *fl, struct xfrm_tmpl *tmpl, |
921 | struct xfrm_policy *pol, int *err, | 929 | struct xfrm_policy *pol, int *err, |
922 | unsigned short family); | 930 | unsigned short family); |
931 | extern struct xfrm_state * xfrm_stateonly_find(xfrm_address_t *daddr, | ||
932 | xfrm_address_t *saddr, | ||
933 | unsigned short family, | ||
934 | u8 mode, u8 proto, u32 reqid); | ||
923 | extern int xfrm_state_check_expire(struct xfrm_state *x); | 935 | extern int xfrm_state_check_expire(struct xfrm_state *x); |
924 | extern void xfrm_state_insert(struct xfrm_state *x); | 936 | extern void xfrm_state_insert(struct xfrm_state *x); |
925 | extern int xfrm_state_add(struct xfrm_state *x); | 937 | extern int xfrm_state_add(struct xfrm_state *x); |
@@ -991,7 +1003,7 @@ extern int xfrm6_find_1stfragopt(struct xfrm_state *x, struct sk_buff *skb, | |||
991 | u8 **prevhdr); | 1003 | u8 **prevhdr); |
992 | 1004 | ||
993 | #ifdef CONFIG_XFRM | 1005 | #ifdef CONFIG_XFRM |
994 | extern int xfrm4_rcv_encap(struct sk_buff *skb, __u16 encap_type); | 1006 | extern int xfrm4_udp_encap_rcv(struct sock *sk, struct sk_buff *skb); |
995 | extern int xfrm_user_policy(struct sock *sk, int optname, u8 __user *optval, int optlen); | 1007 | extern int xfrm_user_policy(struct sock *sk, int optname, u8 __user *optval, int optlen); |
996 | extern int xfrm_dst_lookup(struct xfrm_dst **dst, struct flowi *fl, unsigned short family); | 1008 | extern int xfrm_dst_lookup(struct xfrm_dst **dst, struct flowi *fl, unsigned short family); |
997 | #else | 1009 | #else |
@@ -1000,12 +1012,13 @@ static inline int xfrm_user_policy(struct sock *sk, int optname, u8 __user *optv | |||
1000 | return -ENOPROTOOPT; | 1012 | return -ENOPROTOOPT; |
1001 | } | 1013 | } |
1002 | 1014 | ||
1003 | static inline int xfrm4_rcv_encap(struct sk_buff *skb, __u16 encap_type) | 1015 | static inline int xfrm4_udp_encap_rcv(struct sock *sk, struct sk_buff *skb) |
1004 | { | 1016 | { |
1005 | /* should not happen */ | 1017 | /* should not happen */ |
1006 | kfree_skb(skb); | 1018 | kfree_skb(skb); |
1007 | return 0; | 1019 | return 0; |
1008 | } | 1020 | } |
1021 | |||
1009 | static inline int xfrm_dst_lookup(struct xfrm_dst **dst, struct flowi *fl, unsigned short family) | 1022 | static inline int xfrm_dst_lookup(struct xfrm_dst **dst, struct flowi *fl, unsigned short family) |
1010 | { | 1023 | { |
1011 | return -EINVAL; | 1024 | return -EINVAL; |