aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/addrconf.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/addrconf.h')
-rw-r--r--include/net/addrconf.h180
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
56extern int addrconf_init(void); 56int addrconf_init(void);
57extern void addrconf_cleanup(void); 57void addrconf_cleanup(void);
58 58
59extern int addrconf_add_ifaddr(struct net *net, 59int addrconf_add_ifaddr(struct net *net, void __user *arg);
60 void __user *arg); 60int addrconf_del_ifaddr(struct net *net, void __user *arg);
61extern int addrconf_del_ifaddr(struct net *net, 61int addrconf_set_dstaddr(struct net *net, void __user *arg);
62 void __user *arg);
63extern int addrconf_set_dstaddr(struct net *net,
64 void __user *arg);
65 62
66extern int ipv6_chk_addr(struct net *net, 63int 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)
72extern int ipv6_chk_home_addr(struct net *net, 67int ipv6_chk_home_addr(struct net *net, const struct in6_addr *addr);
73 const struct in6_addr *addr);
74#endif 68#endif
75 69
76extern int ipv6_chk_prefix(const struct in6_addr *addr, 70int ipv6_chk_prefix(const struct in6_addr *addr, struct net_device *dev);
77 struct net_device *dev); 71
78 72struct inet6_ifaddr *ipv6_get_ifaddr(struct net *net,
79extern 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); 76int ipv6_dev_get_saddr(struct net *net, const struct net_device *dev,
83 77 const struct in6_addr *daddr, unsigned int srcprefs,
84extern int ipv6_dev_get_saddr(struct net *net, 78 struct in6_addr *saddr);
85 const struct net_device *dev, 79int __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, 81int ipv6_get_lladdr(struct net_device *dev, struct in6_addr *addr,
88 struct in6_addr *saddr); 82 unsigned char banned_flags);
89extern int __ipv6_get_lladdr(struct inet6_dev *idev, 83int ipv6_rcv_saddr_equal(const struct sock *sk, const struct sock *sk2);
90 struct in6_addr *addr, 84void addrconf_join_solict(struct net_device *dev, const struct in6_addr *addr);
91 unsigned char banned_flags); 85void addrconf_leave_solict(struct inet6_dev *idev, const struct in6_addr *addr);
92extern int ipv6_get_lladdr(struct net_device *dev,
93 struct in6_addr *addr,
94 unsigned char banned_flags);
95extern int ipv6_rcv_saddr_equal(const struct sock *sk,
96 const struct sock *sk2);
97extern void addrconf_join_solict(struct net_device *dev,
98 const struct in6_addr *addr);
99extern void addrconf_leave_solict(struct inet6_dev *idev,
100 const struct in6_addr *addr);
101 86
102static inline unsigned long addrconf_timeout_fixup(u32 timeout, 87static 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 */
127extern int ipv6_addr_label_init(void); 112int ipv6_addr_label_init(void);
128extern void ipv6_addr_label_cleanup(void); 113void ipv6_addr_label_cleanup(void);
129extern void ipv6_addr_label_rtnl_register(void); 114void ipv6_addr_label_rtnl_register(void);
130extern u32 ipv6_addr_label(struct net *net, 115u32 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 */
137extern int ipv6_sock_mc_join(struct sock *sk, int ifindex, 121int ipv6_sock_mc_join(struct sock *sk, int ifindex,
138 const struct in6_addr *addr); 122 const struct in6_addr *addr);
139extern int ipv6_sock_mc_drop(struct sock *sk, int ifindex, 123int ipv6_sock_mc_drop(struct sock *sk, int ifindex,
140 const struct in6_addr *addr); 124 const struct in6_addr *addr);
141extern void ipv6_sock_mc_close(struct sock *sk); 125void ipv6_sock_mc_close(struct sock *sk);
142extern bool inet6_mc_check(struct sock *sk, 126bool 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 129int ipv6_dev_mc_inc(struct net_device *dev, const struct in6_addr *addr);
146extern int ipv6_dev_mc_inc(struct net_device *dev, const struct in6_addr *addr); 130int __ipv6_dev_mc_dec(struct inet6_dev *idev, const struct in6_addr *addr);
147extern int __ipv6_dev_mc_dec(struct inet6_dev *idev, const struct in6_addr *addr); 131int ipv6_dev_mc_dec(struct net_device *dev, const struct in6_addr *addr);
148extern int ipv6_dev_mc_dec(struct net_device *dev, const struct in6_addr *addr); 132void ipv6_mc_up(struct inet6_dev *idev);
149extern void ipv6_mc_up(struct inet6_dev *idev); 133void ipv6_mc_down(struct inet6_dev *idev);
150extern void ipv6_mc_down(struct inet6_dev *idev); 134void ipv6_mc_unmap(struct inet6_dev *idev);
151extern void ipv6_mc_unmap(struct inet6_dev *idev); 135void ipv6_mc_remap(struct inet6_dev *idev);
152extern void ipv6_mc_remap(struct inet6_dev *idev); 136void ipv6_mc_init_dev(struct inet6_dev *idev);
153extern void ipv6_mc_init_dev(struct inet6_dev *idev); 137void ipv6_mc_destroy_dev(struct inet6_dev *idev);
154extern void ipv6_mc_destroy_dev(struct inet6_dev *idev); 138void addrconf_dad_failure(struct inet6_ifaddr *ifp);
155extern void addrconf_dad_failure(struct inet6_ifaddr *ifp); 139
156 140bool ipv6_chk_mcast_addr(struct net_device *dev, const struct in6_addr *group,
157extern 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); 143void ipv6_mc_dad_complete(struct inet6_dev *idev);
160 144
161extern 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 */
148struct 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};
162extern 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
187extern void addrconf_prefix_rcv(struct net_device *dev, 189void 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 */
193extern int ipv6_sock_ac_join(struct sock *sk,int ifindex, const struct in6_addr *addr); 195int ipv6_sock_ac_join(struct sock *sk, int ifindex,
194extern int ipv6_sock_ac_drop(struct sock *sk,int ifindex, const struct in6_addr *addr); 196 const struct in6_addr *addr);
195extern void ipv6_sock_ac_close(struct sock *sk); 197int ipv6_sock_ac_drop(struct sock *sk, int ifindex,
196 198 const struct in6_addr *addr);
197extern int ipv6_dev_ac_inc(struct net_device *dev, const struct in6_addr *addr); 199void ipv6_sock_ac_close(struct sock *sk);
198extern int __ipv6_dev_ac_dec(struct inet6_dev *idev, const struct in6_addr *addr); 200
199extern bool ipv6_chk_acast_addr(struct net *net, struct net_device *dev, 201int ipv6_dev_ac_inc(struct net_device *dev, const struct in6_addr *addr);
202int __ipv6_dev_ac_dec(struct inet6_dev *idev, const struct in6_addr *addr);
203bool 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 */
204extern int register_inet6addr_notifier(struct notifier_block *nb); 208int register_inet6addr_notifier(struct notifier_block *nb);
205extern int unregister_inet6addr_notifier(struct notifier_block *nb); 209int unregister_inet6addr_notifier(struct notifier_block *nb);
206extern int inet6addr_notifier_call_chain(unsigned long val, void *v); 210int inet6addr_notifier_call_chain(unsigned long val, void *v);
207 211
208extern void inet6_netconf_notify_devconf(struct net *net, int type, int ifindex, 212void 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
243extern void in6_dev_finish_destroy(struct inet6_dev *idev); 247void in6_dev_finish_destroy(struct inet6_dev *idev);
244 248
245static inline void in6_dev_put(struct inet6_dev *idev) 249static 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
261extern void inet6_ifa_finish_destroy(struct inet6_ifaddr *ifp); 265void inet6_ifa_finish_destroy(struct inet6_ifaddr *ifp);
262 266
263static inline void in6_ifa_put(struct inet6_ifaddr *ifp) 267static 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
343extern int if6_proc_init(void); 347int if6_proc_init(void);
344extern void if6_proc_exit(void); 348void if6_proc_exit(void);
345#endif 349#endif
346 350
347#endif 351#endif