diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-09 11:01:37 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-09 11:01:37 -0500 |
commit | f049274b012fd3b50113f194bfbbcbc3143d0da3 (patch) | |
tree | 15ef947c1959da3196d8dbc524b435972f6d37f7 /include/net | |
parent | b37df85960a34dd96d0a4695c650f7972ef56c30 (diff) | |
parent | 1539b98b561754252dd520b98fa03a688a4f81b5 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: (79 commits)
[IPX]: Fix NULL pointer dereference on ipx unload
[ATM]: atmarp.h needs to always include linux/types.h
[NET]: Fix net/socket.c warnings.
[NET]: cleanup sock_from_file()
[NET]: change layout of ehash table
[S390]: Add AF_IUCV socket support
[S390]: Adapt special message interface to new IUCV API
[S390]: Adapt netiucv driver to new IUCV API
[S390]: Adapt vmlogrdr driver to new IUCV API
[S390]: Adapt monreader driver to new IUCV API
[S390]: Rewrite of the IUCV base code, part 2
[S390]: Rewrite of the IUCV base code, part 1
[X.25]: Adds /proc/net/x25/forward to view active forwarded calls.
[X.25]: Adds /proc/sys/net/x25/x25_forward to control forwarding.
[X.25]: Add call forwarding
[XFRM]: xfrm_migrate() needs exporting to modules.
[PFKEYV2]: CONFIG_NET_KEY_MIGRATE option
[PFKEYV2]: Extension for dynamic update of endpoint address(es)
[XFRM]: CONFIG_XFRM_MIGRATE option
[XFRM]: User interface for handling XFRM_MSG_MIGRATE
...
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/inet_hashtables.h | 10 | ||||
-rw-r--r-- | include/net/iucv/af_iucv.h | 106 | ||||
-rw-r--r-- | include/net/iucv/iucv.h | 415 | ||||
-rw-r--r-- | include/net/netfilter/nf_conntrack.h | 2 | ||||
-rw-r--r-- | include/net/netfilter/nf_nat.h | 1 | ||||
-rw-r--r-- | include/net/route.h | 5 | ||||
-rw-r--r-- | include/net/tcp.h | 5 | ||||
-rw-r--r-- | include/net/x25.h | 18 | ||||
-rw-r--r-- | include/net/xfrm.h | 47 |
9 files changed, 599 insertions, 10 deletions
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h index 34cc76e3ddb4..d27ee8c0da3f 100644 --- a/include/net/inet_hashtables.h +++ b/include/net/inet_hashtables.h | |||
@@ -34,12 +34,13 @@ | |||
34 | #include <asm/byteorder.h> | 34 | #include <asm/byteorder.h> |
35 | 35 | ||
36 | /* This is for all connections with a full identity, no wildcards. | 36 | /* This is for all connections with a full identity, no wildcards. |
37 | * New scheme, half the table is for TIME_WAIT, the other half is | 37 | * One chain is dedicated to TIME_WAIT sockets. |
38 | * for the rest. I'll experiment with dynamic table growth later. | 38 | * I'll experiment with dynamic table growth later. |
39 | */ | 39 | */ |
40 | struct inet_ehash_bucket { | 40 | struct inet_ehash_bucket { |
41 | rwlock_t lock; | 41 | rwlock_t lock; |
42 | struct hlist_head chain; | 42 | struct hlist_head chain; |
43 | struct hlist_head twchain; | ||
43 | }; | 44 | }; |
44 | 45 | ||
45 | /* There are a few simple rules, which allow for local port reuse by | 46 | /* There are a few simple rules, which allow for local port reuse by |
@@ -97,8 +98,7 @@ struct inet_hashinfo { | |||
97 | * | 98 | * |
98 | * TCP_ESTABLISHED <= sk->sk_state < TCP_CLOSE | 99 | * TCP_ESTABLISHED <= sk->sk_state < TCP_CLOSE |
99 | * | 100 | * |
100 | * First half of the table is for sockets not in TIME_WAIT, second half | 101 | * TIME_WAIT sockets use a separate chain (twchain). |
101 | * is for TIME_WAIT sockets only. | ||
102 | */ | 102 | */ |
103 | struct inet_ehash_bucket *ehash; | 103 | struct inet_ehash_bucket *ehash; |
104 | 104 | ||
@@ -369,7 +369,7 @@ static inline struct sock * | |||
369 | } | 369 | } |
370 | 370 | ||
371 | /* Must check for a TIME_WAIT'er before going to listener hash. */ | 371 | /* Must check for a TIME_WAIT'er before going to listener hash. */ |
372 | sk_for_each(sk, node, &(head + hashinfo->ehash_size)->chain) { | 372 | sk_for_each(sk, node, &head->twchain) { |
373 | if (INET_TW_MATCH(sk, hash, acookie, saddr, daddr, ports, dif)) | 373 | if (INET_TW_MATCH(sk, hash, acookie, saddr, daddr, ports, dif)) |
374 | goto hit; | 374 | goto hit; |
375 | } | 375 | } |
diff --git a/include/net/iucv/af_iucv.h b/include/net/iucv/af_iucv.h new file mode 100644 index 000000000000..04d1abb72d25 --- /dev/null +++ b/include/net/iucv/af_iucv.h | |||
@@ -0,0 +1,106 @@ | |||
1 | /* | ||
2 | * Copyright 2006 IBM Corporation | ||
3 | * IUCV protocol stack for Linux on zSeries | ||
4 | * Version 1.0 | ||
5 | * Author(s): Jennifer Hunt <jenhunt@us.ibm.com> | ||
6 | * | ||
7 | */ | ||
8 | |||
9 | #ifndef __AFIUCV_H | ||
10 | #define __AFIUCV_H | ||
11 | |||
12 | #include <asm/types.h> | ||
13 | #include <asm/byteorder.h> | ||
14 | #include <linux/list.h> | ||
15 | #include <linux/poll.h> | ||
16 | #include <linux/socket.h> | ||
17 | |||
18 | #ifndef AF_IUCV | ||
19 | #define AF_IUCV 32 | ||
20 | #define PF_IUCV AF_IUCV | ||
21 | #endif | ||
22 | |||
23 | /* Connection and socket states */ | ||
24 | enum { | ||
25 | IUCV_CONNECTED = 1, | ||
26 | IUCV_OPEN, | ||
27 | IUCV_BOUND, | ||
28 | IUCV_LISTEN, | ||
29 | IUCV_SEVERED, | ||
30 | IUCV_DISCONN, | ||
31 | IUCV_CLOSED | ||
32 | }; | ||
33 | |||
34 | #define IUCV_QUEUELEN_DEFAULT 65535 | ||
35 | #define IUCV_CONN_TIMEOUT (HZ * 40) | ||
36 | #define IUCV_DISCONN_TIMEOUT (HZ * 2) | ||
37 | #define IUCV_CONN_IDLE_TIMEOUT (HZ * 60) | ||
38 | #define IUCV_BUFSIZE_DEFAULT 32768 | ||
39 | |||
40 | /* IUCV socket address */ | ||
41 | struct sockaddr_iucv { | ||
42 | sa_family_t siucv_family; | ||
43 | unsigned short siucv_port; /* Reserved */ | ||
44 | unsigned int siucv_addr; /* Reserved */ | ||
45 | char siucv_nodeid[8]; /* Reserved */ | ||
46 | char siucv_user_id[8]; /* Guest User Id */ | ||
47 | char siucv_name[8]; /* Application Name */ | ||
48 | }; | ||
49 | |||
50 | |||
51 | /* Common socket structures and functions */ | ||
52 | |||
53 | #define iucv_sk(__sk) ((struct iucv_sock *) __sk) | ||
54 | |||
55 | struct iucv_sock { | ||
56 | struct sock sk; | ||
57 | char src_user_id[8]; | ||
58 | char src_name[8]; | ||
59 | char dst_user_id[8]; | ||
60 | char dst_name[8]; | ||
61 | struct list_head accept_q; | ||
62 | struct sock *parent; | ||
63 | struct iucv_path *path; | ||
64 | struct sk_buff_head send_skb_q; | ||
65 | unsigned int send_tag; | ||
66 | }; | ||
67 | |||
68 | struct iucv_sock_list { | ||
69 | struct hlist_head head; | ||
70 | rwlock_t lock; | ||
71 | atomic_t autobind_name; | ||
72 | }; | ||
73 | |||
74 | static void iucv_sock_destruct(struct sock *sk); | ||
75 | static void iucv_sock_cleanup_listen(struct sock *parent); | ||
76 | static void iucv_sock_kill(struct sock *sk); | ||
77 | static void iucv_sock_close(struct sock *sk); | ||
78 | static int iucv_sock_create(struct socket *sock, int proto); | ||
79 | static int iucv_sock_bind(struct socket *sock, struct sockaddr *addr, | ||
80 | int addr_len); | ||
81 | static int iucv_sock_connect(struct socket *sock, struct sockaddr *addr, | ||
82 | int alen, int flags); | ||
83 | static int iucv_sock_listen(struct socket *sock, int backlog); | ||
84 | static int iucv_sock_accept(struct socket *sock, struct socket *newsock, | ||
85 | int flags); | ||
86 | static int iucv_sock_getname(struct socket *sock, struct sockaddr *addr, | ||
87 | int *len, int peer); | ||
88 | static int iucv_sock_sendmsg(struct kiocb *iocb, struct socket *sock, | ||
89 | struct msghdr *msg, size_t len); | ||
90 | static int iucv_sock_recvmsg(struct kiocb *iocb, struct socket *sock, | ||
91 | struct msghdr *msg, size_t len, int flags); | ||
92 | unsigned int iucv_sock_poll(struct file *file, struct socket *sock, | ||
93 | poll_table *wait); | ||
94 | static int iucv_sock_release(struct socket *sock); | ||
95 | static int iucv_sock_shutdown(struct socket *sock, int how); | ||
96 | |||
97 | void iucv_sock_link(struct iucv_sock_list *l, struct sock *s); | ||
98 | void iucv_sock_unlink(struct iucv_sock_list *l, struct sock *s); | ||
99 | int iucv_sock_wait_state(struct sock *sk, int state, int state2, | ||
100 | unsigned long timeo); | ||
101 | int iucv_sock_wait_cnt(struct sock *sk, unsigned long timeo); | ||
102 | void iucv_accept_enqueue(struct sock *parent, struct sock *sk); | ||
103 | void iucv_accept_unlink(struct sock *sk); | ||
104 | struct sock *iucv_accept_dequeue(struct sock *parent, struct socket *newsock); | ||
105 | |||
106 | #endif /* __IUCV_H */ | ||
diff --git a/include/net/iucv/iucv.h b/include/net/iucv/iucv.h new file mode 100644 index 000000000000..746e7416261e --- /dev/null +++ b/include/net/iucv/iucv.h | |||
@@ -0,0 +1,415 @@ | |||
1 | /* | ||
2 | * drivers/s390/net/iucv.h | ||
3 | * IUCV base support. | ||
4 | * | ||
5 | * S390 version | ||
6 | * Copyright 2000, 2006 IBM Corporation | ||
7 | * Author(s):Alan Altmark (Alan_Altmark@us.ibm.com) | ||
8 | * Xenia Tkatschow (xenia@us.ibm.com) | ||
9 | * Rewritten for af_iucv: | ||
10 | * Martin Schwidefsky <schwidefsky@de.ibm.com> | ||
11 | * | ||
12 | * | ||
13 | * Functionality: | ||
14 | * To explore any of the IUCV functions, one must first register their | ||
15 | * program using iucv_register(). Once your program has successfully | ||
16 | * completed a register, it can exploit the other functions. | ||
17 | * For furthur reference on all IUCV functionality, refer to the | ||
18 | * CP Programming Services book, also available on the web thru | ||
19 | * www.ibm.com/s390/vm/pubs, manual # SC24-5760 | ||
20 | * | ||
21 | * Definition of Return Codes | ||
22 | * - All positive return codes including zero are reflected back | ||
23 | * from CP. The definition of each return code can be found in | ||
24 | * CP Programming Services book. | ||
25 | * - Return Code of: | ||
26 | * -EINVAL: Invalid value | ||
27 | * -ENOMEM: storage allocation failed | ||
28 | */ | ||
29 | |||
30 | #include <linux/types.h> | ||
31 | #include <asm/debug.h> | ||
32 | |||
33 | /* | ||
34 | * IUCV option flags usable by device drivers: | ||
35 | * | ||
36 | * IUCV_IPRMDATA Indicates that your program can handle a message in the | ||
37 | * parameter list / a message is sent in the parameter list. | ||
38 | * Used for iucv_path_accept, iucv_path_connect, | ||
39 | * iucv_message_reply, iucv_message_send, iucv_message_send2way. | ||
40 | * IUCV_IPQUSCE Indicates that you do not want to receive messages on this | ||
41 | * path until an iucv_path_resume is issued. | ||
42 | * Used for iucv_path_accept, iucv_path_connect. | ||
43 | * IUCV_IPBUFLST Indicates that an address list is used for the message data. | ||
44 | * Used for iucv_message_receive, iucv_message_send, | ||
45 | * iucv_message_send2way. | ||
46 | * IUCV_IPPRTY Specifies that you want to send priority messages. | ||
47 | * Used for iucv_path_accept, iucv_path_connect, | ||
48 | * iucv_message_reply, iucv_message_send, iucv_message_send2way. | ||
49 | * IUCV_IPSYNC Indicates a synchronous send request. | ||
50 | * Used for iucv_message_send, iucv_message_send2way. | ||
51 | * IUCV_IPANSLST Indicates that an address list is used for the reply data. | ||
52 | * Used for iucv_message_reply, iucv_message_send2way. | ||
53 | * IUCV_IPLOCAL Specifies that the communication partner has to be on the | ||
54 | * local system. If local is specified no target class can be | ||
55 | * specified. | ||
56 | * Used for iucv_path_connect. | ||
57 | * | ||
58 | * All flags are defined in the input field IPFLAGS1 of each function | ||
59 | * and can be found in CP Programming Services. | ||
60 | */ | ||
61 | #define IUCV_IPRMDATA 0x80 | ||
62 | #define IUCV_IPQUSCE 0x40 | ||
63 | #define IUCV_IPBUFLST 0x40 | ||
64 | #define IUCV_IPPRTY 0x20 | ||
65 | #define IUCV_IPANSLST 0x08 | ||
66 | #define IUCV_IPSYNC 0x04 | ||
67 | #define IUCV_IPLOCAL 0x01 | ||
68 | |||
69 | /* | ||
70 | * iucv_array : Defines buffer array. | ||
71 | * Inside the array may be 31- bit addresses and 31-bit lengths. | ||
72 | * Use a pointer to an iucv_array as the buffer, reply or answer | ||
73 | * parameter on iucv_message_send, iucv_message_send2way, iucv_message_receive | ||
74 | * and iucv_message_reply if IUCV_IPBUFLST or IUCV_IPANSLST are used. | ||
75 | */ | ||
76 | struct iucv_array { | ||
77 | u32 address; | ||
78 | u32 length; | ||
79 | } __attribute__ ((aligned (8))); | ||
80 | |||
81 | extern struct bus_type iucv_bus; | ||
82 | extern struct device *iucv_root; | ||
83 | |||
84 | /* | ||
85 | * struct iucv_path | ||
86 | * pathid: 16 bit path identification | ||
87 | * msglim: 16 bit message limit | ||
88 | * flags: properties of the path: IPRMDATA, IPQUSCE, IPPRTY | ||
89 | * handler: address of iucv handler structure | ||
90 | * private: private information of the handler associated with the path | ||
91 | * list: list_head for the iucv_handler path list. | ||
92 | */ | ||
93 | struct iucv_path { | ||
94 | u16 pathid; | ||
95 | u16 msglim; | ||
96 | u8 flags; | ||
97 | void *private; | ||
98 | struct iucv_handler *handler; | ||
99 | struct list_head list; | ||
100 | }; | ||
101 | |||
102 | /* | ||
103 | * struct iucv_message | ||
104 | * id: 32 bit message id | ||
105 | * audit: 32 bit error information of purged or replied messages | ||
106 | * class: 32 bit target class of a message (source class for replies) | ||
107 | * tag: 32 bit tag to be associated with the message | ||
108 | * length: 32 bit length of the message / reply | ||
109 | * reply_size: 32 bit maximum allowed length of the reply | ||
110 | * rmmsg: 8 byte inline message | ||
111 | * flags: message properties (IUCV_IPPRTY) | ||
112 | */ | ||
113 | struct iucv_message { | ||
114 | u32 id; | ||
115 | u32 audit; | ||
116 | u32 class; | ||
117 | u32 tag; | ||
118 | u32 length; | ||
119 | u32 reply_size; | ||
120 | u8 rmmsg[8]; | ||
121 | u8 flags; | ||
122 | }; | ||
123 | |||
124 | /* | ||
125 | * struct iucv_handler | ||
126 | * | ||
127 | * A vector of functions that handle IUCV interrupts. Each functions gets | ||
128 | * a parameter area as defined by the CP Programming Services and private | ||
129 | * pointer that is provided by the user of the interface. | ||
130 | */ | ||
131 | struct iucv_handler { | ||
132 | /* | ||
133 | * The path_pending function is called after an iucv interrupt | ||
134 | * type 0x01 has been received. The base code allocates a path | ||
135 | * structure and "asks" the handler if this path belongs to the | ||
136 | * handler. To accept the path the path_pending function needs | ||
137 | * to call iucv_path_accept and return 0. If the callback returns | ||
138 | * a value != 0 the iucv base code will continue with the next | ||
139 | * handler. The order in which the path_pending functions are | ||
140 | * called is the order of the registration of the iucv handlers | ||
141 | * to the base code. | ||
142 | */ | ||
143 | int (*path_pending)(struct iucv_path *, u8 ipvmid[8], u8 ipuser[16]); | ||
144 | /* | ||
145 | * The path_complete function is called after an iucv interrupt | ||
146 | * type 0x02 has been received for a path that has been established | ||
147 | * for this handler with iucv_path_connect and got accepted by the | ||
148 | * peer with iucv_path_accept. | ||
149 | */ | ||
150 | void (*path_complete)(struct iucv_path *, u8 ipuser[16]); | ||
151 | /* | ||
152 | * The path_severed function is called after an iucv interrupt | ||
153 | * type 0x03 has been received. The communication peer shutdown | ||
154 | * his end of the communication path. The path still exists and | ||
155 | * remaining messages can be received until a iucv_path_sever | ||
156 | * shuts down the other end of the path as well. | ||
157 | */ | ||
158 | void (*path_severed)(struct iucv_path *, u8 ipuser[16]); | ||
159 | /* | ||
160 | * The path_quiesced function is called after an icuv interrupt | ||
161 | * type 0x04 has been received. The communication peer has quiesced | ||
162 | * the path. Delivery of messages is stopped until iucv_path_resume | ||
163 | * has been called. | ||
164 | */ | ||
165 | void (*path_quiesced)(struct iucv_path *, u8 ipuser[16]); | ||
166 | /* | ||
167 | * The path_resumed function is called after an icuv interrupt | ||
168 | * type 0x05 has been received. The communication peer has resumed | ||
169 | * the path. | ||
170 | */ | ||
171 | void (*path_resumed)(struct iucv_path *, u8 ipuser[16]); | ||
172 | /* | ||
173 | * The message_pending function is called after an icuv interrupt | ||
174 | * type 0x06 or type 0x07 has been received. A new message is | ||
175 | * availabe and can be received with iucv_message_receive. | ||
176 | */ | ||
177 | void (*message_pending)(struct iucv_path *, struct iucv_message *); | ||
178 | /* | ||
179 | * The message_complete function is called after an icuv interrupt | ||
180 | * type 0x08 or type 0x09 has been received. A message send with | ||
181 | * iucv_message_send2way has been replied to. The reply can be | ||
182 | * received with iucv_message_receive. | ||
183 | */ | ||
184 | void (*message_complete)(struct iucv_path *, struct iucv_message *); | ||
185 | |||
186 | struct list_head list; | ||
187 | struct list_head paths; | ||
188 | }; | ||
189 | |||
190 | /** | ||
191 | * iucv_register: | ||
192 | * @handler: address of iucv handler structure | ||
193 | * @smp: != 0 indicates that the handler can deal with out of order messages | ||
194 | * | ||
195 | * Registers a driver with IUCV. | ||
196 | * | ||
197 | * Returns 0 on success, -ENOMEM if the memory allocation for the pathid | ||
198 | * table failed, or -EIO if IUCV_DECLARE_BUFFER failed on all cpus. | ||
199 | */ | ||
200 | int iucv_register(struct iucv_handler *handler, int smp); | ||
201 | |||
202 | /** | ||
203 | * iucv_unregister | ||
204 | * @handler: address of iucv handler structure | ||
205 | * @smp: != 0 indicates that the handler can deal with out of order messages | ||
206 | * | ||
207 | * Unregister driver from IUCV. | ||
208 | */ | ||
209 | void iucv_unregister(struct iucv_handler *handle, int smp); | ||
210 | |||
211 | /** | ||
212 | * iucv_path_alloc | ||
213 | * @msglim: initial message limit | ||
214 | * @flags: initial flags | ||
215 | * @gfp: kmalloc allocation flag | ||
216 | * | ||
217 | * Allocate a new path structure for use with iucv_connect. | ||
218 | * | ||
219 | * Returns NULL if the memory allocation failed or a pointer to the | ||
220 | * path structure. | ||
221 | */ | ||
222 | static inline struct iucv_path *iucv_path_alloc(u16 msglim, u8 flags, gfp_t gfp) | ||
223 | { | ||
224 | struct iucv_path *path; | ||
225 | |||
226 | path = kzalloc(sizeof(struct iucv_path), gfp); | ||
227 | if (path) { | ||
228 | path->msglim = msglim; | ||
229 | path->flags = flags; | ||
230 | } | ||
231 | return path; | ||
232 | } | ||
233 | |||
234 | /** | ||
235 | * iucv_path_free | ||
236 | * @path: address of iucv path structure | ||
237 | * | ||
238 | * Frees a path structure. | ||
239 | */ | ||
240 | static inline void iucv_path_free(struct iucv_path *path) | ||
241 | { | ||
242 | kfree(path); | ||
243 | } | ||
244 | |||
245 | /** | ||
246 | * iucv_path_accept | ||
247 | * @path: address of iucv path structure | ||
248 | * @handler: address of iucv handler structure | ||
249 | * @userdata: 16 bytes of data reflected to the communication partner | ||
250 | * @private: private data passed to interrupt handlers for this path | ||
251 | * | ||
252 | * This function is issued after the user received a connection pending | ||
253 | * external interrupt and now wishes to complete the IUCV communication path. | ||
254 | * | ||
255 | * Returns the result of the CP IUCV call. | ||
256 | */ | ||
257 | int iucv_path_accept(struct iucv_path *path, struct iucv_handler *handler, | ||
258 | u8 userdata[16], void *private); | ||
259 | |||
260 | /** | ||
261 | * iucv_path_connect | ||
262 | * @path: address of iucv path structure | ||
263 | * @handler: address of iucv handler structure | ||
264 | * @userid: 8-byte user identification | ||
265 | * @system: 8-byte target system identification | ||
266 | * @userdata: 16 bytes of data reflected to the communication partner | ||
267 | * @private: private data passed to interrupt handlers for this path | ||
268 | * | ||
269 | * This function establishes an IUCV path. Although the connect may complete | ||
270 | * successfully, you are not able to use the path until you receive an IUCV | ||
271 | * Connection Complete external interrupt. | ||
272 | * | ||
273 | * Returns the result of the CP IUCV call. | ||
274 | */ | ||
275 | int iucv_path_connect(struct iucv_path *path, struct iucv_handler *handler, | ||
276 | u8 userid[8], u8 system[8], u8 userdata[16], | ||
277 | void *private); | ||
278 | |||
279 | /** | ||
280 | * iucv_path_quiesce: | ||
281 | * @path: address of iucv path structure | ||
282 | * @userdata: 16 bytes of data reflected to the communication partner | ||
283 | * | ||
284 | * This function temporarily suspends incoming messages on an IUCV path. | ||
285 | * You can later reactivate the path by invoking the iucv_resume function. | ||
286 | * | ||
287 | * Returns the result from the CP IUCV call. | ||
288 | */ | ||
289 | int iucv_path_quiesce(struct iucv_path *path, u8 userdata[16]); | ||
290 | |||
291 | /** | ||
292 | * iucv_path_resume: | ||
293 | * @path: address of iucv path structure | ||
294 | * @userdata: 16 bytes of data reflected to the communication partner | ||
295 | * | ||
296 | * This function resumes incoming messages on an IUCV path that has | ||
297 | * been stopped with iucv_path_quiesce. | ||
298 | * | ||
299 | * Returns the result from the CP IUCV call. | ||
300 | */ | ||
301 | int iucv_path_resume(struct iucv_path *path, u8 userdata[16]); | ||
302 | |||
303 | /** | ||
304 | * iucv_path_sever | ||
305 | * @path: address of iucv path structure | ||
306 | * @userdata: 16 bytes of data reflected to the communication partner | ||
307 | * | ||
308 | * This function terminates an IUCV path. | ||
309 | * | ||
310 | * Returns the result from the CP IUCV call. | ||
311 | */ | ||
312 | int iucv_path_sever(struct iucv_path *path, u8 userdata[16]); | ||
313 | |||
314 | /** | ||
315 | * iucv_message_purge | ||
316 | * @path: address of iucv path structure | ||
317 | * @msg: address of iucv msg structure | ||
318 | * @srccls: source class of message | ||
319 | * | ||
320 | * Cancels a message you have sent. | ||
321 | * | ||
322 | * Returns the result from the CP IUCV call. | ||
323 | */ | ||
324 | int iucv_message_purge(struct iucv_path *path, struct iucv_message *msg, | ||
325 | u32 srccls); | ||
326 | |||
327 | /** | ||
328 | * iucv_message_receive | ||
329 | * @path: address of iucv path structure | ||
330 | * @msg: address of iucv msg structure | ||
331 | * @flags: flags that affect how the message is received (IUCV_IPBUFLST) | ||
332 | * @buffer: address of data buffer or address of struct iucv_array | ||
333 | * @size: length of data buffer | ||
334 | * @residual: | ||
335 | * | ||
336 | * This function receives messages that are being sent to you over | ||
337 | * established paths. This function will deal with RMDATA messages | ||
338 | * embedded in struct iucv_message as well. | ||
339 | * | ||
340 | * Returns the result from the CP IUCV call. | ||
341 | */ | ||
342 | int iucv_message_receive(struct iucv_path *path, struct iucv_message *msg, | ||
343 | u8 flags, void *buffer, size_t size, size_t *residual); | ||
344 | |||
345 | /** | ||
346 | * iucv_message_reject | ||
347 | * @path: address of iucv path structure | ||
348 | * @msg: address of iucv msg structure | ||
349 | * | ||
350 | * The reject function refuses a specified message. Between the time you | ||
351 | * are notified of a message and the time that you complete the message, | ||
352 | * the message may be rejected. | ||
353 | * | ||
354 | * Returns the result from the CP IUCV call. | ||
355 | */ | ||
356 | int iucv_message_reject(struct iucv_path *path, struct iucv_message *msg); | ||
357 | |||
358 | /** | ||
359 | * iucv_message_reply | ||
360 | * @path: address of iucv path structure | ||
361 | * @msg: address of iucv msg structure | ||
362 | * @flags: how the reply is sent (IUCV_IPRMDATA, IUCV_IPPRTY, IUCV_IPBUFLST) | ||
363 | * @reply: address of data buffer or address of struct iucv_array | ||
364 | * @size: length of reply data buffer | ||
365 | * | ||
366 | * This function responds to the two-way messages that you receive. You | ||
367 | * must identify completely the message to which you wish to reply. ie, | ||
368 | * pathid, msgid, and trgcls. Prmmsg signifies the data is moved into | ||
369 | * the parameter list. | ||
370 | * | ||
371 | * Returns the result from the CP IUCV call. | ||
372 | */ | ||
373 | int iucv_message_reply(struct iucv_path *path, struct iucv_message *msg, | ||
374 | u8 flags, void *reply, size_t size); | ||
375 | |||
376 | /** | ||
377 | * iucv_message_send | ||
378 | * @path: address of iucv path structure | ||
379 | * @msg: address of iucv msg structure | ||
380 | * @flags: how the message is sent (IUCV_IPRMDATA, IUCV_IPPRTY, IUCV_IPBUFLST) | ||
381 | * @srccls: source class of message | ||
382 | * @buffer: address of data buffer or address of struct iucv_array | ||
383 | * @size: length of send buffer | ||
384 | * | ||
385 | * This function transmits data to another application. Data to be | ||
386 | * transmitted is in a buffer and this is a one-way message and the | ||
387 | * receiver will not reply to the message. | ||
388 | * | ||
389 | * Returns the result from the CP IUCV call. | ||
390 | */ | ||
391 | int iucv_message_send(struct iucv_path *path, struct iucv_message *msg, | ||
392 | u8 flags, u32 srccls, void *buffer, size_t size); | ||
393 | |||
394 | /** | ||
395 | * iucv_message_send2way | ||
396 | * @path: address of iucv path structure | ||
397 | * @msg: address of iucv msg structure | ||
398 | * @flags: how the message is sent and the reply is received | ||
399 | * (IUCV_IPRMDATA, IUCV_IPBUFLST, IUCV_IPPRTY, IUCV_ANSLST) | ||
400 | * @srccls: source class of message | ||
401 | * @buffer: address of data buffer or address of struct iucv_array | ||
402 | * @size: length of send buffer | ||
403 | * @ansbuf: address of answer buffer or address of struct iucv_array | ||
404 | * @asize: size of reply buffer | ||
405 | * | ||
406 | * This function transmits data to another application. Data to be | ||
407 | * transmitted is in a buffer. The receiver of the send is expected to | ||
408 | * reply to the message and a buffer is provided into which IUCV moves | ||
409 | * the reply to this message. | ||
410 | * | ||
411 | * Returns the result from the CP IUCV call. | ||
412 | */ | ||
413 | int iucv_message_send2way(struct iucv_path *path, struct iucv_message *msg, | ||
414 | u8 flags, u32 srccls, void *buffer, size_t size, | ||
415 | void *answer, size_t asize, size_t *residual); | ||
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h index bd01b4633ee2..68ec27490c20 100644 --- a/include/net/netfilter/nf_conntrack.h +++ b/include/net/netfilter/nf_conntrack.h | |||
@@ -45,6 +45,7 @@ union nf_conntrack_expect_proto { | |||
45 | #include <linux/netfilter/nf_conntrack_ftp.h> | 45 | #include <linux/netfilter/nf_conntrack_ftp.h> |
46 | #include <linux/netfilter/nf_conntrack_pptp.h> | 46 | #include <linux/netfilter/nf_conntrack_pptp.h> |
47 | #include <linux/netfilter/nf_conntrack_h323.h> | 47 | #include <linux/netfilter/nf_conntrack_h323.h> |
48 | #include <linux/netfilter/nf_conntrack_sane.h> | ||
48 | 49 | ||
49 | /* per conntrack: application helper private data */ | 50 | /* per conntrack: application helper private data */ |
50 | union nf_conntrack_help { | 51 | union nf_conntrack_help { |
@@ -52,6 +53,7 @@ union nf_conntrack_help { | |||
52 | struct nf_ct_ftp_master ct_ftp_info; | 53 | struct nf_ct_ftp_master ct_ftp_info; |
53 | struct nf_ct_pptp_master ct_pptp_info; | 54 | struct nf_ct_pptp_master ct_pptp_info; |
54 | struct nf_ct_h323_master ct_h323_info; | 55 | struct nf_ct_h323_master ct_h323_info; |
56 | struct nf_ct_sane_master ct_sane_info; | ||
55 | }; | 57 | }; |
56 | 58 | ||
57 | #include <linux/types.h> | 59 | #include <linux/types.h> |
diff --git a/include/net/netfilter/nf_nat.h b/include/net/netfilter/nf_nat.h index 61c62068ca6b..bc57dd7b9b5c 100644 --- a/include/net/netfilter/nf_nat.h +++ b/include/net/netfilter/nf_nat.h | |||
@@ -16,6 +16,7 @@ enum nf_nat_manip_type | |||
16 | 16 | ||
17 | #define IP_NAT_RANGE_MAP_IPS 1 | 17 | #define IP_NAT_RANGE_MAP_IPS 1 |
18 | #define IP_NAT_RANGE_PROTO_SPECIFIED 2 | 18 | #define IP_NAT_RANGE_PROTO_SPECIFIED 2 |
19 | #define IP_NAT_RANGE_PROTO_RANDOM 4 | ||
19 | 20 | ||
20 | /* NAT sequence number modifications */ | 21 | /* NAT sequence number modifications */ |
21 | struct nf_nat_seq { | 22 | struct nf_nat_seq { |
diff --git a/include/net/route.h b/include/net/route.h index 486e37aff06c..1440bdb5a27d 100644 --- a/include/net/route.h +++ b/include/net/route.h | |||
@@ -146,7 +146,8 @@ static inline char rt_tos2priority(u8 tos) | |||
146 | 146 | ||
147 | static inline int ip_route_connect(struct rtable **rp, __be32 dst, | 147 | static inline int ip_route_connect(struct rtable **rp, __be32 dst, |
148 | __be32 src, u32 tos, int oif, u8 protocol, | 148 | __be32 src, u32 tos, int oif, u8 protocol, |
149 | __be16 sport, __be16 dport, struct sock *sk) | 149 | __be16 sport, __be16 dport, struct sock *sk, |
150 | int flags) | ||
150 | { | 151 | { |
151 | struct flowi fl = { .oif = oif, | 152 | struct flowi fl = { .oif = oif, |
152 | .nl_u = { .ip4_u = { .daddr = dst, | 153 | .nl_u = { .ip4_u = { .daddr = dst, |
@@ -168,7 +169,7 @@ static inline int ip_route_connect(struct rtable **rp, __be32 dst, | |||
168 | *rp = NULL; | 169 | *rp = NULL; |
169 | } | 170 | } |
170 | security_sk_classify_flow(sk, &fl); | 171 | security_sk_classify_flow(sk, &fl); |
171 | return ip_route_output_flow(rp, &fl, sk, 0); | 172 | return ip_route_output_flow(rp, &fl, sk, flags); |
172 | } | 173 | } |
173 | 174 | ||
174 | static inline int ip_route_newports(struct rtable **rp, u8 protocol, | 175 | static inline int ip_route_newports(struct rtable **rp, u8 protocol, |
diff --git a/include/net/tcp.h b/include/net/tcp.h index cd8fa0c858ae..5c472f255b77 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -802,9 +802,8 @@ static inline void tcp_update_wl(struct tcp_sock *tp, u32 ack, u32 seq) | |||
802 | /* | 802 | /* |
803 | * Calculate(/check) TCP checksum | 803 | * Calculate(/check) TCP checksum |
804 | */ | 804 | */ |
805 | static inline __sum16 tcp_v4_check(struct tcphdr *th, int len, | 805 | static inline __sum16 tcp_v4_check(int len, __be32 saddr, |
806 | __be32 saddr, __be32 daddr, | 806 | __be32 daddr, __wsum base) |
807 | __wsum base) | ||
808 | { | 807 | { |
809 | return csum_tcpudp_magic(saddr,daddr,len,IPPROTO_TCP,base); | 808 | return csum_tcpudp_magic(saddr,daddr,len,IPPROTO_TCP,base); |
810 | } | 809 | } |
diff --git a/include/net/x25.h b/include/net/x25.h index e47fe440d9d7..fc3f03d976f8 100644 --- a/include/net/x25.h +++ b/include/net/x25.h | |||
@@ -161,6 +161,14 @@ struct x25_sock { | |||
161 | unsigned long vc_facil_mask; /* inc_call facilities mask */ | 161 | unsigned long vc_facil_mask; /* inc_call facilities mask */ |
162 | }; | 162 | }; |
163 | 163 | ||
164 | struct x25_forward { | ||
165 | struct list_head node; | ||
166 | unsigned int lci; | ||
167 | struct net_device *dev1; | ||
168 | struct net_device *dev2; | ||
169 | atomic_t refcnt; | ||
170 | }; | ||
171 | |||
164 | static inline struct x25_sock *x25_sk(const struct sock *sk) | 172 | static inline struct x25_sock *x25_sk(const struct sock *sk) |
165 | { | 173 | { |
166 | return (struct x25_sock *)sk; | 174 | return (struct x25_sock *)sk; |
@@ -172,6 +180,7 @@ extern int sysctl_x25_call_request_timeout; | |||
172 | extern int sysctl_x25_reset_request_timeout; | 180 | extern int sysctl_x25_reset_request_timeout; |
173 | extern int sysctl_x25_clear_request_timeout; | 181 | extern int sysctl_x25_clear_request_timeout; |
174 | extern int sysctl_x25_ack_holdback_timeout; | 182 | extern int sysctl_x25_ack_holdback_timeout; |
183 | extern int sysctl_x25_forward; | ||
175 | 184 | ||
176 | extern int x25_addr_ntoa(unsigned char *, struct x25_address *, | 185 | extern int x25_addr_ntoa(unsigned char *, struct x25_address *, |
177 | struct x25_address *); | 186 | struct x25_address *); |
@@ -198,6 +207,13 @@ extern int x25_negotiate_facilities(struct sk_buff *, struct sock *, | |||
198 | struct x25_dte_facilities *); | 207 | struct x25_dte_facilities *); |
199 | extern void x25_limit_facilities(struct x25_facilities *, struct x25_neigh *); | 208 | extern void x25_limit_facilities(struct x25_facilities *, struct x25_neigh *); |
200 | 209 | ||
210 | /* x25_forward.c */ | ||
211 | extern void x25_clear_forward_by_lci(unsigned int lci); | ||
212 | extern void x25_clear_forward_by_dev(struct net_device *); | ||
213 | extern int x25_forward_data(int, struct x25_neigh *, struct sk_buff *); | ||
214 | extern int x25_forward_call(struct x25_address *, struct x25_neigh *, | ||
215 | struct sk_buff *, int); | ||
216 | |||
201 | /* x25_in.c */ | 217 | /* x25_in.c */ |
202 | extern int x25_process_rx_frame(struct sock *, struct sk_buff *); | 218 | extern int x25_process_rx_frame(struct sock *, struct sk_buff *); |
203 | extern int x25_backlog_rcv(struct sock *, struct sk_buff *); | 219 | extern int x25_backlog_rcv(struct sock *, struct sk_buff *); |
@@ -282,6 +298,8 @@ extern struct hlist_head x25_list; | |||
282 | extern rwlock_t x25_list_lock; | 298 | extern rwlock_t x25_list_lock; |
283 | extern struct list_head x25_route_list; | 299 | extern struct list_head x25_route_list; |
284 | extern rwlock_t x25_route_list_lock; | 300 | extern rwlock_t x25_route_list_lock; |
301 | extern struct list_head x25_forward_list; | ||
302 | extern rwlock_t x25_forward_list_lock; | ||
285 | 303 | ||
286 | extern int x25_proc_init(void); | 304 | extern int x25_proc_init(void); |
287 | extern void x25_proc_exit(void); | 305 | extern void x25_proc_exit(void); |
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index e4765413cf80..16924cb772c9 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -252,10 +252,13 @@ struct xfrm_state_afinfo { | |||
252 | xfrm_address_t *daddr, xfrm_address_t *saddr); | 252 | xfrm_address_t *daddr, xfrm_address_t *saddr); |
253 | int (*tmpl_sort)(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, int n); | 253 | int (*tmpl_sort)(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, int n); |
254 | int (*state_sort)(struct xfrm_state **dst, struct xfrm_state **src, int n); | 254 | int (*state_sort)(struct xfrm_state **dst, struct xfrm_state **src, int n); |
255 | int (*output)(struct sk_buff *skb); | ||
255 | }; | 256 | }; |
256 | 257 | ||
257 | extern int xfrm_state_register_afinfo(struct xfrm_state_afinfo *afinfo); | 258 | extern int xfrm_state_register_afinfo(struct xfrm_state_afinfo *afinfo); |
258 | extern int xfrm_state_unregister_afinfo(struct xfrm_state_afinfo *afinfo); | 259 | extern int xfrm_state_unregister_afinfo(struct xfrm_state_afinfo *afinfo); |
260 | extern struct xfrm_state_afinfo *xfrm_state_get_afinfo(unsigned short family); | ||
261 | extern void xfrm_state_put_afinfo(struct xfrm_state_afinfo *afinfo); | ||
259 | 262 | ||
260 | extern void xfrm_state_delete_tunnel(struct xfrm_state *x); | 263 | extern void xfrm_state_delete_tunnel(struct xfrm_state *x); |
261 | 264 | ||
@@ -359,6 +362,19 @@ struct xfrm_policy | |||
359 | struct xfrm_tmpl xfrm_vec[XFRM_MAX_DEPTH]; | 362 | struct xfrm_tmpl xfrm_vec[XFRM_MAX_DEPTH]; |
360 | }; | 363 | }; |
361 | 364 | ||
365 | struct xfrm_migrate { | ||
366 | xfrm_address_t old_daddr; | ||
367 | xfrm_address_t old_saddr; | ||
368 | xfrm_address_t new_daddr; | ||
369 | xfrm_address_t new_saddr; | ||
370 | u8 proto; | ||
371 | u8 mode; | ||
372 | u16 reserved; | ||
373 | u32 reqid; | ||
374 | u16 old_family; | ||
375 | u16 new_family; | ||
376 | }; | ||
377 | |||
362 | #define XFRM_KM_TIMEOUT 30 | 378 | #define XFRM_KM_TIMEOUT 30 |
363 | /* which seqno */ | 379 | /* which seqno */ |
364 | #define XFRM_REPLAY_SEQ 1 | 380 | #define XFRM_REPLAY_SEQ 1 |
@@ -385,6 +401,7 @@ struct xfrm_mgr | |||
385 | int (*new_mapping)(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport); | 401 | int (*new_mapping)(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport); |
386 | int (*notify_policy)(struct xfrm_policy *x, int dir, struct km_event *c); | 402 | int (*notify_policy)(struct xfrm_policy *x, int dir, struct km_event *c); |
387 | int (*report)(u8 proto, struct xfrm_selector *sel, xfrm_address_t *addr); | 403 | int (*report)(u8 proto, struct xfrm_selector *sel, xfrm_address_t *addr); |
404 | int (*migrate)(struct xfrm_selector *sel, u8 dir, u8 type, struct xfrm_migrate *m, int num_bundles); | ||
388 | }; | 405 | }; |
389 | 406 | ||
390 | extern int xfrm_register_km(struct xfrm_mgr *km); | 407 | extern int xfrm_register_km(struct xfrm_mgr *km); |
@@ -985,6 +1002,16 @@ extern int xfrm_bundle_ok(struct xfrm_policy *pol, struct xfrm_dst *xdst, | |||
985 | struct flowi *fl, int family, int strict); | 1002 | struct flowi *fl, int family, int strict); |
986 | extern void xfrm_init_pmtu(struct dst_entry *dst); | 1003 | extern void xfrm_init_pmtu(struct dst_entry *dst); |
987 | 1004 | ||
1005 | #ifdef CONFIG_XFRM_MIGRATE | ||
1006 | extern int km_migrate(struct xfrm_selector *sel, u8 dir, u8 type, | ||
1007 | struct xfrm_migrate *m, int num_bundles); | ||
1008 | extern struct xfrm_state * xfrm_migrate_state_find(struct xfrm_migrate *m); | ||
1009 | extern struct xfrm_state * xfrm_state_migrate(struct xfrm_state *x, | ||
1010 | struct xfrm_migrate *m); | ||
1011 | extern int xfrm_migrate(struct xfrm_selector *sel, u8 dir, u8 type, | ||
1012 | struct xfrm_migrate *m, int num_bundles); | ||
1013 | #endif | ||
1014 | |||
988 | extern wait_queue_head_t km_waitq; | 1015 | extern wait_queue_head_t km_waitq; |
989 | extern int km_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport); | 1016 | extern int km_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport); |
990 | extern void km_policy_expired(struct xfrm_policy *pol, int dir, int hard, u32 pid); | 1017 | extern void km_policy_expired(struct xfrm_policy *pol, int dir, int hard, u32 pid); |
@@ -1050,5 +1077,25 @@ static inline void xfrm_aevent_doreplay(struct xfrm_state *x) | |||
1050 | xfrm_replay_notify(x, XFRM_REPLAY_UPDATE); | 1077 | xfrm_replay_notify(x, XFRM_REPLAY_UPDATE); |
1051 | } | 1078 | } |
1052 | 1079 | ||
1080 | #ifdef CONFIG_XFRM_MIGRATE | ||
1081 | static inline struct xfrm_algo *xfrm_algo_clone(struct xfrm_algo *orig) | ||
1082 | { | ||
1083 | return (struct xfrm_algo *)kmemdup(orig, sizeof(*orig) + orig->alg_key_len, GFP_KERNEL); | ||
1084 | } | ||
1085 | |||
1086 | static inline void xfrm_states_put(struct xfrm_state **states, int n) | ||
1087 | { | ||
1088 | int i; | ||
1089 | for (i = 0; i < n; i++) | ||
1090 | xfrm_state_put(*(states + i)); | ||
1091 | } | ||
1092 | |||
1093 | static inline void xfrm_states_delete(struct xfrm_state **states, int n) | ||
1094 | { | ||
1095 | int i; | ||
1096 | for (i = 0; i < n; i++) | ||
1097 | xfrm_state_delete(*(states + i)); | ||
1098 | } | ||
1099 | #endif | ||
1053 | 1100 | ||
1054 | #endif /* _NET_XFRM_H */ | 1101 | #endif /* _NET_XFRM_H */ |