GBP: l3-out subnets
[vpp.git] / src / plugins / gbp / gbp_route_domain.c
index 5518cc1..67b6915 100644 (file)
@@ -62,6 +62,12 @@ vlib_log_class_t grd_logger;
 #define GBP_BD_DBG(...)                           \
     vlib_log_debug (grd_logger, __VA_ARGS__);
 
+index_t
+gbp_route_domain_index (const gbp_route_domain_t * grd)
+{
+  return (grd - gbp_route_domain_pool);
+}
+
 gbp_route_domain_t *
 gbp_route_domain_get (index_t i)
 {
@@ -225,6 +231,16 @@ gbp_route_domain_unlock (index_t index)
     }
 }
 
+u32
+gbp_route_domain_get_rd_id (index_t grdi)
+{
+  gbp_route_domain_t *grd;
+
+  grd = gbp_route_domain_get (grdi);
+
+  return (grd->grd_id);
+}
+
 int
 gbp_route_domain_delete (u32 rd_id)
 {
@@ -291,9 +307,9 @@ gbp_route_domain_cli (vlib_main_t * vm,
       else if (unformat (input, "ip6-uu %U", unformat_vnet_sw_interface,
                         vnm, &ip6_uu_sw_if_index))
        ;
-      else if (unformat (input, "ip4-table-id %d", ip4_table_id))
+      else if (unformat (input, "ip4-table-id %d", &ip4_table_id))
        ;
-      else if (unformat (input, "ip6-table-id %d", ip6_table_id))
+      else if (unformat (input, "ip6-table-id %d", &ip6_table_id))
        ;
       else if (unformat (input, "add"))
        add = 1;