]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - include/net/fib_rules.h
[NETLINK]: Use nlmsg_trim() where appropriate
[karo-tx-linux.git] / include / net / fib_rules.h
index 8e2f473d3e828123efd147624084845db7b6750a..d585ea9fa97d3887435e064922f5e65a62748851 100644 (file)
@@ -13,6 +13,8 @@ struct fib_rule
        atomic_t                refcnt;
        int                     ifindex;
        char                    ifname[IFNAMSIZ];
+       u32                     mark;
+       u32                     mark_mask;
        u32                     pref;
        u32                     flags;
        u32                     table;
@@ -32,6 +34,7 @@ struct fib_rules_ops
        int                     family;
        struct list_head        list;
        int                     rule_size;
+       int                     addr_size;
 
        int                     (*action)(struct fib_rule *,
                                          struct flowi *, int,
@@ -50,6 +53,7 @@ struct fib_rules_ops
                                        struct nlmsghdr *,
                                        struct fib_rule_hdr *);
        u32                     (*default_pref)(void);
+       size_t                  (*nlmsg_payload)(struct fib_rule *);
 
        int                     nlgroup;
        struct nla_policy       *policy;
@@ -57,6 +61,13 @@ struct fib_rules_ops
        struct module           *owner;
 };
 
+#define FRA_GENERIC_POLICY \
+       [FRA_IFNAME]    = { .type = NLA_STRING, .len = IFNAMSIZ - 1 }, \
+       [FRA_PRIORITY]  = { .type = NLA_U32 }, \
+       [FRA_FWMARK]    = { .type = NLA_U32 }, \
+       [FRA_FWMASK]    = { .type = NLA_U32 }, \
+       [FRA_TABLE]     = { .type = NLA_U32 }
+
 static inline void fib_rule_get(struct fib_rule *rule)
 {
        atomic_inc(&rule->refcnt);