summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorThomas Graf <tgraf@suug.ch>2007-03-25 23:24:24 -0700
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-25 22:27:17 -0700
commitc454673da7c1d6533f40ec2f788023df9af56ebf (patch)
tree004d329e049f3bdef09ff20623e24cba9f1fac12 /include
parent687ad8cc640fd1f1619cc44a9ab274dabd48c758 (diff)
[NET] rules: Unified rules dumping
Implements a unified, protocol independant rules dumping function which is capable of both, dumping a specific protocol family or all of them. This speeds up dumping as less lookups are required. Signed-off-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/net/fib_rules.h3
-rw-r--r--include/net/rtnetlink.h8
2 files changed, 8 insertions, 3 deletions
diff --git a/include/net/fib_rules.h b/include/net/fib_rules.h
index b2b9ccdf32d6..ff3029fe9656 100644
--- a/include/net/fib_rules.h
+++ b/include/net/fib_rules.h
@@ -98,7 +98,4 @@ extern int fib_rules_unregister(struct fib_rules_ops *);
extern int fib_rules_lookup(struct fib_rules_ops *,
struct flowi *, int flags,
struct fib_lookup_arg *);
-
-extern int fib_rules_dump(struct sk_buff *,
- struct netlink_callback *, int);
#endif
diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h
index dce7072bd28c..086fa9e89509 100644
--- a/include/net/rtnetlink.h
+++ b/include/net/rtnetlink.h
@@ -15,4 +15,12 @@ extern int rtnl_unregister(int protocol, int msgtype);
extern void rtnl_unregister_all(int protocol);
extern int rtnl_dump_all(struct sk_buff *skb, struct netlink_callback *cb);
+static inline int rtnl_msg_family(struct nlmsghdr *nlh)
+{
+ if (nlmsg_len(nlh) >= sizeof(struct rtgenmsg))
+ return ((struct rtgenmsg *) nlmsg_data(nlh))->rtgen_family;
+ else
+ return AF_UNSPEC;
+}
+
#endif