diff options
Diffstat (limited to 'include/net/addrconf.h')
-rw-r--r-- | include/net/addrconf.h | 44 |
1 files changed, 39 insertions, 5 deletions
diff --git a/include/net/addrconf.h b/include/net/addrconf.h index 33b593e17441..496503c03846 100644 --- a/include/net/addrconf.h +++ b/include/net/addrconf.h | |||
@@ -17,6 +17,7 @@ | |||
17 | 17 | ||
18 | #define IPV6_MAX_ADDRESSES 16 | 18 | #define IPV6_MAX_ADDRESSES 16 |
19 | 19 | ||
20 | #include <linux/in.h> | ||
20 | #include <linux/in6.h> | 21 | #include <linux/in6.h> |
21 | 22 | ||
22 | struct prefix_info { | 23 | struct prefix_info { |
@@ -58,15 +59,20 @@ extern int addrconf_add_ifaddr(void __user *arg); | |||
58 | extern int addrconf_del_ifaddr(void __user *arg); | 59 | extern int addrconf_del_ifaddr(void __user *arg); |
59 | extern int addrconf_set_dstaddr(void __user *arg); | 60 | extern int addrconf_set_dstaddr(void __user *arg); |
60 | 61 | ||
61 | extern int ipv6_chk_addr(struct in6_addr *addr, | 62 | extern int ipv6_chk_addr(struct net *net, |
63 | struct in6_addr *addr, | ||
62 | struct net_device *dev, | 64 | struct net_device *dev, |
63 | int strict); | 65 | int strict); |
66 | |||
64 | #if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE) | 67 | #if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE) |
65 | extern int ipv6_chk_home_addr(struct in6_addr *addr); | 68 | extern int ipv6_chk_home_addr(struct net *net, |
69 | struct in6_addr *addr); | ||
66 | #endif | 70 | #endif |
67 | extern struct inet6_ifaddr * ipv6_get_ifaddr(struct in6_addr *addr, | 71 | extern struct inet6_ifaddr *ipv6_get_ifaddr(struct net *net, |
68 | struct net_device *dev, | 72 | struct in6_addr *addr, |
69 | int strict); | 73 | struct net_device *dev, |
74 | int strict); | ||
75 | |||
70 | extern int ipv6_get_saddr(struct dst_entry *dst, | 76 | extern int ipv6_get_saddr(struct dst_entry *dst, |
71 | struct in6_addr *daddr, | 77 | struct in6_addr *daddr, |
72 | struct in6_addr *saddr); | 78 | struct in6_addr *saddr); |
@@ -84,6 +90,14 @@ extern void addrconf_leave_solict(struct inet6_dev *idev, | |||
84 | struct in6_addr *addr); | 90 | struct in6_addr *addr); |
85 | 91 | ||
86 | /* | 92 | /* |
93 | * IPv6 Address Label subsystem (addrlabel.c) | ||
94 | */ | ||
95 | extern int ipv6_addr_label_init(void); | ||
96 | extern void ipv6_addr_label_rtnl_register(void); | ||
97 | extern u32 ipv6_addr_label(const struct in6_addr *addr, | ||
98 | int type, int ifindex); | ||
99 | |||
100 | /* | ||
87 | * multicast prototypes (mcast.c) | 101 | * multicast prototypes (mcast.c) |
88 | */ | 102 | */ |
89 | extern int ipv6_sock_mc_join(struct sock *sk, int ifindex, | 103 | extern int ipv6_sock_mc_join(struct sock *sk, int ifindex, |
@@ -241,6 +255,26 @@ static inline int ipv6_addr_is_ll_all_routers(const struct in6_addr *addr) | |||
241 | addr->s6_addr32[3] == htonl(0x00000002)); | 255 | addr->s6_addr32[3] == htonl(0x00000002)); |
242 | } | 256 | } |
243 | 257 | ||
258 | static inline int ipv6_isatap_eui64(u8 *eui, __be32 addr) | ||
259 | { | ||
260 | eui[0] = (ipv4_is_zeronet(addr) || ipv4_is_private_10(addr) || | ||
261 | ipv4_is_loopback(addr) || ipv4_is_linklocal_169(addr) || | ||
262 | ipv4_is_private_172(addr) || ipv4_is_test_192(addr) || | ||
263 | ipv4_is_anycast_6to4(addr) || ipv4_is_private_192(addr) || | ||
264 | ipv4_is_test_198(addr) || ipv4_is_multicast(addr) || | ||
265 | ipv4_is_lbcast(addr)) ? 0x00 : 0x02; | ||
266 | eui[1] = 0; | ||
267 | eui[2] = 0x5E; | ||
268 | eui[3] = 0xFE; | ||
269 | memcpy (eui+4, &addr, 4); | ||
270 | return 0; | ||
271 | } | ||
272 | |||
273 | static inline int ipv6_addr_is_isatap(const struct in6_addr *addr) | ||
274 | { | ||
275 | return ((addr->s6_addr32[2] | htonl(0x02000000)) == htonl(0x02005EFE)); | ||
276 | } | ||
277 | |||
244 | #ifdef CONFIG_PROC_FS | 278 | #ifdef CONFIG_PROC_FS |
245 | extern int if6_proc_init(void); | 279 | extern int if6_proc_init(void); |
246 | extern void if6_proc_exit(void); | 280 | extern void if6_proc_exit(void); |