aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/fib_rules.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/fib_rules.h')
-rw-r--r--include/net/fib_rules.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/include/net/fib_rules.h b/include/net/fib_rules.h
index ca4b2e840078..c07ac9650ebc 100644
--- a/include/net/fib_rules.h
+++ b/include/net/fib_rules.h
@@ -7,12 +7,11 @@
7#include <net/flow.h> 7#include <net/flow.h>
8#include <net/rtnetlink.h> 8#include <net/rtnetlink.h>
9 9
10struct fib_rule 10struct fib_rule {
11{
12 struct list_head list; 11 struct list_head list;
13 atomic_t refcnt; 12 atomic_t refcnt;
14 int ifindex; 13 int iifindex;
15 char ifname[IFNAMSIZ]; 14 int oifindex;
16 u32 mark; 15 u32 mark;
17 u32 mark_mask; 16 u32 mark_mask;
18 u32 pref; 17 u32 pref;
@@ -21,19 +20,19 @@ struct fib_rule
21 u8 action; 20 u8 action;
22 u32 target; 21 u32 target;
23 struct fib_rule * ctarget; 22 struct fib_rule * ctarget;
23 char iifname[IFNAMSIZ];
24 char oifname[IFNAMSIZ];
24 struct rcu_head rcu; 25 struct rcu_head rcu;
25 struct net * fr_net; 26 struct net * fr_net;
26}; 27};
27 28
28struct fib_lookup_arg 29struct fib_lookup_arg {
29{
30 void *lookup_ptr; 30 void *lookup_ptr;
31 void *result; 31 void *result;
32 struct fib_rule *rule; 32 struct fib_rule *rule;
33}; 33};
34 34
35struct fib_rules_ops 35struct fib_rules_ops {
36{
37 int family; 36 int family;
38 struct list_head list; 37 struct list_head list;
39 int rule_size; 38 int rule_size;
@@ -67,10 +66,12 @@ struct fib_rules_ops
67 struct list_head rules_list; 66 struct list_head rules_list;
68 struct module *owner; 67 struct module *owner;
69 struct net *fro_net; 68 struct net *fro_net;
69 struct rcu_head rcu;
70}; 70};
71 71
72#define FRA_GENERIC_POLICY \ 72#define FRA_GENERIC_POLICY \
73 [FRA_IFNAME] = { .type = NLA_STRING, .len = IFNAMSIZ - 1 }, \ 73 [FRA_IIFNAME] = { .type = NLA_STRING, .len = IFNAMSIZ - 1 }, \
74 [FRA_OIFNAME] = { .type = NLA_STRING, .len = IFNAMSIZ - 1 }, \
74 [FRA_PRIORITY] = { .type = NLA_U32 }, \ 75 [FRA_PRIORITY] = { .type = NLA_U32 }, \
75 [FRA_FWMARK] = { .type = NLA_U32 }, \ 76 [FRA_FWMARK] = { .type = NLA_U32 }, \
76 [FRA_FWMASK] = { .type = NLA_U32 }, \ 77 [FRA_FWMASK] = { .type = NLA_U32 }, \
@@ -102,7 +103,7 @@ static inline u32 frh_get_table(struct fib_rule_hdr *frh, struct nlattr **nla)
102 return frh->table; 103 return frh->table;
103} 104}
104 105
105extern int fib_rules_register(struct fib_rules_ops *); 106extern struct fib_rules_ops *fib_rules_register(struct fib_rules_ops *, struct net *);
106extern void fib_rules_unregister(struct fib_rules_ops *); 107extern void fib_rules_unregister(struct fib_rules_ops *);
107extern void fib_rules_cleanup_ops(struct fib_rules_ops *); 108extern void fib_rules_cleanup_ops(struct fib_rules_ops *);
108 109