diff options
Diffstat (limited to 'include/net/neighbour.h')
-rw-r--r-- | include/net/neighbour.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/include/net/neighbour.h b/include/net/neighbour.h index 062281872064..8bec0d69b270 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h | |||
@@ -38,7 +38,9 @@ struct neighbour; | |||
38 | 38 | ||
39 | struct neigh_parms | 39 | struct neigh_parms |
40 | { | 40 | { |
41 | #ifdef CONFIG_NET_NS | ||
41 | struct net *net; | 42 | struct net *net; |
43 | #endif | ||
42 | struct net_device *dev; | 44 | struct net_device *dev; |
43 | struct neigh_parms *next; | 45 | struct neigh_parms *next; |
44 | int (*neigh_setup)(struct neighbour *); | 46 | int (*neigh_setup)(struct neighbour *); |
@@ -131,7 +133,9 @@ struct neigh_ops | |||
131 | struct pneigh_entry | 133 | struct pneigh_entry |
132 | { | 134 | { |
133 | struct pneigh_entry *next; | 135 | struct pneigh_entry *next; |
136 | #ifdef CONFIG_NET_NS | ||
134 | struct net *net; | 137 | struct net *net; |
138 | #endif | ||
135 | struct net_device *dev; | 139 | struct net_device *dev; |
136 | u8 flags; | 140 | u8 flags; |
137 | u8 key[0]; | 141 | u8 key[0]; |
@@ -213,6 +217,17 @@ extern struct neighbour *neigh_event_ns(struct neigh_table *tbl, | |||
213 | 217 | ||
214 | extern struct neigh_parms *neigh_parms_alloc(struct net_device *dev, struct neigh_table *tbl); | 218 | extern struct neigh_parms *neigh_parms_alloc(struct net_device *dev, struct neigh_table *tbl); |
215 | extern void neigh_parms_release(struct neigh_table *tbl, struct neigh_parms *parms); | 219 | extern void neigh_parms_release(struct neigh_table *tbl, struct neigh_parms *parms); |
220 | |||
221 | static inline | ||
222 | struct net *neigh_parms_net(const struct neigh_parms *parms) | ||
223 | { | ||
224 | #ifdef CONFIG_NET_NS | ||
225 | return parms->net; | ||
226 | #else | ||
227 | return &init_net; | ||
228 | #endif | ||
229 | } | ||
230 | |||
216 | extern unsigned long neigh_rand_reach_time(unsigned long base); | 231 | extern unsigned long neigh_rand_reach_time(unsigned long base); |
217 | 232 | ||
218 | extern void pneigh_enqueue(struct neigh_table *tbl, struct neigh_parms *p, | 233 | extern void pneigh_enqueue(struct neigh_table *tbl, struct neigh_parms *p, |
@@ -220,6 +235,16 @@ extern void pneigh_enqueue(struct neigh_table *tbl, struct neigh_parms *p, | |||
220 | extern struct pneigh_entry *pneigh_lookup(struct neigh_table *tbl, struct net *net, const void *key, struct net_device *dev, int creat); | 235 | extern struct pneigh_entry *pneigh_lookup(struct neigh_table *tbl, struct net *net, const void *key, struct net_device *dev, int creat); |
221 | extern int pneigh_delete(struct neigh_table *tbl, struct net *net, const void *key, struct net_device *dev); | 236 | extern int pneigh_delete(struct neigh_table *tbl, struct net *net, const void *key, struct net_device *dev); |
222 | 237 | ||
238 | static inline | ||
239 | struct net *pneigh_net(const struct pneigh_entry *pneigh) | ||
240 | { | ||
241 | #ifdef CONFIG_NET_NS | ||
242 | return pneigh->net; | ||
243 | #else | ||
244 | return &init_net; | ||
245 | #endif | ||
246 | } | ||
247 | |||
223 | extern void neigh_app_ns(struct neighbour *n); | 248 | extern void neigh_app_ns(struct neighbour *n); |
224 | extern void neigh_for_each(struct neigh_table *tbl, void (*cb)(struct neighbour *, void *), void *cookie); | 249 | extern void neigh_for_each(struct neigh_table *tbl, void (*cb)(struct neighbour *, void *), void *cookie); |
225 | extern void __neigh_for_each_release(struct neigh_table *tbl, int (*cb)(struct neighbour *)); | 250 | extern void __neigh_for_each_release(struct neigh_table *tbl, int (*cb)(struct neighbour *)); |