summaryrefslogtreecommitdiff
path: root/nest/route.h
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2021-12-02 02:22:30 +0100
committerOndrej Zajicek (work) <santiago@crfreenet.org>2022-02-06 23:27:13 +0100
commitea97b8905197180bee5244bce378d03e4b741d88 (patch)
treeaccbe414077899b866d3829170dd53d84f96dc32 /nest/route.h
parent836a87b8acd5da40bde6b89702090c6616e06dfb (diff)
Nest: Implement 'show route in <addr>' command
Implement 'show route in <addr>' command, which shows all routes in networks that are subnets of given network. Currently limited to IP network types.
Diffstat (limited to 'nest/route.h')
-rw-r--r--nest/route.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/nest/route.h b/nest/route.h
index fa87e22c..ace4c7f7 100644
--- a/nest/route.h
+++ b/nest/route.h
@@ -384,7 +384,7 @@ struct rt_show_data {
struct channel *export_channel;
struct config *running_on_config;
struct krt_proto *kernel;
- int export_mode, primary_only, filtered, stats, show_for;
+ int export_mode, addr_mode, primary_only, filtered, stats;
int table_open; /* Iteration (fit) is open */
int net_counter, rt_counter, show_counter, table_counter;
@@ -403,6 +403,11 @@ struct rt_show_data_rtable * rt_show_add_table(struct rt_show_data *d, rtable *t
#define RSD_TDB_SET 0x1 /* internal: show empty tables */
#define RSD_TDB_NMN 0x2 /* internal: need matching net */
+/* Value of addr_mode */
+#define RSD_ADDR_EQUAL 1 /* Exact query - show route <addr> */
+#define RSD_ADDR_FOR 2 /* Longest prefix match - show route for <addr> */
+#define RSD_ADDR_IN 3 /* Interval query - show route in <addr> */
+
/* Value of export_mode in struct rt_show_data */
#define RSEM_NONE 0 /* Export mode not used */
#define RSEM_PREEXPORT 1 /* Routes ready for export, before filtering */