diff options
author | Maria Matejka <mq@ucw.cz> | 2022-06-16 23:24:56 +0200 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2022-06-20 11:56:38 +0200 |
commit | becab5072d6d84d6f9c9402387a9e1c14dcc384d (patch) | |
tree | d9d7a016655d271f7cc4d7b1cc04e7ce7cad69ec /nest/rt-show.c | |
parent | 8c92f47ac77f267368b6d6bd161689a0c0bc5e5a (diff) |
Import tables are stored as an attribute layer inside the main tables.
The separate import tables were too memory-greedy, there is no need for
them being stored as full-sized tables.
Diffstat (limited to 'nest/rt-show.c')
-rw-r--r-- | nest/rt-show.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/nest/rt-show.c b/nest/rt-show.c index 8bf74754..12ddc816 100644 --- a/nest/rt-show.c +++ b/nest/rt-show.c @@ -26,7 +26,8 @@ rt_show_table(struct cli *c, struct rt_show_data *d) return; if (d->last_table) cli_printf(c, -1007, ""); - cli_printf(c, -1007, "Table %s:", d->tab->table->name); + cli_printf(c, -1007, "Table %s:", + d->tab->prefilter ? "import" : d->tab->table->name); d->last_table = d->tab; } @@ -156,7 +157,7 @@ rt_show_net(struct cli *c, net *n, struct rt_show_data *d) for (struct rte_storage *er = n->routes; er; er = er->next) { - if (rte_is_filtered(&er->rte) != d->filtered) + if (!d->tab->prefilter && (rte_is_filtered(&er->rte) != d->filtered)) continue; d->rt_counter++; @@ -167,6 +168,11 @@ rt_show_net(struct cli *c, net *n, struct rt_show_data *d) continue; struct rte e = er->rte; + if (d->tab->prefilter) + if (e.sender != d->tab->prefilter->in_req.hook) + continue; + else while (e.attrs->next) + e.attrs = e.attrs->next; /* Export channel is down, do not try to export routes to it */ if (ec && !ec->out_req.hook) @@ -239,7 +245,7 @@ rt_show_net(struct cli *c, net *n, struct rt_show_data *d) else ia[0] = 0; - rt_show_rte(c, ia, &e, d, (n->routes == er)); + rt_show_rte(c, ia, &e, d, !d->tab->prefilter && (n->routes == er)); first_show = 0; } |