diff options
author | Dave Jones <davej@redhat.com> | 2006-12-12 17:41:41 -0500 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2006-12-12 17:41:41 -0500 |
commit | c4366889dda8110247be59ca41fddb82951a8c26 (patch) | |
tree | 705c1a996bed8fd48ce94ff33ec9fd00f9b94875 /include/net/ipv6.h | |
parent | db2fb9db5735cc532fd4fc55e94b9a3c3750378e (diff) | |
parent | e1036502e5263851259d147771226161e5ccc85a (diff) |
Merge ../linus
Conflicts:
drivers/cpufreq/cpufreq.c
Diffstat (limited to 'include/net/ipv6.h')
-rw-r--r-- | include/net/ipv6.h | 62 |
1 files changed, 38 insertions, 24 deletions
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index 8223c4410b4b..00328b71a08c 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h | |||
@@ -95,10 +95,10 @@ | |||
95 | */ | 95 | */ |
96 | 96 | ||
97 | struct frag_hdr { | 97 | struct frag_hdr { |
98 | unsigned char nexthdr; | 98 | __u8 nexthdr; |
99 | unsigned char reserved; | 99 | __u8 reserved; |
100 | unsigned short frag_off; | 100 | __be16 frag_off; |
101 | __u32 identification; | 101 | __be32 identification; |
102 | }; | 102 | }; |
103 | 103 | ||
104 | #define IP6_MF 0x0001 | 104 | #define IP6_MF 0x0001 |
@@ -113,9 +113,24 @@ extern int sysctl_mld_max_msf; | |||
113 | 113 | ||
114 | /* MIBs */ | 114 | /* MIBs */ |
115 | DECLARE_SNMP_STAT(struct ipstats_mib, ipv6_statistics); | 115 | DECLARE_SNMP_STAT(struct ipstats_mib, ipv6_statistics); |
116 | #define IP6_INC_STATS(field) SNMP_INC_STATS(ipv6_statistics, field) | 116 | #define IP6_INC_STATS(idev,field) ({ \ |
117 | #define IP6_INC_STATS_BH(field) SNMP_INC_STATS_BH(ipv6_statistics, field) | 117 | struct inet6_dev *_idev = (idev); \ |
118 | #define IP6_INC_STATS_USER(field) SNMP_INC_STATS_USER(ipv6_statistics, field) | 118 | if (likely(_idev != NULL)) \ |
119 | SNMP_INC_STATS(_idev->stats.ipv6, field); \ | ||
120 | SNMP_INC_STATS(ipv6_statistics, field); \ | ||
121 | }) | ||
122 | #define IP6_INC_STATS_BH(idev,field) ({ \ | ||
123 | struct inet6_dev *_idev = (idev); \ | ||
124 | if (likely(_idev != NULL)) \ | ||
125 | SNMP_INC_STATS_BH(_idev->stats.ipv6, field); \ | ||
126 | SNMP_INC_STATS_BH(ipv6_statistics, field); \ | ||
127 | }) | ||
128 | #define IP6_INC_STATS_USER(idev,field) ({ \ | ||
129 | struct inet6_dev *_idev = (idev); \ | ||
130 | if (likely(_idev != NULL)) \ | ||
131 | SNMP_INC_STATS_USER(_idev->stats.ipv6, field); \ | ||
132 | SNMP_INC_STATS_USER(ipv6_statistics, field); \ | ||
133 | }) | ||
119 | DECLARE_SNMP_STAT(struct icmpv6_mib, icmpv6_statistics); | 134 | DECLARE_SNMP_STAT(struct icmpv6_mib, icmpv6_statistics); |
120 | #define ICMP6_INC_STATS(idev, field) ({ \ | 135 | #define ICMP6_INC_STATS(idev, field) ({ \ |
121 | struct inet6_dev *_idev = (idev); \ | 136 | struct inet6_dev *_idev = (idev); \ |
@@ -143,9 +158,13 @@ DECLARE_SNMP_STAT(struct icmpv6_mib, icmpv6_statistics); | |||
143 | SNMP_INC_STATS_OFFSET_BH(icmpv6_statistics, field, _offset); \ | 158 | SNMP_INC_STATS_OFFSET_BH(icmpv6_statistics, field, _offset); \ |
144 | }) | 159 | }) |
145 | DECLARE_SNMP_STAT(struct udp_mib, udp_stats_in6); | 160 | DECLARE_SNMP_STAT(struct udp_mib, udp_stats_in6); |
146 | #define UDP6_INC_STATS(field) SNMP_INC_STATS(udp_stats_in6, field) | 161 | DECLARE_SNMP_STAT(struct udp_mib, udplite_stats_in6); |
147 | #define UDP6_INC_STATS_BH(field) SNMP_INC_STATS_BH(udp_stats_in6, field) | 162 | #define UDP6_INC_STATS_BH(field, is_udplite) do { \ |
148 | #define UDP6_INC_STATS_USER(field) SNMP_INC_STATS_USER(udp_stats_in6, field) | 163 | if (is_udplite) SNMP_INC_STATS_BH(udplite_stats_in6, field); \ |
164 | else SNMP_INC_STATS_BH(udp_stats_in6, field); } while(0) | ||
165 | #define UDP6_INC_STATS_USER(field, is_udplite) do { \ | ||
166 | if (is_udplite) SNMP_INC_STATS_USER(udplite_stats_in6, field); \ | ||
167 | else SNMP_INC_STATS_USER(udp_stats_in6, field); } while(0) | ||
149 | 168 | ||
150 | int snmp6_register_dev(struct inet6_dev *idev); | 169 | int snmp6_register_dev(struct inet6_dev *idev); |
151 | int snmp6_unregister_dev(struct inet6_dev *idev); | 170 | int snmp6_unregister_dev(struct inet6_dev *idev); |
@@ -191,7 +210,7 @@ struct ipv6_txoptions | |||
191 | struct ip6_flowlabel | 210 | struct ip6_flowlabel |
192 | { | 211 | { |
193 | struct ip6_flowlabel *next; | 212 | struct ip6_flowlabel *next; |
194 | u32 label; | 213 | __be32 label; |
195 | struct in6_addr dst; | 214 | struct in6_addr dst; |
196 | struct ipv6_txoptions *opt; | 215 | struct ipv6_txoptions *opt; |
197 | atomic_t users; | 216 | atomic_t users; |
@@ -211,7 +230,7 @@ struct ipv6_fl_socklist | |||
211 | struct ip6_flowlabel *fl; | 230 | struct ip6_flowlabel *fl; |
212 | }; | 231 | }; |
213 | 232 | ||
214 | extern struct ip6_flowlabel *fl6_sock_lookup(struct sock *sk, u32 label); | 233 | extern struct ip6_flowlabel *fl6_sock_lookup(struct sock *sk, __be32 label); |
215 | extern struct ipv6_txoptions *fl6_merge_options(struct ipv6_txoptions * opt_space, | 234 | extern struct ipv6_txoptions *fl6_merge_options(struct ipv6_txoptions * opt_space, |
216 | struct ip6_flowlabel * fl, | 235 | struct ip6_flowlabel * fl, |
217 | struct ipv6_txoptions * fopt); | 236 | struct ipv6_txoptions * fopt); |
@@ -375,22 +394,15 @@ static inline int ipv6_addr_any(const struct in6_addr *a) | |||
375 | */ | 394 | */ |
376 | static inline int __ipv6_addr_diff(const void *token1, const void *token2, int addrlen) | 395 | static inline int __ipv6_addr_diff(const void *token1, const void *token2, int addrlen) |
377 | { | 396 | { |
378 | const __u32 *a1 = token1, *a2 = token2; | 397 | const __be32 *a1 = token1, *a2 = token2; |
379 | int i; | 398 | int i; |
380 | 399 | ||
381 | addrlen >>= 2; | 400 | addrlen >>= 2; |
382 | 401 | ||
383 | for (i = 0; i < addrlen; i++) { | 402 | for (i = 0; i < addrlen; i++) { |
384 | __u32 xb = a1[i] ^ a2[i]; | 403 | __be32 xb = a1[i] ^ a2[i]; |
385 | if (xb) { | 404 | if (xb) |
386 | int j = 31; | 405 | return i * 32 + 32 - fls(ntohl(xb)); |
387 | |||
388 | xb = ntohl(xb); | ||
389 | while ((xb & (1 << j)) == 0) | ||
390 | j--; | ||
391 | |||
392 | return (i * 32 + 31 - j); | ||
393 | } | ||
394 | } | 406 | } |
395 | 407 | ||
396 | /* | 408 | /* |
@@ -544,7 +556,7 @@ extern int ip6_datagram_connect(struct sock *sk, | |||
544 | struct sockaddr *addr, int addr_len); | 556 | struct sockaddr *addr, int addr_len); |
545 | 557 | ||
546 | extern int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len); | 558 | extern int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len); |
547 | extern void ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err, u16 port, | 559 | extern void ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err, __be16 port, |
548 | u32 info, u8 *payload); | 560 | u32 info, u8 *payload); |
549 | extern void ipv6_local_error(struct sock *sk, int err, struct flowi *fl, u32 info); | 561 | extern void ipv6_local_error(struct sock *sk, int err, struct flowi *fl, u32 info); |
550 | 562 | ||
@@ -589,6 +601,8 @@ extern int tcp6_proc_init(void); | |||
589 | extern void tcp6_proc_exit(void); | 601 | extern void tcp6_proc_exit(void); |
590 | extern int udp6_proc_init(void); | 602 | extern int udp6_proc_init(void); |
591 | extern void udp6_proc_exit(void); | 603 | extern void udp6_proc_exit(void); |
604 | extern int udplite6_proc_init(void); | ||
605 | extern void udplite6_proc_exit(void); | ||
592 | extern int ipv6_misc_proc_init(void); | 606 | extern int ipv6_misc_proc_init(void); |
593 | extern void ipv6_misc_proc_exit(void); | 607 | extern void ipv6_misc_proc_exit(void); |
594 | 608 | ||