aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/fib_lookup.h
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/fib_lookup.h')
-rw-r--r--net/ipv4/fib_lookup.h27
1 files changed, 16 insertions, 11 deletions
diff --git a/net/ipv4/fib_lookup.h b/net/ipv4/fib_lookup.h
index 637b133973bd..af0f14aba169 100644
--- a/net/ipv4/fib_lookup.h
+++ b/net/ipv4/fib_lookup.h
@@ -10,24 +10,25 @@ struct fib_alias {
10 struct fib_info *fa_info; 10 struct fib_info *fa_info;
11 u8 fa_tos; 11 u8 fa_tos;
12 u8 fa_type; 12 u8 fa_type;
13 u8 fa_scope;
14 u8 fa_state; 13 u8 fa_state;
15#ifdef CONFIG_IP_FIB_TRIE
16 struct rcu_head rcu; 14 struct rcu_head rcu;
17#endif
18}; 15};
19 16
20#define FA_S_ACCESSED 0x01 17#define FA_S_ACCESSED 0x01
21 18
19/* Dont write on fa_state unless needed, to keep it shared on all cpus */
20static inline void fib_alias_accessed(struct fib_alias *fa)
21{
22 if (!(fa->fa_state & FA_S_ACCESSED))
23 fa->fa_state |= FA_S_ACCESSED;
24}
25
22/* Exported by fib_semantics.c */ 26/* Exported by fib_semantics.c */
23extern int fib_semantic_match(struct list_head *head,
24 const struct flowi *flp,
25 struct fib_result *res, int prefixlen);
26extern void fib_release_info(struct fib_info *); 27extern void fib_release_info(struct fib_info *);
27extern struct fib_info *fib_create_info(struct fib_config *cfg); 28extern struct fib_info *fib_create_info(struct fib_config *cfg);
28extern int fib_nh_match(struct fib_config *cfg, struct fib_info *fi); 29extern int fib_nh_match(struct fib_config *cfg, struct fib_info *fi);
29extern int fib_dump_info(struct sk_buff *skb, u32 pid, u32 seq, int event, 30extern int fib_dump_info(struct sk_buff *skb, u32 pid, u32 seq, int event,
30 u32 tb_id, u8 type, u8 scope, __be32 dst, 31 u32 tb_id, u8 type, __be32 dst,
31 int dst_len, u8 tos, struct fib_info *fi, 32 int dst_len, u8 tos, struct fib_info *fi,
32 unsigned int); 33 unsigned int);
33extern void rtmsg_fib(int event, __be32 key, struct fib_alias *fa, 34extern void rtmsg_fib(int event, __be32 key, struct fib_alias *fa,
@@ -42,11 +43,15 @@ extern int fib_detect_death(struct fib_info *fi, int order,
42static inline void fib_result_assign(struct fib_result *res, 43static inline void fib_result_assign(struct fib_result *res,
43 struct fib_info *fi) 44 struct fib_info *fi)
44{ 45{
45 if (res->fi != NULL) 46 /* we used to play games with refcounts, but we now use RCU */
46 fib_info_put(res->fi);
47 res->fi = fi; 47 res->fi = fi;
48 if (fi != NULL)
49 atomic_inc(&fi->fib_clntref);
50} 48}
51 49
50struct fib_prop {
51 int error;
52 u8 scope;
53};
54
55extern const struct fib_prop fib_props[RTN_MAX + 1];
56
52#endif /* _FIB_LOOKUP_H */ 57#endif /* _FIB_LOOKUP_H */