From 43307b4e39300f6602a975bbb710b443e5fcd2b5 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Tue, 3 Sep 2013 16:28:34 +0100 Subject: [ipv4] Abstract out protocol-specific portions of "route" command Signed-off-by: Michael Brown --- src/include/usr/route.h | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'src/include') diff --git a/src/include/usr/route.h b/src/include/usr/route.h index 855fa7ba8..b914f4b84 100644 --- a/src/include/usr/route.h +++ b/src/include/usr/route.h @@ -3,12 +3,33 @@ /** @file * - * Routing table management + * Routing management * */ FILE_LICENCE ( GPL2_OR_LATER ); +#include + +/** A routing family */ +struct routing_family { + /** + * Print routes for a network device + * + * @v netdev Network device + */ + void ( * print ) ( struct net_device *netdev ); +}; + +/** Routing family table */ +#define ROUTING_FAMILIES __table ( struct routing_family, "routing_families" ) + +/** Declare a routing family */ +#define __routing_family( order ) __table_entry ( ROUTING_FAMILIES, order ) + +#define ROUTING_IPV4 01 +#define ROUTING_IPV6 02 + extern void route ( void ); #endif /* _USR_ROUTE_H */ -- cgit v1.2.3-55-g7522