aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/dccp.h132
-rw-r--r--include/linux/dn.h44
-rw-r--r--include/linux/icmpv6.h11
-rw-r--r--include/linux/if.h26
-rw-r--r--include/linux/in.h1
-rw-r--r--include/linux/inetdevice.h1
-rw-r--r--include/linux/ipv6.h14
-rw-r--r--include/linux/ipv6_route.h10
-rw-r--r--include/linux/irda.h1
-rw-r--r--include/linux/list.h24
-rw-r--r--include/linux/net.h4
-rw-r--r--include/linux/netdevice.h41
-rw-r--r--include/linux/netfilter.h9
-rw-r--r--include/linux/netfilter/nfnetlink.h1
-rw-r--r--include/linux/netfilter/nfnetlink_log.h6
-rw-r--r--include/linux/netfilter/x_tables.h37
-rw-r--r--include/linux/netfilter/xt_policy.h58
-rw-r--r--include/linux/netfilter_bridge.h27
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack.h2
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack_h323.h30
-rw-r--r--include/linux/netfilter_ipv4/ip_nat.h2
-rw-r--r--include/linux/netfilter_ipv4/ipt_policy.h69
-rw-r--r--include/linux/netfilter_ipv6/ip6t_policy.h69
-rw-r--r--include/linux/netlink.h1
-rw-r--r--include/linux/pci_ids.h6
-rw-r--r--include/linux/rtnetlink.h23
-rw-r--r--include/linux/security.h25
-rw-r--r--include/linux/skbuff.h47
-rw-r--r--include/linux/socket.h1
-rw-r--r--include/linux/sunrpc/svcsock.h2
-rw-r--r--include/linux/sysctl.h27
-rw-r--r--include/linux/tcp.h6
-rw-r--r--include/linux/xfrm.h30
33 files changed, 518 insertions, 269 deletions
diff --git a/include/linux/dccp.h b/include/linux/dccp.h
index 088529f54965..676333b9fad0 100644
--- a/include/linux/dccp.h
+++ b/include/linux/dccp.h
@@ -18,7 +18,7 @@
18 * @dccph_seq - sequence number high or low order 24 bits, depends on dccph_x 18 * @dccph_seq - sequence number high or low order 24 bits, depends on dccph_x
19 */ 19 */
20struct dccp_hdr { 20struct dccp_hdr {
21 __u16 dccph_sport, 21 __be16 dccph_sport,
22 dccph_dport; 22 dccph_dport;
23 __u8 dccph_doff; 23 __u8 dccph_doff;
24#if defined(__LITTLE_ENDIAN_BITFIELD) 24#if defined(__LITTLE_ENDIAN_BITFIELD)
@@ -32,18 +32,18 @@ struct dccp_hdr {
32#endif 32#endif
33 __u16 dccph_checksum; 33 __u16 dccph_checksum;
34#if defined(__LITTLE_ENDIAN_BITFIELD) 34#if defined(__LITTLE_ENDIAN_BITFIELD)
35 __u32 dccph_x:1, 35 __u8 dccph_x:1,
36 dccph_type:4, 36 dccph_type:4,
37 dccph_reserved:3, 37 dccph_reserved:3;
38 dccph_seq:24;
39#elif defined(__BIG_ENDIAN_BITFIELD) 38#elif defined(__BIG_ENDIAN_BITFIELD)
40 __u32 dccph_reserved:3, 39 __u8 dccph_reserved:3,
41 dccph_type:4, 40 dccph_type:4,
42 dccph_x:1, 41 dccph_x:1;
43 dccph_seq:24;
44#else 42#else
45#error "Adjust your <asm/byteorder.h> defines" 43#error "Adjust your <asm/byteorder.h> defines"
46#endif 44#endif
45 __u8 dccph_seq2;
46 __be16 dccph_seq;
47}; 47};
48 48
49/** 49/**
@@ -52,7 +52,7 @@ struct dccp_hdr {
52 * @dccph_seq_low - low 24 bits of a 48 bit seq packet 52 * @dccph_seq_low - low 24 bits of a 48 bit seq packet
53 */ 53 */
54struct dccp_hdr_ext { 54struct dccp_hdr_ext {
55 __u32 dccph_seq_low; 55 __be32 dccph_seq_low;
56}; 56};
57 57
58/** 58/**
@@ -62,7 +62,7 @@ struct dccp_hdr_ext {
62 * @dccph_req_options - list of options (must be a multiple of 32 bits 62 * @dccph_req_options - list of options (must be a multiple of 32 bits
63 */ 63 */
64struct dccp_hdr_request { 64struct dccp_hdr_request {
65 __u32 dccph_req_service; 65 __be32 dccph_req_service;
66}; 66};
67/** 67/**
68 * struct dccp_hdr_ack_bits - acknowledgment bits common to most packets 68 * struct dccp_hdr_ack_bits - acknowledgment bits common to most packets
@@ -71,9 +71,9 @@ struct dccp_hdr_request {
71 * @dccph_resp_ack_nr_low - 48 bit ack number low order bits, contains GSR 71 * @dccph_resp_ack_nr_low - 48 bit ack number low order bits, contains GSR
72 */ 72 */
73struct dccp_hdr_ack_bits { 73struct dccp_hdr_ack_bits {
74 __u32 dccph_reserved1:8, 74 __be16 dccph_reserved1;
75 dccph_ack_nr_high:24; 75 __be16 dccph_ack_nr_high;
76 __u32 dccph_ack_nr_low; 76 __be32 dccph_ack_nr_low;
77}; 77};
78/** 78/**
79 * struct dccp_hdr_response - Conection initiation response header 79 * struct dccp_hdr_response - Conection initiation response header
@@ -85,7 +85,7 @@ struct dccp_hdr_ack_bits {
85 */ 85 */
86struct dccp_hdr_response { 86struct dccp_hdr_response {
87 struct dccp_hdr_ack_bits dccph_resp_ack; 87 struct dccp_hdr_ack_bits dccph_resp_ack;
88 __u32 dccph_resp_service; 88 __be32 dccph_resp_service;
89}; 89};
90 90
91/** 91/**
@@ -154,6 +154,10 @@ enum {
154 DCCPO_MANDATORY = 1, 154 DCCPO_MANDATORY = 1,
155 DCCPO_MIN_RESERVED = 3, 155 DCCPO_MIN_RESERVED = 3,
156 DCCPO_MAX_RESERVED = 31, 156 DCCPO_MAX_RESERVED = 31,
157 DCCPO_CHANGE_L = 32,
158 DCCPO_CONFIRM_L = 33,
159 DCCPO_CHANGE_R = 34,
160 DCCPO_CONFIRM_R = 35,
157 DCCPO_NDP_COUNT = 37, 161 DCCPO_NDP_COUNT = 37,
158 DCCPO_ACK_VECTOR_0 = 38, 162 DCCPO_ACK_VECTOR_0 = 38,
159 DCCPO_ACK_VECTOR_1 = 39, 163 DCCPO_ACK_VECTOR_1 = 39,
@@ -168,7 +172,9 @@ enum {
168/* DCCP features */ 172/* DCCP features */
169enum { 173enum {
170 DCCPF_RESERVED = 0, 174 DCCPF_RESERVED = 0,
175 DCCPF_CCID = 1,
171 DCCPF_SEQUENCE_WINDOW = 3, 176 DCCPF_SEQUENCE_WINDOW = 3,
177 DCCPF_ACK_RATIO = 5,
172 DCCPF_SEND_ACK_VECTOR = 6, 178 DCCPF_SEND_ACK_VECTOR = 6,
173 DCCPF_SEND_NDP_COUNT = 7, 179 DCCPF_SEND_NDP_COUNT = 7,
174 /* 10-127 reserved */ 180 /* 10-127 reserved */
@@ -176,9 +182,18 @@ enum {
176 DCCPF_MAX_CCID_SPECIFIC = 255, 182 DCCPF_MAX_CCID_SPECIFIC = 255,
177}; 183};
178 184
185/* this structure is argument to DCCP_SOCKOPT_CHANGE_X */
186struct dccp_so_feat {
187 __u8 dccpsf_feat;
188 __u8 *dccpsf_val;
189 __u8 dccpsf_len;
190};
191
179/* DCCP socket options */ 192/* DCCP socket options */
180#define DCCP_SOCKOPT_PACKET_SIZE 1 193#define DCCP_SOCKOPT_PACKET_SIZE 1
181#define DCCP_SOCKOPT_SERVICE 2 194#define DCCP_SOCKOPT_SERVICE 2
195#define DCCP_SOCKOPT_CHANGE_L 3
196#define DCCP_SOCKOPT_CHANGE_R 4
182#define DCCP_SOCKOPT_CCID_RX_INFO 128 197#define DCCP_SOCKOPT_CCID_RX_INFO 128
183#define DCCP_SOCKOPT_CCID_TX_INFO 192 198#define DCCP_SOCKOPT_CCID_TX_INFO 192
184 199
@@ -254,16 +269,12 @@ static inline unsigned int dccp_basic_hdr_len(const struct sk_buff *skb)
254static inline __u64 dccp_hdr_seq(const struct sk_buff *skb) 269static inline __u64 dccp_hdr_seq(const struct sk_buff *skb)
255{ 270{
256 const struct dccp_hdr *dh = dccp_hdr(skb); 271 const struct dccp_hdr *dh = dccp_hdr(skb);
257#if defined(__LITTLE_ENDIAN_BITFIELD) 272 __u64 seq_nr = ntohs(dh->dccph_seq);
258 __u64 seq_nr = ntohl(dh->dccph_seq << 8);
259#elif defined(__BIG_ENDIAN_BITFIELD)
260 __u64 seq_nr = ntohl(dh->dccph_seq);
261#else
262#error "Adjust your <asm/byteorder.h> defines"
263#endif
264 273
265 if (dh->dccph_x != 0) 274 if (dh->dccph_x != 0)
266 seq_nr = (seq_nr << 32) + ntohl(dccp_hdrx(skb)->dccph_seq_low); 275 seq_nr = (seq_nr << 32) + ntohl(dccp_hdrx(skb)->dccph_seq_low);
276 else
277 seq_nr += (u32)dh->dccph_seq2 << 16;
267 278
268 return seq_nr; 279 return seq_nr;
269} 280}
@@ -281,13 +292,7 @@ static inline struct dccp_hdr_ack_bits *dccp_hdr_ack_bits(const struct sk_buff *
281static inline u64 dccp_hdr_ack_seq(const struct sk_buff *skb) 292static inline u64 dccp_hdr_ack_seq(const struct sk_buff *skb)
282{ 293{
283 const struct dccp_hdr_ack_bits *dhack = dccp_hdr_ack_bits(skb); 294 const struct dccp_hdr_ack_bits *dhack = dccp_hdr_ack_bits(skb);
284#if defined(__LITTLE_ENDIAN_BITFIELD) 295 return ((u64)ntohs(dhack->dccph_ack_nr_high) << 32) + ntohl(dhack->dccph_ack_nr_low);
285 return (((u64)ntohl(dhack->dccph_ack_nr_high << 8)) << 32) + ntohl(dhack->dccph_ack_nr_low);
286#elif defined(__BIG_ENDIAN_BITFIELD)
287 return (((u64)ntohl(dhack->dccph_ack_nr_high)) << 32) + ntohl(dhack->dccph_ack_nr_low);
288#else
289#error "Adjust your <asm/byteorder.h> defines"
290#endif
291} 296}
292 297
293static inline struct dccp_hdr_response *dccp_hdr_response(struct sk_buff *skb) 298static inline struct dccp_hdr_response *dccp_hdr_response(struct sk_buff *skb)
@@ -314,38 +319,60 @@ static inline unsigned int dccp_hdr_len(const struct sk_buff *skb)
314 319
315/* initial values for each feature */ 320/* initial values for each feature */
316#define DCCPF_INITIAL_SEQUENCE_WINDOW 100 321#define DCCPF_INITIAL_SEQUENCE_WINDOW 100
317/* FIXME: for now we're using CCID 3 (TFRC) */ 322#define DCCPF_INITIAL_ACK_RATIO 2
318#define DCCPF_INITIAL_CCID 3 323#define DCCPF_INITIAL_CCID 2
319#define DCCPF_INITIAL_SEND_ACK_VECTOR 0 324#define DCCPF_INITIAL_SEND_ACK_VECTOR 1
320/* FIXME: for now we're default to 1 but it should really be 0 */ 325/* FIXME: for now we're default to 1 but it should really be 0 */
321#define DCCPF_INITIAL_SEND_NDP_COUNT 1 326#define DCCPF_INITIAL_SEND_NDP_COUNT 1
322 327
323#define DCCP_NDP_LIMIT 0xFFFFFF 328#define DCCP_NDP_LIMIT 0xFFFFFF
324 329
325/** 330/**
326 * struct dccp_options - option values for a DCCP connection 331 * struct dccp_minisock - Minimal DCCP connection representation
327 * @dccpo_sequence_window - Sequence Window Feature (section 7.5.2) 332 *
328 * @dccpo_ccid - Congestion Control Id (CCID) (section 10) 333 * Will be used to pass the state from dccp_request_sock to dccp_sock.
329 * @dccpo_send_ack_vector - Send Ack Vector Feature (section 11.5) 334 *
330 * @dccpo_send_ndp_count - Send NDP Count Feature (7.7.2) 335 * @dccpms_sequence_window - Sequence Window Feature (section 7.5.2)
336 * @dccpms_ccid - Congestion Control Id (CCID) (section 10)
337 * @dccpms_send_ack_vector - Send Ack Vector Feature (section 11.5)
338 * @dccpms_send_ndp_count - Send NDP Count Feature (7.7.2)
331 */ 339 */
332struct dccp_options { 340struct dccp_minisock {
333 __u64 dccpo_sequence_window; 341 __u64 dccpms_sequence_window;
334 __u8 dccpo_rx_ccid; 342 __u8 dccpms_rx_ccid;
335 __u8 dccpo_tx_ccid; 343 __u8 dccpms_tx_ccid;
336 __u8 dccpo_send_ack_vector; 344 __u8 dccpms_send_ack_vector;
337 __u8 dccpo_send_ndp_count; 345 __u8 dccpms_send_ndp_count;
346 __u8 dccpms_ack_ratio;
347 struct list_head dccpms_pending;
348 struct list_head dccpms_conf;
349};
350
351struct dccp_opt_conf {
352 __u8 *dccpoc_val;
353 __u8 dccpoc_len;
354};
355
356struct dccp_opt_pend {
357 struct list_head dccpop_node;
358 __u8 dccpop_type;
359 __u8 dccpop_feat;
360 __u8 *dccpop_val;
361 __u8 dccpop_len;
362 int dccpop_conf;
363 struct dccp_opt_conf *dccpop_sc;
338}; 364};
339 365
340extern void __dccp_options_init(struct dccp_options *dccpo); 366extern void __dccp_minisock_init(struct dccp_minisock *dmsk);
341extern void dccp_options_init(struct dccp_options *dccpo); 367extern void dccp_minisock_init(struct dccp_minisock *dmsk);
368
342extern int dccp_parse_options(struct sock *sk, struct sk_buff *skb); 369extern int dccp_parse_options(struct sock *sk, struct sk_buff *skb);
343 370
344struct dccp_request_sock { 371struct dccp_request_sock {
345 struct inet_request_sock dreq_inet_rsk; 372 struct inet_request_sock dreq_inet_rsk;
346 __u64 dreq_iss; 373 __u64 dreq_iss;
347 __u64 dreq_isr; 374 __u64 dreq_isr;
348 __u32 dreq_service; 375 __be32 dreq_service;
349}; 376};
350 377
351static inline struct dccp_request_sock *dccp_rsk(const struct request_sock *req) 378static inline struct dccp_request_sock *dccp_rsk(const struct request_sock *req)
@@ -373,13 +400,13 @@ enum dccp_role {
373 400
374struct dccp_service_list { 401struct dccp_service_list {
375 __u32 dccpsl_nr; 402 __u32 dccpsl_nr;
376 __u32 dccpsl_list[0]; 403 __be32 dccpsl_list[0];
377}; 404};
378 405
379#define DCCP_SERVICE_INVALID_VALUE htonl((__u32)-1) 406#define DCCP_SERVICE_INVALID_VALUE htonl((__u32)-1)
380 407
381static inline int dccp_list_has_service(const struct dccp_service_list *sl, 408static inline int dccp_list_has_service(const struct dccp_service_list *sl,
382 const u32 service) 409 const __be32 service)
383{ 410{
384 if (likely(sl != NULL)) { 411 if (likely(sl != NULL)) {
385 u32 i = sl->dccpsl_nr; 412 u32 i = sl->dccpsl_nr;
@@ -425,17 +452,17 @@ struct dccp_sock {
425 __u64 dccps_gss; 452 __u64 dccps_gss;
426 __u64 dccps_gsr; 453 __u64 dccps_gsr;
427 __u64 dccps_gar; 454 __u64 dccps_gar;
428 __u32 dccps_service; 455 __be32 dccps_service;
429 struct dccp_service_list *dccps_service_list; 456 struct dccp_service_list *dccps_service_list;
430 struct timeval dccps_timestamp_time; 457 struct timeval dccps_timestamp_time;
431 __u32 dccps_timestamp_echo; 458 __u32 dccps_timestamp_echo;
432 __u32 dccps_packet_size; 459 __u32 dccps_packet_size;
460 __u16 dccps_l_ack_ratio;
461 __u16 dccps_r_ack_ratio;
433 unsigned long dccps_ndp_count; 462 unsigned long dccps_ndp_count;
434 __u32 dccps_mss_cache; 463 __u32 dccps_mss_cache;
435 struct dccp_options dccps_options; 464 struct dccp_minisock dccps_minisock;
436 struct dccp_ackvec *dccps_hc_rx_ackvec; 465 struct dccp_ackvec *dccps_hc_rx_ackvec;
437 void *dccps_hc_rx_ccid_private;
438 void *dccps_hc_tx_ccid_private;
439 struct ccid *dccps_hc_rx_ccid; 466 struct ccid *dccps_hc_rx_ccid;
440 struct ccid *dccps_hc_tx_ccid; 467 struct ccid *dccps_hc_tx_ccid;
441 struct dccp_options_received dccps_options_received; 468 struct dccp_options_received dccps_options_received;
@@ -450,6 +477,11 @@ static inline struct dccp_sock *dccp_sk(const struct sock *sk)
450 return (struct dccp_sock *)sk; 477 return (struct dccp_sock *)sk;
451} 478}
452 479
480static inline struct dccp_minisock *dccp_msk(const struct sock *sk)
481{
482 return (struct dccp_minisock *)&dccp_sk(sk)->dccps_minisock;
483}
484
453static inline int dccp_service_not_initialized(const struct sock *sk) 485static inline int dccp_service_not_initialized(const struct sock *sk)
454{ 486{
455 return dccp_sk(sk)->dccps_service == DCCP_SERVICE_INVALID_VALUE; 487 return dccp_sk(sk)->dccps_service == DCCP_SERVICE_INVALID_VALUE;
diff --git a/include/linux/dn.h b/include/linux/dn.h
index 782cae49e64c..10b6a6fd5837 100644
--- a/include/linux/dn.h
+++ b/include/linux/dn.h
@@ -71,17 +71,17 @@
71 71
72struct dn_naddr 72struct dn_naddr
73{ 73{
74 unsigned short a_len; 74 __le16 a_len;
75 unsigned char a_addr[DN_MAXADDL]; 75 __u8 a_addr[DN_MAXADDL]; /* Two bytes little endian */
76}; 76};
77 77
78struct sockaddr_dn 78struct sockaddr_dn
79{ 79{
80 unsigned short sdn_family; 80 __u16 sdn_family;
81 unsigned char sdn_flags; 81 __u8 sdn_flags;
82 unsigned char sdn_objnum; 82 __u8 sdn_objnum;
83 unsigned short sdn_objnamel; 83 __le16 sdn_objnamel;
84 unsigned char sdn_objname[DN_MAXOBJL]; 84 __u8 sdn_objname[DN_MAXOBJL];
85 struct dn_naddr sdn_add; 85 struct dn_naddr sdn_add;
86}; 86};
87#define sdn_nodeaddrl sdn_add.a_len /* Node address length */ 87#define sdn_nodeaddrl sdn_add.a_len /* Node address length */
@@ -93,38 +93,38 @@ struct sockaddr_dn
93 * DECnet set/get DSO_CONDATA, DSO_DISDATA (optional data) structure 93 * DECnet set/get DSO_CONDATA, DSO_DISDATA (optional data) structure
94 */ 94 */
95struct optdata_dn { 95struct optdata_dn {
96 unsigned short opt_status; /* Extended status return */ 96 __le16 opt_status; /* Extended status return */
97#define opt_sts opt_status 97#define opt_sts opt_status
98 unsigned short opt_optl; /* Length of user data */ 98 __le16 opt_optl; /* Length of user data */
99 unsigned char opt_data[16]; /* User data */ 99 __u8 opt_data[16]; /* User data */
100}; 100};
101 101
102struct accessdata_dn 102struct accessdata_dn
103{ 103{
104 unsigned char acc_accl; 104 __u8 acc_accl;
105 unsigned char acc_acc[DN_MAXACCL]; 105 __u8 acc_acc[DN_MAXACCL];
106 unsigned char acc_passl; 106 __u8 acc_passl;
107 unsigned char acc_pass[DN_MAXACCL]; 107 __u8 acc_pass[DN_MAXACCL];
108 unsigned char acc_userl; 108 __u8 acc_userl;
109 unsigned char acc_user[DN_MAXACCL]; 109 __u8 acc_user[DN_MAXACCL];
110}; 110};
111 111
112/* 112/*
113 * DECnet logical link information structure 113 * DECnet logical link information structure
114 */ 114 */
115struct linkinfo_dn { 115struct linkinfo_dn {
116 unsigned short idn_segsize; /* Segment size for link */ 116 __le16 idn_segsize; /* Segment size for link */
117 unsigned char idn_linkstate; /* Logical link state */ 117 __u8 idn_linkstate; /* Logical link state */
118}; 118};
119 119
120/* 120/*
121 * Ethernet address format (for DECnet) 121 * Ethernet address format (for DECnet)
122 */ 122 */
123union etheraddress { 123union etheraddress {
124 unsigned char dne_addr[6]; /* Full ethernet address */ 124 __u8 dne_addr[6]; /* Full ethernet address */
125 struct { 125 struct {
126 unsigned char dne_hiord[4]; /* DECnet HIORD prefix */ 126 __u8 dne_hiord[4]; /* DECnet HIORD prefix */
127 unsigned char dne_nodeaddr[2]; /* DECnet node address */ 127 __u8 dne_nodeaddr[2]; /* DECnet node address */
128 } dne_remote; 128 } dne_remote;
129}; 129};
130 130
@@ -133,7 +133,7 @@ union etheraddress {
133 * DECnet physical socket address format 133 * DECnet physical socket address format
134 */ 134 */
135struct dn_addr { 135struct dn_addr {
136 unsigned short dna_family; /* AF_DECnet */ 136 __le16 dna_family; /* AF_DECnet */
137 union etheraddress dna_netaddr; /* DECnet ethernet address */ 137 union etheraddress dna_netaddr; /* DECnet ethernet address */
138}; 138};
139 139
diff --git a/include/linux/icmpv6.h b/include/linux/icmpv6.h
index 0cf6c8b12caf..c771a7db9871 100644
--- a/include/linux/icmpv6.h
+++ b/include/linux/icmpv6.h
@@ -40,14 +40,16 @@ struct icmp6hdr {
40 struct icmpv6_nd_ra { 40 struct icmpv6_nd_ra {
41 __u8 hop_limit; 41 __u8 hop_limit;
42#if defined(__LITTLE_ENDIAN_BITFIELD) 42#if defined(__LITTLE_ENDIAN_BITFIELD)
43 __u8 reserved:6, 43 __u8 reserved:4,
44 router_pref:2,
44 other:1, 45 other:1,
45 managed:1; 46 managed:1;
46 47
47#elif defined(__BIG_ENDIAN_BITFIELD) 48#elif defined(__BIG_ENDIAN_BITFIELD)
48 __u8 managed:1, 49 __u8 managed:1,
49 other:1, 50 other:1,
50 reserved:6; 51 router_pref:2,
52 reserved:4;
51#else 53#else
52#error "Please fix <asm/byteorder.h>" 54#error "Please fix <asm/byteorder.h>"
53#endif 55#endif
@@ -70,8 +72,13 @@ struct icmp6hdr {
70#define icmp6_addrconf_managed icmp6_dataun.u_nd_ra.managed 72#define icmp6_addrconf_managed icmp6_dataun.u_nd_ra.managed
71#define icmp6_addrconf_other icmp6_dataun.u_nd_ra.other 73#define icmp6_addrconf_other icmp6_dataun.u_nd_ra.other
72#define icmp6_rt_lifetime icmp6_dataun.u_nd_ra.rt_lifetime 74#define icmp6_rt_lifetime icmp6_dataun.u_nd_ra.rt_lifetime
75#define icmp6_router_pref icmp6_dataun.u_nd_ra.router_pref
73}; 76};
74 77
78#define ICMPV6_ROUTER_PREF_LOW 0x3
79#define ICMPV6_ROUTER_PREF_MEDIUM 0x0
80#define ICMPV6_ROUTER_PREF_HIGH 0x1
81#define ICMPV6_ROUTER_PREF_INVALID 0x2
75 82
76#define ICMPV6_DEST_UNREACH 1 83#define ICMPV6_DEST_UNREACH 1
77#define ICMPV6_PKT_TOOBIG 2 84#define ICMPV6_PKT_TOOBIG 2
diff --git a/include/linux/if.h b/include/linux/if.h
index 12c6f6d157c3..374e20ad8b0d 100644
--- a/include/linux/if.h
+++ b/include/linux/if.h
@@ -33,7 +33,7 @@
33#define IFF_LOOPBACK 0x8 /* is a loopback net */ 33#define IFF_LOOPBACK 0x8 /* is a loopback net */
34#define IFF_POINTOPOINT 0x10 /* interface is has p-p link */ 34#define IFF_POINTOPOINT 0x10 /* interface is has p-p link */
35#define IFF_NOTRAILERS 0x20 /* avoid use of trailers */ 35#define IFF_NOTRAILERS 0x20 /* avoid use of trailers */
36#define IFF_RUNNING 0x40 /* interface running and carrier ok */ 36#define IFF_RUNNING 0x40 /* interface RFC2863 OPER_UP */
37#define IFF_NOARP 0x80 /* no ARP protocol */ 37#define IFF_NOARP 0x80 /* no ARP protocol */
38#define IFF_PROMISC 0x100 /* receive all packets */ 38#define IFF_PROMISC 0x100 /* receive all packets */
39#define IFF_ALLMULTI 0x200 /* receive all multicast packets*/ 39#define IFF_ALLMULTI 0x200 /* receive all multicast packets*/
@@ -43,12 +43,16 @@
43 43
44#define IFF_MULTICAST 0x1000 /* Supports multicast */ 44#define IFF_MULTICAST 0x1000 /* Supports multicast */
45 45
46#define IFF_VOLATILE (IFF_LOOPBACK|IFF_POINTOPOINT|IFF_BROADCAST|IFF_MASTER|IFF_SLAVE|IFF_RUNNING)
47
48#define IFF_PORTSEL 0x2000 /* can set media type */ 46#define IFF_PORTSEL 0x2000 /* can set media type */
49#define IFF_AUTOMEDIA 0x4000 /* auto media select active */ 47#define IFF_AUTOMEDIA 0x4000 /* auto media select active */
50#define IFF_DYNAMIC 0x8000 /* dialup device with changing addresses*/ 48#define IFF_DYNAMIC 0x8000 /* dialup device with changing addresses*/
51 49
50#define IFF_LOWER_UP 0x10000 /* driver signals L1 up */
51#define IFF_DORMANT 0x20000 /* driver signals dormant */
52
53#define IFF_VOLATILE (IFF_LOOPBACK|IFF_POINTOPOINT|IFF_BROADCAST|\
54 IFF_MASTER|IFF_SLAVE|IFF_RUNNING|IFF_LOWER_UP|IFF_DORMANT)
55
52/* Private (from user) interface flags (netdevice->priv_flags). */ 56/* Private (from user) interface flags (netdevice->priv_flags). */
53#define IFF_802_1Q_VLAN 0x1 /* 802.1Q VLAN device. */ 57#define IFF_802_1Q_VLAN 0x1 /* 802.1Q VLAN device. */
54#define IFF_EBRIDGE 0x2 /* Ethernet bridging device. */ 58#define IFF_EBRIDGE 0x2 /* Ethernet bridging device. */
@@ -83,6 +87,22 @@
83#define IF_PROTO_FR_ETH_PVC 0x200B 87#define IF_PROTO_FR_ETH_PVC 0x200B
84#define IF_PROTO_RAW 0x200C /* RAW Socket */ 88#define IF_PROTO_RAW 0x200C /* RAW Socket */
85 89
90/* RFC 2863 operational status */
91enum {
92 IF_OPER_UNKNOWN,
93 IF_OPER_NOTPRESENT,
94 IF_OPER_DOWN,
95 IF_OPER_LOWERLAYERDOWN,
96 IF_OPER_TESTING,
97 IF_OPER_DORMANT,
98 IF_OPER_UP,
99};
100
101/* link modes */
102enum {
103 IF_LINK_MODE_DEFAULT,
104 IF_LINK_MODE_DORMANT, /* limit upward transition to dormant */
105};
86 106
87/* 107/*
88 * Device mapping structure. I'd just gone off and designed a 108 * Device mapping structure. I'd just gone off and designed a
diff --git a/include/linux/in.h b/include/linux/in.h
index ba355384016a..94f557fa4636 100644
--- a/include/linux/in.h
+++ b/include/linux/in.h
@@ -72,6 +72,7 @@ struct in_addr {
72#define IP_FREEBIND 15 72#define IP_FREEBIND 15
73#define IP_IPSEC_POLICY 16 73#define IP_IPSEC_POLICY 16
74#define IP_XFRM_POLICY 17 74#define IP_XFRM_POLICY 17
75#define IP_PASSSEC 18
75 76
76/* BSD compatibility */ 77/* BSD compatibility */
77#define IP_RECVRETOPTS IP_RETOPTS 78#define IP_RECVRETOPTS IP_RETOPTS
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index fd7af86151b1..92297ff24e85 100644
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -25,6 +25,7 @@ struct ipv4_devconf
25 int arp_filter; 25 int arp_filter;
26 int arp_announce; 26 int arp_announce;
27 int arp_ignore; 27 int arp_ignore;
28 int arp_accept;
28 int medium_id; 29 int medium_id;
29 int no_xfrm; 30 int no_xfrm;
30 int no_policy; 31 int no_policy;
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index 9c8f4c9ed429..1263d8cb3c18 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -145,6 +145,15 @@ struct ipv6_devconf {
145 __s32 max_desync_factor; 145 __s32 max_desync_factor;
146#endif 146#endif
147 __s32 max_addresses; 147 __s32 max_addresses;
148 __s32 accept_ra_defrtr;
149 __s32 accept_ra_pinfo;
150#ifdef CONFIG_IPV6_ROUTER_PREF
151 __s32 accept_ra_rtr_pref;
152 __s32 rtr_probe_interval;
153#ifdef CONFIG_IPV6_ROUTE_INFO
154 __s32 accept_ra_rt_info_max_plen;
155#endif
156#endif
148 void *sysctl; 157 void *sysctl;
149}; 158};
150 159
@@ -167,6 +176,11 @@ enum {
167 DEVCONF_MAX_DESYNC_FACTOR, 176 DEVCONF_MAX_DESYNC_FACTOR,
168 DEVCONF_MAX_ADDRESSES, 177 DEVCONF_MAX_ADDRESSES,
169 DEVCONF_FORCE_MLD_VERSION, 178 DEVCONF_FORCE_MLD_VERSION,
179 DEVCONF_ACCEPT_RA_DEFRTR,
180 DEVCONF_ACCEPT_RA_PINFO,
181 DEVCONF_ACCEPT_RA_RTR_PREF,
182 DEVCONF_RTR_PROBE_INTERVAL,
183 DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN,
170 DEVCONF_MAX 184 DEVCONF_MAX
171}; 185};
172 186
diff --git a/include/linux/ipv6_route.h b/include/linux/ipv6_route.h
index d7c41d1d706a..b323ff577967 100644
--- a/include/linux/ipv6_route.h
+++ b/include/linux/ipv6_route.h
@@ -23,12 +23,22 @@
23#define RTF_NONEXTHOP 0x00200000 /* route with no nexthop */ 23#define RTF_NONEXTHOP 0x00200000 /* route with no nexthop */
24#define RTF_EXPIRES 0x00400000 24#define RTF_EXPIRES 0x00400000
25 25
26#define RTF_ROUTEINFO 0x00800000 /* route information - RA */
27
26#define RTF_CACHE 0x01000000 /* cache entry */ 28#define RTF_CACHE 0x01000000 /* cache entry */
27#define RTF_FLOW 0x02000000 /* flow significant route */ 29#define RTF_FLOW 0x02000000 /* flow significant route */
28#define RTF_POLICY 0x04000000 /* policy route */ 30#define RTF_POLICY 0x04000000 /* policy route */
29 31
32#define RTF_PREF(pref) ((pref) << 27)
33#define RTF_PREF_MASK 0x18000000
34
30#define RTF_LOCAL 0x80000000 35#define RTF_LOCAL 0x80000000
31 36
37#ifdef __KERNEL__
38#define IPV6_EXTRACT_PREF(flag) (((flag) & RTF_PREF_MASK) >> 27)
39#define IPV6_DECODE_PREF(pref) ((pref) ^ 2) /* 1:low,2:med,3:high */
40#endif
41
32struct in6_rtmsg { 42struct in6_rtmsg {
33 struct in6_addr rtmsg_dst; 43 struct in6_addr rtmsg_dst;
34 struct in6_addr rtmsg_src; 44 struct in6_addr rtmsg_src;
diff --git a/include/linux/irda.h b/include/linux/irda.h
index 95dee174cdc5..09d8f105a5a8 100644
--- a/include/linux/irda.h
+++ b/include/linux/irda.h
@@ -76,6 +76,7 @@ typedef enum {
76 IRDA_MCP2120_DONGLE = 9, 76 IRDA_MCP2120_DONGLE = 9,
77 IRDA_ACT200L_DONGLE = 10, 77 IRDA_ACT200L_DONGLE = 10,
78 IRDA_MA600_DONGLE = 11, 78 IRDA_MA600_DONGLE = 11,
79 IRDA_TOIM3232_DONGLE = 12,
79} IRDA_DONGLE; 80} IRDA_DONGLE;
80 81
81/* Protocol types to be used for SOCK_DGRAM */ 82/* Protocol types to be used for SOCK_DGRAM */
diff --git a/include/linux/list.h b/include/linux/list.h
index 47208bd99f9e..67258b47e9ca 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -411,6 +411,17 @@ static inline void list_splice_init(struct list_head *list,
411 pos = list_entry(pos->member.next, typeof(*pos), member)) 411 pos = list_entry(pos->member.next, typeof(*pos), member))
412 412
413/** 413/**
414 * list_for_each_entry_from - iterate over list of given type
415 * continuing from existing point
416 * @pos: the type * to use as a loop counter.
417 * @head: the head for your list.
418 * @member: the name of the list_struct within the struct.
419 */
420#define list_for_each_entry_from(pos, head, member) \
421 for (; prefetch(pos->member.next), &pos->member != (head); \
422 pos = list_entry(pos->member.next, typeof(*pos), member))
423
424/**
414 * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry 425 * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry
415 * @pos: the type * to use as a loop counter. 426 * @pos: the type * to use as a loop counter.
416 * @n: another type * to use as temporary storage 427 * @n: another type * to use as temporary storage
@@ -438,6 +449,19 @@ static inline void list_splice_init(struct list_head *list,
438 pos = n, n = list_entry(n->member.next, typeof(*n), member)) 449 pos = n, n = list_entry(n->member.next, typeof(*n), member))
439 450
440/** 451/**
452 * list_for_each_entry_safe_from - iterate over list of given type
453 * from existing point safe against removal of list entry
454 * @pos: the type * to use as a loop counter.
455 * @n: another type * to use as temporary storage
456 * @head: the head for your list.
457 * @member: the name of the list_struct within the struct.
458 */
459#define list_for_each_entry_safe_from(pos, n, head, member) \
460 for (n = list_entry(pos->member.next, typeof(*pos), member); \
461 &pos->member != (head); \
462 pos = n, n = list_entry(n->member.next, typeof(*n), member))
463
464/**
441 * list_for_each_entry_safe_reverse - iterate backwards over list of given type safe against 465 * list_for_each_entry_safe_reverse - iterate backwards over list of given type safe against
442 * removal of list entry 466 * removal of list entry
443 * @pos: the type * to use as a loop counter. 467 * @pos: the type * to use as a loop counter.
diff --git a/include/linux/net.h b/include/linux/net.h
index 28195a2d8ff0..152fa6551fd8 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -149,6 +149,10 @@ struct proto_ops {
149 int optname, char __user *optval, int optlen); 149 int optname, char __user *optval, int optlen);
150 int (*getsockopt)(struct socket *sock, int level, 150 int (*getsockopt)(struct socket *sock, int level,
151 int optname, char __user *optval, int __user *optlen); 151 int optname, char __user *optval, int __user *optlen);
152 int (*compat_setsockopt)(struct socket *sock, int level,
153 int optname, char __user *optval, int optlen);
154 int (*compat_getsockopt)(struct socket *sock, int level,
155 int optname, char __user *optval, int __user *optlen);
152 int (*sendmsg) (struct kiocb *iocb, struct socket *sock, 156 int (*sendmsg) (struct kiocb *iocb, struct socket *sock,
153 struct msghdr *m, size_t total_len); 157 struct msghdr *m, size_t total_len);
154 int (*recvmsg) (struct kiocb *iocb, struct socket *sock, 158 int (*recvmsg) (struct kiocb *iocb, struct socket *sock,
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 7fda03d338d1..950dc55e5192 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -230,7 +230,8 @@ enum netdev_state_t
230 __LINK_STATE_SCHED, 230 __LINK_STATE_SCHED,
231 __LINK_STATE_NOCARRIER, 231 __LINK_STATE_NOCARRIER,
232 __LINK_STATE_RX_SCHED, 232 __LINK_STATE_RX_SCHED,
233 __LINK_STATE_LINKWATCH_PENDING 233 __LINK_STATE_LINKWATCH_PENDING,
234 __LINK_STATE_DORMANT,
234}; 235};
235 236
236 237
@@ -335,11 +336,14 @@ struct net_device
335 */ 336 */
336 337
337 338
338 unsigned short flags; /* interface flags (a la BSD) */ 339 unsigned int flags; /* interface flags (a la BSD) */
339 unsigned short gflags; 340 unsigned short gflags;
340 unsigned short priv_flags; /* Like 'flags' but invisible to userspace. */ 341 unsigned short priv_flags; /* Like 'flags' but invisible to userspace. */
341 unsigned short padded; /* How much padding added by alloc_netdev() */ 342 unsigned short padded; /* How much padding added by alloc_netdev() */
342 343
344 unsigned char operstate; /* RFC2863 operstate */
345 unsigned char link_mode; /* mapping policy to operstate */
346
343 unsigned mtu; /* interface MTU value */ 347 unsigned mtu; /* interface MTU value */
344 unsigned short type; /* interface hardware type */ 348 unsigned short type; /* interface hardware type */
345 unsigned short hard_header_len; /* hardware hdr length */ 349 unsigned short hard_header_len; /* hardware hdr length */
@@ -708,12 +712,18 @@ static inline void dev_put(struct net_device *dev)
708 atomic_dec(&dev->refcnt); 712 atomic_dec(&dev->refcnt);
709} 713}
710 714
711#define __dev_put(dev) atomic_dec(&(dev)->refcnt) 715static inline void dev_hold(struct net_device *dev)
712#define dev_hold(dev) atomic_inc(&(dev)->refcnt) 716{
717 atomic_inc(&dev->refcnt);
718}
713 719
714/* Carrier loss detection, dial on demand. The functions netif_carrier_on 720/* Carrier loss detection, dial on demand. The functions netif_carrier_on
715 * and _off may be called from IRQ context, but it is caller 721 * and _off may be called from IRQ context, but it is caller
716 * who is responsible for serialization of these calls. 722 * who is responsible for serialization of these calls.
723 *
724 * The name carrier is inappropriate, these functions should really be
725 * called netif_lowerlayer_*() because they represent the state of any
726 * kind of lower layer not just hardware media.
717 */ 727 */
718 728
719extern void linkwatch_fire_event(struct net_device *dev); 729extern void linkwatch_fire_event(struct net_device *dev);
@@ -729,6 +739,29 @@ extern void netif_carrier_on(struct net_device *dev);
729 739
730extern void netif_carrier_off(struct net_device *dev); 740extern void netif_carrier_off(struct net_device *dev);
731 741
742static inline void netif_dormant_on(struct net_device *dev)
743{
744 if (!test_and_set_bit(__LINK_STATE_DORMANT, &dev->state))
745 linkwatch_fire_event(dev);
746}
747
748static inline void netif_dormant_off(struct net_device *dev)
749{
750 if (test_and_clear_bit(__LINK_STATE_DORMANT, &dev->state))
751 linkwatch_fire_event(dev);
752}
753
754static inline int netif_dormant(const struct net_device *dev)
755{
756 return test_bit(__LINK_STATE_DORMANT, &dev->state);
757}
758
759
760static inline int netif_oper_up(const struct net_device *dev) {
761 return (dev->operstate == IF_OPER_UP ||
762 dev->operstate == IF_OPER_UNKNOWN /* backward compat */);
763}
764
732/* Hot-plugging. */ 765/* Hot-plugging. */
733static inline int netif_device_present(struct net_device *dev) 766static inline int netif_device_present(struct net_device *dev)
734{ 767{
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
index 468896939843..412e52ca9720 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -80,10 +80,14 @@ struct nf_sockopt_ops
80 int set_optmin; 80 int set_optmin;
81 int set_optmax; 81 int set_optmax;
82 int (*set)(struct sock *sk, int optval, void __user *user, unsigned int len); 82 int (*set)(struct sock *sk, int optval, void __user *user, unsigned int len);
83 int (*compat_set)(struct sock *sk, int optval,
84 void __user *user, unsigned int len);
83 85
84 int get_optmin; 86 int get_optmin;
85 int get_optmax; 87 int get_optmax;
86 int (*get)(struct sock *sk, int optval, void __user *user, int *len); 88 int (*get)(struct sock *sk, int optval, void __user *user, int *len);
89 int (*compat_get)(struct sock *sk, int optval,
90 void __user *user, int *len);
87 91
88 /* Number of users inside set() or get(). */ 92 /* Number of users inside set() or get(). */
89 unsigned int use; 93 unsigned int use;
@@ -246,6 +250,11 @@ int nf_setsockopt(struct sock *sk, int pf, int optval, char __user *opt,
246int nf_getsockopt(struct sock *sk, int pf, int optval, char __user *opt, 250int nf_getsockopt(struct sock *sk, int pf, int optval, char __user *opt,
247 int *len); 251 int *len);
248 252
253int compat_nf_setsockopt(struct sock *sk, int pf, int optval,
254 char __user *opt, int len);
255int compat_nf_getsockopt(struct sock *sk, int pf, int optval,
256 char __user *opt, int *len);
257
249/* Packet queuing */ 258/* Packet queuing */
250struct nf_queue_handler { 259struct nf_queue_handler {
251 int (*outfn)(struct sk_buff *skb, struct nf_info *info, 260 int (*outfn)(struct sk_buff *skb, struct nf_info *info,
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h
index 934a2479f160..9f5b12cf489b 100644
--- a/include/linux/netfilter/nfnetlink.h
+++ b/include/linux/netfilter/nfnetlink.h
@@ -164,6 +164,7 @@ extern void nfattr_parse(struct nfattr *tb[], int maxattr,
164 __res; \ 164 __res; \
165}) 165})
166 166
167extern int nfnetlink_has_listeners(unsigned int group);
167extern int nfnetlink_send(struct sk_buff *skb, u32 pid, unsigned group, 168extern int nfnetlink_send(struct sk_buff *skb, u32 pid, unsigned group,
168 int echo); 169 int echo);
169extern int nfnetlink_unicast(struct sk_buff *skb, u_int32_t pid, int flags); 170extern int nfnetlink_unicast(struct sk_buff *skb, u_int32_t pid, int flags);
diff --git a/include/linux/netfilter/nfnetlink_log.h b/include/linux/netfilter/nfnetlink_log.h
index b04b03880595..a7497c7436df 100644
--- a/include/linux/netfilter/nfnetlink_log.h
+++ b/include/linux/netfilter/nfnetlink_log.h
@@ -47,6 +47,8 @@ enum nfulnl_attr_type {
47 NFULA_PAYLOAD, /* opaque data payload */ 47 NFULA_PAYLOAD, /* opaque data payload */
48 NFULA_PREFIX, /* string prefix */ 48 NFULA_PREFIX, /* string prefix */
49 NFULA_UID, /* user id of socket */ 49 NFULA_UID, /* user id of socket */
50 NFULA_SEQ, /* instance-local sequence number */
51 NFULA_SEQ_GLOBAL, /* global sequence number */
50 52
51 __NFULA_MAX 53 __NFULA_MAX
52}; 54};
@@ -77,6 +79,7 @@ enum nfulnl_attr_config {
77 NFULA_CFG_NLBUFSIZ, /* u_int32_t buffer size */ 79 NFULA_CFG_NLBUFSIZ, /* u_int32_t buffer size */
78 NFULA_CFG_TIMEOUT, /* u_int32_t in 1/100 s */ 80 NFULA_CFG_TIMEOUT, /* u_int32_t in 1/100 s */
79 NFULA_CFG_QTHRESH, /* u_int32_t */ 81 NFULA_CFG_QTHRESH, /* u_int32_t */
82 NFULA_CFG_FLAGS, /* u_int16_t */
80 __NFULA_CFG_MAX 83 __NFULA_CFG_MAX
81}; 84};
82#define NFULA_CFG_MAX (__NFULA_CFG_MAX -1) 85#define NFULA_CFG_MAX (__NFULA_CFG_MAX -1)
@@ -85,4 +88,7 @@ enum nfulnl_attr_config {
85#define NFULNL_COPY_META 0x01 88#define NFULNL_COPY_META 0x01
86#define NFULNL_COPY_PACKET 0x02 89#define NFULNL_COPY_PACKET 0x02
87 90
91#define NFULNL_CFG_F_SEQ 0x0001
92#define NFULNL_CFG_F_SEQ_GLOBAL 0x0002
93
88#endif /* _NFNETLINK_LOG_H */ 94#endif /* _NFNETLINK_LOG_H */
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h
index 6500d4e59d46..46a0f974f87c 100644
--- a/include/linux/netfilter/x_tables.h
+++ b/include/linux/netfilter/x_tables.h
@@ -92,8 +92,6 @@ struct xt_match
92 92
93 const char name[XT_FUNCTION_MAXNAMELEN-1]; 93 const char name[XT_FUNCTION_MAXNAMELEN-1];
94 94
95 u_int8_t revision;
96
97 /* Return true or false: return FALSE and set *hotdrop = 1 to 95 /* Return true or false: return FALSE and set *hotdrop = 1 to
98 force immediate packet drop. */ 96 force immediate packet drop. */
99 /* Arguments changed since 2.6.9, as this must now handle 97 /* Arguments changed since 2.6.9, as this must now handle
@@ -102,6 +100,7 @@ struct xt_match
102 int (*match)(const struct sk_buff *skb, 100 int (*match)(const struct sk_buff *skb,
103 const struct net_device *in, 101 const struct net_device *in,
104 const struct net_device *out, 102 const struct net_device *out,
103 const struct xt_match *match,
105 const void *matchinfo, 104 const void *matchinfo,
106 int offset, 105 int offset,
107 unsigned int protoff, 106 unsigned int protoff,
@@ -111,15 +110,25 @@ struct xt_match
111 /* Should return true or false. */ 110 /* Should return true or false. */
112 int (*checkentry)(const char *tablename, 111 int (*checkentry)(const char *tablename,
113 const void *ip, 112 const void *ip,
113 const struct xt_match *match,
114 void *matchinfo, 114 void *matchinfo,
115 unsigned int matchinfosize, 115 unsigned int matchinfosize,
116 unsigned int hook_mask); 116 unsigned int hook_mask);
117 117
118 /* Called when entry of this type deleted. */ 118 /* Called when entry of this type deleted. */
119 void (*destroy)(void *matchinfo, unsigned int matchinfosize); 119 void (*destroy)(const struct xt_match *match, void *matchinfo,
120 unsigned int matchinfosize);
120 121
121 /* Set this to THIS_MODULE if you are a module, otherwise NULL */ 122 /* Set this to THIS_MODULE if you are a module, otherwise NULL */
122 struct module *me; 123 struct module *me;
124
125 char *table;
126 unsigned int matchsize;
127 unsigned int hooks;
128 unsigned short proto;
129
130 unsigned short family;
131 u_int8_t revision;
123}; 132};
124 133
125/* Registration hooks for targets. */ 134/* Registration hooks for targets. */
@@ -129,8 +138,6 @@ struct xt_target
129 138
130 const char name[XT_FUNCTION_MAXNAMELEN-1]; 139 const char name[XT_FUNCTION_MAXNAMELEN-1];
131 140
132 u_int8_t revision;
133
134 /* Returns verdict. Argument order changed since 2.6.9, as this 141 /* Returns verdict. Argument order changed since 2.6.9, as this
135 must now handle non-linear skbs, using skb_copy_bits and 142 must now handle non-linear skbs, using skb_copy_bits and
136 skb_ip_make_writable. */ 143 skb_ip_make_writable. */
@@ -138,6 +145,7 @@ struct xt_target
138 const struct net_device *in, 145 const struct net_device *in,
139 const struct net_device *out, 146 const struct net_device *out,
140 unsigned int hooknum, 147 unsigned int hooknum,
148 const struct xt_target *target,
141 const void *targinfo, 149 const void *targinfo,
142 void *userdata); 150 void *userdata);
143 151
@@ -147,15 +155,25 @@ struct xt_target
147 /* Should return true or false. */ 155 /* Should return true or false. */
148 int (*checkentry)(const char *tablename, 156 int (*checkentry)(const char *tablename,
149 const void *entry, 157 const void *entry,
158 const struct xt_target *target,
150 void *targinfo, 159 void *targinfo,
151 unsigned int targinfosize, 160 unsigned int targinfosize,
152 unsigned int hook_mask); 161 unsigned int hook_mask);
153 162
154 /* Called when entry of this type deleted. */ 163 /* Called when entry of this type deleted. */
155 void (*destroy)(void *targinfo, unsigned int targinfosize); 164 void (*destroy)(const struct xt_target *target, void *targinfo,
165 unsigned int targinfosize);
156 166
157 /* Set this to THIS_MODULE if you are a module, otherwise NULL */ 167 /* Set this to THIS_MODULE if you are a module, otherwise NULL */
158 struct module *me; 168 struct module *me;
169
170 char *table;
171 unsigned int targetsize;
172 unsigned int hooks;
173 unsigned short proto;
174
175 unsigned short family;
176 u_int8_t revision;
159}; 177};
160 178
161/* Furniture shopping... */ 179/* Furniture shopping... */
@@ -207,6 +225,13 @@ extern void xt_unregister_target(int af, struct xt_target *target);
207extern int xt_register_match(int af, struct xt_match *target); 225extern int xt_register_match(int af, struct xt_match *target);
208extern void xt_unregister_match(int af, struct xt_match *target); 226extern void xt_unregister_match(int af, struct xt_match *target);
209 227
228extern int xt_check_match(const struct xt_match *match, unsigned short family,
229 unsigned int size, const char *table, unsigned int hook,
230 unsigned short proto, int inv_proto);
231extern int xt_check_target(const struct xt_target *target, unsigned short family,
232 unsigned int size, const char *table, unsigned int hook,
233 unsigned short proto, int inv_proto);
234
210extern int xt_register_table(struct xt_table *table, 235extern int xt_register_table(struct xt_table *table,
211 struct xt_table_info *bootstrap, 236 struct xt_table_info *bootstrap,
212 struct xt_table_info *newinfo); 237 struct xt_table_info *newinfo);
diff --git a/include/linux/netfilter/xt_policy.h b/include/linux/netfilter/xt_policy.h
new file mode 100644
index 000000000000..a8132ec076fb
--- /dev/null
+++ b/include/linux/netfilter/xt_policy.h
@@ -0,0 +1,58 @@
1#ifndef _XT_POLICY_H
2#define _XT_POLICY_H
3
4#define XT_POLICY_MAX_ELEM 4
5
6enum xt_policy_flags
7{
8 XT_POLICY_MATCH_IN = 0x1,
9 XT_POLICY_MATCH_OUT = 0x2,
10 XT_POLICY_MATCH_NONE = 0x4,
11 XT_POLICY_MATCH_STRICT = 0x8,
12};
13
14enum xt_policy_modes
15{
16 XT_POLICY_MODE_TRANSPORT,
17 XT_POLICY_MODE_TUNNEL
18};
19
20struct xt_policy_spec
21{
22 u_int8_t saddr:1,
23 daddr:1,
24 proto:1,
25 mode:1,
26 spi:1,
27 reqid:1;
28};
29
30union xt_policy_addr
31{
32 struct in_addr a4;
33 struct in6_addr a6;
34};
35
36struct xt_policy_elem
37{
38 union xt_policy_addr saddr;
39 union xt_policy_addr smask;
40 union xt_policy_addr daddr;
41 union xt_policy_addr dmask;
42 u_int32_t spi;
43 u_int32_t reqid;
44 u_int8_t proto;
45 u_int8_t mode;
46
47 struct xt_policy_spec match;
48 struct xt_policy_spec invert;
49};
50
51struct xt_policy_info
52{
53 struct xt_policy_elem pol[XT_POLICY_MAX_ELEM];
54 u_int16_t flags;
55 u_int16_t len;
56};
57
58#endif /* _XT_POLICY_H */
diff --git a/include/linux/netfilter_bridge.h b/include/linux/netfilter_bridge.h
index de4d397865ce..a75b84bb9a88 100644
--- a/include/linux/netfilter_bridge.h
+++ b/include/linux/netfilter_bridge.h
@@ -47,22 +47,6 @@ enum nf_br_hook_priorities {
47#define BRNF_BRIDGED 0x08 47#define BRNF_BRIDGED 0x08
48#define BRNF_NF_BRIDGE_PREROUTING 0x10 48#define BRNF_NF_BRIDGE_PREROUTING 0x10
49 49
50static inline
51struct nf_bridge_info *nf_bridge_alloc(struct sk_buff *skb)
52{
53 struct nf_bridge_info **nf_bridge = &(skb->nf_bridge);
54
55 if ((*nf_bridge = kmalloc(sizeof(**nf_bridge), GFP_ATOMIC)) != NULL) {
56 atomic_set(&(*nf_bridge)->use, 1);
57 (*nf_bridge)->mask = 0;
58 (*nf_bridge)->physindev = (*nf_bridge)->physoutdev = NULL;
59#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
60 (*nf_bridge)->netoutdev = NULL;
61#endif
62 }
63
64 return *nf_bridge;
65}
66 50
67/* Only used in br_forward.c */ 51/* Only used in br_forward.c */
68static inline 52static inline
@@ -77,17 +61,6 @@ void nf_bridge_maybe_copy_header(struct sk_buff *skb)
77 } 61 }
78} 62}
79 63
80static inline
81void nf_bridge_save_header(struct sk_buff *skb)
82{
83 int header_size = 16;
84
85 if (skb->protocol == __constant_htons(ETH_P_8021Q))
86 header_size = 18;
87
88 memcpy(skb->nf_bridge->data, skb->data - header_size, header_size);
89}
90
91/* This is called by the IP fragmenting code and it ensures there is 64/* This is called by the IP fragmenting code and it ensures there is
92 * enough room for the encapsulating header (if there is one). */ 65 * enough room for the encapsulating header (if there is one). */
93static inline 66static inline
diff --git a/include/linux/netfilter_ipv4/ip_conntrack.h b/include/linux/netfilter_ipv4/ip_conntrack.h
index 215765f043e6..f32d75c4f4cf 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack.h
@@ -29,6 +29,7 @@ union ip_conntrack_expect_proto {
29}; 29};
30 30
31/* Add protocol helper include file here */ 31/* Add protocol helper include file here */
32#include <linux/netfilter_ipv4/ip_conntrack_h323.h>
32#include <linux/netfilter_ipv4/ip_conntrack_pptp.h> 33#include <linux/netfilter_ipv4/ip_conntrack_pptp.h>
33#include <linux/netfilter_ipv4/ip_conntrack_amanda.h> 34#include <linux/netfilter_ipv4/ip_conntrack_amanda.h>
34#include <linux/netfilter_ipv4/ip_conntrack_ftp.h> 35#include <linux/netfilter_ipv4/ip_conntrack_ftp.h>
@@ -37,6 +38,7 @@ union ip_conntrack_expect_proto {
37/* per conntrack: application helper private data */ 38/* per conntrack: application helper private data */
38union ip_conntrack_help { 39union ip_conntrack_help {
39 /* insert conntrack helper private data (master) here */ 40 /* insert conntrack helper private data (master) here */
41 struct ip_ct_h323_master ct_h323_info;
40 struct ip_ct_pptp_master ct_pptp_info; 42 struct ip_ct_pptp_master ct_pptp_info;
41 struct ip_ct_ftp_master ct_ftp_info; 43 struct ip_ct_ftp_master ct_ftp_info;
42 struct ip_ct_irc_master ct_irc_info; 44 struct ip_ct_irc_master ct_irc_info;
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_h323.h b/include/linux/netfilter_ipv4/ip_conntrack_h323.h
new file mode 100644
index 000000000000..0987cea53840
--- /dev/null
+++ b/include/linux/netfilter_ipv4/ip_conntrack_h323.h
@@ -0,0 +1,30 @@
1#ifndef _IP_CONNTRACK_H323_H
2#define _IP_CONNTRACK_H323_H
3
4#ifdef __KERNEL__
5
6#define RAS_PORT 1719
7#define Q931_PORT 1720
8#define H323_RTP_CHANNEL_MAX 4 /* Audio, video, FAX and other */
9
10/* This structure exists only once per master */
11struct ip_ct_h323_master {
12
13 /* Original and NATed Q.931 or H.245 signal ports */
14 u_int16_t sig_port[IP_CT_DIR_MAX];
15
16 /* Original and NATed RTP ports */
17 u_int16_t rtp_port[H323_RTP_CHANNEL_MAX][IP_CT_DIR_MAX];
18
19 union {
20 /* RAS connection timeout */
21 u_int32_t timeout;
22
23 /* Next TPKT length (for separate TPKT header and data) */
24 u_int16_t tpkt_len[IP_CT_DIR_MAX];
25 };
26};
27
28#endif
29
30#endif
diff --git a/include/linux/netfilter_ipv4/ip_nat.h b/include/linux/netfilter_ipv4/ip_nat.h
index 41a107de17cf..e9f5ed1d9f68 100644
--- a/include/linux/netfilter_ipv4/ip_nat.h
+++ b/include/linux/netfilter_ipv4/ip_nat.h
@@ -23,7 +23,7 @@ struct ip_nat_seq {
23 * modification (if any) */ 23 * modification (if any) */
24 u_int32_t correction_pos; 24 u_int32_t correction_pos;
25 /* sequence number offset before and after last modification */ 25 /* sequence number offset before and after last modification */
26 int32_t offset_before, offset_after; 26 int16_t offset_before, offset_after;
27}; 27};
28 28
29/* Single range specification. */ 29/* Single range specification. */
diff --git a/include/linux/netfilter_ipv4/ipt_policy.h b/include/linux/netfilter_ipv4/ipt_policy.h
index a3f6eff39d33..b9478a255301 100644
--- a/include/linux/netfilter_ipv4/ipt_policy.h
+++ b/include/linux/netfilter_ipv4/ipt_policy.h
@@ -1,58 +1,21 @@
1#ifndef _IPT_POLICY_H 1#ifndef _IPT_POLICY_H
2#define _IPT_POLICY_H 2#define _IPT_POLICY_H
3 3
4#define IPT_POLICY_MAX_ELEM 4 4#define IPT_POLICY_MAX_ELEM XT_POLICY_MAX_ELEM
5 5
6enum ipt_policy_flags 6/* ipt_policy_flags */
7{ 7#define IPT_POLICY_MATCH_IN XT_POLICY_MATCH_IN
8 IPT_POLICY_MATCH_IN = 0x1, 8#define IPT_POLICY_MATCH_OUT XT_POLICY_MATCH_OUT
9 IPT_POLICY_MATCH_OUT = 0x2, 9#define IPT_POLICY_MATCH_NONE XT_POLICY_MATCH_NONE
10 IPT_POLICY_MATCH_NONE = 0x4, 10#define IPT_POLICY_MATCH_STRICT XT_POLICY_MATCH_STRICT
11 IPT_POLICY_MATCH_STRICT = 0x8, 11
12}; 12/* ipt_policy_modes */
13 13#define IPT_POLICY_MODE_TRANSPORT XT_POLICY_MODE_TRANSPORT
14enum ipt_policy_modes 14#define IPT_POLICY_MODE_TUNNEL XT_POLICY_MODE_TUNNEL
15{ 15
16 IPT_POLICY_MODE_TRANSPORT, 16#define ipt_policy_spec xt_policy_spec
17 IPT_POLICY_MODE_TUNNEL 17#define ipt_policy_addr xt_policy_addr
18}; 18#define ipt_policy_elem xt_policy_elem
19 19#define ipt_policy_info xt_policy_info
20struct ipt_policy_spec
21{
22 u_int8_t saddr:1,
23 daddr:1,
24 proto:1,
25 mode:1,
26 spi:1,
27 reqid:1;
28};
29
30union ipt_policy_addr
31{
32 struct in_addr a4;
33 struct in6_addr a6;
34};
35
36struct ipt_policy_elem
37{
38 union ipt_policy_addr saddr;
39 union ipt_policy_addr smask;
40 union ipt_policy_addr daddr;
41 union ipt_policy_addr dmask;
42 u_int32_t spi;
43 u_int32_t reqid;
44 u_int8_t proto;
45 u_int8_t mode;
46
47 struct ipt_policy_spec match;
48 struct ipt_policy_spec invert;
49};
50
51struct ipt_policy_info
52{
53 struct ipt_policy_elem pol[IPT_POLICY_MAX_ELEM];
54 u_int16_t flags;
55 u_int16_t len;
56};
57 20
58#endif /* _IPT_POLICY_H */ 21#endif /* _IPT_POLICY_H */
diff --git a/include/linux/netfilter_ipv6/ip6t_policy.h b/include/linux/netfilter_ipv6/ip6t_policy.h
index 671bd818300f..6bab3163d2fb 100644
--- a/include/linux/netfilter_ipv6/ip6t_policy.h
+++ b/include/linux/netfilter_ipv6/ip6t_policy.h
@@ -1,58 +1,21 @@
1#ifndef _IP6T_POLICY_H 1#ifndef _IP6T_POLICY_H
2#define _IP6T_POLICY_H 2#define _IP6T_POLICY_H
3 3
4#define IP6T_POLICY_MAX_ELEM 4 4#define IP6T_POLICY_MAX_ELEM XT_POLICY_MAX_ELEM
5 5
6enum ip6t_policy_flags 6/* ip6t_policy_flags */
7{ 7#define IP6T_POLICY_MATCH_IN XT_POLICY_MATCH_IN
8 IP6T_POLICY_MATCH_IN = 0x1, 8#define IP6T_POLICY_MATCH_OUT XT_POLICY_MATCH_OUT
9 IP6T_POLICY_MATCH_OUT = 0x2, 9#define IP6T_POLICY_MATCH_NONE XT_POLICY_MATCH_NONE
10 IP6T_POLICY_MATCH_NONE = 0x4, 10#define IP6T_POLICY_MATCH_STRICT XT_POLICY_MATCH_STRICT
11 IP6T_POLICY_MATCH_STRICT = 0x8, 11
12}; 12/* ip6t_policy_modes */
13 13#define IP6T_POLICY_MODE_TRANSPORT XT_POLICY_MODE_TRANSPORT
14enum ip6t_policy_modes 14#define IP6T_POLICY_MODE_TUNNEL XT_POLICY_MODE_TUNNEL
15{ 15
16 IP6T_POLICY_MODE_TRANSPORT, 16#define ip6t_policy_spec xt_policy_spec
17 IP6T_POLICY_MODE_TUNNEL 17#define ip6t_policy_addr xt_policy_addr
18}; 18#define ip6t_policy_elem xt_policy_elem
19 19#define ip6t_policy_info xt_policy_info
20struct ip6t_policy_spec
21{
22 u_int8_t saddr:1,
23 daddr:1,
24 proto:1,
25 mode:1,
26 spi:1,
27 reqid:1;
28};
29
30union ip6t_policy_addr
31{
32 struct in_addr a4;
33 struct in6_addr a6;
34};
35
36struct ip6t_policy_elem
37{
38 union ip6t_policy_addr saddr;
39 union ip6t_policy_addr smask;
40 union ip6t_policy_addr daddr;
41 union ip6t_policy_addr dmask;
42 u_int32_t spi;
43 u_int32_t reqid;
44 u_int8_t proto;
45 u_int8_t mode;
46
47 struct ip6t_policy_spec match;
48 struct ip6t_policy_spec invert;
49};
50
51struct ip6t_policy_info
52{
53 struct ip6t_policy_elem pol[IP6T_POLICY_MAX_ELEM];
54 u_int16_t flags;
55 u_int16_t len;
56};
57 20
58#endif /* _IP6T_POLICY_H */ 21#endif /* _IP6T_POLICY_H */
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index c256ebe2a7b4..f8f3d1c927f8 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -151,6 +151,7 @@ struct netlink_skb_parms
151 151
152extern struct sock *netlink_kernel_create(int unit, unsigned int groups, void (*input)(struct sock *sk, int len), struct module *module); 152extern struct sock *netlink_kernel_create(int unit, unsigned int groups, void (*input)(struct sock *sk, int len), struct module *module);
153extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); 153extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err);
154extern int netlink_has_listeners(struct sock *sk, unsigned int group);
154extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 pid, int nonblock); 155extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 pid, int nonblock);
155extern int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, __u32 pid, 156extern int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, __u32 pid,
156 __u32 group, gfp_t allocation); 157 __u32 group, gfp_t allocation);
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 751eea58bde8..b9810ddf435a 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -1857,16 +1857,22 @@
1857#define PCI_DEVICE_ID_TIGON3_5705M 0x165d 1857#define PCI_DEVICE_ID_TIGON3_5705M 0x165d
1858#define PCI_DEVICE_ID_TIGON3_5705M_2 0x165e 1858#define PCI_DEVICE_ID_TIGON3_5705M_2 0x165e
1859#define PCI_DEVICE_ID_TIGON3_5714 0x1668 1859#define PCI_DEVICE_ID_TIGON3_5714 0x1668
1860#define PCI_DEVICE_ID_TIGON3_5714S 0x1669
1860#define PCI_DEVICE_ID_TIGON3_5780 0x166a 1861#define PCI_DEVICE_ID_TIGON3_5780 0x166a
1861#define PCI_DEVICE_ID_TIGON3_5780S 0x166b 1862#define PCI_DEVICE_ID_TIGON3_5780S 0x166b
1862#define PCI_DEVICE_ID_TIGON3_5705F 0x166e 1863#define PCI_DEVICE_ID_TIGON3_5705F 0x166e
1864#define PCI_DEVICE_ID_TIGON3_5754M 0x1672
1863#define PCI_DEVICE_ID_TIGON3_5750 0x1676 1865#define PCI_DEVICE_ID_TIGON3_5750 0x1676
1864#define PCI_DEVICE_ID_TIGON3_5751 0x1677 1866#define PCI_DEVICE_ID_TIGON3_5751 0x1677
1865#define PCI_DEVICE_ID_TIGON3_5715 0x1678 1867#define PCI_DEVICE_ID_TIGON3_5715 0x1678
1868#define PCI_DEVICE_ID_TIGON3_5715S 0x1679
1869#define PCI_DEVICE_ID_TIGON3_5754 0x167a
1866#define PCI_DEVICE_ID_TIGON3_5750M 0x167c 1870#define PCI_DEVICE_ID_TIGON3_5750M 0x167c
1867#define PCI_DEVICE_ID_TIGON3_5751M 0x167d 1871#define PCI_DEVICE_ID_TIGON3_5751M 0x167d
1868#define PCI_DEVICE_ID_TIGON3_5751F 0x167e 1872#define PCI_DEVICE_ID_TIGON3_5751F 0x167e
1873#define PCI_DEVICE_ID_TIGON3_5787M 0x1693
1869#define PCI_DEVICE_ID_TIGON3_5782 0x1696 1874#define PCI_DEVICE_ID_TIGON3_5782 0x1696
1875#define PCI_DEVICE_ID_TIGON3_5787 0x169b
1870#define PCI_DEVICE_ID_TIGON3_5788 0x169c 1876#define PCI_DEVICE_ID_TIGON3_5788 0x169c
1871#define PCI_DEVICE_ID_TIGON3_5789 0x169d 1877#define PCI_DEVICE_ID_TIGON3_5789 0x169d
1872#define PCI_DEVICE_ID_TIGON3_5702X 0x16a6 1878#define PCI_DEVICE_ID_TIGON3_5702X 0x16a6
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index d50482ba27fe..d572d5376319 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -199,6 +199,7 @@ enum
199#define RTPROT_BIRD 12 /* BIRD */ 199#define RTPROT_BIRD 12 /* BIRD */
200#define RTPROT_DNROUTED 13 /* DECnet routing daemon */ 200#define RTPROT_DNROUTED 13 /* DECnet routing daemon */
201#define RTPROT_XORP 14 /* XORP */ 201#define RTPROT_XORP 14 /* XORP */
202#define RTPROT_NTK 15 /* Netsukuku */
202 203
203/* rtm_scope 204/* rtm_scope
204 205
@@ -733,6 +734,8 @@ enum
733#define IFLA_MAP IFLA_MAP 734#define IFLA_MAP IFLA_MAP
734 IFLA_WEIGHT, 735 IFLA_WEIGHT,
735#define IFLA_WEIGHT IFLA_WEIGHT 736#define IFLA_WEIGHT IFLA_WEIGHT
737 IFLA_OPERSTATE,
738 IFLA_LINKMODE,
736 __IFLA_MAX 739 __IFLA_MAX
737}; 740};
738 741
@@ -905,6 +908,7 @@ struct tcamsg
905#ifdef __KERNEL__ 908#ifdef __KERNEL__
906 909
907#include <linux/config.h> 910#include <linux/config.h>
911#include <linux/mutex.h>
908 912
909extern size_t rtattr_strlcpy(char *dest, const struct rtattr *rta, size_t size); 913extern size_t rtattr_strlcpy(char *dest, const struct rtattr *rta, size_t size);
910static __inline__ int rtattr_strcmp(const struct rtattr *rta, const char *str) 914static __inline__ int rtattr_strcmp(const struct rtattr *rta, const char *str)
@@ -1036,24 +1040,17 @@ __rta_reserve(struct sk_buff *skb, int attrtype, int attrlen)
1036 1040
1037extern void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change); 1041extern void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change);
1038 1042
1039extern struct semaphore rtnl_sem; 1043/* RTNL is used as a global lock for all changes to network configuration */
1040
1041#define rtnl_shlock() down(&rtnl_sem)
1042#define rtnl_shlock_nowait() down_trylock(&rtnl_sem)
1043
1044#define rtnl_shunlock() do { up(&rtnl_sem); \
1045 if (rtnl && rtnl->sk_receive_queue.qlen) \
1046 rtnl->sk_data_ready(rtnl, 0); \
1047 } while(0)
1048
1049extern void rtnl_lock(void); 1044extern void rtnl_lock(void);
1050extern int rtnl_lock_interruptible(void);
1051extern void rtnl_unlock(void); 1045extern void rtnl_unlock(void);
1046extern int rtnl_trylock(void);
1047
1052extern void rtnetlink_init(void); 1048extern void rtnetlink_init(void);
1049extern void __rtnl_unlock(void);
1053 1050
1054#define ASSERT_RTNL() do { \ 1051#define ASSERT_RTNL() do { \
1055 if (unlikely(down_trylock(&rtnl_sem) == 0)) { \ 1052 if (unlikely(rtnl_trylock())) { \
1056 up(&rtnl_sem); \ 1053 rtnl_unlock(); \
1057 printk(KERN_ERR "RTNL: assertion failed at %s (%d)\n", \ 1054 printk(KERN_ERR "RTNL: assertion failed at %s (%d)\n", \
1058 __FILE__, __LINE__); \ 1055 __FILE__, __LINE__); \
1059 dump_stack(); \ 1056 dump_stack(); \
diff --git a/include/linux/security.h b/include/linux/security.h
index 7cbef482e13a..b18eb8cfa639 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -1286,7 +1286,8 @@ struct security_operations {
1286 int (*socket_setsockopt) (struct socket * sock, int level, int optname); 1286 int (*socket_setsockopt) (struct socket * sock, int level, int optname);
1287 int (*socket_shutdown) (struct socket * sock, int how); 1287 int (*socket_shutdown) (struct socket * sock, int how);
1288 int (*socket_sock_rcv_skb) (struct sock * sk, struct sk_buff * skb); 1288 int (*socket_sock_rcv_skb) (struct sock * sk, struct sk_buff * skb);
1289 int (*socket_getpeersec) (struct socket *sock, char __user *optval, int __user *optlen, unsigned len); 1289 int (*socket_getpeersec_stream) (struct socket *sock, char __user *optval, int __user *optlen, unsigned len);
1290 int (*socket_getpeersec_dgram) (struct sk_buff *skb, char **secdata, u32 *seclen);
1290 int (*sk_alloc_security) (struct sock *sk, int family, gfp_t priority); 1291 int (*sk_alloc_security) (struct sock *sk, int family, gfp_t priority);
1291 void (*sk_free_security) (struct sock *sk); 1292 void (*sk_free_security) (struct sock *sk);
1292 unsigned int (*sk_getsid) (struct sock *sk, struct flowi *fl, u8 dir); 1293 unsigned int (*sk_getsid) (struct sock *sk, struct flowi *fl, u8 dir);
@@ -2741,10 +2742,16 @@ static inline int security_sock_rcv_skb (struct sock * sk,
2741 return security_ops->socket_sock_rcv_skb (sk, skb); 2742 return security_ops->socket_sock_rcv_skb (sk, skb);
2742} 2743}
2743 2744
2744static inline int security_socket_getpeersec(struct socket *sock, char __user *optval, 2745static inline int security_socket_getpeersec_stream(struct socket *sock, char __user *optval,
2745 int __user *optlen, unsigned len) 2746 int __user *optlen, unsigned len)
2746{ 2747{
2747 return security_ops->socket_getpeersec(sock, optval, optlen, len); 2748 return security_ops->socket_getpeersec_stream(sock, optval, optlen, len);
2749}
2750
2751static inline int security_socket_getpeersec_dgram(struct sk_buff *skb, char **secdata,
2752 u32 *seclen)
2753{
2754 return security_ops->socket_getpeersec_dgram(skb, secdata, seclen);
2748} 2755}
2749 2756
2750static inline int security_sk_alloc(struct sock *sk, int family, gfp_t priority) 2757static inline int security_sk_alloc(struct sock *sk, int family, gfp_t priority)
@@ -2863,8 +2870,14 @@ static inline int security_sock_rcv_skb (struct sock * sk,
2863 return 0; 2870 return 0;
2864} 2871}
2865 2872
2866static inline int security_socket_getpeersec(struct socket *sock, char __user *optval, 2873static inline int security_socket_getpeersec_stream(struct socket *sock, char __user *optval,
2867 int __user *optlen, unsigned len) 2874 int __user *optlen, unsigned len)
2875{
2876 return -ENOPROTOOPT;
2877}
2878
2879static inline int security_socket_getpeersec_dgram(struct sk_buff *skb, char **secdata,
2880 u32 *seclen)
2868{ 2881{
2869 return -ENOPROTOOPT; 2882 return -ENOPROTOOPT;
2870} 2883}
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index ad7cc22bd424..613b9513f8b9 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -270,7 +270,6 @@ struct sk_buff {
270 270
271 void (*destructor)(struct sk_buff *skb); 271 void (*destructor)(struct sk_buff *skb);
272#ifdef CONFIG_NETFILTER 272#ifdef CONFIG_NETFILTER
273 __u32 nfmark;
274 struct nf_conntrack *nfct; 273 struct nf_conntrack *nfct;
275#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) 274#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
276 struct sk_buff *nfct_reasm; 275 struct sk_buff *nfct_reasm;
@@ -278,6 +277,7 @@ struct sk_buff {
278#ifdef CONFIG_BRIDGE_NETFILTER 277#ifdef CONFIG_BRIDGE_NETFILTER
279 struct nf_bridge_info *nf_bridge; 278 struct nf_bridge_info *nf_bridge;
280#endif 279#endif
280 __u32 nfmark;
281#endif /* CONFIG_NETFILTER */ 281#endif /* CONFIG_NETFILTER */
282#ifdef CONFIG_NET_SCHED 282#ifdef CONFIG_NET_SCHED
283 __u16 tc_index; /* traffic control index */ 283 __u16 tc_index; /* traffic control index */
@@ -304,6 +304,7 @@ struct sk_buff {
304 304
305#include <asm/system.h> 305#include <asm/system.h>
306 306
307extern void kfree_skb(struct sk_buff *skb);
307extern void __kfree_skb(struct sk_buff *skb); 308extern void __kfree_skb(struct sk_buff *skb);
308extern struct sk_buff *__alloc_skb(unsigned int size, 309extern struct sk_buff *__alloc_skb(unsigned int size,
309 gfp_t priority, int fclone); 310 gfp_t priority, int fclone);
@@ -404,22 +405,6 @@ static inline struct sk_buff *skb_get(struct sk_buff *skb)
404 */ 405 */
405 406
406/** 407/**
407 * kfree_skb - free an sk_buff
408 * @skb: buffer to free
409 *
410 * Drop a reference to the buffer and free it if the usage count has
411 * hit zero.
412 */
413static inline void kfree_skb(struct sk_buff *skb)
414{
415 if (likely(atomic_read(&skb->users) == 1))
416 smp_rmb();
417 else if (likely(!atomic_dec_and_test(&skb->users)))
418 return;
419 __kfree_skb(skb);
420}
421
422/**
423 * skb_cloned - is the buffer a clone 408 * skb_cloned - is the buffer a clone
424 * @skb: buffer to check 409 * @skb: buffer to check
425 * 410 *
@@ -1174,12 +1159,14 @@ static inline int skb_linearize(struct sk_buff *skb, gfp_t gfp)
1174 */ 1159 */
1175 1160
1176static inline void skb_postpull_rcsum(struct sk_buff *skb, 1161static inline void skb_postpull_rcsum(struct sk_buff *skb,
1177 const void *start, int len) 1162 const void *start, unsigned int len)
1178{ 1163{
1179 if (skb->ip_summed == CHECKSUM_HW) 1164 if (skb->ip_summed == CHECKSUM_HW)
1180 skb->csum = csum_sub(skb->csum, csum_partial(start, len, 0)); 1165 skb->csum = csum_sub(skb->csum, csum_partial(start, len, 0));
1181} 1166}
1182 1167
1168unsigned char *skb_pull_rcsum(struct sk_buff *skb, unsigned int len);
1169
1183/** 1170/**
1184 * pskb_trim_rcsum - trim received skb and update checksum 1171 * pskb_trim_rcsum - trim received skb and update checksum
1185 * @skb: buffer to trim 1172 * @skb: buffer to trim
@@ -1351,16 +1338,6 @@ static inline void nf_conntrack_put_reasm(struct sk_buff *skb)
1351 kfree_skb(skb); 1338 kfree_skb(skb);
1352} 1339}
1353#endif 1340#endif
1354static inline void nf_reset(struct sk_buff *skb)
1355{
1356 nf_conntrack_put(skb->nfct);
1357 skb->nfct = NULL;
1358#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
1359 nf_conntrack_put_reasm(skb->nfct_reasm);
1360 skb->nfct_reasm = NULL;
1361#endif
1362}
1363
1364#ifdef CONFIG_BRIDGE_NETFILTER 1341#ifdef CONFIG_BRIDGE_NETFILTER
1365static inline void nf_bridge_put(struct nf_bridge_info *nf_bridge) 1342static inline void nf_bridge_put(struct nf_bridge_info *nf_bridge)
1366{ 1343{
@@ -1373,6 +1350,20 @@ static inline void nf_bridge_get(struct nf_bridge_info *nf_bridge)
1373 atomic_inc(&nf_bridge->use); 1350 atomic_inc(&nf_bridge->use);
1374} 1351}
1375#endif /* CONFIG_BRIDGE_NETFILTER */ 1352#endif /* CONFIG_BRIDGE_NETFILTER */
1353static inline void nf_reset(struct sk_buff *skb)
1354{
1355 nf_conntrack_put(skb->nfct);
1356 skb->nfct = NULL;
1357#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
1358 nf_conntrack_put_reasm(skb->nfct_reasm);
1359 skb->nfct_reasm = NULL;
1360#endif
1361#ifdef CONFIG_BRIDGE_NETFILTER
1362 nf_bridge_put(skb->nf_bridge);
1363 skb->nf_bridge = NULL;
1364#endif
1365}
1366
1376#else /* CONFIG_NETFILTER */ 1367#else /* CONFIG_NETFILTER */
1377static inline void nf_reset(struct sk_buff *skb) {} 1368static inline void nf_reset(struct sk_buff *skb) {}
1378#endif /* CONFIG_NETFILTER */ 1369#endif /* CONFIG_NETFILTER */
diff --git a/include/linux/socket.h b/include/linux/socket.h
index b02dda4ee83d..9ab2ddd80221 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -150,6 +150,7 @@ __KINLINE struct cmsghdr * cmsg_nxthdr (struct msghdr *__msg, struct cmsghdr *__
150 150
151#define SCM_RIGHTS 0x01 /* rw: access rights (array of int) */ 151#define SCM_RIGHTS 0x01 /* rw: access rights (array of int) */
152#define SCM_CREDENTIALS 0x02 /* rw: struct ucred */ 152#define SCM_CREDENTIALS 0x02 /* rw: struct ucred */
153#define SCM_SECURITY 0x03 /* rw: security label */
153 154
154struct ucred { 155struct ucred {
155 __u32 pid; 156 __u32 pid;
diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h
index d33c6face032..b4acb3d37c3f 100644
--- a/include/linux/sunrpc/svcsock.h
+++ b/include/linux/sunrpc/svcsock.h
@@ -36,7 +36,7 @@ struct svc_sock {
36 36
37 struct list_head sk_deferred; /* deferred requests that need to 37 struct list_head sk_deferred; /* deferred requests that need to
38 * be revisted */ 38 * be revisted */
39 struct semaphore sk_sem; /* to serialize sending data */ 39 struct mutex sk_mutex; /* to serialize sending data */
40 40
41 int (*sk_recvfrom)(struct svc_rqst *rqstp); 41 int (*sk_recvfrom)(struct svc_rqst *rqstp);
42 int (*sk_sendto)(struct svc_rqst *rqstp); 42 int (*sk_sendto)(struct svc_rqst *rqstp);
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index bac61db26456..76eaeff76f82 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -211,6 +211,7 @@ enum
211 NET_SCTP=17, 211 NET_SCTP=17,
212 NET_LLC=18, 212 NET_LLC=18,
213 NET_NETFILTER=19, 213 NET_NETFILTER=19,
214 NET_DCCP=20,
214}; 215};
215 216
216/* /proc/sys/kernel/random */ 217/* /proc/sys/kernel/random */
@@ -261,6 +262,8 @@ enum
261 NET_CORE_DEV_WEIGHT=17, 262 NET_CORE_DEV_WEIGHT=17,
262 NET_CORE_SOMAXCONN=18, 263 NET_CORE_SOMAXCONN=18,
263 NET_CORE_BUDGET=19, 264 NET_CORE_BUDGET=19,
265 NET_CORE_AEVENT_ETIME=20,
266 NET_CORE_AEVENT_RSEQTH=21,
264}; 267};
265 268
266/* /proc/sys/net/ethernet */ 269/* /proc/sys/net/ethernet */
@@ -397,6 +400,9 @@ enum
397 NET_TCP_CONG_CONTROL=110, 400 NET_TCP_CONG_CONTROL=110,
398 NET_TCP_ABC=111, 401 NET_TCP_ABC=111,
399 NET_IPV4_IPFRAG_MAX_DIST=112, 402 NET_IPV4_IPFRAG_MAX_DIST=112,
403 NET_TCP_MTU_PROBING=113,
404 NET_TCP_BASE_MSS=114,
405 NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS=115,
400}; 406};
401 407
402enum { 408enum {
@@ -451,6 +457,7 @@ enum
451 NET_IPV4_CONF_ARP_ANNOUNCE=18, 457 NET_IPV4_CONF_ARP_ANNOUNCE=18,
452 NET_IPV4_CONF_ARP_IGNORE=19, 458 NET_IPV4_CONF_ARP_IGNORE=19,
453 NET_IPV4_CONF_PROMOTE_SECONDARIES=20, 459 NET_IPV4_CONF_PROMOTE_SECONDARIES=20,
460 NET_IPV4_CONF_ARP_ACCEPT=21,
454 __NET_IPV4_CONF_MAX 461 __NET_IPV4_CONF_MAX
455}; 462};
456 463
@@ -531,6 +538,11 @@ enum {
531 NET_IPV6_MAX_DESYNC_FACTOR=15, 538 NET_IPV6_MAX_DESYNC_FACTOR=15,
532 NET_IPV6_MAX_ADDRESSES=16, 539 NET_IPV6_MAX_ADDRESSES=16,
533 NET_IPV6_FORCE_MLD_VERSION=17, 540 NET_IPV6_FORCE_MLD_VERSION=17,
541 NET_IPV6_ACCEPT_RA_DEFRTR=18,
542 NET_IPV6_ACCEPT_RA_PINFO=19,
543 NET_IPV6_ACCEPT_RA_RTR_PREF=20,
544 NET_IPV6_RTR_PROBE_INTERVAL=21,
545 NET_IPV6_ACCEPT_RA_RT_INFO_MAX_PLEN=22,
534 __NET_IPV6_MAX 546 __NET_IPV6_MAX
535}; 547};
536 548
@@ -562,6 +574,21 @@ enum {
562 __NET_NEIGH_MAX 574 __NET_NEIGH_MAX
563}; 575};
564 576
577/* /proc/sys/net/dccp */
578enum {
579 NET_DCCP_DEFAULT=1,
580};
581
582/* /proc/sys/net/dccp/default */
583enum {
584 NET_DCCP_DEFAULT_SEQ_WINDOW = 1,
585 NET_DCCP_DEFAULT_RX_CCID = 2,
586 NET_DCCP_DEFAULT_TX_CCID = 3,
587 NET_DCCP_DEFAULT_ACK_RATIO = 4,
588 NET_DCCP_DEFAULT_SEND_ACKVEC = 5,
589 NET_DCCP_DEFAULT_SEND_NDP = 6,
590};
591
565/* /proc/sys/net/ipx */ 592/* /proc/sys/net/ipx */
566enum { 593enum {
567 NET_IPX_PPROP_BROADCASTING=1, 594 NET_IPX_PPROP_BROADCASTING=1,
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index f2bb2396853f..542d39596bd8 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -343,6 +343,12 @@ struct tcp_sock {
343 __u32 seq; 343 __u32 seq;
344 __u32 time; 344 __u32 time;
345 } rcvq_space; 345 } rcvq_space;
346
347/* TCP-specific MTU probe information. */
348 struct {
349 __u32 probe_seq_start;
350 __u32 probe_seq_end;
351 } mtu_probe;
346}; 352};
347 353
348static inline struct tcp_sock *tcp_sk(const struct sock *sk) 354static inline struct tcp_sock *tcp_sk(const struct sock *sk)
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h
index 82fbb758e28f..6b42cc474c01 100644
--- a/include/linux/xfrm.h
+++ b/include/linux/xfrm.h
@@ -156,6 +156,10 @@ enum {
156 XFRM_MSG_FLUSHPOLICY, 156 XFRM_MSG_FLUSHPOLICY,
157#define XFRM_MSG_FLUSHPOLICY XFRM_MSG_FLUSHPOLICY 157#define XFRM_MSG_FLUSHPOLICY XFRM_MSG_FLUSHPOLICY
158 158
159 XFRM_MSG_NEWAE,
160#define XFRM_MSG_NEWAE XFRM_MSG_NEWAE
161 XFRM_MSG_GETAE,
162#define XFRM_MSG_GETAE XFRM_MSG_GETAE
159 __XFRM_MSG_MAX 163 __XFRM_MSG_MAX
160}; 164};
161#define XFRM_MSG_MAX (__XFRM_MSG_MAX - 1) 165#define XFRM_MSG_MAX (__XFRM_MSG_MAX - 1)
@@ -194,6 +198,21 @@ struct xfrm_encap_tmpl {
194 xfrm_address_t encap_oa; 198 xfrm_address_t encap_oa;
195}; 199};
196 200
201/* AEVENT flags */
202enum xfrm_ae_ftype_t {
203 XFRM_AE_UNSPEC,
204 XFRM_AE_RTHR=1, /* replay threshold*/
205 XFRM_AE_RVAL=2, /* replay value */
206 XFRM_AE_LVAL=4, /* lifetime value */
207 XFRM_AE_ETHR=8, /* expiry timer threshold */
208 XFRM_AE_CR=16, /* Event cause is replay update */
209 XFRM_AE_CE=32, /* Event cause is timer expiry */
210 XFRM_AE_CU=64, /* Event cause is policy update */
211 __XFRM_AE_MAX
212
213#define XFRM_AE_MAX (__XFRM_AE_MAX - 1)
214};
215
197/* Netlink message attributes. */ 216/* Netlink message attributes. */
198enum xfrm_attr_type_t { 217enum xfrm_attr_type_t {
199 XFRMA_UNSPEC, 218 XFRMA_UNSPEC,
@@ -205,6 +224,10 @@ enum xfrm_attr_type_t {
205 XFRMA_SA, 224 XFRMA_SA,
206 XFRMA_POLICY, 225 XFRMA_POLICY,
207 XFRMA_SEC_CTX, /* struct xfrm_sec_ctx */ 226 XFRMA_SEC_CTX, /* struct xfrm_sec_ctx */
227 XFRMA_LTIME_VAL,
228 XFRMA_REPLAY_VAL,
229 XFRMA_REPLAY_THRESH,
230 XFRMA_ETIMER_THRESH,
208 __XFRMA_MAX 231 __XFRMA_MAX
209 232
210#define XFRMA_MAX (__XFRMA_MAX - 1) 233#define XFRMA_MAX (__XFRMA_MAX - 1)
@@ -235,6 +258,11 @@ struct xfrm_usersa_id {
235 __u8 proto; 258 __u8 proto;
236}; 259};
237 260
261struct xfrm_aevent_id {
262 struct xfrm_usersa_id sa_id;
263 __u32 flags;
264};
265
238struct xfrm_userspi_info { 266struct xfrm_userspi_info {
239 struct xfrm_usersa_info info; 267 struct xfrm_usersa_info info;
240 __u32 min; 268 __u32 min;
@@ -306,6 +334,8 @@ enum xfrm_nlgroups {
306#define XFRMNLGRP_SA XFRMNLGRP_SA 334#define XFRMNLGRP_SA XFRMNLGRP_SA
307 XFRMNLGRP_POLICY, 335 XFRMNLGRP_POLICY,
308#define XFRMNLGRP_POLICY XFRMNLGRP_POLICY 336#define XFRMNLGRP_POLICY XFRMNLGRP_POLICY
337 XFRMNLGRP_AEVENTS,
338#define XFRMNLGRP_AEVENTS XFRMNLGRP_AEVENTS
309 __XFRMNLGRP_MAX 339 __XFRMNLGRP_MAX
310}; 340};
311#define XFRMNLGRP_MAX (__XFRMNLGRP_MAX - 1) 341#define XFRMNLGRP_MAX (__XFRMNLGRP_MAX - 1)