diff options
Diffstat (limited to 'include/net/ipv6.h')
-rw-r--r-- | include/net/ipv6.h | 93 |
1 files changed, 42 insertions, 51 deletions
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index c0c019f72ba9..e0a612bc9c4e 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h | |||
@@ -202,6 +202,7 @@ struct ip6_flowlabel | |||
202 | u32 owner; | 202 | u32 owner; |
203 | unsigned long lastuse; | 203 | unsigned long lastuse; |
204 | unsigned long expires; | 204 | unsigned long expires; |
205 | struct net *fl_net; | ||
205 | }; | 206 | }; |
206 | 207 | ||
207 | #define IPV6_FLOWINFO_MASK __constant_htonl(0x0FFFFFFF) | 208 | #define IPV6_FLOWINFO_MASK __constant_htonl(0x0FFFFFFF) |
@@ -249,15 +250,6 @@ int ip6_frag_mem(struct net *net); | |||
249 | 250 | ||
250 | #define IPV6_FRAG_TIMEOUT (60*HZ) /* 60 seconds */ | 251 | #define IPV6_FRAG_TIMEOUT (60*HZ) /* 60 seconds */ |
251 | 252 | ||
252 | /* | ||
253 | * Function prototype for build_xmit | ||
254 | */ | ||
255 | |||
256 | typedef int (*inet_getfrag_t) (const void *data, | ||
257 | struct in6_addr *addr, | ||
258 | char *, | ||
259 | unsigned int, unsigned int); | ||
260 | |||
261 | extern int __ipv6_addr_type(const struct in6_addr *addr); | 253 | extern int __ipv6_addr_type(const struct in6_addr *addr); |
262 | static inline int ipv6_addr_type(const struct in6_addr *addr) | 254 | static inline int ipv6_addr_type(const struct in6_addr *addr) |
263 | { | 255 | { |
@@ -288,12 +280,10 @@ static inline int | |||
288 | ipv6_masked_addr_cmp(const struct in6_addr *a1, const struct in6_addr *m, | 280 | ipv6_masked_addr_cmp(const struct in6_addr *a1, const struct in6_addr *m, |
289 | const struct in6_addr *a2) | 281 | const struct in6_addr *a2) |
290 | { | 282 | { |
291 | unsigned int i; | 283 | return (!!(((a1->s6_addr32[0] ^ a2->s6_addr32[0]) & m->s6_addr32[0]) | |
292 | 284 | ((a1->s6_addr32[1] ^ a2->s6_addr32[1]) & m->s6_addr32[1]) | | |
293 | for (i = 0; i < 4; i++) | 285 | ((a1->s6_addr32[2] ^ a2->s6_addr32[2]) & m->s6_addr32[2]) | |
294 | if ((a1->s6_addr32[i] ^ a2->s6_addr32[i]) & m->s6_addr32[i]) | 286 | ((a1->s6_addr32[3] ^ a2->s6_addr32[3]) & m->s6_addr32[3]))); |
295 | return 1; | ||
296 | return 0; | ||
297 | } | 287 | } |
298 | 288 | ||
299 | static inline void ipv6_addr_copy(struct in6_addr *a1, const struct in6_addr *a2) | 289 | static inline void ipv6_addr_copy(struct in6_addr *a1, const struct in6_addr *a2) |
@@ -328,10 +318,10 @@ static inline void ipv6_addr_set(struct in6_addr *addr, | |||
328 | static inline int ipv6_addr_equal(const struct in6_addr *a1, | 318 | static inline int ipv6_addr_equal(const struct in6_addr *a1, |
329 | const struct in6_addr *a2) | 319 | const struct in6_addr *a2) |
330 | { | 320 | { |
331 | return (a1->s6_addr32[0] == a2->s6_addr32[0] && | 321 | return (((a1->s6_addr32[0] ^ a2->s6_addr32[0]) | |
332 | a1->s6_addr32[1] == a2->s6_addr32[1] && | 322 | (a1->s6_addr32[1] ^ a2->s6_addr32[1]) | |
333 | a1->s6_addr32[2] == a2->s6_addr32[2] && | 323 | (a1->s6_addr32[2] ^ a2->s6_addr32[2]) | |
334 | a1->s6_addr32[3] == a2->s6_addr32[3]); | 324 | (a1->s6_addr32[3] ^ a2->s6_addr32[3])) == 0); |
335 | } | 325 | } |
336 | 326 | ||
337 | static inline int __ipv6_prefix_equal(const __be32 *a1, const __be32 *a2, | 327 | static inline int __ipv6_prefix_equal(const __be32 *a1, const __be32 *a2, |
@@ -379,8 +369,27 @@ static inline int ipv6_addr_any(const struct in6_addr *a) | |||
379 | 369 | ||
380 | static inline int ipv6_addr_v4mapped(const struct in6_addr *a) | 370 | static inline int ipv6_addr_v4mapped(const struct in6_addr *a) |
381 | { | 371 | { |
382 | return ((a->s6_addr32[0] | a->s6_addr32[1]) == 0 && | 372 | return ((a->s6_addr32[0] | a->s6_addr32[1] | |
383 | a->s6_addr32[2] == htonl(0x0000ffff)); | 373 | (a->s6_addr32[2] ^ htonl(0x0000ffff))) == 0); |
374 | } | ||
375 | |||
376 | /* | ||
377 | * Check for a RFC 4843 ORCHID address | ||
378 | * (Overlay Routable Cryptographic Hash Identifiers) | ||
379 | */ | ||
380 | static inline int ipv6_addr_orchid(const struct in6_addr *a) | ||
381 | { | ||
382 | return ((a->s6_addr32[0] & htonl(0xfffffff0)) | ||
383 | == htonl(0x20010010)); | ||
384 | } | ||
385 | |||
386 | static inline void ipv6_addr_set_v4mapped(const __be32 addr, | ||
387 | struct in6_addr *v4mapped) | ||
388 | { | ||
389 | ipv6_addr_set(v4mapped, | ||
390 | 0, 0, | ||
391 | htonl(0x0000FFFF), | ||
392 | addr); | ||
384 | } | 393 | } |
385 | 394 | ||
386 | /* | 395 | /* |
@@ -451,8 +460,8 @@ extern int ip6_xmit(struct sock *sk, | |||
451 | extern int ip6_nd_hdr(struct sock *sk, | 460 | extern int ip6_nd_hdr(struct sock *sk, |
452 | struct sk_buff *skb, | 461 | struct sk_buff *skb, |
453 | struct net_device *dev, | 462 | struct net_device *dev, |
454 | struct in6_addr *saddr, | 463 | const struct in6_addr *saddr, |
455 | struct in6_addr *daddr, | 464 | const struct in6_addr *daddr, |
456 | int proto, int len); | 465 | int proto, int len); |
457 | 466 | ||
458 | extern int ip6_find_1stfragopt(struct sk_buff *skb, u8 **nexthdr); | 467 | extern int ip6_find_1stfragopt(struct sk_buff *skb, u8 **nexthdr); |
@@ -499,14 +508,6 @@ extern int ip6_local_out(struct sk_buff *skb); | |||
499 | * Extension header (options) processing | 508 | * Extension header (options) processing |
500 | */ | 509 | */ |
501 | 510 | ||
502 | extern u8 * ipv6_build_nfrag_opts(struct sk_buff *skb, | ||
503 | u8 *prev_hdr, | ||
504 | struct ipv6_txoptions *opt, | ||
505 | struct in6_addr *daddr, | ||
506 | u32 jumbolen); | ||
507 | extern u8 * ipv6_build_frag_opts(struct sk_buff *skb, | ||
508 | u8 *prev_hdr, | ||
509 | struct ipv6_txoptions *opt); | ||
510 | extern void ipv6_push_nfrag_opts(struct sk_buff *skb, | 511 | extern void ipv6_push_nfrag_opts(struct sk_buff *skb, |
511 | struct ipv6_txoptions *opt, | 512 | struct ipv6_txoptions *opt, |
512 | u8 *proto, | 513 | u8 *proto, |
@@ -545,10 +546,6 @@ extern int compat_ipv6_getsockopt(struct sock *sk, | |||
545 | char __user *optval, | 546 | char __user *optval, |
546 | int __user *optlen); | 547 | int __user *optlen); |
547 | 548 | ||
548 | extern int ipv6_packet_init(void); | ||
549 | |||
550 | extern void ipv6_packet_cleanup(void); | ||
551 | |||
552 | extern int ip6_datagram_connect(struct sock *sk, | 549 | extern int ip6_datagram_connect(struct sock *sk, |
553 | struct sockaddr *addr, int addr_len); | 550 | struct sockaddr *addr, int addr_len); |
554 | 551 | ||
@@ -585,14 +582,14 @@ extern int ip6_mc_msfget(struct sock *sk, struct group_filter *gsf, | |||
585 | int __user *optlen); | 582 | int __user *optlen); |
586 | 583 | ||
587 | #ifdef CONFIG_PROC_FS | 584 | #ifdef CONFIG_PROC_FS |
588 | extern int ac6_proc_init(void); | 585 | extern int ac6_proc_init(struct net *net); |
589 | extern void ac6_proc_exit(void); | 586 | extern void ac6_proc_exit(struct net *net); |
590 | extern int raw6_proc_init(void); | 587 | extern int raw6_proc_init(void); |
591 | extern void raw6_proc_exit(void); | 588 | extern void raw6_proc_exit(void); |
592 | extern int tcp6_proc_init(void); | 589 | extern int tcp6_proc_init(struct net *net); |
593 | extern void tcp6_proc_exit(void); | 590 | extern void tcp6_proc_exit(struct net *net); |
594 | extern int udp6_proc_init(void); | 591 | extern int udp6_proc_init(struct net *net); |
595 | extern void udp6_proc_exit(void); | 592 | extern void udp6_proc_exit(struct net *net); |
596 | extern int udplite6_proc_init(void); | 593 | extern int udplite6_proc_init(void); |
597 | extern void udplite6_proc_exit(void); | 594 | extern void udplite6_proc_exit(void); |
598 | extern int ipv6_misc_proc_init(void); | 595 | extern int ipv6_misc_proc_init(void); |
@@ -600,17 +597,11 @@ extern void ipv6_misc_proc_exit(void); | |||
600 | extern int snmp6_register_dev(struct inet6_dev *idev); | 597 | extern int snmp6_register_dev(struct inet6_dev *idev); |
601 | extern int snmp6_unregister_dev(struct inet6_dev *idev); | 598 | extern int snmp6_unregister_dev(struct inet6_dev *idev); |
602 | 599 | ||
603 | extern struct rt6_statistics rt6_stats; | ||
604 | #else | 600 | #else |
605 | static inline int snmp6_register_dev(struct inet6_dev *idev) | 601 | static inline int ac6_proc_init(struct net *net) { return 0; } |
606 | { | 602 | static inline void ac6_proc_exit(struct net *net) { } |
607 | return 0; | 603 | static inline int snmp6_register_dev(struct inet6_dev *idev) { return 0; } |
608 | } | 604 | static inline int snmp6_unregister_dev(struct inet6_dev *idev) { return 0; } |
609 | |||
610 | static inline int snmp6_unregister_dev(struct inet6_dev *idev) | ||
611 | { | ||
612 | return 0; | ||
613 | } | ||
614 | #endif | 605 | #endif |
615 | 606 | ||
616 | #ifdef CONFIG_SYSCTL | 607 | #ifdef CONFIG_SYSCTL |