diff options
author | Thomas Graf <tgraf@suug.ch> | 2007-03-22 14:48:11 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 01:27:04 -0400 |
commit | e284986385b6420a5f30f2dcd743512bbe1a3202 (patch) | |
tree | aee0d30b618ada57371fddfcaeb47bbd767e16e3 /include | |
parent | 30833ffead66e1f0052150a51db0b45151189ac1 (diff) |
[RTNL]: Message handler registration interface
This patch adds a new interface to register rtnetlink message
handlers replacing the exported rtnl_links[] array which
required many message handlers to be exported unnecessarly.
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/linux/rtnetlink.h | 7 | ||||
-rw-r--r-- | include/net/rtnetlink.h | 18 |
2 files changed, 18 insertions, 7 deletions
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index 3a4cb242ecd2..1fae30af91f3 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
@@ -574,13 +574,6 @@ extern int rtattr_parse(struct rtattr *tb[], int maxattr, struct rtattr *rta, in | |||
574 | #define rtattr_parse_nested(tb, max, rta) \ | 574 | #define rtattr_parse_nested(tb, max, rta) \ |
575 | rtattr_parse((tb), (max), RTA_DATA((rta)), RTA_PAYLOAD((rta))) | 575 | rtattr_parse((tb), (max), RTA_DATA((rta)), RTA_PAYLOAD((rta))) |
576 | 576 | ||
577 | struct rtnetlink_link | ||
578 | { | ||
579 | int (*doit)(struct sk_buff *, struct nlmsghdr*, void *attr); | ||
580 | int (*dumpit)(struct sk_buff *, struct netlink_callback *cb); | ||
581 | }; | ||
582 | |||
583 | extern struct rtnetlink_link * rtnetlink_links[NPROTO]; | ||
584 | extern int rtnetlink_send(struct sk_buff *skb, u32 pid, u32 group, int echo); | 577 | extern int rtnetlink_send(struct sk_buff *skb, u32 pid, u32 group, int echo); |
585 | extern int rtnl_unicast(struct sk_buff *skb, u32 pid); | 578 | extern int rtnl_unicast(struct sk_buff *skb, u32 pid); |
586 | extern int rtnl_notify(struct sk_buff *skb, u32 pid, u32 group, | 579 | extern int rtnl_notify(struct sk_buff *skb, u32 pid, u32 group, |
diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h new file mode 100644 index 000000000000..dce7072bd28c --- /dev/null +++ b/include/net/rtnetlink.h | |||
@@ -0,0 +1,18 @@ | |||
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 | extern int rtnl_dump_all(struct sk_buff *skb, struct netlink_callback *cb); | ||
17 | |||
18 | #endif | ||