Commit a8731cbf authored by Steven Whitehouse's avatar Steven Whitehouse Committed by David S. Miller

[DECNET]: Covert rules to use generic code

This patch converts the DECnet rules code to use the generic
rules system created by Thomas Graf <tgraf@suug.ch>.
Signed-off-by: default avatarSteven Whitehouse <steve@chygwyn.com>
Acked-by: default avatarThomas Graf <tgraf@suug.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8f491069
...@@ -534,7 +534,8 @@ enum rtnetlink_groups { ...@@ -534,7 +534,8 @@ enum rtnetlink_groups {
RTNLGRP_NOP2, RTNLGRP_NOP2,
RTNLGRP_DECnet_ROUTE, RTNLGRP_DECnet_ROUTE,
#define RTNLGRP_DECnet_ROUTE RTNLGRP_DECnet_ROUTE #define RTNLGRP_DECnet_ROUTE RTNLGRP_DECnet_ROUTE
RTNLGRP_NOP3, RTNLGRP_DECnet_RULE,
#define RTNLGRP_DECnet_RULE RTNLGRP_DECnet_RULE
RTNLGRP_NOP4, RTNLGRP_NOP4,
RTNLGRP_IPV6_PREFIX, RTNLGRP_IPV6_PREFIX,
#define RTNLGRP_IPV6_PREFIX RTNLGRP_IPV6_PREFIX #define RTNLGRP_IPV6_PREFIX RTNLGRP_IPV6_PREFIX
......
...@@ -22,7 +22,7 @@ struct dn_kern_rta ...@@ -22,7 +22,7 @@ struct dn_kern_rta
}; };
struct dn_fib_res { struct dn_fib_res {
struct dn_fib_rule *r; struct fib_rule *r;
struct dn_fib_info *fi; struct dn_fib_info *fi;
unsigned char prefixlen; unsigned char prefixlen;
unsigned char nh_sel; unsigned char nh_sel;
...@@ -147,10 +147,8 @@ extern void dn_fib_table_cleanup(void); ...@@ -147,10 +147,8 @@ extern void dn_fib_table_cleanup(void);
*/ */
extern void dn_fib_rules_init(void); extern void dn_fib_rules_init(void);
extern void dn_fib_rules_cleanup(void); extern void dn_fib_rules_cleanup(void);
extern void dn_fib_rule_put(struct dn_fib_rule *);
extern __le16 dn_fib_rules_policy(__le16 saddr, struct dn_fib_res *res, unsigned *flags);
extern unsigned dnet_addr_type(__le16 addr); extern unsigned dnet_addr_type(__le16 addr);
extern int dn_fib_lookup(const struct flowi *fl, struct dn_fib_res *res); extern int dn_fib_lookup(struct flowi *fl, struct dn_fib_res *res);
/* /*
* rtnetlink interface * rtnetlink interface
...@@ -176,7 +174,7 @@ static inline void dn_fib_res_put(struct dn_fib_res *res) ...@@ -176,7 +174,7 @@ static inline void dn_fib_res_put(struct dn_fib_res *res)
if (res->fi) if (res->fi)
dn_fib_info_put(res->fi); dn_fib_info_put(res->fi);
if (res->r) if (res->r)
dn_fib_rule_put(res->r); fib_rule_put(res->r);
} }
extern struct dn_fib_table *dn_fib_tables[]; extern struct dn_fib_table *dn_fib_tables[];
......
...@@ -27,6 +27,7 @@ config DECNET ...@@ -27,6 +27,7 @@ config DECNET
config DECNET_ROUTER config DECNET_ROUTER
bool "DECnet: router support (EXPERIMENTAL)" bool "DECnet: router support (EXPERIMENTAL)"
depends on DECNET && EXPERIMENTAL depends on DECNET && EXPERIMENTAL
select FIB_RULES
---help--- ---help---
Add support for turning your DECnet Endnode into a level 1 or 2 Add support for turning your DECnet Endnode into a level 1 or 2
router. This is an experimental, but functional option. If you router. This is an experimental, but functional option. If you
......
...@@ -130,6 +130,7 @@ Version 0.0.6 2.1.110 07-aug-98 Eduardo Marcelo Serrat ...@@ -130,6 +130,7 @@ Version 0.0.6 2.1.110 07-aug-98 Eduardo Marcelo Serrat
#include <linux/poll.h> #include <linux/poll.h>
#include <net/neighbour.h> #include <net/neighbour.h>
#include <net/dst.h> #include <net/dst.h>
#include <net/fib_rules.h>
#include <net/dn.h> #include <net/dn.h>
#include <net/dn_nsp.h> #include <net/dn_nsp.h>
#include <net/dn_dev.h> #include <net/dn_dev.h>
......
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
#include <net/neighbour.h> #include <net/neighbour.h>
#include <net/dst.h> #include <net/dst.h>
#include <net/flow.h> #include <net/flow.h>
#include <net/fib_rules.h>
#include <net/dn.h> #include <net/dn.h>
#include <net/dn_dev.h> #include <net/dn_dev.h>
#include <net/dn_route.h> #include <net/dn_route.h>
...@@ -1418,8 +1419,6 @@ static struct rtnetlink_link dnet_rtnetlink_table[RTM_NR_MSGTYPES] = ...@@ -1418,8 +1419,6 @@ static struct rtnetlink_link dnet_rtnetlink_table[RTM_NR_MSGTYPES] =
[RTM_DELROUTE - RTM_BASE] = { .doit = dn_fib_rtm_delroute, }, [RTM_DELROUTE - RTM_BASE] = { .doit = dn_fib_rtm_delroute, },
[RTM_GETROUTE - RTM_BASE] = { .doit = dn_cache_getroute, [RTM_GETROUTE - RTM_BASE] = { .doit = dn_cache_getroute,
.dumpit = dn_fib_dump, }, .dumpit = dn_fib_dump, },
[RTM_NEWRULE - RTM_BASE] = { .doit = dn_fib_rtm_newrule, },
[RTM_DELRULE - RTM_BASE] = { .doit = dn_fib_rtm_delrule, },
[RTM_GETRULE - RTM_BASE] = { .dumpit = dn_fib_dump_rules, }, [RTM_GETRULE - RTM_BASE] = { .dumpit = dn_fib_dump_rules, },
#else #else
[RTM_GETROUTE - RTM_BASE] = { .doit = dn_cache_getroute, [RTM_GETROUTE - RTM_BASE] = { .doit = dn_cache_getroute,
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <net/neighbour.h> #include <net/neighbour.h>
#include <net/dst.h> #include <net/dst.h>
#include <net/flow.h> #include <net/flow.h>
#include <net/fib_rules.h>
#include <net/dn.h> #include <net/dn.h>
#include <net/dn_route.h> #include <net/dn_route.h>
#include <net/dn_fib.h> #include <net/dn_fib.h>
......
...@@ -80,6 +80,7 @@ ...@@ -80,6 +80,7 @@
#include <net/neighbour.h> #include <net/neighbour.h>
#include <net/dst.h> #include <net/dst.h>
#include <net/flow.h> #include <net/flow.h>
#include <net/fib_rules.h>
#include <net/dn.h> #include <net/dn.h>
#include <net/dn_dev.h> #include <net/dn_dev.h>
#include <net/dn_nsp.h> #include <net/dn_nsp.h>
...@@ -1284,7 +1285,7 @@ static int dn_route_input_slow(struct sk_buff *skb) ...@@ -1284,7 +1285,7 @@ static int dn_route_input_slow(struct sk_buff *skb)
dev_hold(out_dev); dev_hold(out_dev);
if (res.r) if (res.r)
src_map = dn_fib_rules_policy(fl.fld_src, &res, &flags); src_map = fl.fld_src; /* no NAT support for now */
gateway = DN_FIB_RES_GW(res); gateway = DN_FIB_RES_GW(res);
if (res.type == RTN_NAT) { if (res.type == RTN_NAT) {
......
This diff is collapsed.
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <net/neighbour.h> #include <net/neighbour.h>
#include <net/dst.h> #include <net/dst.h>
#include <net/flow.h> #include <net/flow.h>
#include <net/fib_rules.h>
#include <net/dn.h> #include <net/dn.h>
#include <net/dn_route.h> #include <net/dn_route.h>
#include <net/dn_fib.h> #include <net/dn_fib.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment