summaryrefslogtreecommitdiff
path: root/nest/route.h
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2017-04-25 19:02:31 +0200
committerOndrej Zajicek (work) <santiago@crfreenet.org>2017-04-25 19:02:31 +0200
commitb29499996bbc1612a63a7e715bb53a8abf0940e3 (patch)
tree2cda557718d08df68f0be9f5b05283bedeeb71b1 /nest/route.h
parent6f535924ebbb5a08d96c4a8d0cf0984b130a0995 (diff)
Nest: Update of show route cmd
Some code cleanup, multiple bugfixes, allows to specify also channel for 'show route export'. Interesting how such apparenty simple thing like show route cmd has plenty of ugly corner cases.
Diffstat (limited to 'nest/route.h')
-rw-r--r--nest/route.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/nest/route.h b/nest/route.h
index 12968cb8..6c9b00c2 100644
--- a/nest/route.h
+++ b/nest/route.h
@@ -313,26 +313,30 @@ struct rtable_config *rt_new_table(struct symbol *s, uint addr_type);
struct rt_show_data_rtable {
node n;
rtable *table;
+ struct channel *export_channel;
};
struct rt_show_data {
net_addr *addr;
- list table;
- struct rt_show_data_rtable *tit;
- struct filter *filter;
+ list tables;
+ struct rt_show_data_rtable *tab; /* Iterator over table list */
+ struct rt_show_data_rtable *last_table; /* Last table in output */
+ struct fib_iterator fit; /* Iterator over networks in table */
int verbose, tables_defined_by;
- struct fib_iterator fit;
+ struct filter *filter;
struct proto *show_protocol;
struct proto *export_protocol;
struct channel *export_channel;
- int export_mode, primary_only, filtered;
struct config *running_on_config;
+ int export_mode, primary_only, filtered, stats, show_for;
+
+ int table_open; /* Iteration (fit) is open */
int net_counter, rt_counter, show_counter, table_counter;
int net_counter_last, rt_counter_last, show_counter_last;
- int stats, show_for, stats_by_table;
};
+
void rt_show(struct rt_show_data *);
-void rt_show_add_table(struct rt_show_data *d, rtable *t);
+struct rt_show_data_rtable * rt_show_add_table(struct rt_show_data *d, rtable *t);
/* Value of table definition mode in struct rt_show_data */
#define RSD_TDB_DEFAULT 0 /* no table specified */