From: Donald Sharp Date: Mon, 1 Feb 2016 17:56:42 +0000 (-0800) Subject: zebra: Add the 'struct zebra_ns' data structure X-Git-Tag: frr-2.0-rc1~1149 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=244a59d22809d9a4a3bc555764e71aa4aff299bf;p=mirror%2Ffrr.git zebra: Add the 'struct zebra_ns' data structure This commit adds the 'struct zebra_ns' data structure. We are not currently using it. But pretty much everything after this commit in zebra depends on it. Signed-off-by: Vipin Kumar Signed-off-by: Donald Sharp --- diff --git a/zebra/rib.h b/zebra/rib.h index 285994c015..ba0aa4b729 100644 --- a/zebra/rib.h +++ b/zebra/rib.h @@ -28,6 +28,7 @@ #include "table.h" #include "queue.h" #include "nexthop.h" +#include "vrf.h" #define DISTANCE_INFINITY 255 #define ZEBRA_KERNEL_TABLE_MAX 252 /* support for no more than this rt tables */ @@ -283,6 +284,21 @@ struct nlsock }; #endif +/* NetNS ID type. */ +typedef u_int16_t ns_id_t; + +struct zebra_ns +{ + /* net-ns name. */ + char name[VRF_NAMSIZ]; + + /* Identifier. */ + ns_id_t ns_id; + + struct route_table *if_table; +}; + + /* Routing table instance. */ struct zebra_vrf { @@ -290,7 +306,7 @@ struct zebra_vrf vrf_id_t vrf_id; /* Routing table name. */ - char *name; + char name[VRF_NAMSIZ]; /* Description. */ char *desc; @@ -298,6 +314,8 @@ struct zebra_vrf /* FIB identifier. */ u_char fib_id; + u_int32_t table_id; + /* Routing table. */ struct route_table *table[AFI_MAX][SAFI_MAX]; @@ -331,6 +349,11 @@ struct zebra_vrf #if defined (HAVE_RTADV) struct rtadv rtadv; #endif /* HAVE_RTADV */ + + /* + * Back pointer to the owning namespace. + */ + struct zebra_ns *zns; }; /*