aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/ipv6.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/ipv6.h')
-rw-r--r--include/net/ipv6.h93
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
256typedef int (*inet_getfrag_t) (const void *data,
257 struct in6_addr *addr,
258 char *,
259 unsigned int, unsigned int);
260
261extern int __ipv6_addr_type(const struct in6_addr *addr); 253extern int __ipv6_addr_type(const struct in6_addr *addr);
262static inline int ipv6_addr_type(const struct in6_addr *addr) 254static inline int ipv6_addr_type(const struct in6_addr *addr)
263{ 255{
@@ -288,12 +280,10 @@ static inline int
288ipv6_masked_addr_cmp(const struct in6_addr *a1, const struct in6_addr *m, 280ipv6_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
299static inline void ipv6_addr_copy(struct in6_addr *a1, const struct in6_addr *a2) 289static 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,
328static inline int ipv6_addr_equal(const struct in6_addr *a1, 318static 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
337static inline int __ipv6_prefix_equal(const __be32 *a1, const __be32 *a2, 327static 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
380static inline int ipv6_addr_v4mapped(const struct in6_addr *a) 370static 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 */
380static inline int ipv6_addr_orchid(const struct in6_addr *a)
381{
382 return ((a->s6_addr32[0] & htonl(0xfffffff0))
383 == htonl(0x20010010));
384}
385
386static 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,
451extern int ip6_nd_hdr(struct sock *sk, 460extern 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
458extern int ip6_find_1stfragopt(struct sk_buff *skb, u8 **nexthdr); 467extern 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
502extern 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);
507extern u8 * ipv6_build_frag_opts(struct sk_buff *skb,
508 u8 *prev_hdr,
509 struct ipv6_txoptions *opt);
510extern void ipv6_push_nfrag_opts(struct sk_buff *skb, 511extern 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
548extern int ipv6_packet_init(void);
549
550extern void ipv6_packet_cleanup(void);
551
552extern int ip6_datagram_connect(struct sock *sk, 549extern 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
588extern int ac6_proc_init(void); 585extern int ac6_proc_init(struct net *net);
589extern void ac6_proc_exit(void); 586extern void ac6_proc_exit(struct net *net);
590extern int raw6_proc_init(void); 587extern int raw6_proc_init(void);
591extern void raw6_proc_exit(void); 588extern void raw6_proc_exit(void);
592extern int tcp6_proc_init(void); 589extern int tcp6_proc_init(struct net *net);
593extern void tcp6_proc_exit(void); 590extern void tcp6_proc_exit(struct net *net);
594extern int udp6_proc_init(void); 591extern int udp6_proc_init(struct net *net);
595extern void udp6_proc_exit(void); 592extern void udp6_proc_exit(struct net *net);
596extern int udplite6_proc_init(void); 593extern int udplite6_proc_init(void);
597extern void udplite6_proc_exit(void); 594extern void udplite6_proc_exit(void);
598extern int ipv6_misc_proc_init(void); 595extern int ipv6_misc_proc_init(void);
@@ -600,17 +597,11 @@ extern void ipv6_misc_proc_exit(void);
600extern int snmp6_register_dev(struct inet6_dev *idev); 597extern int snmp6_register_dev(struct inet6_dev *idev);
601extern int snmp6_unregister_dev(struct inet6_dev *idev); 598extern int snmp6_unregister_dev(struct inet6_dev *idev);
602 599
603extern struct rt6_statistics rt6_stats;
604#else 600#else
605static inline int snmp6_register_dev(struct inet6_dev *idev) 601static inline int ac6_proc_init(struct net *net) { return 0; }
606{ 602static inline void ac6_proc_exit(struct net *net) { }
607 return 0; 603static inline int snmp6_register_dev(struct inet6_dev *idev) { return 0; }
608} 604static inline int snmp6_unregister_dev(struct inet6_dev *idev) { return 0; }
609
610static 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