diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-08-27 10:43:37 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-10-24 06:52:07 -0400 |
| commit | 89272910f738c05ba7986e7d91c14dc0eb1f6ba6 (patch) | |
| tree | bbf83ea49b2b84b0264e763c656f21158d1c2670 /zebra/zebra_rnh.c | |
| parent | 82d6d6e9be004cd8dbe88b0603f6420fcd80a0a5 (diff) | |
zebra: Start breakup of zns into zrouter and zns
The `struct zebra_ns` data structure is being used
for both router information as well as support for
the vrf backend( as appropriate ). This is a confusing
state. Start the movement of `struct zebra_ns` into
2 things `struct zebra_router` and `struct zebra_ns`.
In this new regime `struct zebra_router` is purely
for handling data about the router. It has no knowledge
of the underlying representation of the Data Plane.
`struct zebra_ns` becomes a linux specific bit of code
that allows us to handle the vrf backend and is allowed
to have knowledge about underlying data plane constructs.
When someone implements a *bsd backend the zebra_vrf data
structure will need to be abstracted to take advantage of this
instead of relying on zebra_ns.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'zebra/zebra_rnh.c')
| -rw-r--r-- | zebra/zebra_rnh.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/zebra/zebra_rnh.c b/zebra/zebra_rnh.c index 0a531990dc..df4435b619 100644 --- a/zebra/zebra_rnh.c +++ b/zebra/zebra_rnh.c @@ -36,6 +36,7 @@ #include "nexthop.h" #include "vrf.h" +#include "zebra/zebra_router.h" #include "zebra/rib.h" #include "zebra/rt.h" #include "zebra/zserv.h" @@ -469,12 +470,11 @@ static void zebra_rnh_process_pbr_tables(int family, struct route_node *prn, struct route_entry *re) { - struct zebra_ns_table *znst; + struct zebra_router_table *zrt; struct route_entry *o_re; struct route_node *o_rn; struct listnode *node; struct zserv *client; - struct zebra_ns *zns; afi_t afi = AFI_IP; if (family == AF_INET6) @@ -492,13 +492,12 @@ static void zebra_rnh_process_pbr_tables(int family, if (!client) return; - zns = zebra_ns_lookup(NS_DEFAULT); - RB_FOREACH (znst, zebra_ns_table_head, &zns->ns_tables) { - if (afi != znst->afi) + RB_FOREACH (zrt, zebra_router_table_head, &zrouter.tables) { + if (afi != zrt->afi) continue; - for (o_rn = route_top(znst->table); - o_rn; o_rn = srcdest_route_next(o_rn)) { + for (o_rn = route_top(zrt->table); o_rn; + o_rn = srcdest_route_next(o_rn)) { RNODE_FOREACH_RE (o_rn, o_re) { if (o_re->type == ZEBRA_ROUTE_PBR) break; |
