]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: Add the 'struct zebra_ns' data structure
authorDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 1 Feb 2016 17:56:42 +0000 (09:56 -0800)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 1 Feb 2016 17:56:42 +0000 (09:56 -0800)
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 <vipin@cumulusnetworks.com>
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
zebra/rib.h

index 285994c01519a438404b64a99644b6b1bcdc84d0..ba0aa4b729d127c97ce6b57328dbc6ae5efe063b 100644 (file)
@@ -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;
 };
 
 /*