diff options
Diffstat (limited to 'include/net/rtnetlink.h')
-rw-r--r-- | include/net/rtnetlink.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h new file mode 100644 index 000000000000..3b3d4745618d --- /dev/null +++ b/include/net/rtnetlink.h | |||
@@ -0,0 +1,25 @@ | |||
1 | #ifndef __NET_RTNETLINK_H | ||
2 | #define __NET_RTNETLINK_H | ||
3 | |||
4 | #include <linux/rtnetlink.h> | ||
5 | #include <net/netlink.h> | ||
6 | |||
7 | typedef int (*rtnl_doit_func)(struct sk_buff *, struct nlmsghdr *, void *); | ||
8 | typedef int (*rtnl_dumpit_func)(struct sk_buff *, struct netlink_callback *); | ||
9 | |||
10 | extern int __rtnl_register(int protocol, int msgtype, | ||
11 | rtnl_doit_func, rtnl_dumpit_func); | ||
12 | extern void rtnl_register(int protocol, int msgtype, | ||
13 | rtnl_doit_func, rtnl_dumpit_func); | ||
14 | extern int rtnl_unregister(int protocol, int msgtype); | ||
15 | extern void rtnl_unregister_all(int protocol); | ||
16 | |||
17 | static inline int rtnl_msg_family(struct nlmsghdr *nlh) | ||
18 | { | ||
19 | if (nlmsg_len(nlh) >= sizeof(struct rtgenmsg)) | ||
20 | return ((struct rtgenmsg *) nlmsg_data(nlh))->rtgen_family; | ||
21 | else | ||
22 | return AF_UNSPEC; | ||
23 | } | ||
24 | |||
25 | #endif | ||