diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-02-13 20:25:11 -0500 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-02-23 07:08:36 -0500 |
| commit | 5335613bc741a45a2f307e66b73b4f1303567146 (patch) | |
| tree | 750eea82e462498314e038778c17532538a23f9f /zebra/zebra_ns.h | |
| parent | 8d056acc82e16b83a56d82960e1d3f3dfbabfef9 (diff) | |
zebra: Move zvrf->other_tables into zns
The other_tables data structure does not belong to a vrf.
It belongs to the zns. This is because each vrf does not
need to have copies of each of other_tables.
Additionally move the array into a RB_TREE. This will allow
us to sort quickly and easily expand the number of tables
we can support to beyond the ZEBRA_KERNEL_TABLE_MAX define.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'zebra/zebra_ns.h')
| -rw-r--r-- | zebra/zebra_ns.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/zebra/zebra_ns.h b/zebra/zebra_ns.h index 5d90b9be67..29905ccad3 100644 --- a/zebra/zebra_ns.h +++ b/zebra/zebra_ns.h @@ -34,6 +34,18 @@ struct nlsock { }; #endif +struct zebra_ns_table { + RB_ENTRY(zebra_ns_table) zebra_ns_table_entry; + + uint32_t tableid; + afi_t afi; + + struct route_table *table; +}; +RB_HEAD(zebra_ns_table_head, zebra_ns_table); +RB_PROTOTYPE(zebra_ns_table_head, zebra_ns_table, zebra_ns_table_entry, + zebra_ns_table_entry_compare) + struct zebra_ns { /* net-ns name. */ char name[VRF_NAMSIZ]; @@ -55,6 +67,8 @@ struct zebra_ns { #if defined(HAVE_RTADV) struct rtadv rtadv; #endif /* HAVE_RTADV */ + + struct zebra_ns_table_head ns_tables; }; struct zebra_ns *zebra_ns_lookup(ns_id_t ns_id); @@ -62,4 +76,8 @@ struct zebra_ns *zebra_ns_lookup(ns_id_t ns_id); int zebra_ns_init(void); int zebra_ns_enable(ns_id_t ns_id, void **info); int zebra_ns_disable(ns_id_t ns_id, void **info); + +extern struct route_table *zebra_ns_get_table(struct zebra_ns *zns, + struct zebra_vrf *zvrf, + uint32_t tableid, afi_t afi); #endif |
