ip: add container proxy api
[vpp.git] / src / vat / api_format.c
index daa0907..0651be9 100644 (file)
@@ -718,14 +718,14 @@ increment_v6_address (ip6_address_t * a)
 }
 
 static void
-increment_mac_address (u64 * mac)
+increment_mac_address (u8 * mac)
 {
-  u64 tmp = *mac;
-
+  u64 tmp = *((u64 *) mac);
   tmp = clib_net_to_host_u64 (tmp);
   tmp += 1 << 16;              /* skip unused (least significant) octets */
   tmp = clib_host_to_net_u64 (tmp);
-  *mac = tmp;
+
+  clib_memcpy (mac, &tmp, 6);
 }
 
 static void vl_api_create_loopback_reply_t_handler
@@ -2137,6 +2137,7 @@ static void vl_api_memfd_segment_create_reply_t_handler
 
       vam->client_index_invalid = 1;
 
+      /* Note: this closes memfd.fd */
       retval = memfd_slave_init (&memfd);
       if (retval)
        clib_warning ("WARNING: segment map returned %d", retval);
@@ -2152,8 +2153,6 @@ static void vl_api_memfd_segment_create_reply_t_handler
       vl_client_connect_to_vlib_no_map ("pvt",
                                        "vpp_api_test(p)",
                                        32 /* input_queue_length */ );
-      if (close (my_fd) < 0)
-       clib_unix_warning ("close memfd fd pivot");
       vam->vl_input_queue = am->shmem_hdr->vl_input_queue;
 
       vl_socket_client_enable_disable (&vam->socket_client_main,
@@ -2179,6 +2178,69 @@ static void vl_api_memfd_segment_create_reply_t_handler_json
   clib_warning ("no");
 }
 
+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)
@@ -4176,6 +4238,123 @@ static void
   vam->result_ready = 1;
 }
 
+static void
+  vl_api_one_show_xtr_mode_reply_t_handler
+  (vl_api_one_show_xtr_mode_reply_t * mp)
+{
+  vat_main_t *vam = &vat_main;
+  i32 retval = ntohl (mp->retval);
+
+  if (0 <= retval)
+    {
+      print (vam->ofp, "%s\n", mp->is_en ? "enabled" : "disabled");
+    }
+
+  vam->retval = retval;
+  vam->result_ready = 1;
+}
+
+static void
+  vl_api_one_show_xtr_mode_reply_t_handler_json
+  (vl_api_one_show_xtr_mode_reply_t * mp)
+{
+  vat_main_t *vam = &vat_main;
+  vat_json_node_t node;
+  u8 *status = 0;
+
+  status = format (0, "%s", mp->is_en ? "enabled" : "disabled");
+  vec_add1 (status, 0);
+
+  vat_json_init_object (&node);
+  vat_json_object_add_string_copy (&node, "status", status);
+
+  vec_free (status);
+
+  vat_json_print (vam->ofp, &node);
+  vat_json_free (&node);
+
+  vam->retval = ntohl (mp->retval);
+  vam->result_ready = 1;
+}
+
+static void
+  vl_api_one_show_pitr_mode_reply_t_handler
+  (vl_api_one_show_pitr_mode_reply_t * mp)
+{
+  vat_main_t *vam = &vat_main;
+  i32 retval = ntohl (mp->retval);
+
+  if (0 <= retval)
+    {
+      print (vam->ofp, "%s\n", mp->is_en ? "enabled" : "disabled");
+    }
+
+  vam->retval = retval;
+  vam->result_ready = 1;
+}
+
+static void
+  vl_api_one_show_pitr_mode_reply_t_handler_json
+  (vl_api_one_show_pitr_mode_reply_t * mp)
+{
+  vat_main_t *vam = &vat_main;
+  vat_json_node_t node;
+  u8 *status = 0;
+
+  status = format (0, "%s", mp->is_en ? "enabled" : "disabled");
+  vec_add1 (status, 0);
+
+  vat_json_init_object (&node);
+  vat_json_object_add_string_copy (&node, "status", status);
+
+  vec_free (status);
+
+  vat_json_print (vam->ofp, &node);
+  vat_json_free (&node);
+
+  vam->retval = ntohl (mp->retval);
+  vam->result_ready = 1;
+}
+
+static void
+  vl_api_one_show_petr_mode_reply_t_handler
+  (vl_api_one_show_petr_mode_reply_t * mp)
+{
+  vat_main_t *vam = &vat_main;
+  i32 retval = ntohl (mp->retval);
+
+  if (0 <= retval)
+    {
+      print (vam->ofp, "%s\n", mp->is_en ? "enabled" : "disabled");
+    }
+
+  vam->retval = retval;
+  vam->result_ready = 1;
+}
+
+static void
+  vl_api_one_show_petr_mode_reply_t_handler_json
+  (vl_api_one_show_petr_mode_reply_t * mp)
+{
+  vat_main_t *vam = &vat_main;
+  vat_json_node_t node;
+  u8 *status = 0;
+
+  status = format (0, "%s", mp->is_en ? "enabled" : "disabled");
+  vec_add1 (status, 0);
+
+  vat_json_init_object (&node);
+  vat_json_object_add_string_copy (&node, "status", status);
+
+  vec_free (status);
+
+  vat_json_print (vam->ofp, &node);
+  vat_json_free (&node);
+
+  vam->retval = ntohl (mp->retval);
+  vam->result_ready = 1;
+}
+
 static void
   vl_api_show_one_use_petr_reply_t_handler
   (vl_api_show_one_use_petr_reply_t * mp)
@@ -4982,6 +5161,7 @@ static void vl_api_flow_classify_details_t_handler_json
 #define foreach_standard_reply_retval_handler           \
 _(sw_interface_set_flags_reply)                         \
 _(sw_interface_add_del_address_reply)                   \
+_(sw_interface_set_rx_mode_reply)                       \
 _(sw_interface_set_table_reply)                         \
 _(sw_interface_set_mpls_enable_reply)                   \
 _(sw_interface_set_vpath_reply)                         \
@@ -5044,6 +5224,8 @@ _(ipsec_spd_add_del_entry_reply)                        \
 _(ipsec_sad_add_del_entry_reply)                        \
 _(ipsec_sa_set_key_reply)                               \
 _(ipsec_tunnel_if_add_del_reply)                        \
+_(ipsec_tunnel_if_set_key_reply)                        \
+_(ipsec_tunnel_if_set_sa_reply)                         \
 _(ikev2_profile_add_del_reply)                          \
 _(ikev2_profile_set_auth_reply)                         \
 _(ikev2_profile_set_id_reply)                           \
@@ -5066,8 +5248,8 @@ _(want_stats_reply)                                       \
 _(cop_interface_enable_disable_reply)                  \
 _(cop_whitelist_enable_disable_reply)                   \
 _(sw_interface_clear_stats_reply)                       \
-_(ioam_enable_reply)                              \
-_(ioam_disable_reply)                              \
+_(ioam_enable_reply)                                    \
+_(ioam_disable_reply)                                   \
 _(one_add_del_locator_reply)                            \
 _(one_add_del_local_eid_reply)                          \
 _(one_add_del_remote_mapping_reply)                     \
@@ -5089,6 +5271,9 @@ _(one_stats_enable_disable_reply)                       \
 _(one_add_del_l2_arp_entry_reply)                       \
 _(one_add_del_ndp_entry_reply)                          \
 _(one_stats_flush_reply)                                \
+_(one_enable_disable_xtr_mode_reply)                    \
+_(one_enable_disable_pitr_mode_reply)                   \
+_(one_enable_disable_petr_mode_reply)                   \
 _(gpe_enable_disable_reply)                             \
 _(gpe_set_encap_mode_reply)                             \
 _(gpe_add_del_iface_reply)                              \
@@ -5117,7 +5302,11 @@ _(p2p_ethernet_del_reply)                               \
 _(lldp_config_reply)                                    \
 _(sw_interface_set_lldp_reply)                         \
 _(tcp_configure_src_addresses_reply)                   \
-_(app_namespace_add_del_reply)
+_(app_namespace_add_del_reply)                          \
+_(dns_enable_disable_reply)                             \
+_(dns_name_server_add_del_reply)                       \
+_(session_rule_add_del_reply)                          \
+_(ip_container_proxy_add_del_reply)
 
 #define _(n)                                    \
     static void vl_api_##n##_t_handler          \
@@ -5165,6 +5354,7 @@ _(CLI_REPLY, cli_reply)                                                 \
 _(CLI_INBAND_REPLY, cli_inband_reply)                                   \
 _(SW_INTERFACE_ADD_DEL_ADDRESS_REPLY,                                   \
   sw_interface_add_del_address_reply)                                   \
+_(SW_INTERFACE_SET_RX_MODE_REPLY, sw_interface_set_rx_mode_reply)       \
 _(SW_INTERFACE_SET_TABLE_REPLY, sw_interface_set_table_reply)          \
 _(SW_INTERFACE_SET_MPLS_ENABLE_REPLY, sw_interface_set_mpls_enable_reply) \
 _(SW_INTERFACE_SET_VPATH_REPLY, sw_interface_set_vpath_reply)          \
@@ -5275,6 +5465,8 @@ _(IPSEC_SAD_ADD_DEL_ENTRY_REPLY, ipsec_sad_add_del_entry_reply)         \
 _(IPSEC_SA_DETAILS, ipsec_sa_details)                                   \
 _(IPSEC_SA_SET_KEY_REPLY, ipsec_sa_set_key_reply)                       \
 _(IPSEC_TUNNEL_IF_ADD_DEL_REPLY, ipsec_tunnel_if_add_del_reply)         \
+_(IPSEC_TUNNEL_IF_SET_KEY_REPLY, ipsec_tunnel_if_set_key_reply)         \
+_(IPSEC_TUNNEL_IF_SET_SA_REPLY, ipsec_tunnel_if_set_sa_reply)           \
 _(IKEV2_PROFILE_ADD_DEL_REPLY, ikev2_profile_add_del_reply)             \
 _(IKEV2_PROFILE_SET_AUTH_REPLY, ikev2_profile_set_auth_reply)           \
 _(IKEV2_PROFILE_SET_ID_REPLY, ikev2_profile_set_id_reply)               \
@@ -5345,6 +5537,14 @@ _(ONE_NDP_ENTRIES_GET_REPLY, one_ndp_entries_get_reply)                 \
 _(ONE_ADD_DEL_L2_ARP_ENTRY_REPLY, one_add_del_l2_arp_entry_reply)       \
 _(ONE_L2_ARP_BD_GET_REPLY, one_l2_arp_bd_get_reply)                     \
 _(ONE_L2_ARP_ENTRIES_GET_REPLY, one_l2_arp_entries_get_reply)           \
+_(ONE_ENABLE_DISABLE_XTR_MODE_REPLY, one_enable_disable_xtr_mode_reply) \
+_(ONE_ENABLE_DISABLE_PITR_MODE_REPLY,                                   \
+  one_enable_disable_pitr_mode_reply)                                   \
+_(ONE_ENABLE_DISABLE_PETR_MODE_REPLY,                                   \
+  one_enable_disable_petr_mode_reply)                                   \
+_(ONE_SHOW_XTR_MODE_REPLY, one_show_xtr_mode_reply)                     \
+_(ONE_SHOW_PITR_MODE_REPLY, one_show_pitr_mode_reply)                   \
+_(ONE_SHOW_PETR_MODE_REPLY, one_show_petr_mode_reply)                   \
 _(GPE_SET_ENCAP_MODE_REPLY, gpe_set_encap_mode_reply)                   \
 _(GPE_GET_ENCAP_MODE_REPLY, gpe_get_encap_mode_reply)                   \
 _(GPE_ADD_DEL_IFACE_REPLY, gpe_add_del_iface_reply)                     \
@@ -5422,7 +5622,14 @@ _(P2P_ETHERNET_DEL_REPLY, p2p_ethernet_del_reply)                       \
 _(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)
+_(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)  \
 
 #define foreach_standalone_reply_msg                                   \
 _(SW_INTERFACE_EVENT, sw_interface_event)                               \
@@ -5432,7 +5639,7 @@ _(VNET_IP4_FIB_COUNTERS, vnet_ip4_fib_counters)                         \
 _(VNET_IP6_FIB_COUNTERS, vnet_ip6_fib_counters)                         \
 _(VNET_IP4_NBR_COUNTERS, vnet_ip4_nbr_counters)                         \
 _(VNET_IP6_NBR_COUNTERS, vnet_ip6_nbr_counters)                                \
-_(MEMFD_SEGMENT_CREATE_REPLY, memfd_segment_create_reply)
+_(MEMFD_SEGMENT_CREATE_REPLY, memfd_segment_create_reply)               \
 
 typedef struct
 {
@@ -5845,7 +6052,7 @@ exec_inband (vat_main_t * vam)
   W (ret);
   /* json responses may or may not include a useful reply... */
   if (vec_len (vam->cmd_reply))
-    print (vam->ofp, (char *) (vam->cmd_reply));
+    print (vam->ofp, "%v", (char *) (vam->cmd_reply));
   return ret;
 }
 
@@ -6158,6 +6365,64 @@ api_sw_interface_set_flags (vat_main_t * vam)
   return ret;
 }
 
+static int
+api_sw_interface_set_rx_mode (vat_main_t * vam)
+{
+  unformat_input_t *i = vam->input;
+  vl_api_sw_interface_set_rx_mode_t *mp;
+  u32 sw_if_index;
+  u8 sw_if_index_set = 0;
+  int ret;
+  u8 queue_id_valid = 0;
+  u32 queue_id;
+  vnet_hw_interface_rx_mode mode = VNET_HW_INTERFACE_RX_MODE_UNKNOWN;
+
+  /* Parse args required to build the message */
+  while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
+    {
+      if (unformat (i, "queue %d", &queue_id))
+       queue_id_valid = 1;
+      else if (unformat (i, "polling"))
+       mode = VNET_HW_INTERFACE_RX_MODE_POLLING;
+      else if (unformat (i, "interrupt"))
+       mode = VNET_HW_INTERFACE_RX_MODE_INTERRUPT;
+      else if (unformat (i, "adaptive"))
+       mode = VNET_HW_INTERFACE_RX_MODE_ADAPTIVE;
+      else
+       if (unformat (i, "%U", api_unformat_sw_if_index, vam, &sw_if_index))
+       sw_if_index_set = 1;
+      else if (unformat (i, "sw_if_index %d", &sw_if_index))
+       sw_if_index_set = 1;
+      else
+       break;
+    }
+
+  if (sw_if_index_set == 0)
+    {
+      errmsg ("missing interface name or sw_if_index");
+      return -99;
+    }
+  if (mode == VNET_HW_INTERFACE_RX_MODE_UNKNOWN)
+    {
+      errmsg ("missing rx-mode");
+      return -99;
+    }
+
+  /* Construct the API message */
+  M (SW_INTERFACE_SET_RX_MODE, mp);
+  mp->sw_if_index = ntohl (sw_if_index);
+  mp->mode = mode;
+  mp->queue_id_valid = queue_id_valid;
+  mp->queue_id = queue_id_valid ? ntohl (queue_id) : ~0;
+
+  /* send it... */
+  S (mp);
+
+  /* Wait for a reply, return the good/bad news... */
+  W (ret);
+  return ret;
+}
+
 static int
 api_sw_interface_clear_stats (vat_main_t * vam)
 {
@@ -6892,7 +7157,7 @@ api_l2fib_add_del (vat_main_t * vam)
   unformat_input_t *i = vam->input;
   vl_api_l2fib_add_del_t *mp;
   f64 timeout;
-  u64 mac = 0;
+  u8 mac[6] = { 0 };
   u8 mac_set = 0;
   u32 bd_id;
   u8 bd_id_set = 0;
@@ -6909,7 +7174,7 @@ api_l2fib_add_del (vat_main_t * vam)
   /* Parse args required to build the message */
   while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
     {
-      if (unformat (i, "mac %U", unformat_ethernet_address, &mac))
+      if (unformat (i, "mac %U", unformat_ethernet_address, mac))
        mac_set = 1;
       else if (unformat (i, "bd_id %d", &bd_id))
        bd_id_set = 1;
@@ -6976,7 +7241,7 @@ api_l2fib_add_del (vat_main_t * vam)
     {
       M (L2FIB_ADD_DEL, mp);
 
-      mp->mac = mac;
+      clib_memcpy (mp->mac, mac, 6);
       mp->bd_id = ntohl (bd_id);
       mp->is_add = is_add;
 
@@ -6987,7 +7252,7 @@ api_l2fib_add_del (vat_main_t * vam)
          mp->filter_mac = filter_mac;
          mp->bvi_mac = bvi_mac;
        }
-      increment_mac_address (&mac);
+      increment_mac_address (mac);
       /* send it... */
       S (mp);
     }
@@ -7525,7 +7790,6 @@ api_ip_add_del_route (vat_main_t * vam)
   u8 create_vrf_if_needed = 0;
   u8 is_add = 1;
   u32 next_hop_weight = 1;
-  u8 not_last = 0;
   u8 is_multipath = 0;
   u8 address_set = 0;
   u8 address_length_set = 0;
@@ -7609,8 +7873,6 @@ api_ip_add_del_route (vat_main_t * vam)
        is_add = 0;
       else if (unformat (i, "add"))
        is_add = 1;
-      else if (unformat (i, "not-last"))
-       not_last = 1;
       else if (unformat (i, "resolve-via-host"))
        resolve_host = 1;
       else if (unformat (i, "resolve-via-attached"))
@@ -7719,7 +7981,6 @@ api_ip_add_del_route (vat_main_t * vam)
       mp->is_multipath = is_multipath;
       mp->is_resolve_host = resolve_host;
       mp->is_resolve_attached = resolve_attached;
-      mp->not_last = not_last;
       mp->next_hop_weight = next_hop_weight;
       mp->dst_address_length = dst_address_length;
       mp->next_hop_table_id = ntohl (next_hop_table_id);
@@ -13186,16 +13447,6 @@ api_vxlan_gpe_tunnel_dump (vat_main_t * vam)
   return ret;
 }
 
-
-u8 *
-format_l2_fib_mac_address (u8 * s, va_list * args)
-{
-  u8 *a = va_arg (*args, u8 *);
-
-  return format (s, "%02x:%02x:%02x:%02x:%02x:%02x",
-                a[2], a[3], a[4], a[5], a[6], a[7]);
-}
-
 static void vl_api_l2_fib_table_details_t_handler
   (vl_api_l2_fib_table_details_t * mp)
 {
@@ -13203,7 +13454,7 @@ static void vl_api_l2_fib_table_details_t_handler
 
   print (vam->ofp, "%3" PRIu32 "    %U    %3" PRIu32
         "       %d       %d     %d",
-        ntohl (mp->bd_id), format_l2_fib_mac_address, &mp->mac,
+        ntohl (mp->bd_id), format_ethernet_address, mp->mac,
         ntohl (mp->sw_if_index), mp->static_mac, mp->filter_mac,
         mp->bvi_mac);
 }
@@ -13223,7 +13474,7 @@ static void vl_api_l2_fib_table_details_t_handler_json
 
   vat_json_init_object (node);
   vat_json_object_add_uint (node, "bd_id", ntohl (mp->bd_id));
-  vat_json_object_add_uint (node, "mac", clib_net_to_host_u64 (mp->mac));
+  vat_json_object_add_bytes (node, "mac", mp->mac, 6);
   vat_json_object_add_uint (node, "sw_if_index", ntohl (mp->sw_if_index));
   vat_json_object_add_uint (node, "static_mac", mp->static_mac);
   vat_json_object_add_uint (node, "filter_mac", mp->filter_mac);
@@ -14263,79 +14514,203 @@ api_ipsec_sa_dump (vat_main_t * vam)
 }
 
 static int
-api_ikev2_profile_add_del (vat_main_t * vam)
+api_ipsec_tunnel_if_set_key (vat_main_t * vam)
 {
   unformat_input_t *i = vam->input;
-  vl_api_ikev2_profile_add_del_t *mp;
-  u8 is_add = 1;
-  u8 *name = 0;
+  vl_api_ipsec_tunnel_if_set_key_t *mp;
+  u32 sw_if_index = ~0;
+  u8 key_type = IPSEC_IF_SET_KEY_TYPE_NONE;
+  u8 *key = 0;
+  u32 alg = ~0;
   int ret;
 
-  const char *valid_chars = "a-zA-Z0-9_";
-
   while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
     {
-      if (unformat (i, "del"))
-       is_add = 0;
-      else if (unformat (i, "name %U", unformat_token, valid_chars, &name))
-       vec_add1 (name, 0);
+      if (unformat (i, "%U", api_unformat_sw_if_index, vam, &sw_if_index))
+       ;
+      else
+       if (unformat (i, "local crypto %U", unformat_ipsec_crypto_alg, &alg))
+       key_type = IPSEC_IF_SET_KEY_TYPE_LOCAL_CRYPTO;
+      else
+       if (unformat (i, "remote crypto %U", unformat_ipsec_crypto_alg, &alg))
+       key_type = IPSEC_IF_SET_KEY_TYPE_REMOTE_CRYPTO;
+      else if (unformat (i, "local integ %U", unformat_ipsec_integ_alg, &alg))
+       key_type = IPSEC_IF_SET_KEY_TYPE_LOCAL_INTEG;
+      else
+       if (unformat (i, "remote integ %U", unformat_ipsec_integ_alg, &alg))
+       key_type = IPSEC_IF_SET_KEY_TYPE_REMOTE_INTEG;
+      else if (unformat (i, "%U", unformat_hex_string, &key))
+       ;
       else
        {
-         errmsg ("parse error '%U'", format_unformat_error, i);
+         clib_warning ("parse error '%U'", format_unformat_error, i);
          return -99;
        }
     }
 
-  if (!vec_len (name))
+  if (sw_if_index == ~0)
     {
-      errmsg ("profile name must be specified");
+      errmsg ("interface must be specified");
       return -99;
     }
 
-  if (vec_len (name) > 64)
+  if (key_type == IPSEC_IF_SET_KEY_TYPE_NONE)
     {
-      errmsg ("profile name too long");
+      errmsg ("key type must be specified");
       return -99;
     }
 
-  M (IKEV2_PROFILE_ADD_DEL, mp);
+  if (alg == ~0)
+    {
+      errmsg ("algorithm must be specified");
+      return -99;
+    }
 
-  clib_memcpy (mp->name, name, vec_len (name));
-  mp->is_add = is_add;
-  vec_free (name);
+  if (vec_len (key) == 0)
+    {
+      errmsg ("key must be specified");
+      return -99;
+    }
+
+  M (IPSEC_TUNNEL_IF_SET_KEY, mp);
+
+  mp->sw_if_index = htonl (sw_if_index);
+  mp->alg = alg;
+  mp->key_type = key_type;
+  mp->key_len = vec_len (key);
+  clib_memcpy (mp->key, key, vec_len (key));
 
   S (mp);
   W (ret);
+
   return ret;
 }
 
 static int
-api_ikev2_profile_set_auth (vat_main_t * vam)
+api_ipsec_tunnel_if_set_sa (vat_main_t * vam)
 {
   unformat_input_t *i = vam->input;
-  vl_api_ikev2_profile_set_auth_t *mp;
-  u8 *name = 0;
-  u8 *data = 0;
-  u32 auth_method = 0;
-  u8 is_hex = 0;
+  vl_api_ipsec_tunnel_if_set_sa_t *mp;
+  u32 sw_if_index = ~0;
+  u32 sa_id = ~0;
+  u8 is_outbound = (u8) ~ 0;
   int ret;
 
-  const char *valid_chars = "a-zA-Z0-9_";
-
   while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
     {
-      if (unformat (i, "name %U", unformat_token, valid_chars, &name))
-       vec_add1 (name, 0);
-      else if (unformat (i, "auth_method %U",
-                        unformat_ikev2_auth_method, &auth_method))
+      if (unformat (i, "%U", api_unformat_sw_if_index, vam, &sw_if_index))
        ;
-      else if (unformat (i, "auth_data 0x%U", unformat_hex_string, &data))
-       is_hex = 1;
-      else if (unformat (i, "auth_data %v", &data))
+      else if (unformat (i, "sa_id %d", &sa_id))
        ;
+      else if (unformat (i, "outbound"))
+       is_outbound = 1;
+      else if (unformat (i, "inbound"))
+       is_outbound = 0;
       else
        {
-         errmsg ("parse error '%U'", format_unformat_error, i);
+         clib_warning ("parse error '%U'", format_unformat_error, i);
+         return -99;
+       }
+    }
+
+  if (sw_if_index == ~0)
+    {
+      errmsg ("interface must be specified");
+      return -99;
+    }
+
+  if (sa_id == ~0)
+    {
+      errmsg ("SA ID must be specified");
+      return -99;
+    }
+
+  M (IPSEC_TUNNEL_IF_SET_SA, mp);
+
+  mp->sw_if_index = htonl (sw_if_index);
+  mp->sa_id = htonl (sa_id);
+  mp->is_outbound = is_outbound;
+
+  S (mp);
+  W (ret);
+
+  return ret;
+}
+
+static int
+api_ikev2_profile_add_del (vat_main_t * vam)
+{
+  unformat_input_t *i = vam->input;
+  vl_api_ikev2_profile_add_del_t *mp;
+  u8 is_add = 1;
+  u8 *name = 0;
+  int ret;
+
+  const char *valid_chars = "a-zA-Z0-9_";
+
+  while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
+    {
+      if (unformat (i, "del"))
+       is_add = 0;
+      else if (unformat (i, "name %U", unformat_token, valid_chars, &name))
+       vec_add1 (name, 0);
+      else
+       {
+         errmsg ("parse error '%U'", format_unformat_error, i);
+         return -99;
+       }
+    }
+
+  if (!vec_len (name))
+    {
+      errmsg ("profile name must be specified");
+      return -99;
+    }
+
+  if (vec_len (name) > 64)
+    {
+      errmsg ("profile name too long");
+      return -99;
+    }
+
+  M (IKEV2_PROFILE_ADD_DEL, mp);
+
+  clib_memcpy (mp->name, name, vec_len (name));
+  mp->is_add = is_add;
+  vec_free (name);
+
+  S (mp);
+  W (ret);
+  return ret;
+}
+
+static int
+api_ikev2_profile_set_auth (vat_main_t * vam)
+{
+  unformat_input_t *i = vam->input;
+  vl_api_ikev2_profile_set_auth_t *mp;
+  u8 *name = 0;
+  u8 *data = 0;
+  u32 auth_method = 0;
+  u8 is_hex = 0;
+  int ret;
+
+  const char *valid_chars = "a-zA-Z0-9_";
+
+  while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
+    {
+      if (unformat (i, "name %U", unformat_token, valid_chars, &name))
+       vec_add1 (name, 0);
+      else if (unformat (i, "auth_method %U",
+                        unformat_ikev2_auth_method, &auth_method))
+       ;
+      else if (unformat (i, "auth_data 0x%U", unformat_hex_string, &data))
+       is_hex = 1;
+      else if (unformat (i, "auth_data %v", &data))
+       ;
+      else
+       {
+         errmsg ("parse error '%U'", format_unformat_error, i);
          return -99;
        }
     }
@@ -16160,153 +16535,336 @@ api_one_enable_disable (vat_main_t * vam)
 #define api_lisp_enable_disable api_one_enable_disable
 
 static int
-api_show_one_map_register_state (vat_main_t * vam)
+api_one_enable_disable_xtr_mode (vat_main_t * vam)
 {
-  vl_api_show_one_map_register_state_t *mp;
+  unformat_input_t *input = vam->input;
+  vl_api_one_enable_disable_xtr_mode_t *mp;
+  u8 is_set = 0;
+  u8 is_en = 0;
   int ret;
 
-  M (SHOW_ONE_MAP_REGISTER_STATE, mp);
+  /* Parse args required to build the message */
+  while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
+    {
+      if (unformat (input, "enable"))
+       {
+         is_set = 1;
+         is_en = 1;
+       }
+      else if (unformat (input, "disable"))
+       {
+         is_set = 1;
+       }
+      else
+       break;
+    }
 
-  /* send */
+  if (!is_set)
+    {
+      errmsg ("Value not set");
+      return -99;
+    }
+
+  /* Construct the API message */
+  M (ONE_ENABLE_DISABLE_XTR_MODE, mp);
+
+  mp->is_en = is_en;
+
+  /* send it... */
   S (mp);
 
-  /* wait for reply */
+  /* Wait for a reply... */
   W (ret);
   return ret;
 }
 
-#define api_show_lisp_map_register_state api_show_one_map_register_state
-
 static int
-api_show_one_rloc_probe_state (vat_main_t * vam)
+api_one_show_xtr_mode (vat_main_t * vam)
 {
-  vl_api_show_one_rloc_probe_state_t *mp;
+  vl_api_one_show_xtr_mode_t *mp;
   int ret;
 
-  M (SHOW_ONE_RLOC_PROBE_STATE, mp);
+  /* Construct the API message */
+  M (ONE_SHOW_XTR_MODE, mp);
 
-  /* send */
+  /* send it... */
   S (mp);
 
-  /* wait for reply */
+  /* Wait for a reply... */
   W (ret);
   return ret;
 }
 
-#define api_show_lisp_rloc_probe_state api_show_one_rloc_probe_state
-
 static int
-api_one_add_del_ndp_entry (vat_main_t * vam)
+api_one_enable_disable_pitr_mode (vat_main_t * vam)
 {
-  vl_api_one_add_del_ndp_entry_t *mp;
   unformat_input_t *input = vam->input;
-  u8 is_add = 1;
-  u8 mac_set = 0;
-  u8 bd_set = 0;
-  u8 ip_set = 0;
-  u8 mac[6] = { 0, };
-  u8 ip6[16] = { 0, };
-  u32 bd = ~0;
+  vl_api_one_enable_disable_pitr_mode_t *mp;
+  u8 is_set = 0;
+  u8 is_en = 0;
   int ret;
 
   /* Parse args required to build the message */
   while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
     {
-      if (unformat (input, "del"))
-       is_add = 0;
-      else if (unformat (input, "mac %U", unformat_ethernet_address, mac))
-       mac_set = 1;
-      else if (unformat (input, "ip %U", unformat_ip6_address, ip6))
-       ip_set = 1;
-      else if (unformat (input, "bd %d", &bd))
-       bd_set = 1;
-      else
+      if (unformat (input, "enable"))
        {
-         errmsg ("parse error '%U'", format_unformat_error, input);
-         return -99;
+         is_set = 1;
+         is_en = 1;
+       }
+      else if (unformat (input, "disable"))
+       {
+         is_set = 1;
        }
+      else
+       break;
     }
 
-  if (!bd_set || !ip_set || (!mac_set && is_add))
+  if (!is_set)
     {
-      errmsg ("Missing BD, IP or MAC!");
+      errmsg ("Value not set");
       return -99;
     }
 
-  M (ONE_ADD_DEL_NDP_ENTRY, mp);
-  mp->is_add = is_add;
-  clib_memcpy (mp->mac, mac, 6);
-  mp->bd = clib_host_to_net_u32 (bd);
-  clib_memcpy (mp->ip6, ip6, sizeof (mp->ip6));
+  /* Construct the API message */
+  M (ONE_ENABLE_DISABLE_PITR_MODE, mp);
 
-  /* send */
+  mp->is_en = is_en;
+
+  /* send it... */
   S (mp);
 
-  /* wait for reply */
+  /* Wait for a reply... */
   W (ret);
   return ret;
 }
 
 static int
-api_one_add_del_l2_arp_entry (vat_main_t * vam)
+api_one_show_pitr_mode (vat_main_t * vam)
+{
+  vl_api_one_show_pitr_mode_t *mp;
+  int ret;
+
+  /* Construct the API message */
+  M (ONE_SHOW_PITR_MODE, mp);
+
+  /* send it... */
+  S (mp);
+
+  /* Wait for a reply... */
+  W (ret);
+  return ret;
+}
+
+static int
+api_one_enable_disable_petr_mode (vat_main_t * vam)
 {
-  vl_api_one_add_del_l2_arp_entry_t *mp;
   unformat_input_t *input = vam->input;
-  u8 is_add = 1;
-  u8 mac_set = 0;
-  u8 bd_set = 0;
-  u8 ip_set = 0;
-  u8 mac[6] = { 0, };
-  u32 ip4 = 0, bd = ~0;
+  vl_api_one_enable_disable_petr_mode_t *mp;
+  u8 is_set = 0;
+  u8 is_en = 0;
   int ret;
 
   /* Parse args required to build the message */
   while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
     {
-      if (unformat (input, "del"))
-       is_add = 0;
-      else if (unformat (input, "mac %U", unformat_ethernet_address, mac))
-       mac_set = 1;
-      else if (unformat (input, "ip %U", unformat_ip4_address, &ip4))
-       ip_set = 1;
-      else if (unformat (input, "bd %d", &bd))
-       bd_set = 1;
-      else
+      if (unformat (input, "enable"))
        {
-         errmsg ("parse error '%U'", format_unformat_error, input);
-         return -99;
+         is_set = 1;
+         is_en = 1;
+       }
+      else if (unformat (input, "disable"))
+       {
+         is_set = 1;
        }
+      else
+       break;
     }
 
-  if (!bd_set || !ip_set || (!mac_set && is_add))
+  if (!is_set)
     {
-      errmsg ("Missing BD, IP or MAC!");
+      errmsg ("Value not set");
       return -99;
     }
 
-  M (ONE_ADD_DEL_L2_ARP_ENTRY, mp);
-  mp->is_add = is_add;
-  clib_memcpy (mp->mac, mac, 6);
-  mp->bd = clib_host_to_net_u32 (bd);
-  mp->ip4 = ip4;
+  /* Construct the API message */
+  M (ONE_ENABLE_DISABLE_PETR_MODE, mp);
 
-  /* send */
+  mp->is_en = is_en;
+
+  /* send it... */
   S (mp);
 
-  /* wait for reply */
+  /* Wait for a reply... */
   W (ret);
   return ret;
 }
 
 static int
-api_one_ndp_bd_get (vat_main_t * vam)
+api_one_show_petr_mode (vat_main_t * vam)
 {
-  vl_api_one_ndp_bd_get_t *mp;
+  vl_api_one_show_petr_mode_t *mp;
   int ret;
 
-  M (ONE_NDP_BD_GET, mp);
+  /* Construct the API message */
+  M (ONE_SHOW_PETR_MODE, mp);
 
-  /* send */
+  /* send it... */
+  S (mp);
+
+  /* Wait for a reply... */
+  W (ret);
+  return ret;
+}
+
+static int
+api_show_one_map_register_state (vat_main_t * vam)
+{
+  vl_api_show_one_map_register_state_t *mp;
+  int ret;
+
+  M (SHOW_ONE_MAP_REGISTER_STATE, mp);
+
+  /* send */
+  S (mp);
+
+  /* wait for reply */
+  W (ret);
+  return ret;
+}
+
+#define api_show_lisp_map_register_state api_show_one_map_register_state
+
+static int
+api_show_one_rloc_probe_state (vat_main_t * vam)
+{
+  vl_api_show_one_rloc_probe_state_t *mp;
+  int ret;
+
+  M (SHOW_ONE_RLOC_PROBE_STATE, mp);
+
+  /* send */
+  S (mp);
+
+  /* wait for reply */
+  W (ret);
+  return ret;
+}
+
+#define api_show_lisp_rloc_probe_state api_show_one_rloc_probe_state
+
+static int
+api_one_add_del_ndp_entry (vat_main_t * vam)
+{
+  vl_api_one_add_del_ndp_entry_t *mp;
+  unformat_input_t *input = vam->input;
+  u8 is_add = 1;
+  u8 mac_set = 0;
+  u8 bd_set = 0;
+  u8 ip_set = 0;
+  u8 mac[6] = { 0, };
+  u8 ip6[16] = { 0, };
+  u32 bd = ~0;
+  int ret;
+
+  /* Parse args required to build the message */
+  while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
+    {
+      if (unformat (input, "del"))
+       is_add = 0;
+      else if (unformat (input, "mac %U", unformat_ethernet_address, mac))
+       mac_set = 1;
+      else if (unformat (input, "ip %U", unformat_ip6_address, ip6))
+       ip_set = 1;
+      else if (unformat (input, "bd %d", &bd))
+       bd_set = 1;
+      else
+       {
+         errmsg ("parse error '%U'", format_unformat_error, input);
+         return -99;
+       }
+    }
+
+  if (!bd_set || !ip_set || (!mac_set && is_add))
+    {
+      errmsg ("Missing BD, IP or MAC!");
+      return -99;
+    }
+
+  M (ONE_ADD_DEL_NDP_ENTRY, mp);
+  mp->is_add = is_add;
+  clib_memcpy (mp->mac, mac, 6);
+  mp->bd = clib_host_to_net_u32 (bd);
+  clib_memcpy (mp->ip6, ip6, sizeof (mp->ip6));
+
+  /* send */
+  S (mp);
+
+  /* wait for reply */
+  W (ret);
+  return ret;
+}
+
+static int
+api_one_add_del_l2_arp_entry (vat_main_t * vam)
+{
+  vl_api_one_add_del_l2_arp_entry_t *mp;
+  unformat_input_t *input = vam->input;
+  u8 is_add = 1;
+  u8 mac_set = 0;
+  u8 bd_set = 0;
+  u8 ip_set = 0;
+  u8 mac[6] = { 0, };
+  u32 ip4 = 0, bd = ~0;
+  int ret;
+
+  /* Parse args required to build the message */
+  while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
+    {
+      if (unformat (input, "del"))
+       is_add = 0;
+      else if (unformat (input, "mac %U", unformat_ethernet_address, mac))
+       mac_set = 1;
+      else if (unformat (input, "ip %U", unformat_ip4_address, &ip4))
+       ip_set = 1;
+      else if (unformat (input, "bd %d", &bd))
+       bd_set = 1;
+      else
+       {
+         errmsg ("parse error '%U'", format_unformat_error, input);
+         return -99;
+       }
+    }
+
+  if (!bd_set || !ip_set || (!mac_set && is_add))
+    {
+      errmsg ("Missing BD, IP or MAC!");
+      return -99;
+    }
+
+  M (ONE_ADD_DEL_L2_ARP_ENTRY, mp);
+  mp->is_add = is_add;
+  clib_memcpy (mp->mac, mac, 6);
+  mp->bd = clib_host_to_net_u32 (bd);
+  mp->ip4 = ip4;
+
+  /* send */
+  S (mp);
+
+  /* wait for reply */
+  W (ret);
+  return ret;
+}
+
+static int
+api_one_ndp_bd_get (vat_main_t * vam)
+{
+  vl_api_one_ndp_bd_get_t *mp;
+  int ret;
+
+  M (ONE_NDP_BD_GET, mp);
+
+  /* send */
   S (mp);
 
   /* wait for reply */
@@ -20633,9 +21191,14 @@ api_sw_interface_set_lldp (vat_main_t * vam)
   vl_api_sw_interface_set_lldp_t *mp;
   u32 sw_if_index = ~0;
   u32 enable = 1;
-  u8 *port_desc = NULL;
+  u8 *port_desc = NULL, *mgmt_oid = NULL;
+  ip4_address_t ip4_addr;
+  ip6_address_t ip6_addr;
   int ret;
 
+  memset (&ip4_addr, 0, sizeof (ip4_addr));
+  memset (&ip6_addr, 0, sizeof (ip6_addr));
+
   while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
     {
       if (unformat (i, "disable"))
@@ -20647,6 +21210,12 @@ api_sw_interface_set_lldp (vat_main_t * vam)
        ;
       else if (unformat (i, "port-desc %s", &port_desc))
        ;
+      else if (unformat (i, "mgmt-ip4 %U", unformat_ip4_address, &ip4_addr))
+       ;
+      else if (unformat (i, "mgmt-ip6 %U", unformat_ip6_address, &ip6_addr))
+       ;
+      else if (unformat (i, "mgmt-oid %s", &mgmt_oid))
+       ;
       else
        break;
     }
@@ -20659,11 +21228,16 @@ api_sw_interface_set_lldp (vat_main_t * vam)
 
   /* Construct the API message */
   vec_add1 (port_desc, 0);
+  vec_add1 (mgmt_oid, 0);
   M (SW_INTERFACE_SET_LLDP, mp);
   mp->sw_if_index = ntohl (sw_if_index);
   mp->enable = enable;
   clib_memcpy (mp->port_desc, port_desc, vec_len (port_desc));
+  clib_memcpy (mp->mgmt_oid, mgmt_oid, vec_len (mgmt_oid));
+  clib_memcpy (mp->mgmt_ip4, &ip4_addr, sizeof (ip4_addr));
+  clib_memcpy (mp->mgmt_ip6, &ip6_addr, sizeof (ip6_addr));
   vec_free (port_desc);
+  vec_free (mgmt_oid);
 
   S (mp);
   W (ret);
@@ -20776,7 +21350,7 @@ api_app_namespace_add_del (vat_main_t * vam)
 
   clib_memcpy (mp->namespace_id, ns_id, vec_len (ns_id));
   mp->namespace_id_len = vec_len (ns_id);
-  mp->secret = secret;
+  mp->secret = clib_host_to_net_u64 (secret);
   mp->sw_if_index = clib_host_to_net_u32 (sw_if_index);
   mp->ip4_fib_id = clib_host_to_net_u32 (ip4_fib_id);
   mp->ip6_fib_id = clib_host_to_net_u32 (ip6_fib_id);
@@ -20789,26 +21363,442 @@ api_app_namespace_add_del (vat_main_t * vam)
 static int
 api_memfd_segment_create (vat_main_t * vam)
 {
+#if VPP_API_TEST_BUILTIN == 0
   unformat_input_t *i = vam->input;
   vl_api_memfd_segment_create_t *mp;
   u64 size = 64 << 20;
   int ret;
 
-#if VPP_API_TEST_BUILTIN == 1
+  while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
+    {
+      if (unformat (i, "size %U", unformat_memory_size, &size))
+       ;
+      else
+       break;
+    }
+
+  M (MEMFD_SEGMENT_CREATE, mp);
+  mp->requested_size = size;
+  S (mp);
+  W (ret);
+  return ret;
+
+#else
   errmsg ("memfd_segment_create (builtin) not supported");
   return -99;
 #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, "size %U", unformat_memory_size, &size))
+      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)
+{
+  vat_main_t *vam = &vat_main;
+
+  if (mp->is_ip4)
+    {
+      print (vam->ofp,
+            "appns %u tp %u scope %d %U/%d %d %U/%d %d action: %d tag: %s",
+            mp->appns_index, mp->transport_proto, mp->scope,
+            format_ip4_address, &mp->lcl_ip, mp->lcl_plen, mp->lcl_port,
+            format_ip4_address, &mp->rmt_ip, mp->rmt_plen, mp->rmt_port,
+            mp->action_index, mp->tag);
+    }
+  else
+    {
+      print (vam->ofp,
+            "appns %u tp %u scope %d %U/%d %d %U/%d %d action: %d tag: %s",
+            mp->appns_index, mp->transport_proto, mp->scope,
+            format_ip6_address, &mp->lcl_ip, mp->lcl_plen, mp->lcl_port,
+            format_ip6_address, &mp->rmt_ip, mp->rmt_plen, mp->rmt_port,
+            mp->action_index, mp->tag);
+    }
+}
+
+static void
+vl_api_session_rules_details_t_handler_json (vl_api_session_rules_details_t *
+                                            mp)
+{
+  vat_main_t *vam = &vat_main;
+  vat_json_node_t *node = NULL;
+  struct in6_addr ip6;
+  struct in_addr ip4;
+
+  if (VAT_JSON_ARRAY != vam->json_tree.type)
+    {
+      ASSERT (VAT_JSON_NONE == vam->json_tree.type);
+      vat_json_init_array (&vam->json_tree);
+    }
+  node = vat_json_array_add (&vam->json_tree);
+  vat_json_init_object (node);
+
+  vat_json_object_add_uint (node, "is_ip4", mp->is_ip4 ? 1 : 0);
+  vat_json_object_add_uint (node, "appns_index",
+                           clib_net_to_host_u32 (mp->appns_index));
+  vat_json_object_add_uint (node, "transport_proto", mp->transport_proto);
+  vat_json_object_add_uint (node, "scope", mp->scope);
+  vat_json_object_add_uint (node, "action_index",
+                           clib_net_to_host_u32 (mp->action_index));
+  vat_json_object_add_uint (node, "lcl_port",
+                           clib_net_to_host_u16 (mp->lcl_port));
+  vat_json_object_add_uint (node, "rmt_port",
+                           clib_net_to_host_u16 (mp->rmt_port));
+  vat_json_object_add_uint (node, "lcl_plen", mp->lcl_plen);
+  vat_json_object_add_uint (node, "rmt_plen", mp->rmt_plen);
+  vat_json_object_add_string_copy (node, "tag", mp->tag);
+  if (mp->is_ip4)
+    {
+      clib_memcpy (&ip4, mp->lcl_ip, sizeof (ip4));
+      vat_json_object_add_ip4 (node, "lcl_ip", ip4);
+      clib_memcpy (&ip4, mp->rmt_ip, sizeof (ip4));
+      vat_json_object_add_ip4 (node, "rmt_ip", ip4);
+    }
+  else
+    {
+      clib_memcpy (&ip6, mp->lcl_ip, sizeof (ip6));
+      vat_json_object_add_ip6 (node, "lcl_ip", ip6);
+      clib_memcpy (&ip6, mp->rmt_ip, sizeof (ip6));
+      vat_json_object_add_ip6 (node, "rmt_ip", ip6);
+    }
+}
+
+static int
+api_session_rule_add_del (vat_main_t * vam)
+{
+  vl_api_session_rule_add_del_t *mp;
+  unformat_input_t *i = vam->input;
+  u32 proto = ~0, lcl_port, rmt_port, action = 0, lcl_plen, rmt_plen;
+  u32 appns_index = 0, scope = 0;
+  ip4_address_t lcl_ip4, rmt_ip4;
+  ip6_address_t lcl_ip6, rmt_ip6;
+  u8 is_ip4 = 1, conn_set = 0;
+  u8 is_add = 1, *tag = 0;
+  int ret;
+
+  while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
+    {
+      if (unformat (i, "del"))
+       is_add = 0;
+      else if (unformat (i, "add"))
+       ;
+      else if (unformat (i, "proto tcp"))
+       proto = 0;
+      else if (unformat (i, "proto udp"))
+       proto = 1;
+      else if (unformat (i, "appns %d", &appns_index))
+       ;
+      else if (unformat (i, "scope %d", &scope))
+       ;
+      else if (unformat (i, "tag %_%v%_", &tag))
+       ;
+      else
+       if (unformat
+           (i, "%U/%d %d %U/%d %d", unformat_ip4_address, &lcl_ip4,
+            &lcl_plen, &lcl_port, unformat_ip4_address, &rmt_ip4, &rmt_plen,
+            &rmt_port))
+       {
+         is_ip4 = 1;
+         conn_set = 1;
+       }
+      else
+       if (unformat
+           (i, "%U/%d %d %U/%d %d", unformat_ip6_address, &lcl_ip6,
+            &lcl_plen, &lcl_port, unformat_ip6_address, &rmt_ip6, &rmt_plen,
+            &rmt_port))
+       {
+         is_ip4 = 0;
+         conn_set = 1;
+       }
+      else if (unformat (i, "action %d", &action))
        ;
       else
        break;
     }
+  if (proto == ~0 || !conn_set || action == ~0)
+    {
+      errmsg ("transport proto, connection and action must be set");
+      return -99;
+    }
+
+  if (scope > 3)
+    {
+      errmsg ("scope should be 0-3");
+      return -99;
+    }
+
+  M (SESSION_RULE_ADD_DEL, mp);
+
+  mp->is_ip4 = is_ip4;
+  mp->transport_proto = proto;
+  mp->lcl_port = clib_host_to_net_u16 ((u16) lcl_port);
+  mp->rmt_port = clib_host_to_net_u16 ((u16) rmt_port);
+  mp->lcl_plen = lcl_plen;
+  mp->rmt_plen = rmt_plen;
+  mp->action_index = clib_host_to_net_u32 (action);
+  mp->appns_index = clib_host_to_net_u32 (appns_index);
+  mp->scope = scope;
+  mp->is_add = is_add;
+  if (is_ip4)
+    {
+      clib_memcpy (mp->lcl_ip, &lcl_ip4, sizeof (lcl_ip4));
+      clib_memcpy (mp->rmt_ip, &rmt_ip4, sizeof (rmt_ip4));
+    }
+  else
+    {
+      clib_memcpy (mp->lcl_ip, &lcl_ip6, sizeof (lcl_ip6));
+      clib_memcpy (mp->rmt_ip, &rmt_ip6, sizeof (rmt_ip6));
+    }
+  if (tag)
+    {
+      clib_memcpy (mp->tag, tag, vec_len (tag));
+      vec_free (tag);
+    }
+
+  S (mp);
+  W (ret);
+  return ret;
+}
+
+static int
+api_session_rules_dump (vat_main_t * vam)
+{
+  vl_api_session_rules_dump_t *mp;
+  vl_api_control_ping_t *mp_ping;
+  int ret;
+
+  if (!vam->json_output)
+    {
+      print (vam->ofp, "%=20s", "Session Rules");
+    }
+
+  M (SESSION_RULES_DUMP, mp);
+  /* send it... */
+  S (mp);
+
+  /* Use a control ping for synchronization */
+  MPING (CONTROL_PING, mp_ping);
+  S (mp_ping);
+
+  /* Wait for a reply... */
+  W (ret);
+  return ret;
+}
+
+static int
+api_ip_container_proxy_add_del (vat_main_t * vam)
+{
+  vl_api_ip_container_proxy_add_del_t *mp;
+  unformat_input_t *i = vam->input;
+  u32 plen = ~0, sw_if_index = ~0;
+  ip4_address_t ip4;
+  ip6_address_t ip6;
+  u8 is_ip4 = 1;
+  u8 is_add = 1;
+  int ret;
+
+  while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
+    {
+      if (unformat (i, "del"))
+       is_add = 0;
+      else if (unformat (i, "add"))
+       ;
+      if (unformat (i, "%U", unformat_ip4_address, &ip4))
+       {
+         is_ip4 = 1;
+         plen = 32;
+       }
+      else if (unformat (i, "%U", unformat_ip6_address, &ip6))
+       {
+         is_ip4 = 0;
+         plen = 128;
+       }
+      else if (unformat (i, "sw_if_index %u", &sw_if_index))
+       ;
+      else
+       break;
+    }
+  if (sw_if_index == ~0 || plen == ~0)
+    {
+      errmsg ("address and sw_if_index must be set");
+      return -99;
+    }
+
+  M (IP_CONTAINER_PROXY_ADD_DEL, mp);
+
+  mp->is_ip4 = is_ip4;
+  mp->sw_if_index = clib_host_to_net_u32 (sw_if_index);
+  mp->plen = plen;
+  mp->is_add = is_add;
+  if (is_ip4)
+    clib_memcpy (mp->ip, &ip4, sizeof (ip4));
+  else
+    clib_memcpy (mp->ip, &ip6, sizeof (ip6));
 
-  M (MEMFD_SEGMENT_CREATE, mp);
-  mp->requested_size = size;
   S (mp);
   W (ret);
   return ret;
@@ -21186,6 +22176,8 @@ _(sw_interface_set_flags,                                               \
   "<intfc> | sw_if_index <id> admin-up | admin-down link-up | link down") \
 _(sw_interface_add_del_address,                                         \
   "<intfc> | sw_if_index <id> <ip4-address> | <ip6-address> [del] [del-all] ") \
+_(sw_interface_set_rx_mode,                                             \
+  "<intfc> | sw_if_index <id> [queue <id>] <polling | interrupt | adaptive>") \
 _(sw_interface_set_table,                                               \
   "<intfc> | sw_if_index <id> vrf <table-id> [ipv6]")                   \
 _(sw_interface_set_mpls_enable,                                         \
@@ -21383,6 +22375,9 @@ _(ipsec_tunnel_if_add_del, "local_spi <n> remote_spi <n>\n"             \
   "  integ_alg <alg> local_integ_key <hex> remote_integ_key <hex>\n"    \
   "  local_ip <addr> remote_ip <addr> [esn] [anti_replay] [del]\n")     \
 _(ipsec_sa_dump, "[sa_id <n>]")                                         \
+_(ipsec_tunnel_if_set_key, "<intfc> <local|remote> <crypto|integ>\n"    \
+  "  <alg> <hex>\n")                                                    \
+_(ipsec_tunnel_if_set_sa, "<intfc> sa_id <n> <inbound|outbound>\n")     \
 _(ikev2_profile_add_del, "name <profile_name> [del]")                   \
 _(ikev2_profile_set_auth, "name <profile_name> auth_method <method>\n"  \
   "(auth_data 0x<data> | auth_data <data>)")                            \
@@ -21476,6 +22471,12 @@ _(one_get_map_request_itr_rlocs, "")                                    \
 _(one_map_register_set_ttl, "<ttl>")                                    \
 _(one_set_transport_protocol, "udp|api")                                \
 _(one_get_transport_protocol, "")                                       \
+_(one_enable_disable_xtr_mode, "enable|disable")                        \
+_(one_show_xtr_mode, "")                                                \
+_(one_enable_disable_pitr_mode, "enable|disable")                       \
+_(one_show_pitr_mode, "")                                               \
+_(one_enable_disable_petr_mode, "enable|disable")                       \
+_(one_show_petr_mode, "")                                               \
 _(show_one_nsh_mapping, "")                                             \
 _(show_one_pitr, "")                                                    \
 _(show_one_use_petr, "")                                                \
@@ -21600,10 +22601,21 @@ _(sw_interface_get_table, "<intfc> | sw_if_index <id> [ipv6]")          \
 _(p2p_ethernet_add, "<intfc> | sw_if_index <nn> remote_mac <mac-address> sub_id <id>") \
 _(p2p_ethernet_del, "<intfc> | sw_if_index <nn> remote_mac <mac-address>") \
 _(lldp_config, "system-name <name> tx-hold <nn> tx-interval <nn>") \
-_(sw_interface_set_lldp, "<intfc> | sw_if_index <nn> [port-desc <description>] [disable]") \
+_(sw_interface_set_lldp, "<intfc> | sw_if_index <nn> [port-desc <description>]\n" \
+  " [mgmt-ip4 <ip4>] [mgmt-ip6 <ip6>] [mgmt-oid <object id>] [disable]") \
 _(tcp_configure_src_addresses, "<ip4|6>first-<ip4|6>last [vrf <id>]")  \
 _(memfd_segment_create,"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, "")                                              \
+_(ip_container_proxy_add_del, "[add|del] <address> <sw_if_index>")     \
 
 /* List of command functions, CLI names map directly to functions */
 #define foreach_cli_function                                    \