From 665be7f6bdbf1fd8dbac45cef533bd4b1df35d4d Mon Sep 17 00:00:00 2001 From: "Ondrej Zajicek (work)" Date: Wed, 8 Mar 2017 16:27:18 +0100 Subject: Nest: Minor fixes in show route --- nest/route.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'nest/route.h') diff --git a/nest/route.h b/nest/route.h index 98bef1fd..65711138 100644 --- a/nest/route.h +++ b/nest/route.h @@ -401,6 +401,7 @@ typedef struct rta { #define RTD_BLACKHOLE 2 /* Silently drop packets */ #define RTD_UNREACHABLE 3 /* Reject as unreachable */ #define RTD_PROHIBIT 4 /* Administratively prohibited */ +#define RTD_MAX 5 /* Flags for net->n.flags, used by kernel syncer */ #define KRF_INSTALLED 0x80 /* This route should be installed in the kernel */ @@ -412,6 +413,11 @@ typedef struct rta { protocol-specific metric is availabe */ +const char * rta_dest_names[RTD_MAX]; + +static inline const char *rta_dest_name(uint n) +{ return (n < RTD_MAX) ? rta_dest_names[n] : "???"; } + /* Route has regular, reachable nexthop (i.e. not RTD_UNREACHABLE and like) */ static inline int rte_is_reachable(rte *r) { return r->attrs->dest == RTD_UNICAST; } -- cgit v1.2.3