Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

[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
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -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
+3 −5
Original line number Original line Diff line number Diff line
@@ -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);
 */
 */
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)
	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[];
+1 −0
Original line number Original line Diff line number Diff line
@@ -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
+1 −0
Original line number Original line Diff line number Diff line
@@ -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>
+1 −2
Original line number Original line Diff line number Diff line
@@ -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] =
	[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,
Loading