api: use string type for strings in memclnt.api
[vpp.git] / src / vat / api_format.c
index e0d77a4..abce805 100644 (file)
@@ -85,6 +85,9 @@
 #define __plugin_msg_base 0
 #include <vlibapi/vat_helper_macros.h>
 
+void vl_api_set_elog_main (elog_main_t * m);
+int vl_api_set_elog_trace_api_messages (int enable);
+
 #if VPP_API_TEST_BUILTIN == 0
 #include <netdb.h>
 
@@ -164,7 +167,8 @@ errmsg (char *fmt, ...)
     if (vam->ifp != stdin)
       fformat (vam->ofp, "%s(%d): \n", vam->current_file,
               vam->input_line_number);
-    fformat (vam->ofp, (char *) s);
+    else
+      fformat (vam->ofp, "%s\n", (char *) s);
     fflush (vam->ofp);
   }
 #endif
@@ -970,7 +974,8 @@ static void vl_api_sw_interface_details_t_handler
   (vl_api_sw_interface_details_t * mp)
 {
   vat_main_t *vam = &vat_main;
-  u8 *s = format (0, "%s%c", mp->interface_name, 0);
+  u8 *s = format (0, "%s%c",
+                 vl_api_from_api_string (&mp->interface_name), 0);
 
   hash_set_mem (vam->sw_if_index_by_interface_name, s,
                ntohl (mp->sw_if_index));
@@ -988,14 +993,11 @@ static void vl_api_sw_interface_details_t_handler
       sub->sw_if_index = ntohl (mp->sw_if_index);
       sub->sub_id = ntohl (mp->sub_id);
 
-      sub->sub_dot1ad = mp->sub_dot1ad;
+      sub->raw_flags = ntohl (mp->sub_if_flags & SUB_IF_API_FLAG_MASK_VNET);
+
       sub->sub_number_of_tags = mp->sub_number_of_tags;
       sub->sub_outer_vlan_id = ntohs (mp->sub_outer_vlan_id);
       sub->sub_inner_vlan_id = ntohs (mp->sub_inner_vlan_id);
-      sub->sub_exact_match = mp->sub_exact_match;
-      sub->sub_default = mp->sub_default;
-      sub->sub_outer_vlan_id_any = mp->sub_outer_vlan_id_any;
-      sub->sub_inner_vlan_id_any = mp->sub_inner_vlan_id_any;
 
       /* vlan tag rewrite */
       sub->vtr_op = ntohl (mp->vtr_op);
@@ -1022,37 +1024,28 @@ static void vl_api_sw_interface_details_t_handler_json
   vat_json_object_add_uint (node, "sw_if_index", ntohl (mp->sw_if_index));
   vat_json_object_add_uint (node, "sup_sw_if_index",
                            ntohl (mp->sup_sw_if_index));
-  vat_json_object_add_uint (node, "l2_address_length",
-                           ntohl (mp->l2_address_length));
   vat_json_object_add_bytes (node, "l2_address", mp->l2_address,
                             sizeof (mp->l2_address));
   vat_json_object_add_string_copy (node, "interface_name",
-                                  mp->interface_name);
-  vat_json_object_add_uint (node, "admin_up_down", mp->admin_up_down);
-  vat_json_object_add_uint (node, "link_up_down", mp->link_up_down);
+                                  mp->interface_name.buf);
+  vat_json_object_add_uint (node, "flags", mp->flags);
   vat_json_object_add_uint (node, "link_duplex", mp->link_duplex);
   vat_json_object_add_uint (node, "link_speed", mp->link_speed);
   vat_json_object_add_uint (node, "mtu", ntohs (mp->link_mtu));
   vat_json_object_add_uint (node, "sub_id", ntohl (mp->sub_id));
-  vat_json_object_add_uint (node, "sub_dot1ad", mp->sub_dot1ad);
   vat_json_object_add_uint (node, "sub_number_of_tags",
                            mp->sub_number_of_tags);
   vat_json_object_add_uint (node, "sub_outer_vlan_id",
                            ntohs (mp->sub_outer_vlan_id));
   vat_json_object_add_uint (node, "sub_inner_vlan_id",
                            ntohs (mp->sub_inner_vlan_id));
-  vat_json_object_add_uint (node, "sub_exact_match", mp->sub_exact_match);
-  vat_json_object_add_uint (node, "sub_default", mp->sub_default);
-  vat_json_object_add_uint (node, "sub_outer_vlan_id_any",
-                           mp->sub_outer_vlan_id_any);
-  vat_json_object_add_uint (node, "sub_inner_vlan_id_any",
-                           mp->sub_inner_vlan_id_any);
+  vat_json_object_add_uint (node, "sub_if_flags", ntohl (mp->sub_if_flags));
   vat_json_object_add_uint (node, "vtr_op", ntohl (mp->vtr_op));
   vat_json_object_add_uint (node, "vtr_push_dot1q",
                            ntohl (mp->vtr_push_dot1q));
   vat_json_object_add_uint (node, "vtr_tag1", ntohl (mp->vtr_tag1));
   vat_json_object_add_uint (node, "vtr_tag2", ntohl (mp->vtr_tag2));
-  if (mp->sub_dot1ah)
+  if (ntohl (mp->sub_if_flags) & SUB_IF_API_FLAG_DOT1AH)
     {
       vat_json_object_add_string_copy (node, "pbb_vtr_dmac",
                                       format (0, "%U",
@@ -1075,8 +1068,10 @@ static void vl_api_sw_interface_event_t_handler
   if (vam->interface_event_display)
     errmsg ("interface flags: sw_if_index %d %s %s",
            ntohl (mp->sw_if_index),
-           mp->admin_up_down ? "admin-up" : "admin-down",
-           mp->link_up_down ? "link-up" : "link-down");
+           ((ntohl (mp->flags)) & IF_STATUS_API_FLAG_ADMIN_UP) ?
+           "admin-up" : "admin-down",
+           ((ntohl (mp->flags)) & IF_STATUS_API_FLAG_LINK_UP) ?
+           "link-up" : "link-down");
 }
 #endif
 
@@ -2570,70 +2565,6 @@ static void vl_api_create_vhost_user_if_reply_t_handler_json
   vam->result_ready = 1;
 }
 
-static void vl_api_dns_resolve_name_reply_t_handler
-  (vl_api_dns_resolve_name_reply_t * mp)
-{
-  vat_main_t *vam = &vat_main;
-  i32 retval = ntohl (mp->retval);
-  if (vam->async_mode)
-    {
-      vam->async_errors += (retval < 0);
-    }
-  else
-    {
-      vam->retval = retval;
-      vam->result_ready = 1;
-
-      if (retval == 0)
-       {
-         if (mp->ip4_set)
-           clib_warning ("ip4 address %U", format_ip4_address,
-                         (ip4_address_t *) mp->ip4_address);
-         if (mp->ip6_set)
-           clib_warning ("ip6 address %U", format_ip6_address,
-                         (ip6_address_t *) mp->ip6_address);
-       }
-      else
-       clib_warning ("retval %d", retval);
-    }
-}
-
-static void vl_api_dns_resolve_name_reply_t_handler_json
-  (vl_api_dns_resolve_name_reply_t * mp)
-{
-  clib_warning ("not implemented");
-}
-
-static void vl_api_dns_resolve_ip_reply_t_handler
-  (vl_api_dns_resolve_ip_reply_t * mp)
-{
-  vat_main_t *vam = &vat_main;
-  i32 retval = ntohl (mp->retval);
-  if (vam->async_mode)
-    {
-      vam->async_errors += (retval < 0);
-    }
-  else
-    {
-      vam->retval = retval;
-      vam->result_ready = 1;
-
-      if (retval == 0)
-       {
-         clib_warning ("canonical name %s", mp->name);
-       }
-      else
-       clib_warning ("retval %d", retval);
-    }
-}
-
-static void vl_api_dns_resolve_ip_reply_t_handler_json
-  (vl_api_dns_resolve_ip_reply_t * mp)
-{
-  clib_warning ("not implemented");
-}
-
-
 static void vl_api_ip_address_details_t_handler
   (vl_api_ip_address_details_t * mp)
 {
@@ -5261,8 +5192,6 @@ _(p2p_ethernet_del_reply)                               \
 _(lldp_config_reply)                                    \
 _(sw_interface_set_lldp_reply)                         \
 _(tcp_configure_src_addresses_reply)                   \
-_(dns_enable_disable_reply)                             \
-_(dns_name_server_add_del_reply)                       \
 _(session_rule_add_del_reply)                          \
 _(ip_container_proxy_add_del_reply)                     \
 _(output_acl_set_interface_reply)                       \
@@ -5579,10 +5508,6 @@ _(LLDP_CONFIG_REPLY, lldp_config_reply)                                 \
 _(SW_INTERFACE_SET_LLDP_REPLY, sw_interface_set_lldp_reply)            \
 _(TCP_CONFIGURE_SRC_ADDRESSES_REPLY, tcp_configure_src_addresses_reply)        \
 _(APP_NAMESPACE_ADD_DEL_REPLY, app_namespace_add_del_reply)            \
-_(DNS_ENABLE_DISABLE_REPLY, dns_enable_disable_reply)                   \
-_(DNS_NAME_SERVER_ADD_DEL_REPLY, dns_name_server_add_del_reply)                \
-_(DNS_RESOLVE_NAME_REPLY, dns_resolve_name_reply)                      \
-_(DNS_RESOLVE_IP_REPLY, dns_resolve_ip_reply)                          \
 _(SESSION_RULE_ADD_DEL_REPLY, session_rule_add_del_reply)              \
 _(SESSION_RULES_DETAILS, session_rules_details)                                \
 _(IP_CONTAINER_PROXY_ADD_DEL_REPLY, ip_container_proxy_add_del_reply)  \
@@ -6012,7 +5937,7 @@ api_sw_interface_set_flags (vat_main_t * vam)
   /* Construct the API message */
   M (SW_INTERFACE_SET_FLAGS, mp);
   mp->sw_if_index = ntohl (sw_if_index);
-  mp->admin_up_down = admin_up;
+  mp->flags = ntohl ((admin_up) ? IF_STATUS_API_FLAG_ADMIN_UP : 0);
 
   /* send it... */
   S (mp);
@@ -6068,7 +5993,7 @@ api_sw_interface_set_rx_mode (vat_main_t * vam)
   /* Construct the API message */
   M (SW_INTERFACE_SET_RX_MODE, mp);
   mp->sw_if_index = ntohl (sw_if_index);
-  mp->mode = mode;
+  mp->mode = (vl_api_rx_mode_t) mode;
   mp->queue_id_valid = queue_id_valid;
   mp->queue_id = queue_id_valid ? ntohl (queue_id) : ~0;
 
@@ -6304,14 +6229,15 @@ api_sw_interface_add_del_address (vat_main_t * vam)
   mp->del_all = del_all;
   if (v6_address_set)
     {
-      mp->is_ipv6 = 1;
-      clib_memcpy (mp->address, &v6address, sizeof (v6address));
+      mp->prefix.address.af = ADDRESS_IP6;
+      clib_memcpy (mp->prefix.address.un.ip6, &v6address, sizeof (v6address));
     }
   else
     {
-      clib_memcpy (mp->address, &v4address, sizeof (v4address));
+      mp->prefix.address.af = ADDRESS_IP4;
+      clib_memcpy (mp->prefix.address.un.ip4, &v4address, sizeof (v4address));
     }
-  mp->address_length = address_length;
+  mp->prefix.len = address_length;
 
   /* send it... */
   S (mp);
@@ -7765,6 +7691,7 @@ api_bond_create (vat_main_t * vam)
   u8 lb;
   u8 mode_is_set = 0;
   u32 id = ~0;
+  u8 numa_only = 0;
 
   clib_memset (mac_address, 0, sizeof (mac_address));
   lb = BOND_LB_L2;
@@ -7780,6 +7707,8 @@ api_bond_create (vat_main_t * vam)
       else if (unformat (i, "hw-addr %U", unformat_ethernet_address,
                         mac_address))
        custom_mac = 1;
+      else if (unformat (i, "numa-only"))
+       numa_only = 1;
       else if (unformat (i, "id %u", &id))
        ;
       else
@@ -7800,6 +7729,7 @@ api_bond_create (vat_main_t * vam)
   mp->mode = mode;
   mp->lb = lb;
   mp->id = htonl (id);
+  mp->numa_only = numa_only;
 
   if (custom_mac)
     clib_memcpy (mp->mac_address, mac_address, 6);
@@ -9213,6 +9143,16 @@ _(default_sub)                                  \
 _(outer_vlan_id_any)                            \
 _(inner_vlan_id_any)
 
+#define foreach_create_subif_flag              \
+_(0, "no_tags")                                        \
+_(1, "one_tag")                                        \
+_(2, "two_tags")                               \
+_(3, "dot1ad")                                 \
+_(4, "exact_match")                            \
+_(5, "default_sub")                            \
+_(6, "outer_vlan_id_any")                      \
+_(7, "inner_vlan_id_any")
+
 static int
 api_create_subif (vat_main_t * vam)
 {
@@ -9222,14 +9162,14 @@ api_create_subif (vat_main_t * vam)
   u8 sw_if_index_set = 0;
   u32 sub_id;
   u8 sub_id_set = 0;
-  u32 no_tags = 0;
-  u32 one_tag = 0;
-  u32 two_tags = 0;
-  u32 dot1ad = 0;
-  u32 exact_match = 0;
-  u32 default_sub = 0;
-  u32 outer_vlan_id_any = 0;
-  u32 inner_vlan_id_any = 0;
+  u32 __attribute__ ((unused)) no_tags = 0;
+  u32 __attribute__ ((unused)) one_tag = 0;
+  u32 __attribute__ ((unused)) two_tags = 0;
+  u32 __attribute__ ((unused)) dot1ad = 0;
+  u32 __attribute__ ((unused)) exact_match = 0;
+  u32 __attribute__ ((unused)) default_sub = 0;
+  u32 __attribute__ ((unused)) outer_vlan_id_any = 0;
+  u32 __attribute__ ((unused)) inner_vlan_id_any = 0;
   u32 tmp;
   u16 outer_vlan_id = 0;
   u16 inner_vlan_id = 0;
@@ -9275,8 +9215,8 @@ api_create_subif (vat_main_t * vam)
   mp->sw_if_index = ntohl (sw_if_index);
   mp->sub_id = ntohl (sub_id);
 
-#define _(a) mp->a = a;
-  foreach_create_subif_bit;
+#define _(a,b) mp->sub_if_flags |= (1 << a);
+  foreach_create_subif_flag;
 #undef _
 
   mp->outer_vlan_id = ntohs (outer_vlan_id);
@@ -13292,6 +13232,7 @@ api_create_vhost_user_if (vat_main_t * vam)
   u8 disable_mrg_rxbuf = 0;
   u8 disable_indirect_desc = 0;
   u8 *tag = 0;
+  u8 enable_gso = 0;
   int ret;
 
   /* Shut up coverity */
@@ -13313,6 +13254,8 @@ api_create_vhost_user_if (vat_main_t * vam)
        disable_mrg_rxbuf = 1;
       else if (unformat (i, "disable_indirect_desc"))
        disable_indirect_desc = 1;
+      else if (unformat (i, "gso"))
+       enable_gso = 1;
       else if (unformat (i, "tag %s", &tag))
        ;
       else
@@ -13337,6 +13280,7 @@ api_create_vhost_user_if (vat_main_t * vam)
   mp->is_server = is_server;
   mp->disable_mrg_rxbuf = disable_mrg_rxbuf;
   mp->disable_indirect_desc = disable_indirect_desc;
+  mp->enable_gso = enable_gso;
   clib_memcpy (mp->sock_filename, file_name, vec_len (file_name));
   vec_free (file_name);
   if (custom_dev_instance != ~0)
@@ -13367,6 +13311,7 @@ api_modify_vhost_user_if (vat_main_t * vam)
   u32 custom_dev_instance = ~0;
   u8 sw_if_index_set = 0;
   u32 sw_if_index = (u32) ~ 0;
+  u8 enable_gso = 0;
   int ret;
 
   while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
@@ -13383,6 +13328,8 @@ api_modify_vhost_user_if (vat_main_t * vam)
        ;
       else if (unformat (i, "server"))
        is_server = 1;
+      else if (unformat (i, "gso"))
+       enable_gso = 1;
       else
        break;
     }
@@ -13410,6 +13357,7 @@ api_modify_vhost_user_if (vat_main_t * vam)
 
   mp->sw_if_index = ntohl (sw_if_index);
   mp->is_server = is_server;
+  mp->enable_gso = enable_gso;
   clib_memcpy (mp->sock_filename, file_name, vec_len (file_name));
   vec_free (file_name);
   if (custom_dev_instance != ~0)
@@ -15042,7 +14990,7 @@ api_get_first_msg_id (vat_main_t * vam)
     }
 
   M (GET_FIRST_MSG_ID, mp);
-  clib_memcpy (mp->name, name, vec_len (name));
+  vl_api_vec_to_api_string (name, &mp->name);
   S (mp);
   W (ret);
   return ret;
@@ -18921,7 +18869,7 @@ static void
 vl_api_mpls_route_details_t_handler (vl_api_mpls_route_details_t * mp)
 {
   vat_main_t *vam = &vat_main;
-  int count = ntohl (mp->mr_route.mr_n_paths);
+  int count = (int) clib_net_to_host_u32 (mp->mr_route.mr_n_paths);
   vl_api_fib_path_t *fp;
   int i;
 
@@ -18941,7 +18889,7 @@ static void vl_api_mpls_route_details_t_handler_json
   (vl_api_mpls_route_details_t * mp)
 {
   vat_main_t *vam = &vat_main;
-  int count = ntohl (mp->mr_route.mr_n_paths);
+  int count = (int) clib_host_to_net_u32 (mp->mr_route.mr_n_paths);
   vat_json_node_t *node = NULL;
   vl_api_fib_path_t *fp;
   int i;
@@ -19741,12 +19689,24 @@ api_pg_create_interface (vat_main_t * vam)
   unformat_input_t *input = vam->input;
   vl_api_pg_create_interface_t *mp;
 
-  u32 if_id = ~0;
+  u32 if_id = ~0, gso_size = 0;
+  u8 gso_enabled = 0;
   int ret;
   while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
     {
       if (unformat (input, "if_id %d", &if_id))
        ;
+      else if (unformat (input, "gso-enabled"))
+       {
+         gso_enabled = 1;
+         if (unformat (input, "gso-size %u", &gso_size))
+           ;
+         else
+           {
+             errmsg ("missing gso-size");
+             return -99;
+           }
+       }
       else
        break;
     }
@@ -19760,6 +19720,7 @@ api_pg_create_interface (vat_main_t * vam)
   M (PG_CREATE_INTERFACE, mp);
   mp->context = 0;
   mp->interface_id = ntohl (if_id);
+  mp->gso_enabled = gso_enabled;
 
   S (mp);
   W (ret);
@@ -20406,7 +20367,7 @@ api_sw_interface_tag_add_del (vat_main_t * vam)
   mp->sw_if_index = ntohl (sw_if_index);
   mp->is_add = enable;
   if (enable)
-    strncpy ((char *) mp->tag, (char *) tag, ARRAY_LEN (mp->tag) - 1);
+    vl_api_to_api_string (strlen ((char *) tag), (char *) tag, &mp->tag);
   vec_free (tag);
 
   S (mp);
@@ -20923,172 +20884,6 @@ api_sock_init_shm (vat_main_t * vam)
 #endif
 }
 
-static int
-api_dns_enable_disable (vat_main_t * vam)
-{
-  unformat_input_t *line_input = vam->input;
-  vl_api_dns_enable_disable_t *mp;
-  u8 enable_disable = 1;
-  int ret;
-
-  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
-    {
-      if (unformat (line_input, "disable"))
-       enable_disable = 0;
-      if (unformat (line_input, "enable"))
-       enable_disable = 1;
-      else
-       break;
-    }
-
-  /* Construct the API message */
-  M (DNS_ENABLE_DISABLE, mp);
-  mp->enable = enable_disable;
-
-  /* send it... */
-  S (mp);
-  /* Wait for the reply */
-  W (ret);
-  return ret;
-}
-
-static int
-api_dns_resolve_name (vat_main_t * vam)
-{
-  unformat_input_t *line_input = vam->input;
-  vl_api_dns_resolve_name_t *mp;
-  u8 *name = 0;
-  int ret;
-
-  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
-    {
-      if (unformat (line_input, "%s", &name))
-       ;
-      else
-       break;
-    }
-
-  if (vec_len (name) > 127)
-    {
-      errmsg ("name too long");
-      return -99;
-    }
-
-  /* Construct the API message */
-  M (DNS_RESOLVE_NAME, mp);
-  memcpy (mp->name, name, vec_len (name));
-  vec_free (name);
-
-  /* send it... */
-  S (mp);
-  /* Wait for the reply */
-  W (ret);
-  return ret;
-}
-
-static int
-api_dns_resolve_ip (vat_main_t * vam)
-{
-  unformat_input_t *line_input = vam->input;
-  vl_api_dns_resolve_ip_t *mp;
-  int is_ip6 = -1;
-  ip4_address_t addr4;
-  ip6_address_t addr6;
-  int ret;
-
-  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
-    {
-      if (unformat (line_input, "%U", unformat_ip6_address, &addr6))
-       is_ip6 = 1;
-      else if (unformat (line_input, "%U", unformat_ip4_address, &addr4))
-       is_ip6 = 0;
-      else
-       break;
-    }
-
-  if (is_ip6 == -1)
-    {
-      errmsg ("missing address");
-      return -99;
-    }
-
-  /* Construct the API message */
-  M (DNS_RESOLVE_IP, mp);
-  mp->is_ip6 = is_ip6;
-  if (is_ip6)
-    memcpy (mp->address, &addr6, sizeof (addr6));
-  else
-    memcpy (mp->address, &addr4, sizeof (addr4));
-
-  /* send it... */
-  S (mp);
-  /* Wait for the reply */
-  W (ret);
-  return ret;
-}
-
-static int
-api_dns_name_server_add_del (vat_main_t * vam)
-{
-  unformat_input_t *i = vam->input;
-  vl_api_dns_name_server_add_del_t *mp;
-  u8 is_add = 1;
-  ip6_address_t ip6_server;
-  ip4_address_t ip4_server;
-  int ip6_set = 0;
-  int ip4_set = 0;
-  int ret = 0;
-
-  while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
-    {
-      if (unformat (i, "%U", unformat_ip6_address, &ip6_server))
-       ip6_set = 1;
-      else if (unformat (i, "%U", unformat_ip4_address, &ip4_server))
-       ip4_set = 1;
-      else if (unformat (i, "del"))
-       is_add = 0;
-      else
-       {
-         clib_warning ("parse error '%U'", format_unformat_error, i);
-         return -99;
-       }
-    }
-
-  if (ip4_set && ip6_set)
-    {
-      errmsg ("Only one server address allowed per message");
-      return -99;
-    }
-  if ((ip4_set + ip6_set) == 0)
-    {
-      errmsg ("Server address required");
-      return -99;
-    }
-
-  /* Construct the API message */
-  M (DNS_NAME_SERVER_ADD_DEL, mp);
-
-  if (ip6_set)
-    {
-      memcpy (mp->server_address, &ip6_server, sizeof (ip6_address_t));
-      mp->is_ip6 = 1;
-    }
-  else
-    {
-      memcpy (mp->server_address, &ip4_server, sizeof (ip4_address_t));
-      mp->is_ip6 = 0;
-    }
-
-  mp->is_add = is_add;
-
-  /* send it... */
-  S (mp);
-
-  /* Wait for a reply, return good/bad news  */
-  W (ret);
-  return ret;
-}
-
 static void
 vl_api_session_rules_details_t_handler (vl_api_session_rules_details_t * mp)
 {
@@ -21365,8 +21160,8 @@ api_qos_record_enable_disable (vat_main_t * vam)
 
   M (QOS_RECORD_ENABLE_DISABLE, mp);
 
-  mp->sw_if_index = ntohl (sw_if_index);
-  mp->input_source = qs;
+  mp->record.sw_if_index = ntohl (sw_if_index);
+  mp->record.input_source = qs;
   mp->enable = enable;
 
   S (mp);
@@ -21402,6 +21197,98 @@ comment (vat_main_t * vam)
   return 0;
 }
 
+static int
+elog_save (vat_main_t * vam)
+{
+#if VPP_API_TEST_BUILTIN == 0
+  elog_main_t *em = &vam->elog_main;
+  unformat_input_t *i = vam->input;
+  char *file, *chroot_file;
+  clib_error_t *error;
+
+  if (!unformat (i, "%s", &file))
+    {
+      errmsg ("expected file name, got `%U'", format_unformat_error, i);
+      return 0;
+    }
+
+  /* It's fairly hard to get "../oopsie" through unformat; just in case */
+  if (strstr (file, "..") || index (file, '/'))
+    {
+      errmsg ("illegal characters in filename '%s'", file);
+      return 0;
+    }
+
+  chroot_file = (char *) format (0, "/tmp/%s%c", file, 0);
+
+  vec_free (file);
+
+  errmsg ("Saving %wd of %wd events to %s",
+         elog_n_events_in_buffer (em),
+         elog_buffer_capacity (em), chroot_file);
+
+  error = elog_write_file (em, chroot_file, 1 /* flush ring */ );
+  vec_free (chroot_file);
+
+  if (error)
+    clib_error_report (error);
+#else
+  errmsg ("Use the vpp event loger...");
+#endif
+
+  return 0;
+}
+
+static int
+elog_setup (vat_main_t * vam)
+{
+#if VPP_API_TEST_BUILTIN == 0
+  elog_main_t *em = &vam->elog_main;
+  unformat_input_t *i = vam->input;
+  u32 nevents = 128 << 10;
+
+  (void) unformat (i, "nevents %d", &nevents);
+
+  elog_init (em, nevents);
+  vl_api_set_elog_main (em);
+  vl_api_set_elog_trace_api_messages (1);
+  errmsg ("Event logger initialized with %u events", nevents);
+#else
+  errmsg ("Use the vpp event loger...");
+#endif
+  return 0;
+}
+
+static int
+elog_enable (vat_main_t * vam)
+{
+#if VPP_API_TEST_BUILTIN == 0
+  elog_main_t *em = &vam->elog_main;
+
+  elog_enable_disable (em, 1 /* enable */ );
+  vl_api_set_elog_trace_api_messages (1);
+  errmsg ("Event logger enabled...");
+#else
+  errmsg ("Use the vpp event loger...");
+#endif
+  return 0;
+}
+
+static int
+elog_disable (vat_main_t * vam)
+{
+#if VPP_API_TEST_BUILTIN == 0
+  elog_main_t *em = &vam->elog_main;
+
+  elog_enable_disable (em, 0 /* enable */ );
+  vl_api_set_elog_trace_api_messages (1);
+  errmsg ("Event logger disabled...");
+#else
+  errmsg ("Use the vpp event loger...");
+#endif
+  return 0;
+}
+
 static int
 statseg (vat_main_t * vam)
 {
@@ -22013,11 +21900,11 @@ _(l2_interface_vlan_tag_rewrite,                                        \
   "[translate-2-[1|2]] [push_dot1q 0] tag1 <nn> tag2 <nn>")             \
 _(create_vhost_user_if,                                                 \
         "socket <filename> [server] [renumber <dev_instance>] "         \
-        "[disable_mrg_rxbuf] [disable_indirect_desc] "                  \
+        "[disable_mrg_rxbuf] [disable_indirect_desc] [gso] "            \
         "[mac <mac_address>]")                                          \
 _(modify_vhost_user_if,                                                 \
         "<intfc> | sw_if_index <nn> socket <filename>\n"                \
-        "[server] [renumber <dev_instance>]")                           \
+        "[server] [renumber <dev_instance>] [gso]")                     \
 _(delete_vhost_user_if, "<intfc> | sw_if_index <nn>")                   \
 _(sw_interface_vhost_user_dump, "")                                     \
 _(show_version, "")                                                     \
@@ -22224,7 +22111,7 @@ _(ipfix_classify_table_dump, "")                                        \
 _(sw_interface_span_enable_disable, "[l2] [src <intfc> | src_sw_if_index <id>] [disable | [[dst <intfc> | dst_sw_if_index <id>] [both|rx|tx]]]") \
 _(sw_interface_span_dump, "[l2]")                                           \
 _(get_next_index, "node-name <node-name> next-node-name <node-name>")   \
-_(pg_create_interface, "if_id <nn>")                                    \
+_(pg_create_interface, "if_id <nn> [gso-enabled gso-size <size>]")      \
 _(pg_capture, "if_id <nnn> pcap <file_name> count <nnn> [disable]")     \
 _(pg_enable_disable, "[stream <id>] disable")                           \
 _(ip_source_and_port_range_check_add_del,                               \
@@ -22261,12 +22148,6 @@ _(sw_interface_set_lldp, "<intfc> | sw_if_index <nn> [port-desc <description>]\n
 _(tcp_configure_src_addresses, "<ip4|6>first-<ip4|6>last [vrf <id>]")  \
 _(sock_init_shm, "size <nnn>")                                         \
 _(app_namespace_add_del, "[add] id <ns-id> secret <nn> sw_if_index <nn>")\
-_(dns_enable_disable, "[enable][disable]")                             \
-_(dns_name_server_add_del, "<ip-address> [del]")                       \
-_(dns_resolve_name, "<hostname>")                                      \
-_(dns_resolve_ip, "<ip4|ip6>")                                         \
-_(dns_name_server_add_del, "<ip-address> [del]")                       \
-_(dns_resolve_name, "<hostname>")                                      \
 _(session_rule_add_del, "[add|del] proto <tcp/udp> <lcl-ip>/<plen> "   \
   "<lcl-port> <rmt-ip>/<plen> <rmt-port> action <nn>")                 \
 _(session_rules_dump, "")                                              \
@@ -22286,6 +22167,10 @@ _(dump_ipv6_table, "usage: dump_ipv6_table")                    \
 _(dump_macro_table, "usage: dump_macro_table ")                 \
 _(dump_node_table, "usage: dump_node_table")                   \
 _(dump_msg_api_table, "usage: dump_msg_api_table")             \
+_(elog_setup, "usage: elog_setup [nevents, default 128K]")      \
+_(elog_disable, "usage: elog_disable")                          \
+_(elog_enable, "usage: elog_enable")                            \
+_(elog_save, "usage: elog_save <filename>")                     \
 _(get_msg_id, "usage: get_msg_id name_and_crc")                        \
 _(echo, "usage: echo <message>")                               \
 _(exec, "usage: exec <vpe-debug-CLI-command>")                  \