diff options
Diffstat (limited to 'include/net/ip_fib.h')
-rw-r--r-- | include/net/ip_fib.h | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h index 4d22fabc7719..c93f94edc610 100644 --- a/include/net/ip_fib.h +++ b/include/net/ip_fib.h | |||
@@ -144,18 +144,21 @@ struct fib_table { | |||
144 | struct hlist_node tb_hlist; | 144 | struct hlist_node tb_hlist; |
145 | u32 tb_id; | 145 | u32 tb_id; |
146 | int tb_default; | 146 | int tb_default; |
147 | int (*tb_lookup)(struct fib_table *tb, const struct flowi *flp, struct fib_result *res); | ||
148 | int (*tb_insert)(struct fib_table *, struct fib_config *); | ||
149 | int (*tb_delete)(struct fib_table *, struct fib_config *); | ||
150 | int (*tb_dump)(struct fib_table *table, struct sk_buff *skb, | ||
151 | struct netlink_callback *cb); | ||
152 | int (*tb_flush)(struct fib_table *table); | ||
153 | void (*tb_select_default)(struct fib_table *table, | ||
154 | const struct flowi *flp, struct fib_result *res); | ||
155 | |||
156 | unsigned char tb_data[0]; | 147 | unsigned char tb_data[0]; |
157 | }; | 148 | }; |
158 | 149 | ||
150 | extern int fib_table_lookup(struct fib_table *tb, const struct flowi *flp, | ||
151 | struct fib_result *res); | ||
152 | extern int fib_table_insert(struct fib_table *, struct fib_config *); | ||
153 | extern int fib_table_delete(struct fib_table *, struct fib_config *); | ||
154 | extern int fib_table_dump(struct fib_table *table, struct sk_buff *skb, | ||
155 | struct netlink_callback *cb); | ||
156 | extern int fib_table_flush(struct fib_table *table); | ||
157 | extern void fib_table_select_default(struct fib_table *table, | ||
158 | const struct flowi *flp, | ||
159 | struct fib_result *res); | ||
160 | |||
161 | |||
159 | #ifndef CONFIG_IP_MULTIPLE_TABLES | 162 | #ifndef CONFIG_IP_MULTIPLE_TABLES |
160 | 163 | ||
161 | #define TABLE_LOCAL_INDEX 0 | 164 | #define TABLE_LOCAL_INDEX 0 |
@@ -182,11 +185,11 @@ static inline int fib_lookup(struct net *net, const struct flowi *flp, | |||
182 | struct fib_table *table; | 185 | struct fib_table *table; |
183 | 186 | ||
184 | table = fib_get_table(net, RT_TABLE_LOCAL); | 187 | table = fib_get_table(net, RT_TABLE_LOCAL); |
185 | if (!table->tb_lookup(table, flp, res)) | 188 | if (!fib_table_lookup(table, flp, res)) |
186 | return 0; | 189 | return 0; |
187 | 190 | ||
188 | table = fib_get_table(net, RT_TABLE_MAIN); | 191 | table = fib_get_table(net, RT_TABLE_MAIN); |
189 | if (!table->tb_lookup(table, flp, res)) | 192 | if (!fib_table_lookup(table, flp, res)) |
190 | return 0; | 193 | return 0; |
191 | return -ENETUNREACH; | 194 | return -ENETUNREACH; |
192 | } | 195 | } |