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