Skip to content

Commit

Permalink
[DECNET]: Covert rules to use generic code
Browse files Browse the repository at this point in the history
This patch converts the DECnet rules code to use the generic
rules system created by Thomas Graf <[email protected]>.

Signed-off-by: Steven Whitehouse <[email protected]>
Acked-by: Thomas Graf <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
StevenWhitehouse authored and David S. Miller committed Sep 22, 2006
1 parent 8f49106 commit a8731cb
Show file tree
Hide file tree
Showing 9 changed files with 196 additions and 319 deletions.
3 changes: 2 additions & 1 deletion include/linux/rtnetlink.h
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,8 @@ enum rtnetlink_groups {
RTNLGRP_NOP2,
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_IPV6_PREFIX,
#define RTNLGRP_IPV6_PREFIX RTNLGRP_IPV6_PREFIX
Expand Down
8 changes: 3 additions & 5 deletions include/net/dn_fib.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct dn_kern_rta
};

struct dn_fib_res {
struct dn_fib_rule *r;
struct fib_rule *r;
struct dn_fib_info *fi;
unsigned char prefixlen;
unsigned char nh_sel;
Expand Down Expand Up @@ -147,10 +147,8 @@ extern void dn_fib_table_cleanup(void);
*/
extern void dn_fib_rules_init(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 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
Expand All @@ -176,7 +174,7 @@ static inline void dn_fib_res_put(struct dn_fib_res *res)
if (res->fi)
dn_fib_info_put(res->fi);
if (res->r)
dn_fib_rule_put(res->r);
fib_rule_put(res->r);
}

extern struct dn_fib_table *dn_fib_tables[];
Expand Down
1 change: 1 addition & 0 deletions net/decnet/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ config DECNET
config DECNET_ROUTER
bool "DECnet: router support (EXPERIMENTAL)"
depends on DECNET && EXPERIMENTAL
select FIB_RULES
---help---
Add support for turning your DECnet Endnode into a level 1 or 2
router. This is an experimental, but functional option. If you
Expand Down
1 change: 1 addition & 0 deletions net/decnet/af_decnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ Version 0.0.6 2.1.110 07-aug-98 Eduardo Marcelo Serrat
#include <linux/poll.h>
#include <net/neighbour.h>
#include <net/dst.h>
#include <net/fib_rules.h>
#include <net/dn.h>
#include <net/dn_nsp.h>
#include <net/dn_dev.h>
Expand Down
3 changes: 1 addition & 2 deletions net/decnet/dn_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
#include <net/neighbour.h>
#include <net/dst.h>
#include <net/flow.h>
#include <net/fib_rules.h>
#include <net/dn.h>
#include <net/dn_dev.h>
#include <net/dn_route.h>
Expand Down Expand Up @@ -1418,8 +1419,6 @@ static struct rtnetlink_link dnet_rtnetlink_table[RTM_NR_MSGTYPES] =
[RTM_DELROUTE - RTM_BASE] = { .doit = dn_fib_rtm_delroute, },
[RTM_GETROUTE - RTM_BASE] = { .doit = dn_cache_getroute,
.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, },
#else
[RTM_GETROUTE - RTM_BASE] = { .doit = dn_cache_getroute,
Expand Down
1 change: 1 addition & 0 deletions net/decnet/dn_fib.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <net/neighbour.h>
#include <net/dst.h>
#include <net/flow.h>
#include <net/fib_rules.h>
#include <net/dn.h>
#include <net/dn_route.h>
#include <net/dn_fib.h>
Expand Down
3 changes: 2 additions & 1 deletion net/decnet/dn_route.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
#include <net/neighbour.h>
#include <net/dst.h>
#include <net/flow.h>
#include <net/fib_rules.h>
#include <net/dn.h>
#include <net/dn_dev.h>
#include <net/dn_nsp.h>
Expand Down Expand Up @@ -1284,7 +1285,7 @@ static int dn_route_input_slow(struct sk_buff *skb)
dev_hold(out_dev);

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);
if (res.type == RTN_NAT) {
Expand Down
Loading

0 comments on commit a8731cb

Please sign in to comment.