[PATCH 09/12] [DECNet]: Use rtnl registration interface
Signed-off-by: Thomas Graf [EMAIL PROTECTED] Index: net-2.6.22/include/net/dn_fib.h === --- net-2.6.22.orig/include/net/dn_fib.h2007-03-22 13:23:13.0 +0100 +++ net-2.6.22/include/net/dn_fib.h 2007-03-22 13:24:01.0 +0100 @@ -148,17 +148,8 @@ extern void dn_fib_rules_cleanup(void); extern unsigned dnet_addr_type(__le16 addr); extern int dn_fib_lookup(struct flowi *fl, struct dn_fib_res *res); -/* - * rtnetlink interface - */ -extern int dn_fib_rtm_delroute(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg); -extern int dn_fib_rtm_newroute(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg); extern int dn_fib_dump(struct sk_buff *skb, struct netlink_callback *cb); -extern int dn_fib_rtm_delrule(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg); -extern int dn_fib_rtm_newrule(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg); -extern int dn_fib_dump_rules(struct sk_buff *skb, struct netlink_callback *cb); - extern void dn_fib_free_info(struct dn_fib_info *fi); static inline void dn_fib_info_put(struct dn_fib_info *fi) Index: net-2.6.22/net/decnet/dn_rules.c === --- net-2.6.22.orig/net/decnet/dn_rules.c 2007-03-22 13:23:13.0 +0100 +++ net-2.6.22/net/decnet/dn_rules.c2007-03-22 13:24:01.0 +0100 @@ -241,7 +241,7 @@ static u32 dn_fib_rule_default_pref(void return 0; } -int dn_fib_dump_rules(struct sk_buff *skb, struct netlink_callback *cb) +static int dn_fib_dump_rules(struct sk_buff *skb, struct netlink_callback *cb) { return fib_rules_dump(skb, cb, AF_DECnet); } @@ -265,10 +265,12 @@ void __init dn_fib_rules_init(void) { list_add_tail(default_rule.common.list, dn_fib_rules); fib_rules_register(dn_fib_rules_ops); + rtnl_register(PF_DECnet, RTM_GETRULE, NULL, dn_fib_dump_rules); } void __exit dn_fib_rules_cleanup(void) { + rtnl_unregister(PF_DECnet, RTM_GETRULE); fib_rules_unregister(dn_fib_rules_ops); } Index: net-2.6.22/net/decnet/dn_fib.c === --- net-2.6.22.orig/net/decnet/dn_fib.c 2007-03-22 13:23:13.0 +0100 +++ net-2.6.22/net/decnet/dn_fib.c 2007-03-22 13:24:01.0 +0100 @@ -501,7 +501,7 @@ static int dn_fib_check_attr(struct rtms return 0; } -int dn_fib_rtm_delroute(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) +static int dn_fib_rtm_delroute(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) { struct dn_fib_table *tb; struct rtattr **rta = arg; @@ -517,7 +517,7 @@ int dn_fib_rtm_delroute(struct sk_buff * return -ESRCH; } -int dn_fib_rtm_newroute(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) +static int dn_fib_rtm_newroute(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) { struct dn_fib_table *tb; struct rtattr **rta = arg; @@ -745,11 +745,13 @@ void __exit dn_fib_cleanup(void) void __init dn_fib_init(void) { - dn_fib_table_init(); dn_fib_rules_init(); register_dnaddr_notifier(dn_fib_dnaddr_notifier); + + rtnl_register(PF_DECnet, RTM_NEWROUTE, dn_fib_rtm_newroute, NULL); + rtnl_register(PF_DECnet, RTM_DELROUTE, dn_fib_rtm_delroute, NULL); } Index: net-2.6.22/net/decnet/af_decnet.c === --- net-2.6.22.orig/net/decnet/af_decnet.c 2007-03-22 13:23:13.0 +0100 +++ net-2.6.22/net/decnet/af_decnet.c 2007-03-22 13:24:01.0 +0100 @@ -2413,6 +2413,7 @@ module_init(decnet_init); static void __exit decnet_exit(void) { sock_unregister(AF_DECnet); + rtnl_unregister_all(PF_DECnet); dev_remove_pack(dn_dix_packet_type); dn_unregister_sysctl(); Index: net-2.6.22/net/decnet/dn_dev.c === --- net-2.6.22.orig/net/decnet/dn_dev.c 2007-03-22 13:23:13.0 +0100 +++ net-2.6.22/net/decnet/dn_dev.c 2007-03-22 13:24:01.0 +0100 @@ -1447,24 +1447,6 @@ static const struct file_operations dn_d #endif /* CONFIG_PROC_FS */ -static struct rtnetlink_link dnet_rtnetlink_table[RTM_NR_MSGTYPES] = -{ - [RTM_NEWADDR - RTM_BASE] = { .doit = dn_nl_newaddr,}, - [RTM_DELADDR - RTM_BASE] = { .doit = dn_nl_deladdr,}, - [RTM_GETADDR - RTM_BASE] = { .dumpit = dn_nl_dump_ifaddr,}, -#ifdef CONFIG_DECNET_ROUTER - [RTM_NEWROUTE - RTM_BASE] = { .doit = dn_fib_rtm_newroute, }, - [RTM_DELROUTE - RTM_BASE] = { .doit = dn_fib_rtm_delroute, }, - [RTM_GETROUTE - RTM_BASE] = { .doit = dn_cache_getroute, - .dumpit = dn_fib_dump, }, - [RTM_GETRULE - RTM_BASE] = { .dumpit = dn_fib_dump_rules,}, -#else - [RTM_GETROUTE - RTM_BASE] = { .doit
Re: [PATCH 09/12] [DECNet]: Use rtnl registration interface
Hi, On Thu, Mar 22, 2007 at 02:00:04PM +0100, Thomas Graf wrote: Signed-off-by: Thomas Graf [EMAIL PROTECTED] Acked-by: Steven Whitehouse [EMAIL PROTECTED] for all the DECnet bits also the DECnet changes in the other patch I saw from you relating to the routing rules, Steve. - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 09/12] [DECNet]: Use rtnl registration interface
From: Steven Whitehouse [EMAIL PROTECTED] Date: Thu, 22 Mar 2007 13:07:54 + Hi, On Thu, Mar 22, 2007 at 02:00:04PM +0100, Thomas Graf wrote: Signed-off-by: Thomas Graf [EMAIL PROTECTED] Acked-by: Steven Whitehouse [EMAIL PROTECTED] for all the DECnet bits also the DECnet changes in the other patch I saw from you relating to the routing rules, Thanks for helping review Steven. - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 09/12] [DECNet]: Use rtnl registration interface
Signed-off-by: Thomas Graf [EMAIL PROTECTED] Index: net-2.6.22/include/net/dn_fib.h === --- net-2.6.22.orig/include/net/dn_fib.h2007-03-20 23:53:20.0 +0100 +++ net-2.6.22/include/net/dn_fib.h 2007-03-21 00:52:38.0 +0100 @@ -148,17 +148,8 @@ extern void dn_fib_rules_cleanup(void); extern unsigned dnet_addr_type(__le16 addr); extern int dn_fib_lookup(struct flowi *fl, struct dn_fib_res *res); -/* - * rtnetlink interface - */ -extern int dn_fib_rtm_delroute(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg); -extern int dn_fib_rtm_newroute(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg); extern int dn_fib_dump(struct sk_buff *skb, struct netlink_callback *cb); -extern int dn_fib_rtm_delrule(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg); -extern int dn_fib_rtm_newrule(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg); -extern int dn_fib_dump_rules(struct sk_buff *skb, struct netlink_callback *cb); - extern void dn_fib_free_info(struct dn_fib_info *fi); static inline void dn_fib_info_put(struct dn_fib_info *fi) Index: net-2.6.22/net/decnet/dn_rules.c === --- net-2.6.22.orig/net/decnet/dn_rules.c 2007-03-20 23:53:21.0 +0100 +++ net-2.6.22/net/decnet/dn_rules.c2007-03-21 00:52:38.0 +0100 @@ -241,7 +241,7 @@ static u32 dn_fib_rule_default_pref(void return 0; } -int dn_fib_dump_rules(struct sk_buff *skb, struct netlink_callback *cb) +static int nl_dn_rules_dump(struct sk_buff *skb, struct netlink_callback *cb) { return fib_rules_dump(skb, cb, AF_DECnet); } @@ -265,10 +265,12 @@ void __init dn_fib_rules_init(void) { list_add_tail(default_rule.common.list, dn_fib_rules); fib_rules_register(dn_fib_rules_ops); + rtnl_register(PF_DECnet, RTM_GETRULE, NULL, nl_dn_rules_dump); } void __exit dn_fib_rules_cleanup(void) { + rtnl_unregister(PF_DECnet, RTM_GETRULE); fib_rules_unregister(dn_fib_rules_ops); } Index: net-2.6.22/net/decnet/dn_fib.c === --- net-2.6.22.orig/net/decnet/dn_fib.c 2007-03-20 23:53:20.0 +0100 +++ net-2.6.22/net/decnet/dn_fib.c 2007-03-21 00:52:38.0 +0100 @@ -501,7 +501,7 @@ static int dn_fib_check_attr(struct rtms return 0; } -int dn_fib_rtm_delroute(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) +int nl_route_del(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) { struct dn_fib_table *tb; struct rtattr **rta = arg; @@ -517,7 +517,7 @@ int dn_fib_rtm_delroute(struct sk_buff * return -ESRCH; } -int dn_fib_rtm_newroute(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) +static int nl_route_new(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) { struct dn_fib_table *tb; struct rtattr **rta = arg; @@ -745,11 +745,13 @@ void __exit dn_fib_cleanup(void) void __init dn_fib_init(void) { - dn_fib_table_init(); dn_fib_rules_init(); register_dnaddr_notifier(dn_fib_dnaddr_notifier); + + rtnl_register(PF_DECnet, RTM_NEWROUTE, nl_route_new, NULL); + rtnl_register(PF_DECnet, RTM_DELROUTE, nl_route_del, NULL); } Index: net-2.6.22/net/decnet/af_decnet.c === --- net-2.6.22.orig/net/decnet/af_decnet.c 2007-03-20 23:53:20.0 +0100 +++ net-2.6.22/net/decnet/af_decnet.c 2007-03-21 00:52:38.0 +0100 @@ -2413,6 +2413,7 @@ module_init(decnet_init); static void __exit decnet_exit(void) { sock_unregister(AF_DECnet); + rtnl_unregister_all(PF_DECnet); dev_remove_pack(dn_dix_packet_type); dn_unregister_sysctl(); Index: net-2.6.22/net/decnet/dn_dev.c === --- net-2.6.22.orig/net/decnet/dn_dev.c 2007-03-20 23:53:20.0 +0100 +++ net-2.6.22/net/decnet/dn_dev.c 2007-03-21 00:52:38.0 +0100 @@ -645,7 +645,7 @@ static struct nla_policy dn_ifa_policy[I .len = IFNAMSIZ - 1 }, }; -static int dn_nl_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) +static int nl_addr_del(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) { struct nlattr *tb[IFA_MAX+1]; struct dn_dev *dn_db; @@ -677,7 +677,7 @@ errout: return err; } -static int dn_nl_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) +static int nl_addr_new(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) { struct nlattr *tb[IFA_MAX+1]; struct net_device *dev; @@ -789,7 +789,7 @@ errout: rtnl_set_sk_err(RTNLGRP_DECnet_IFADDR, err); } -static int dn_nl_dump_ifaddr(struct sk_buff *skb, struct netlink_callback *cb) +static int nl_addr_dump(struct sk_buff *skb, struct netlink_callback