VPP-198: LISP map-resolver failover algorithm
[vpp.git] / vpp / vpp-api / api.c
index 8a34159..86dd9ac 100644 (file)
@@ -5861,8 +5861,8 @@ static void
 vl_api_lisp_map_resolver_dump_t_handler (vl_api_lisp_map_resolver_dump_t * mp)
 {
   unix_shared_memory_queue_t *q = NULL;
-  lisp_cp_main_t *lcm = vnet_lisp_cp_get_main ();
-  ip_address_t *ip = NULL;
+  lisp_cp_main_t * lcm = vnet_lisp_cp_get_main ();
+  map_resolver_t * mr;
 
   q = vl_api_client_index_to_input_queue (mp->client_index);
   if (q == 0)
@@ -5870,11 +5870,10 @@ vl_api_lisp_map_resolver_dump_t_handler (vl_api_lisp_map_resolver_dump_t * mp)
       return;
     }
 
-  vec_foreach (ip, lcm->map_resolvers)
+  vec_foreach(mr, lcm->map_resolvers)
   {
-    send_lisp_map_resolver_details (ip, q, mp->context);
+    send_lisp_map_resolver_details(&mr->address, q, mp->context);
   }
-
 }
 
 static void
@@ -8112,6 +8111,7 @@ static clib_error_t *
 api_segment_config (vlib_main_t * vm, unformat_input_t * input)
 {
   u8 *chroot_path;
+  u64 baseva, size, pvt_heap_size;
   int uid, gid, rv;
   const int max_buf_size = 4096;
   char *s, *buf;
@@ -8130,6 +8130,30 @@ api_segment_config (vlib_main_t * vm, unformat_input_t * input)
        vl_set_memory_uid (uid);
       else if (unformat (input, "gid %d", &gid))
        vl_set_memory_gid (gid);
+      else if (unformat (input, "baseva %llx", &baseva))
+       vl_set_global_memory_baseva (baseva);
+      else if (unformat (input, "global-size %lldM", &size))
+       vl_set_global_memory_size (size * (1ULL << 20));
+      else if (unformat (input, "global-size %lldG", &size))
+       vl_set_global_memory_size (size * (1ULL << 30));
+      else if (unformat (input, "global-size %lld", &size))
+       vl_set_global_memory_size (size);
+      else if (unformat (input, "global-pvt-heap-size %lldM", &pvt_heap_size))
+       vl_set_global_pvt_heap_size (pvt_heap_size * (1ULL << 20));
+      else if (unformat (input, "global-pvt-heap-size size %lld",
+                        &pvt_heap_size))
+       vl_set_global_pvt_heap_size (pvt_heap_size);
+      else if (unformat (input, "api-pvt-heap-size %lldM", &pvt_heap_size))
+       vl_set_api_pvt_heap_size (pvt_heap_size * (1ULL << 20));
+      else if (unformat (input, "api-pvt-heap-size size %lld",
+                        &pvt_heap_size))
+       vl_set_api_pvt_heap_size (pvt_heap_size);
+      else if (unformat (input, "api-size %lldM", &size))
+       vl_set_api_memory_size (size * (1ULL << 20));
+      else if (unformat (input, "api-size %lldG", &size))
+       vl_set_api_memory_size (size * (1ULL << 30));
+      else if (unformat (input, "api-size %lld", &size))
+       vl_set_api_memory_size (size);
       else if (unformat (input, "uid %s", &s))
        {
          /* lookup the username */