aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-09 11:01:37 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-09 11:01:37 -0500
commitf049274b012fd3b50113f194bfbbcbc3143d0da3 (patch)
tree15ef947c1959da3196d8dbc524b435972f6d37f7 /include
parentb37df85960a34dd96d0a4695c650f7972ef56c30 (diff)
parent1539b98b561754252dd520b98fa03a688a4f81b5 (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')
-rw-r--r--include/crypto/algapi.h24
-rw-r--r--include/linux/atmarp.h2
-rw-r--r--include/linux/crypto.h148
-rw-r--r--include/linux/if_packet.h10
-rw-r--r--include/linux/net.h2
-rw-r--r--include/linux/netdevice.h2
-rw-r--r--include/linux/netfilter/Kbuild1
-rw-r--r--include/linux/netfilter/nf_conntrack_sane.h21
-rw-r--r--include/linux/netfilter/nf_conntrack_tcp.h4
-rw-r--r--include/linux/netfilter/xt_TCPMSS.h10
-rw-r--r--include/linux/netfilter_ipv4/ip_nat.h1
-rw-r--r--include/linux/netfilter_ipv4/ip_tables.h22
-rw-r--r--include/linux/netfilter_ipv4/ipt_TCPMSS.h7
-rw-r--r--include/linux/netfilter_ipv6/ip6_tables.h35
-rw-r--r--include/linux/netfilter_ipv6/ip6t_mh.h15
-rw-r--r--include/linux/pfkeyv2.h4
-rw-r--r--include/linux/socket.h4
-rw-r--r--include/linux/sysctl.h3
-rw-r--r--include/linux/tcp.h2
-rw-r--r--include/linux/wanrouter.h8
-rw-r--r--include/linux/xfrm.h19
-rw-r--r--include/net/inet_hashtables.h10
-rw-r--r--include/net/iucv/af_iucv.h106
-rw-r--r--include/net/iucv/iucv.h415
-rw-r--r--include/net/netfilter/nf_conntrack.h2
-rw-r--r--include/net/netfilter/nf_nat.h1
-rw-r--r--include/net/route.h5
-rw-r--r--include/net/tcp.h5
-rw-r--r--include/net/x25.h18
-rw-r--r--include/net/xfrm.h47
30 files changed, 753 insertions, 200 deletions
diff --git a/include/crypto/algapi.h b/include/crypto/algapi.h
index 5748aecdb414..4e05e93ff681 100644
--- a/include/crypto/algapi.h
+++ b/include/crypto/algapi.h
@@ -18,8 +18,8 @@ struct module;
18struct seq_file; 18struct seq_file;
19 19
20struct crypto_type { 20struct crypto_type {
21 unsigned int (*ctxsize)(struct crypto_alg *alg); 21 unsigned int (*ctxsize)(struct crypto_alg *alg, u32 type, u32 mask);
22 int (*init)(struct crypto_tfm *tfm); 22 int (*init)(struct crypto_tfm *tfm, u32 type, u32 mask);
23 void (*exit)(struct crypto_tfm *tfm); 23 void (*exit)(struct crypto_tfm *tfm);
24 void (*show)(struct seq_file *m, struct crypto_alg *alg); 24 void (*show)(struct seq_file *m, struct crypto_alg *alg);
25}; 25};
@@ -93,7 +93,8 @@ struct crypto_template *crypto_lookup_template(const char *name);
93int crypto_init_spawn(struct crypto_spawn *spawn, struct crypto_alg *alg, 93int crypto_init_spawn(struct crypto_spawn *spawn, struct crypto_alg *alg,
94 struct crypto_instance *inst); 94 struct crypto_instance *inst);
95void crypto_drop_spawn(struct crypto_spawn *spawn); 95void crypto_drop_spawn(struct crypto_spawn *spawn);
96struct crypto_tfm *crypto_spawn_tfm(struct crypto_spawn *spawn); 96struct crypto_tfm *crypto_spawn_tfm(struct crypto_spawn *spawn, u32 type,
97 u32 mask);
97 98
98struct crypto_alg *crypto_get_attr_alg(void *param, unsigned int len, 99struct crypto_alg *crypto_get_attr_alg(void *param, unsigned int len,
99 u32 type, u32 mask); 100 u32 type, u32 mask);
@@ -132,11 +133,28 @@ static inline void *crypto_blkcipher_ctx_aligned(struct crypto_blkcipher *tfm)
132 return crypto_tfm_ctx_aligned(&tfm->base); 133 return crypto_tfm_ctx_aligned(&tfm->base);
133} 134}
134 135
136static inline struct crypto_cipher *crypto_spawn_cipher(
137 struct crypto_spawn *spawn)
138{
139 u32 type = CRYPTO_ALG_TYPE_CIPHER;
140 u32 mask = CRYPTO_ALG_TYPE_MASK;
141
142 return __crypto_cipher_cast(crypto_spawn_tfm(spawn, type, mask));
143}
144
135static inline struct cipher_alg *crypto_cipher_alg(struct crypto_cipher *tfm) 145static inline struct cipher_alg *crypto_cipher_alg(struct crypto_cipher *tfm)
136{ 146{
137 return &crypto_cipher_tfm(tfm)->__crt_alg->cra_cipher; 147 return &crypto_cipher_tfm(tfm)->__crt_alg->cra_cipher;
138} 148}
139 149
150static inline struct crypto_hash *crypto_spawn_hash(struct crypto_spawn *spawn)
151{
152 u32 type = CRYPTO_ALG_TYPE_HASH;
153 u32 mask = CRYPTO_ALG_TYPE_HASH_MASK;
154
155 return __crypto_hash_cast(crypto_spawn_tfm(spawn, type, mask));
156}
157
140static inline void *crypto_hash_ctx_aligned(struct crypto_hash *tfm) 158static inline void *crypto_hash_ctx_aligned(struct crypto_hash *tfm)
141{ 159{
142 return crypto_tfm_ctx_aligned(&tfm->base); 160 return crypto_tfm_ctx_aligned(&tfm->base);
diff --git a/include/linux/atmarp.h b/include/linux/atmarp.h
index ee108f9e9cb7..231f4bdec730 100644
--- a/include/linux/atmarp.h
+++ b/include/linux/atmarp.h
@@ -6,9 +6,7 @@
6#ifndef _LINUX_ATMARP_H 6#ifndef _LINUX_ATMARP_H
7#define _LINUX_ATMARP_H 7#define _LINUX_ATMARP_H
8 8
9#ifdef __KERNEL__
10#include <linux/types.h> 9#include <linux/types.h>
11#endif
12#include <linux/atmapi.h> 10#include <linux/atmapi.h>
13#include <linux/atmioc.h> 11#include <linux/atmioc.h>
14 12
diff --git a/include/linux/crypto.h b/include/linux/crypto.h
index 4aa9046601da..779aa78ee643 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -51,15 +51,9 @@
51/* 51/*
52 * Transform masks and values (for crt_flags). 52 * Transform masks and values (for crt_flags).
53 */ 53 */
54#define CRYPTO_TFM_MODE_MASK 0x000000ff
55#define CRYPTO_TFM_REQ_MASK 0x000fff00 54#define CRYPTO_TFM_REQ_MASK 0x000fff00
56#define CRYPTO_TFM_RES_MASK 0xfff00000 55#define CRYPTO_TFM_RES_MASK 0xfff00000
57 56
58#define CRYPTO_TFM_MODE_ECB 0x00000001
59#define CRYPTO_TFM_MODE_CBC 0x00000002
60#define CRYPTO_TFM_MODE_CFB 0x00000004
61#define CRYPTO_TFM_MODE_CTR 0x00000008
62
63#define CRYPTO_TFM_REQ_WEAK_KEY 0x00000100 57#define CRYPTO_TFM_REQ_WEAK_KEY 0x00000100
64#define CRYPTO_TFM_REQ_MAY_SLEEP 0x00000200 58#define CRYPTO_TFM_REQ_MAY_SLEEP 0x00000200
65#define CRYPTO_TFM_RES_WEAK_KEY 0x00100000 59#define CRYPTO_TFM_RES_WEAK_KEY 0x00100000
@@ -71,12 +65,8 @@
71/* 65/*
72 * Miscellaneous stuff. 66 * Miscellaneous stuff.
73 */ 67 */
74#define CRYPTO_UNSPEC 0
75#define CRYPTO_MAX_ALG_NAME 64 68#define CRYPTO_MAX_ALG_NAME 64
76 69
77#define CRYPTO_DIR_ENCRYPT 1
78#define CRYPTO_DIR_DECRYPT 0
79
80/* 70/*
81 * The macro CRYPTO_MINALIGN_ATTR (along with the void * type in the actual 71 * The macro CRYPTO_MINALIGN_ATTR (along with the void * type in the actual
82 * declaration) is used to ensure that the crypto_tfm context structure is 72 * declaration) is used to ensure that the crypto_tfm context structure is
@@ -148,19 +138,6 @@ struct cipher_alg {
148 unsigned int keylen); 138 unsigned int keylen);
149 void (*cia_encrypt)(struct crypto_tfm *tfm, u8 *dst, const u8 *src); 139 void (*cia_encrypt)(struct crypto_tfm *tfm, u8 *dst, const u8 *src);
150 void (*cia_decrypt)(struct crypto_tfm *tfm, u8 *dst, const u8 *src); 140 void (*cia_decrypt)(struct crypto_tfm *tfm, u8 *dst, const u8 *src);
151
152 unsigned int (*cia_encrypt_ecb)(const struct cipher_desc *desc,
153 u8 *dst, const u8 *src,
154 unsigned int nbytes) __deprecated;
155 unsigned int (*cia_decrypt_ecb)(const struct cipher_desc *desc,
156 u8 *dst, const u8 *src,
157 unsigned int nbytes) __deprecated;
158 unsigned int (*cia_encrypt_cbc)(const struct cipher_desc *desc,
159 u8 *dst, const u8 *src,
160 unsigned int nbytes) __deprecated;
161 unsigned int (*cia_decrypt_cbc)(const struct cipher_desc *desc,
162 u8 *dst, const u8 *src,
163 unsigned int nbytes) __deprecated;
164}; 141};
165 142
166struct digest_alg { 143struct digest_alg {
@@ -243,11 +220,6 @@ int crypto_unregister_alg(struct crypto_alg *alg);
243#ifdef CONFIG_CRYPTO 220#ifdef CONFIG_CRYPTO
244int crypto_has_alg(const char *name, u32 type, u32 mask); 221int crypto_has_alg(const char *name, u32 type, u32 mask);
245#else 222#else
246static inline int crypto_alg_available(const char *name, u32 flags)
247{
248 return 0;
249}
250
251static inline int crypto_has_alg(const char *name, u32 type, u32 mask) 223static inline int crypto_has_alg(const char *name, u32 type, u32 mask)
252{ 224{
253 return 0; 225 return 0;
@@ -339,13 +311,18 @@ struct crypto_tfm {
339 void *__crt_ctx[] CRYPTO_MINALIGN_ATTR; 311 void *__crt_ctx[] CRYPTO_MINALIGN_ATTR;
340}; 312};
341 313
342#define crypto_cipher crypto_tfm
343#define crypto_comp crypto_tfm
344
345struct crypto_blkcipher { 314struct crypto_blkcipher {
346 struct crypto_tfm base; 315 struct crypto_tfm base;
347}; 316};
348 317
318struct crypto_cipher {
319 struct crypto_tfm base;
320};
321
322struct crypto_comp {
323 struct crypto_tfm base;
324};
325
349struct crypto_hash { 326struct crypto_hash {
350 struct crypto_tfm base; 327 struct crypto_tfm base;
351}; 328};
@@ -395,40 +372,11 @@ static inline u32 crypto_tfm_alg_type(struct crypto_tfm *tfm)
395 return tfm->__crt_alg->cra_flags & CRYPTO_ALG_TYPE_MASK; 372 return tfm->__crt_alg->cra_flags & CRYPTO_ALG_TYPE_MASK;
396} 373}
397 374
398static unsigned int crypto_tfm_alg_min_keysize(struct crypto_tfm *tfm)
399 __deprecated;
400static inline unsigned int crypto_tfm_alg_min_keysize(struct crypto_tfm *tfm)
401{
402 BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
403 return tfm->__crt_alg->cra_cipher.cia_min_keysize;
404}
405
406static unsigned int crypto_tfm_alg_max_keysize(struct crypto_tfm *tfm)
407 __deprecated;
408static inline unsigned int crypto_tfm_alg_max_keysize(struct crypto_tfm *tfm)
409{
410 BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
411 return tfm->__crt_alg->cra_cipher.cia_max_keysize;
412}
413
414static unsigned int crypto_tfm_alg_ivsize(struct crypto_tfm *tfm) __deprecated;
415static inline unsigned int crypto_tfm_alg_ivsize(struct crypto_tfm *tfm)
416{
417 BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
418 return tfm->crt_cipher.cit_ivsize;
419}
420
421static inline unsigned int crypto_tfm_alg_blocksize(struct crypto_tfm *tfm) 375static inline unsigned int crypto_tfm_alg_blocksize(struct crypto_tfm *tfm)
422{ 376{
423 return tfm->__crt_alg->cra_blocksize; 377 return tfm->__crt_alg->cra_blocksize;
424} 378}
425 379
426static inline unsigned int crypto_tfm_alg_digestsize(struct crypto_tfm *tfm)
427{
428 BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_DIGEST);
429 return tfm->__crt_alg->cra_digest.dia_digestsize;
430}
431
432static inline unsigned int crypto_tfm_alg_alignmask(struct crypto_tfm *tfm) 380static inline unsigned int crypto_tfm_alg_alignmask(struct crypto_tfm *tfm)
433{ 381{
434 return tfm->__crt_alg->cra_alignmask; 382 return tfm->__crt_alg->cra_alignmask;
@@ -633,7 +581,7 @@ static inline struct crypto_cipher *crypto_alloc_cipher(const char *alg_name,
633 581
634static inline struct crypto_tfm *crypto_cipher_tfm(struct crypto_cipher *tfm) 582static inline struct crypto_tfm *crypto_cipher_tfm(struct crypto_cipher *tfm)
635{ 583{
636 return tfm; 584 return &tfm->base;
637} 585}
638 586
639static inline void crypto_free_cipher(struct crypto_cipher *tfm) 587static inline void crypto_free_cipher(struct crypto_cipher *tfm)
@@ -809,76 +757,6 @@ static inline int crypto_hash_setkey(struct crypto_hash *hash,
809 return crypto_hash_crt(hash)->setkey(hash, key, keylen); 757 return crypto_hash_crt(hash)->setkey(hash, key, keylen);
810} 758}
811 759
812static int crypto_cipher_encrypt(struct crypto_tfm *tfm,
813 struct scatterlist *dst,
814 struct scatterlist *src,
815 unsigned int nbytes) __deprecated;
816static inline int crypto_cipher_encrypt(struct crypto_tfm *tfm,
817 struct scatterlist *dst,
818 struct scatterlist *src,
819 unsigned int nbytes)
820{
821 BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
822 return tfm->crt_cipher.cit_encrypt(tfm, dst, src, nbytes);
823}
824
825static int crypto_cipher_encrypt_iv(struct crypto_tfm *tfm,
826 struct scatterlist *dst,
827 struct scatterlist *src,
828 unsigned int nbytes, u8 *iv) __deprecated;
829static inline int crypto_cipher_encrypt_iv(struct crypto_tfm *tfm,
830 struct scatterlist *dst,
831 struct scatterlist *src,
832 unsigned int nbytes, u8 *iv)
833{
834 BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
835 return tfm->crt_cipher.cit_encrypt_iv(tfm, dst, src, nbytes, iv);
836}
837
838static int crypto_cipher_decrypt(struct crypto_tfm *tfm,
839 struct scatterlist *dst,
840 struct scatterlist *src,
841 unsigned int nbytes) __deprecated;
842static inline int crypto_cipher_decrypt(struct crypto_tfm *tfm,
843 struct scatterlist *dst,
844 struct scatterlist *src,
845 unsigned int nbytes)
846{
847 BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
848 return tfm->crt_cipher.cit_decrypt(tfm, dst, src, nbytes);
849}
850
851static int crypto_cipher_decrypt_iv(struct crypto_tfm *tfm,
852 struct scatterlist *dst,
853 struct scatterlist *src,
854 unsigned int nbytes, u8 *iv) __deprecated;
855static inline int crypto_cipher_decrypt_iv(struct crypto_tfm *tfm,
856 struct scatterlist *dst,
857 struct scatterlist *src,
858 unsigned int nbytes, u8 *iv)
859{
860 BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
861 return tfm->crt_cipher.cit_decrypt_iv(tfm, dst, src, nbytes, iv);
862}
863
864static void crypto_cipher_set_iv(struct crypto_tfm *tfm,
865 const u8 *src, unsigned int len) __deprecated;
866static inline void crypto_cipher_set_iv(struct crypto_tfm *tfm,
867 const u8 *src, unsigned int len)
868{
869 BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
870 memcpy(tfm->crt_cipher.cit_iv, src, len);
871}
872
873static void crypto_cipher_get_iv(struct crypto_tfm *tfm,
874 u8 *dst, unsigned int len) __deprecated;
875static inline void crypto_cipher_get_iv(struct crypto_tfm *tfm,
876 u8 *dst, unsigned int len)
877{
878 BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
879 memcpy(dst, tfm->crt_cipher.cit_iv, len);
880}
881
882static inline struct crypto_comp *__crypto_comp_cast(struct crypto_tfm *tfm) 760static inline struct crypto_comp *__crypto_comp_cast(struct crypto_tfm *tfm)
883{ 761{
884 return (struct crypto_comp *)tfm; 762 return (struct crypto_comp *)tfm;
@@ -903,7 +781,7 @@ static inline struct crypto_comp *crypto_alloc_comp(const char *alg_name,
903 781
904static inline struct crypto_tfm *crypto_comp_tfm(struct crypto_comp *tfm) 782static inline struct crypto_tfm *crypto_comp_tfm(struct crypto_comp *tfm)
905{ 783{
906 return tfm; 784 return &tfm->base;
907} 785}
908 786
909static inline void crypto_free_comp(struct crypto_comp *tfm) 787static inline void crypto_free_comp(struct crypto_comp *tfm)
@@ -934,14 +812,16 @@ static inline int crypto_comp_compress(struct crypto_comp *tfm,
934 const u8 *src, unsigned int slen, 812 const u8 *src, unsigned int slen,
935 u8 *dst, unsigned int *dlen) 813 u8 *dst, unsigned int *dlen)
936{ 814{
937 return crypto_comp_crt(tfm)->cot_compress(tfm, src, slen, dst, dlen); 815 return crypto_comp_crt(tfm)->cot_compress(crypto_comp_tfm(tfm),
816 src, slen, dst, dlen);
938} 817}
939 818
940static inline int crypto_comp_decompress(struct crypto_comp *tfm, 819static inline int crypto_comp_decompress(struct crypto_comp *tfm,
941 const u8 *src, unsigned int slen, 820 const u8 *src, unsigned int slen,
942 u8 *dst, unsigned int *dlen) 821 u8 *dst, unsigned int *dlen)
943{ 822{
944 return crypto_comp_crt(tfm)->cot_decompress(tfm, src, slen, dst, dlen); 823 return crypto_comp_crt(tfm)->cot_decompress(crypto_comp_tfm(tfm),
824 src, slen, dst, dlen);
945} 825}
946 826
947#endif /* _LINUX_CRYPTO_H */ 827#endif /* _LINUX_CRYPTO_H */
diff --git a/include/linux/if_packet.h b/include/linux/if_packet.h
index 99393ef3af39..f3de05c30678 100644
--- a/include/linux/if_packet.h
+++ b/include/linux/if_packet.h
@@ -41,6 +41,7 @@ struct sockaddr_ll
41#define PACKET_RX_RING 5 41#define PACKET_RX_RING 5
42#define PACKET_STATISTICS 6 42#define PACKET_STATISTICS 6
43#define PACKET_COPY_THRESH 7 43#define PACKET_COPY_THRESH 7
44#define PACKET_AUXDATA 8
44 45
45struct tpacket_stats 46struct tpacket_stats
46{ 47{
@@ -48,6 +49,15 @@ struct tpacket_stats
48 unsigned int tp_drops; 49 unsigned int tp_drops;
49}; 50};
50 51
52struct tpacket_auxdata
53{
54 __u32 tp_status;
55 __u32 tp_len;
56 __u32 tp_snaplen;
57 __u16 tp_mac;
58 __u16 tp_net;
59};
60
51struct tpacket_hdr 61struct tpacket_hdr
52{ 62{
53 unsigned long tp_status; 63 unsigned long tp_status;
diff --git a/include/linux/net.h b/include/linux/net.h
index f28d8a2e2c91..4db21e63d8d2 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -24,7 +24,7 @@
24struct poll_table_struct; 24struct poll_table_struct;
25struct inode; 25struct inode;
26 26
27#define NPROTO 32 /* should be enough for now.. */ 27#define NPROTO 33 /* should be enough for now.. */
28 28
29#define SYS_SOCKET 1 /* sys_socket(2) */ 29#define SYS_SOCKET 1 /* sys_socket(2) */
30#define SYS_BIND 2 /* sys_bind(2) */ 30#define SYS_BIND 2 /* sys_bind(2) */
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 2e37f5012788..1a528548cd1d 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -589,7 +589,7 @@ extern int dev_open(struct net_device *dev);
589extern int dev_close(struct net_device *dev); 589extern int dev_close(struct net_device *dev);
590extern int dev_queue_xmit(struct sk_buff *skb); 590extern int dev_queue_xmit(struct sk_buff *skb);
591extern int register_netdevice(struct net_device *dev); 591extern int register_netdevice(struct net_device *dev);
592extern int unregister_netdevice(struct net_device *dev); 592extern void unregister_netdevice(struct net_device *dev);
593extern void free_netdev(struct net_device *dev); 593extern void free_netdev(struct net_device *dev);
594extern void synchronize_net(void); 594extern void synchronize_net(void);
595extern int register_netdevice_notifier(struct notifier_block *nb); 595extern int register_netdevice_notifier(struct notifier_block *nb);
diff --git a/include/linux/netfilter/Kbuild b/include/linux/netfilter/Kbuild
index 6328175a1c3a..43397a414cd6 100644
--- a/include/linux/netfilter/Kbuild
+++ b/include/linux/netfilter/Kbuild
@@ -33,6 +33,7 @@ header-y += xt_tcpmss.h
33header-y += xt_tcpudp.h 33header-y += xt_tcpudp.h
34header-y += xt_SECMARK.h 34header-y += xt_SECMARK.h
35header-y += xt_CONNSECMARK.h 35header-y += xt_CONNSECMARK.h
36header-y += xt_TCPMSS.h
36 37
37unifdef-y += nf_conntrack_common.h 38unifdef-y += nf_conntrack_common.h
38unifdef-y += nf_conntrack_ftp.h 39unifdef-y += nf_conntrack_ftp.h
diff --git a/include/linux/netfilter/nf_conntrack_sane.h b/include/linux/netfilter/nf_conntrack_sane.h
new file mode 100644
index 000000000000..4767d6e23e97
--- /dev/null
+++ b/include/linux/netfilter/nf_conntrack_sane.h
@@ -0,0 +1,21 @@
1#ifndef _NF_CONNTRACK_SANE_H
2#define _NF_CONNTRACK_SANE_H
3/* SANE tracking. */
4
5#ifdef __KERNEL__
6
7#define SANE_PORT 6566
8
9enum sane_state {
10 SANE_STATE_NORMAL,
11 SANE_STATE_START_REQUESTED,
12};
13
14/* This structure exists only once per master */
15struct nf_ct_sane_master {
16 enum sane_state state;
17};
18
19#endif /* __KERNEL__ */
20
21#endif /* _NF_CONNTRACK_SANE_H */
diff --git a/include/linux/netfilter/nf_conntrack_tcp.h b/include/linux/netfilter/nf_conntrack_tcp.h
index 2f4e98b90cc0..007af4c2770b 100644
--- a/include/linux/netfilter/nf_conntrack_tcp.h
+++ b/include/linux/netfilter/nf_conntrack_tcp.h
@@ -27,6 +27,9 @@ enum tcp_conntrack {
27/* This sender sent FIN first */ 27/* This sender sent FIN first */
28#define IP_CT_TCP_FLAG_CLOSE_INIT 0x04 28#define IP_CT_TCP_FLAG_CLOSE_INIT 0x04
29 29
30/* Be liberal in window checking */
31#define IP_CT_TCP_FLAG_BE_LIBERAL 0x08
32
30#ifdef __KERNEL__ 33#ifdef __KERNEL__
31 34
32struct ip_ct_tcp_state { 35struct ip_ct_tcp_state {
@@ -34,7 +37,6 @@ struct ip_ct_tcp_state {
34 u_int32_t td_maxend; /* max of ack + max(win, 1) */ 37 u_int32_t td_maxend; /* max of ack + max(win, 1) */
35 u_int32_t td_maxwin; /* max(win) */ 38 u_int32_t td_maxwin; /* max(win) */
36 u_int8_t td_scale; /* window scale factor */ 39 u_int8_t td_scale; /* window scale factor */
37 u_int8_t loose; /* used when connection picked up from the middle */
38 u_int8_t flags; /* per direction options */ 40 u_int8_t flags; /* per direction options */
39}; 41};
40 42
diff --git a/include/linux/netfilter/xt_TCPMSS.h b/include/linux/netfilter/xt_TCPMSS.h
new file mode 100644
index 000000000000..53a292cd47f3
--- /dev/null
+++ b/include/linux/netfilter/xt_TCPMSS.h
@@ -0,0 +1,10 @@
1#ifndef _XT_TCPMSS_H
2#define _XT_TCPMSS_H
3
4struct xt_tcpmss_info {
5 u_int16_t mss;
6};
7
8#define XT_TCPMSS_CLAMP_PMTU 0xffff
9
10#endif /* _XT_TCPMSS_H */
diff --git a/include/linux/netfilter_ipv4/ip_nat.h b/include/linux/netfilter_ipv4/ip_nat.h
index bdf553620ca1..bbca89aab813 100644
--- a/include/linux/netfilter_ipv4/ip_nat.h
+++ b/include/linux/netfilter_ipv4/ip_nat.h
@@ -16,6 +16,7 @@ enum ip_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 /* add randomness to "port" selection */
19 20
20/* NAT sequence number modifications */ 21/* NAT sequence number modifications */
21struct ip_nat_seq { 22struct ip_nat_seq {
diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h
index 98d566c5e32a..9527296595cd 100644
--- a/include/linux/netfilter_ipv4/ip_tables.h
+++ b/include/linux/netfilter_ipv4/ip_tables.h
@@ -272,25 +272,9 @@ ipt_get_target(struct ipt_entry *e)
272#include <linux/init.h> 272#include <linux/init.h>
273extern void ipt_init(void) __init; 273extern void ipt_init(void) __init;
274 274
275#define ipt_register_target(tgt) \ 275extern int ipt_register_table(struct xt_table *table,
276({ (tgt)->family = AF_INET; \
277 xt_register_target(tgt); })
278#define ipt_unregister_target(tgt) xt_unregister_target(tgt)
279
280#define ipt_register_match(mtch) \
281({ (mtch)->family = AF_INET; \
282 xt_register_match(mtch); })
283#define ipt_unregister_match(mtch) xt_unregister_match(mtch)
284
285//#define ipt_register_table(tbl, repl) xt_register_table(AF_INET, tbl, repl)
286//#define ipt_unregister_table(tbl) xt_unregister_table(AF_INET, tbl)
287
288extern int ipt_register_table(struct ipt_table *table,
289 const struct ipt_replace *repl); 276 const struct ipt_replace *repl);
290extern void ipt_unregister_table(struct ipt_table *table); 277extern void ipt_unregister_table(struct xt_table *table);
291
292/* net/sched/ipt.c: Gimme access to your targets! Gets target->me. */
293extern struct ipt_target *ipt_find_target(const char *name, u8 revision);
294 278
295/* Standard entry. */ 279/* Standard entry. */
296struct ipt_standard 280struct ipt_standard
@@ -315,7 +299,7 @@ extern unsigned int ipt_do_table(struct sk_buff **pskb,
315 unsigned int hook, 299 unsigned int hook,
316 const struct net_device *in, 300 const struct net_device *in,
317 const struct net_device *out, 301 const struct net_device *out,
318 struct ipt_table *table); 302 struct xt_table *table);
319 303
320#define IPT_ALIGN(s) XT_ALIGN(s) 304#define IPT_ALIGN(s) XT_ALIGN(s)
321 305
diff --git a/include/linux/netfilter_ipv4/ipt_TCPMSS.h b/include/linux/netfilter_ipv4/ipt_TCPMSS.h
index aadb39580cd3..7a850f945824 100644
--- a/include/linux/netfilter_ipv4/ipt_TCPMSS.h
+++ b/include/linux/netfilter_ipv4/ipt_TCPMSS.h
@@ -1,10 +1,9 @@
1#ifndef _IPT_TCPMSS_H 1#ifndef _IPT_TCPMSS_H
2#define _IPT_TCPMSS_H 2#define _IPT_TCPMSS_H
3 3
4struct ipt_tcpmss_info { 4#include <linux/netfilter/xt_TCPMSS.h>
5 u_int16_t mss;
6};
7 5
8#define IPT_TCPMSS_CLAMP_PMTU 0xffff 6#define ipt_tcpmss_info xt_tcpmss_info
7#define IPT_TCPMSS_CLAMP_PMTU XT_TCPMSS_CLAMP_PMTU
9 8
10#endif /*_IPT_TCPMSS_H*/ 9#endif /*_IPT_TCPMSS_H*/
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h
index 4aed340401db..61aa10412fc8 100644
--- a/include/linux/netfilter_ipv6/ip6_tables.h
+++ b/include/linux/netfilter_ipv6/ip6_tables.h
@@ -104,6 +104,25 @@ struct ip6t_entry
104 unsigned char elems[0]; 104 unsigned char elems[0];
105}; 105};
106 106
107/* Standard entry */
108struct ip6t_standard
109{
110 struct ip6t_entry entry;
111 struct ip6t_standard_target target;
112};
113
114struct ip6t_error_target
115{
116 struct ip6t_entry_target target;
117 char errorname[IP6T_FUNCTION_MAXNAMELEN];
118};
119
120struct ip6t_error
121{
122 struct ip6t_entry entry;
123 struct ip6t_error_target target;
124};
125
107/* 126/*
108 * New IP firewall options for [gs]etsockopt at the RAW IP level. 127 * New IP firewall options for [gs]etsockopt at the RAW IP level.
109 * Unlike BSD Linux inherits IP options so you don't have to use 128 * Unlike BSD Linux inherits IP options so you don't have to use
@@ -286,24 +305,14 @@ ip6t_get_target(struct ip6t_entry *e)
286#include <linux/init.h> 305#include <linux/init.h>
287extern void ip6t_init(void) __init; 306extern void ip6t_init(void) __init;
288 307
289#define ip6t_register_target(tgt) \ 308extern int ip6t_register_table(struct xt_table *table,
290({ (tgt)->family = AF_INET6; \
291 xt_register_target(tgt); })
292#define ip6t_unregister_target(tgt) xt_unregister_target(tgt)
293
294#define ip6t_register_match(match) \
295({ (match)->family = AF_INET6; \
296 xt_register_match(match); })
297#define ip6t_unregister_match(match) xt_unregister_match(match)
298
299extern int ip6t_register_table(struct ip6t_table *table,
300 const struct ip6t_replace *repl); 309 const struct ip6t_replace *repl);
301extern void ip6t_unregister_table(struct ip6t_table *table); 310extern void ip6t_unregister_table(struct xt_table *table);
302extern unsigned int ip6t_do_table(struct sk_buff **pskb, 311extern unsigned int ip6t_do_table(struct sk_buff **pskb,
303 unsigned int hook, 312 unsigned int hook,
304 const struct net_device *in, 313 const struct net_device *in,
305 const struct net_device *out, 314 const struct net_device *out,
306 struct ip6t_table *table); 315 struct xt_table *table);
307 316
308/* Check for an extension */ 317/* Check for an extension */
309extern int ip6t_ext_hdr(u8 nexthdr); 318extern int ip6t_ext_hdr(u8 nexthdr);
diff --git a/include/linux/netfilter_ipv6/ip6t_mh.h b/include/linux/netfilter_ipv6/ip6t_mh.h
new file mode 100644
index 000000000000..b9ca9a5f74d0
--- /dev/null
+++ b/include/linux/netfilter_ipv6/ip6t_mh.h
@@ -0,0 +1,15 @@
1#ifndef _IP6T_MH_H
2#define _IP6T_MH_H
3
4/* MH matching stuff */
5struct ip6t_mh
6{
7 u_int8_t types[2]; /* MH type range */
8 u_int8_t invflags; /* Inverse flags */
9};
10
11/* Values for "invflags" field in struct ip6t_mh. */
12#define IP6T_MH_INV_TYPE 0x01 /* Invert the sense of type. */
13#define IP6T_MH_INV_MASK 0x01 /* All possible flags. */
14
15#endif /*_IP6T_MH_H*/
diff --git a/include/linux/pfkeyv2.h b/include/linux/pfkeyv2.h
index 265bafab6494..d9db5f62ee48 100644
--- a/include/linux/pfkeyv2.h
+++ b/include/linux/pfkeyv2.h
@@ -251,7 +251,8 @@ struct sadb_x_sec_ctx {
251#define SADB_X_SPDEXPIRE 21 251#define SADB_X_SPDEXPIRE 21
252#define SADB_X_SPDDELETE2 22 252#define SADB_X_SPDDELETE2 22
253#define SADB_X_NAT_T_NEW_MAPPING 23 253#define SADB_X_NAT_T_NEW_MAPPING 23
254#define SADB_MAX 23 254#define SADB_X_MIGRATE 24
255#define SADB_MAX 24
255 256
256/* Security Association flags */ 257/* Security Association flags */
257#define SADB_SAFLAGS_PFS 1 258#define SADB_SAFLAGS_PFS 1
@@ -297,6 +298,7 @@ struct sadb_x_sec_ctx {
297#define SADB_X_EALG_BLOWFISHCBC 7 298#define SADB_X_EALG_BLOWFISHCBC 7
298#define SADB_EALG_NULL 11 299#define SADB_EALG_NULL 11
299#define SADB_X_EALG_AESCBC 12 300#define SADB_X_EALG_AESCBC 12
301#define SADB_X_EALG_CAMELLIACBC 22
300#define SADB_EALG_MAX 253 /* last EALG */ 302#define SADB_EALG_MAX 253 /* last EALG */
301/* private allocations should use 249-255 (RFC2407) */ 303/* private allocations should use 249-255 (RFC2407) */
302#define SADB_X_EALG_SERPENTCBC 252 /* draft-ietf-ipsec-ciph-aes-cbc-00 */ 304#define SADB_X_EALG_SERPENTCBC 252 /* draft-ietf-ipsec-ciph-aes-cbc-00 */
diff --git a/include/linux/socket.h b/include/linux/socket.h
index 92cd38efad7f..fcd35a210e7f 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -187,7 +187,8 @@ struct ucred {
187#define AF_LLC 26 /* Linux LLC */ 187#define AF_LLC 26 /* Linux LLC */
188#define AF_TIPC 30 /* TIPC sockets */ 188#define AF_TIPC 30 /* TIPC sockets */
189#define AF_BLUETOOTH 31 /* Bluetooth sockets */ 189#define AF_BLUETOOTH 31 /* Bluetooth sockets */
190#define AF_MAX 32 /* For now.. */ 190#define AF_IUCV 32 /* IUCV sockets */
191#define AF_MAX 33 /* For now.. */
191 192
192/* Protocol families, same as address families. */ 193/* Protocol families, same as address families. */
193#define PF_UNSPEC AF_UNSPEC 194#define PF_UNSPEC AF_UNSPEC
@@ -220,6 +221,7 @@ struct ucred {
220#define PF_LLC AF_LLC 221#define PF_LLC AF_LLC
221#define PF_TIPC AF_TIPC 222#define PF_TIPC AF_TIPC
222#define PF_BLUETOOTH AF_BLUETOOTH 223#define PF_BLUETOOTH AF_BLUETOOTH
224#define PF_IUCV AF_IUCV
223#define PF_MAX AF_MAX 225#define PF_MAX AF_MAX
224 226
225/* Maximum queue length specifiable by listen. */ 227/* Maximum queue length specifiable by listen. */
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index 81480e613467..665412c4f4b9 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -699,7 +699,8 @@ enum {
699 NET_X25_CALL_REQUEST_TIMEOUT=2, 699 NET_X25_CALL_REQUEST_TIMEOUT=2,
700 NET_X25_RESET_REQUEST_TIMEOUT=3, 700 NET_X25_RESET_REQUEST_TIMEOUT=3,
701 NET_X25_CLEAR_REQUEST_TIMEOUT=4, 701 NET_X25_CLEAR_REQUEST_TIMEOUT=4,
702 NET_X25_ACK_HOLD_BACK_TIMEOUT=5 702 NET_X25_ACK_HOLD_BACK_TIMEOUT=5,
703 NET_X25_FORWARD=6
703}; 704};
704 705
705/* /proc/sys/net/token-ring */ 706/* /proc/sys/net/token-ring */
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 3cc70d1a3504..29d3089038ab 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -316,7 +316,7 @@ struct tcp_sock {
316 struct tcp_sack_block duplicate_sack[1]; /* D-SACK block */ 316 struct tcp_sack_block duplicate_sack[1]; /* D-SACK block */
317 struct tcp_sack_block selective_acks[4]; /* The SACKS themselves*/ 317 struct tcp_sack_block selective_acks[4]; /* The SACKS themselves*/
318 318
319 struct tcp_sack_block recv_sack_cache[4]; 319 struct tcp_sack_block_wire recv_sack_cache[4];
320 320
321 /* from STCP, retrans queue hinting */ 321 /* from STCP, retrans queue hinting */
322 struct sk_buff* lost_skb_hint; 322 struct sk_buff* lost_skb_hint;
diff --git a/include/linux/wanrouter.h b/include/linux/wanrouter.h
index 2cd05013edfc..3add87465b1f 100644
--- a/include/linux/wanrouter.h
+++ b/include/linux/wanrouter.h
@@ -516,9 +516,6 @@ struct wan_device {
516/* Public functions available for device drivers */ 516/* Public functions available for device drivers */
517extern int register_wan_device(struct wan_device *wandev); 517extern int register_wan_device(struct wan_device *wandev);
518extern int unregister_wan_device(char *name); 518extern int unregister_wan_device(char *name);
519__be16 wanrouter_type_trans(struct sk_buff *skb, struct net_device *dev);
520int wanrouter_encapsulate(struct sk_buff *skb, struct net_device *dev,
521 unsigned short type);
522 519
523/* Proc interface functions. These must not be called by the drivers! */ 520/* Proc interface functions. These must not be called by the drivers! */
524extern int wanrouter_proc_init(void); 521extern int wanrouter_proc_init(void);
@@ -527,11 +524,6 @@ extern int wanrouter_proc_add(struct wan_device *wandev);
527extern int wanrouter_proc_delete(struct wan_device *wandev); 524extern int wanrouter_proc_delete(struct wan_device *wandev);
528extern int wanrouter_ioctl( struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg); 525extern int wanrouter_ioctl( struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg);
529 526
530extern void lock_adapter_irq(spinlock_t *lock, unsigned long *smp_flags);
531extern void unlock_adapter_irq(spinlock_t *lock, unsigned long *smp_flags);
532
533
534
535/* Public Data */ 527/* Public Data */
536/* list of registered devices */ 528/* list of registered devices */
537extern struct wan_device *wanrouter_router_devlist; 529extern struct wan_device *wanrouter_router_devlist;
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h
index 9529ea1ae392..15ca89e9961b 100644
--- a/include/linux/xfrm.h
+++ b/include/linux/xfrm.h
@@ -178,6 +178,9 @@ enum {
178 XFRM_MSG_REPORT, 178 XFRM_MSG_REPORT,
179#define XFRM_MSG_REPORT XFRM_MSG_REPORT 179#define XFRM_MSG_REPORT XFRM_MSG_REPORT
180 180
181 XFRM_MSG_MIGRATE,
182#define XFRM_MSG_MIGRATE XFRM_MSG_MIGRATE
183
181 __XFRM_MSG_MAX 184 __XFRM_MSG_MAX
182}; 185};
183#define XFRM_MSG_MAX (__XFRM_MSG_MAX - 1) 186#define XFRM_MSG_MAX (__XFRM_MSG_MAX - 1)
@@ -256,6 +259,7 @@ enum xfrm_attr_type_t {
256 XFRMA_COADDR, /* xfrm_address_t */ 259 XFRMA_COADDR, /* xfrm_address_t */
257 XFRMA_LASTUSED, 260 XFRMA_LASTUSED,
258 XFRMA_POLICY_TYPE, /* struct xfrm_userpolicy_type */ 261 XFRMA_POLICY_TYPE, /* struct xfrm_userpolicy_type */
262 XFRMA_MIGRATE,
259 __XFRMA_MAX 263 __XFRMA_MAX
260 264
261#define XFRMA_MAX (__XFRMA_MAX - 1) 265#define XFRMA_MAX (__XFRMA_MAX - 1)
@@ -351,6 +355,19 @@ struct xfrm_user_report {
351 struct xfrm_selector sel; 355 struct xfrm_selector sel;
352}; 356};
353 357
358struct xfrm_user_migrate {
359 xfrm_address_t old_daddr;
360 xfrm_address_t old_saddr;
361 xfrm_address_t new_daddr;
362 xfrm_address_t new_saddr;
363 __u8 proto;
364 __u8 mode;
365 __u16 reserved;
366 __u32 reqid;
367 __u16 old_family;
368 __u16 new_family;
369};
370
354#ifndef __KERNEL__ 371#ifndef __KERNEL__
355/* backwards compatibility for userspace */ 372/* backwards compatibility for userspace */
356#define XFRMGRP_ACQUIRE 1 373#define XFRMGRP_ACQUIRE 1
@@ -375,6 +392,8 @@ enum xfrm_nlgroups {
375#define XFRMNLGRP_AEVENTS XFRMNLGRP_AEVENTS 392#define XFRMNLGRP_AEVENTS XFRMNLGRP_AEVENTS
376 XFRMNLGRP_REPORT, 393 XFRMNLGRP_REPORT,
377#define XFRMNLGRP_REPORT XFRMNLGRP_REPORT 394#define XFRMNLGRP_REPORT XFRMNLGRP_REPORT
395 XFRMNLGRP_MIGRATE,
396#define XFRMNLGRP_MIGRATE XFRMNLGRP_MIGRATE
378 __XFRMNLGRP_MAX 397 __XFRMNLGRP_MAX
379}; 398};
380#define XFRMNLGRP_MAX (__XFRMNLGRP_MAX - 1) 399#define XFRMNLGRP_MAX (__XFRMNLGRP_MAX - 1)
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 */
40struct inet_ehash_bucket { 40struct 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 */
24enum {
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 */
41struct 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
55struct 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
68struct iucv_sock_list {
69 struct hlist_head head;
70 rwlock_t lock;
71 atomic_t autobind_name;
72};
73
74static void iucv_sock_destruct(struct sock *sk);
75static void iucv_sock_cleanup_listen(struct sock *parent);
76static void iucv_sock_kill(struct sock *sk);
77static void iucv_sock_close(struct sock *sk);
78static int iucv_sock_create(struct socket *sock, int proto);
79static int iucv_sock_bind(struct socket *sock, struct sockaddr *addr,
80 int addr_len);
81static int iucv_sock_connect(struct socket *sock, struct sockaddr *addr,
82 int alen, int flags);
83static int iucv_sock_listen(struct socket *sock, int backlog);
84static int iucv_sock_accept(struct socket *sock, struct socket *newsock,
85 int flags);
86static int iucv_sock_getname(struct socket *sock, struct sockaddr *addr,
87 int *len, int peer);
88static int iucv_sock_sendmsg(struct kiocb *iocb, struct socket *sock,
89 struct msghdr *msg, size_t len);
90static int iucv_sock_recvmsg(struct kiocb *iocb, struct socket *sock,
91 struct msghdr *msg, size_t len, int flags);
92unsigned int iucv_sock_poll(struct file *file, struct socket *sock,
93 poll_table *wait);
94static int iucv_sock_release(struct socket *sock);
95static int iucv_sock_shutdown(struct socket *sock, int how);
96
97void iucv_sock_link(struct iucv_sock_list *l, struct sock *s);
98void iucv_sock_unlink(struct iucv_sock_list *l, struct sock *s);
99int iucv_sock_wait_state(struct sock *sk, int state, int state2,
100 unsigned long timeo);
101int iucv_sock_wait_cnt(struct sock *sk, unsigned long timeo);
102void iucv_accept_enqueue(struct sock *parent, struct sock *sk);
103void iucv_accept_unlink(struct sock *sk);
104struct 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 */
76struct iucv_array {
77 u32 address;
78 u32 length;
79} __attribute__ ((aligned (8)));
80
81extern struct bus_type iucv_bus;
82extern 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 */
93struct 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 */
113struct 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 */
131struct 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 */
200int 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 */
209void 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 */
222static 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 */
240static 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 */
257int 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 */
275int 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 */
289int 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 */
301int 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 */
312int 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 */
324int 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 */
342int 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 */
356int 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 */
373int 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 */
391int 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 */
413int 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 */
50union nf_conntrack_help { 51union 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 */
21struct nf_nat_seq { 22struct 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
147static inline int ip_route_connect(struct rtable **rp, __be32 dst, 147static 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
174static inline int ip_route_newports(struct rtable **rp, u8 protocol, 175static 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 */
805static inline __sum16 tcp_v4_check(struct tcphdr *th, int len, 805static 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
164struct 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
164static inline struct x25_sock *x25_sk(const struct sock *sk) 172static 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;
172extern int sysctl_x25_reset_request_timeout; 180extern int sysctl_x25_reset_request_timeout;
173extern int sysctl_x25_clear_request_timeout; 181extern int sysctl_x25_clear_request_timeout;
174extern int sysctl_x25_ack_holdback_timeout; 182extern int sysctl_x25_ack_holdback_timeout;
183extern int sysctl_x25_forward;
175 184
176extern int x25_addr_ntoa(unsigned char *, struct x25_address *, 185extern 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 *);
199extern void x25_limit_facilities(struct x25_facilities *, struct x25_neigh *); 208extern void x25_limit_facilities(struct x25_facilities *, struct x25_neigh *);
200 209
210/* x25_forward.c */
211extern void x25_clear_forward_by_lci(unsigned int lci);
212extern void x25_clear_forward_by_dev(struct net_device *);
213extern int x25_forward_data(int, struct x25_neigh *, struct sk_buff *);
214extern int x25_forward_call(struct x25_address *, struct x25_neigh *,
215 struct sk_buff *, int);
216
201/* x25_in.c */ 217/* x25_in.c */
202extern int x25_process_rx_frame(struct sock *, struct sk_buff *); 218extern int x25_process_rx_frame(struct sock *, struct sk_buff *);
203extern int x25_backlog_rcv(struct sock *, struct sk_buff *); 219extern int x25_backlog_rcv(struct sock *, struct sk_buff *);
@@ -282,6 +298,8 @@ extern struct hlist_head x25_list;
282extern rwlock_t x25_list_lock; 298extern rwlock_t x25_list_lock;
283extern struct list_head x25_route_list; 299extern struct list_head x25_route_list;
284extern rwlock_t x25_route_list_lock; 300extern rwlock_t x25_route_list_lock;
301extern struct list_head x25_forward_list;
302extern rwlock_t x25_forward_list_lock;
285 303
286extern int x25_proc_init(void); 304extern int x25_proc_init(void);
287extern void x25_proc_exit(void); 305extern 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
257extern int xfrm_state_register_afinfo(struct xfrm_state_afinfo *afinfo); 258extern int xfrm_state_register_afinfo(struct xfrm_state_afinfo *afinfo);
258extern int xfrm_state_unregister_afinfo(struct xfrm_state_afinfo *afinfo); 259extern int xfrm_state_unregister_afinfo(struct xfrm_state_afinfo *afinfo);
260extern struct xfrm_state_afinfo *xfrm_state_get_afinfo(unsigned short family);
261extern void xfrm_state_put_afinfo(struct xfrm_state_afinfo *afinfo);
259 262
260extern void xfrm_state_delete_tunnel(struct xfrm_state *x); 263extern 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
365struct 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
390extern int xfrm_register_km(struct xfrm_mgr *km); 407extern 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);
986extern void xfrm_init_pmtu(struct dst_entry *dst); 1003extern void xfrm_init_pmtu(struct dst_entry *dst);
987 1004
1005#ifdef CONFIG_XFRM_MIGRATE
1006extern int km_migrate(struct xfrm_selector *sel, u8 dir, u8 type,
1007 struct xfrm_migrate *m, int num_bundles);
1008extern struct xfrm_state * xfrm_migrate_state_find(struct xfrm_migrate *m);
1009extern struct xfrm_state * xfrm_state_migrate(struct xfrm_state *x,
1010 struct xfrm_migrate *m);
1011extern int xfrm_migrate(struct xfrm_selector *sel, u8 dir, u8 type,
1012 struct xfrm_migrate *m, int num_bundles);
1013#endif
1014
988extern wait_queue_head_t km_waitq; 1015extern wait_queue_head_t km_waitq;
989extern int km_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport); 1016extern int km_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport);
990extern void km_policy_expired(struct xfrm_policy *pol, int dir, int hard, u32 pid); 1017extern 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
1081static 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
1086static 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
1093static 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 */