diff options
Diffstat (limited to 'include/net/addrconf.h')
-rw-r--r-- | include/net/addrconf.h | 180 |
1 files changed, 92 insertions, 88 deletions
diff --git a/include/net/addrconf.h b/include/net/addrconf.h index c7b181cb47a6..fb314de2b61b 100644 --- a/include/net/addrconf.h +++ b/include/net/addrconf.h | |||
@@ -53,51 +53,36 @@ struct prefix_info { | |||
53 | #define IN6_ADDR_HSIZE_SHIFT 4 | 53 | #define IN6_ADDR_HSIZE_SHIFT 4 |
54 | #define IN6_ADDR_HSIZE (1 << IN6_ADDR_HSIZE_SHIFT) | 54 | #define IN6_ADDR_HSIZE (1 << IN6_ADDR_HSIZE_SHIFT) |
55 | 55 | ||
56 | extern int addrconf_init(void); | 56 | int addrconf_init(void); |
57 | extern void addrconf_cleanup(void); | 57 | void addrconf_cleanup(void); |
58 | 58 | ||
59 | extern int addrconf_add_ifaddr(struct net *net, | 59 | int addrconf_add_ifaddr(struct net *net, void __user *arg); |
60 | void __user *arg); | 60 | int addrconf_del_ifaddr(struct net *net, void __user *arg); |
61 | extern int addrconf_del_ifaddr(struct net *net, | 61 | int addrconf_set_dstaddr(struct net *net, void __user *arg); |
62 | void __user *arg); | ||
63 | extern int addrconf_set_dstaddr(struct net *net, | ||
64 | void __user *arg); | ||
65 | 62 | ||
66 | extern int ipv6_chk_addr(struct net *net, | 63 | int ipv6_chk_addr(struct net *net, const struct in6_addr *addr, |
67 | const struct in6_addr *addr, | 64 | const struct net_device *dev, int strict); |
68 | const struct net_device *dev, | ||
69 | int strict); | ||
70 | 65 | ||
71 | #if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE) | 66 | #if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE) |
72 | extern int ipv6_chk_home_addr(struct net *net, | 67 | int ipv6_chk_home_addr(struct net *net, const struct in6_addr *addr); |
73 | const struct in6_addr *addr); | ||
74 | #endif | 68 | #endif |
75 | 69 | ||
76 | extern int ipv6_chk_prefix(const struct in6_addr *addr, | 70 | int ipv6_chk_prefix(const struct in6_addr *addr, struct net_device *dev); |
77 | struct net_device *dev); | 71 | |
78 | 72 | struct inet6_ifaddr *ipv6_get_ifaddr(struct net *net, | |
79 | extern struct inet6_ifaddr *ipv6_get_ifaddr(struct net *net, | 73 | const struct in6_addr *addr, |
80 | const struct in6_addr *addr, | 74 | struct net_device *dev, int strict); |
81 | struct net_device *dev, | 75 | |
82 | int strict); | 76 | int ipv6_dev_get_saddr(struct net *net, const struct net_device *dev, |
83 | 77 | const struct in6_addr *daddr, unsigned int srcprefs, | |
84 | extern int ipv6_dev_get_saddr(struct net *net, | 78 | struct in6_addr *saddr); |
85 | const struct net_device *dev, | 79 | int __ipv6_get_lladdr(struct inet6_dev *idev, struct in6_addr *addr, |
86 | const struct in6_addr *daddr, | 80 | unsigned char banned_flags); |
87 | unsigned int srcprefs, | 81 | int ipv6_get_lladdr(struct net_device *dev, struct in6_addr *addr, |
88 | struct in6_addr *saddr); | 82 | unsigned char banned_flags); |
89 | extern int __ipv6_get_lladdr(struct inet6_dev *idev, | 83 | int ipv6_rcv_saddr_equal(const struct sock *sk, const struct sock *sk2); |
90 | struct in6_addr *addr, | 84 | void addrconf_join_solict(struct net_device *dev, const struct in6_addr *addr); |
91 | unsigned char banned_flags); | 85 | void addrconf_leave_solict(struct inet6_dev *idev, const struct in6_addr *addr); |
92 | extern int ipv6_get_lladdr(struct net_device *dev, | ||
93 | struct in6_addr *addr, | ||
94 | unsigned char banned_flags); | ||
95 | extern int ipv6_rcv_saddr_equal(const struct sock *sk, | ||
96 | const struct sock *sk2); | ||
97 | extern void addrconf_join_solict(struct net_device *dev, | ||
98 | const struct in6_addr *addr); | ||
99 | extern void addrconf_leave_solict(struct inet6_dev *idev, | ||
100 | const struct in6_addr *addr); | ||
101 | 86 | ||
102 | static inline unsigned long addrconf_timeout_fixup(u32 timeout, | 87 | static inline unsigned long addrconf_timeout_fixup(u32 timeout, |
103 | unsigned int unit) | 88 | unsigned int unit) |
@@ -124,41 +109,58 @@ static inline int addrconf_finite_timeout(unsigned long timeout) | |||
124 | /* | 109 | /* |
125 | * IPv6 Address Label subsystem (addrlabel.c) | 110 | * IPv6 Address Label subsystem (addrlabel.c) |
126 | */ | 111 | */ |
127 | extern int ipv6_addr_label_init(void); | 112 | int ipv6_addr_label_init(void); |
128 | extern void ipv6_addr_label_cleanup(void); | 113 | void ipv6_addr_label_cleanup(void); |
129 | extern void ipv6_addr_label_rtnl_register(void); | 114 | void ipv6_addr_label_rtnl_register(void); |
130 | extern u32 ipv6_addr_label(struct net *net, | 115 | u32 ipv6_addr_label(struct net *net, const struct in6_addr *addr, |
131 | const struct in6_addr *addr, | 116 | int type, int ifindex); |
132 | int type, int ifindex); | ||
133 | 117 | ||
134 | /* | 118 | /* |
135 | * multicast prototypes (mcast.c) | 119 | * multicast prototypes (mcast.c) |
136 | */ | 120 | */ |
137 | extern int ipv6_sock_mc_join(struct sock *sk, int ifindex, | 121 | int ipv6_sock_mc_join(struct sock *sk, int ifindex, |
138 | const struct in6_addr *addr); | 122 | const struct in6_addr *addr); |
139 | extern int ipv6_sock_mc_drop(struct sock *sk, int ifindex, | 123 | int ipv6_sock_mc_drop(struct sock *sk, int ifindex, |
140 | const struct in6_addr *addr); | 124 | const struct in6_addr *addr); |
141 | extern void ipv6_sock_mc_close(struct sock *sk); | 125 | void ipv6_sock_mc_close(struct sock *sk); |
142 | extern bool inet6_mc_check(struct sock *sk, | 126 | bool inet6_mc_check(struct sock *sk, const struct in6_addr *mc_addr, |
143 | const struct in6_addr *mc_addr, | 127 | const struct in6_addr *src_addr); |
144 | const struct in6_addr *src_addr); | 128 | |
145 | 129 | int ipv6_dev_mc_inc(struct net_device *dev, const struct in6_addr *addr); | |
146 | extern int ipv6_dev_mc_inc(struct net_device *dev, const struct in6_addr *addr); | 130 | int __ipv6_dev_mc_dec(struct inet6_dev *idev, const struct in6_addr *addr); |
147 | extern int __ipv6_dev_mc_dec(struct inet6_dev *idev, const struct in6_addr *addr); | 131 | int ipv6_dev_mc_dec(struct net_device *dev, const struct in6_addr *addr); |
148 | extern int ipv6_dev_mc_dec(struct net_device *dev, const struct in6_addr *addr); | 132 | void ipv6_mc_up(struct inet6_dev *idev); |
149 | extern void ipv6_mc_up(struct inet6_dev *idev); | 133 | void ipv6_mc_down(struct inet6_dev *idev); |
150 | extern void ipv6_mc_down(struct inet6_dev *idev); | 134 | void ipv6_mc_unmap(struct inet6_dev *idev); |
151 | extern void ipv6_mc_unmap(struct inet6_dev *idev); | 135 | void ipv6_mc_remap(struct inet6_dev *idev); |
152 | extern void ipv6_mc_remap(struct inet6_dev *idev); | 136 | void ipv6_mc_init_dev(struct inet6_dev *idev); |
153 | extern void ipv6_mc_init_dev(struct inet6_dev *idev); | 137 | void ipv6_mc_destroy_dev(struct inet6_dev *idev); |
154 | extern void ipv6_mc_destroy_dev(struct inet6_dev *idev); | 138 | void addrconf_dad_failure(struct inet6_ifaddr *ifp); |
155 | extern void addrconf_dad_failure(struct inet6_ifaddr *ifp); | 139 | |
156 | 140 | bool ipv6_chk_mcast_addr(struct net_device *dev, const struct in6_addr *group, | |
157 | extern bool ipv6_chk_mcast_addr(struct net_device *dev, | 141 | const struct in6_addr *src_addr); |
158 | const struct in6_addr *group, | 142 | |
159 | const struct in6_addr *src_addr); | 143 | void ipv6_mc_dad_complete(struct inet6_dev *idev); |
160 | 144 | ||
161 | extern void ipv6_mc_dad_complete(struct inet6_dev *idev); | 145 | /* A stub used by vxlan module. This is ugly, ideally these |
146 | * symbols should be built into the core kernel. | ||
147 | */ | ||
148 | struct ipv6_stub { | ||
149 | int (*ipv6_sock_mc_join)(struct sock *sk, int ifindex, | ||
150 | const struct in6_addr *addr); | ||
151 | int (*ipv6_sock_mc_drop)(struct sock *sk, int ifindex, | ||
152 | const struct in6_addr *addr); | ||
153 | int (*ipv6_dst_lookup)(struct sock *sk, struct dst_entry **dst, | ||
154 | struct flowi6 *fl6); | ||
155 | void (*udpv6_encap_enable)(void); | ||
156 | void (*ndisc_send_na)(struct net_device *dev, struct neighbour *neigh, | ||
157 | const struct in6_addr *daddr, | ||
158 | const struct in6_addr *solicited_addr, | ||
159 | bool router, bool solicited, bool override, bool inc_opt); | ||
160 | struct neigh_table *nd_tbl; | ||
161 | }; | ||
162 | extern const struct ipv6_stub *ipv6_stub __read_mostly; | ||
163 | |||
162 | /* | 164 | /* |
163 | * identify MLD packets for MLD filter exceptions | 165 | * identify MLD packets for MLD filter exceptions |
164 | */ | 166 | */ |
@@ -184,29 +186,31 @@ static inline bool ipv6_is_mld(struct sk_buff *skb, int nexthdr, int offset) | |||
184 | return false; | 186 | return false; |
185 | } | 187 | } |
186 | 188 | ||
187 | extern void addrconf_prefix_rcv(struct net_device *dev, | 189 | void addrconf_prefix_rcv(struct net_device *dev, |
188 | u8 *opt, int len, bool sllao); | 190 | u8 *opt, int len, bool sllao); |
189 | 191 | ||
190 | /* | 192 | /* |
191 | * anycast prototypes (anycast.c) | 193 | * anycast prototypes (anycast.c) |
192 | */ | 194 | */ |
193 | extern int ipv6_sock_ac_join(struct sock *sk,int ifindex, const struct in6_addr *addr); | 195 | int ipv6_sock_ac_join(struct sock *sk, int ifindex, |
194 | extern int ipv6_sock_ac_drop(struct sock *sk,int ifindex, const struct in6_addr *addr); | 196 | const struct in6_addr *addr); |
195 | extern void ipv6_sock_ac_close(struct sock *sk); | 197 | int ipv6_sock_ac_drop(struct sock *sk, int ifindex, |
196 | 198 | const struct in6_addr *addr); | |
197 | extern int ipv6_dev_ac_inc(struct net_device *dev, const struct in6_addr *addr); | 199 | void ipv6_sock_ac_close(struct sock *sk); |
198 | extern int __ipv6_dev_ac_dec(struct inet6_dev *idev, const struct in6_addr *addr); | 200 | |
199 | extern bool ipv6_chk_acast_addr(struct net *net, struct net_device *dev, | 201 | int ipv6_dev_ac_inc(struct net_device *dev, const struct in6_addr *addr); |
202 | int __ipv6_dev_ac_dec(struct inet6_dev *idev, const struct in6_addr *addr); | ||
203 | bool ipv6_chk_acast_addr(struct net *net, struct net_device *dev, | ||
200 | const struct in6_addr *addr); | 204 | const struct in6_addr *addr); |
201 | 205 | ||
202 | 206 | ||
203 | /* Device notifier */ | 207 | /* Device notifier */ |
204 | extern int register_inet6addr_notifier(struct notifier_block *nb); | 208 | int register_inet6addr_notifier(struct notifier_block *nb); |
205 | extern int unregister_inet6addr_notifier(struct notifier_block *nb); | 209 | int unregister_inet6addr_notifier(struct notifier_block *nb); |
206 | extern int inet6addr_notifier_call_chain(unsigned long val, void *v); | 210 | int inet6addr_notifier_call_chain(unsigned long val, void *v); |
207 | 211 | ||
208 | extern void inet6_netconf_notify_devconf(struct net *net, int type, int ifindex, | 212 | void inet6_netconf_notify_devconf(struct net *net, int type, int ifindex, |
209 | struct ipv6_devconf *devconf); | 213 | struct ipv6_devconf *devconf); |
210 | 214 | ||
211 | /** | 215 | /** |
212 | * __in6_dev_get - get inet6_dev pointer from netdevice | 216 | * __in6_dev_get - get inet6_dev pointer from netdevice |
@@ -240,7 +244,7 @@ static inline struct inet6_dev *in6_dev_get(const struct net_device *dev) | |||
240 | return idev; | 244 | return idev; |
241 | } | 245 | } |
242 | 246 | ||
243 | extern void in6_dev_finish_destroy(struct inet6_dev *idev); | 247 | void in6_dev_finish_destroy(struct inet6_dev *idev); |
244 | 248 | ||
245 | static inline void in6_dev_put(struct inet6_dev *idev) | 249 | static inline void in6_dev_put(struct inet6_dev *idev) |
246 | { | 250 | { |
@@ -258,7 +262,7 @@ static inline void in6_dev_hold(struct inet6_dev *idev) | |||
258 | atomic_inc(&idev->refcnt); | 262 | atomic_inc(&idev->refcnt); |
259 | } | 263 | } |
260 | 264 | ||
261 | extern void inet6_ifa_finish_destroy(struct inet6_ifaddr *ifp); | 265 | void inet6_ifa_finish_destroy(struct inet6_ifaddr *ifp); |
262 | 266 | ||
263 | static inline void in6_ifa_put(struct inet6_ifaddr *ifp) | 267 | static inline void in6_ifa_put(struct inet6_ifaddr *ifp) |
264 | { | 268 | { |
@@ -340,8 +344,8 @@ static inline bool ipv6_addr_is_solict_mult(const struct in6_addr *addr) | |||
340 | } | 344 | } |
341 | 345 | ||
342 | #ifdef CONFIG_PROC_FS | 346 | #ifdef CONFIG_PROC_FS |
343 | extern int if6_proc_init(void); | 347 | int if6_proc_init(void); |
344 | extern void if6_proc_exit(void); | 348 | void if6_proc_exit(void); |
345 | #endif | 349 | #endif |
346 | 350 | ||
347 | #endif | 351 | #endif |