API support for IPsec tunnel interface creation
[vpp.git] / src / vat / api_format.c
index b5943f0..28b227b 100644 (file)
@@ -403,6 +403,46 @@ api_unformat_sw_if_index (unformat_input_t * input, va_list * args)
 }
 #endif /* VPP_API_TEST_BUILTIN */
 
+#define VHOST_USER_POLLING_MODE   0
+#define VHOST_USER_INTERRUPT_MODE 1
+#define VHOST_USER_ADAPTIVE_MODE  2
+
+static u8 *
+api_format_vhost_user_operation_mode (u8 * s, va_list * va)
+{
+  int operation_mode = va_arg (*va, int);
+
+  switch (operation_mode)
+    {
+    case VHOST_USER_POLLING_MODE:
+      s = format (s, "%-9s", "polling");
+      break;
+    case VHOST_USER_INTERRUPT_MODE:
+      s = format (s, "%-9s", "interrupt");
+      break;
+    default:
+      s = format (s, "%-9s", "invalid");
+    }
+  return s;
+}
+
+static uword
+api_unformat_vhost_user_operation_mode (unformat_input_t * input,
+                                       va_list * args)
+{
+  u8 *operation_mode = va_arg (*args, u8 *);
+  uword rc = 1;
+
+  if (unformat (input, "interrupt"))
+    *operation_mode = VHOST_USER_INTERRUPT_MODE;
+  else if (unformat (input, "polling"))
+    *operation_mode = VHOST_USER_POLLING_MODE;
+  else
+    rc = 0;
+
+  return rc;
+}
+
 static uword
 unformat_policer_rate_type (unformat_input_t * input, va_list * args)
 {
@@ -1255,9 +1295,9 @@ static void
 vl_api_ip4_arp_event_t_handler (vl_api_ip4_arp_event_t * mp)
 {
   u32 sw_if_index = ntohl (mp->sw_if_index);
-  errmsg ("arp %s event: address %U new mac %U sw_if_index %d",
+  errmsg ("arp %s event: pid %d address %U new mac %U sw_if_index %d\n",
          mp->mac_ip ? "mac/ip binding" : "address resolution",
-         format_ip4_address, &mp->address,
+         ntohl (mp->pid), format_ip4_address, &mp->address,
          format_ethernet_address, mp->new_mac, sw_if_index);
 }
 
@@ -1271,9 +1311,9 @@ static void
 vl_api_ip6_nd_event_t_handler (vl_api_ip6_nd_event_t * mp)
 {
   u32 sw_if_index = ntohl (mp->sw_if_index);
-  errmsg ("ip6 nd %s event: address %U new mac %U sw_if_index %d",
+  errmsg ("ip6 nd %s event: pid %d address %U new mac %U sw_if_index %d\n",
          mp->mac_ip ? "mac/ip binding" : "address resolution",
-         format_ip6_address, mp->address,
+         ntohl (mp->pid), format_ip6_address, mp->address,
          format_ethernet_address, mp->new_mac, sw_if_index);
 }
 
@@ -1418,6 +1458,39 @@ static void vl_api_control_ping_reply_t_handler_json
   vam->result_ready = 1;
 }
 
+static void
+  vl_api_bridge_domain_set_mac_age_reply_t_handler
+  (vl_api_bridge_domain_set_mac_age_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;
+    }
+}
+
+static void vl_api_bridge_domain_set_mac_age_reply_t_handler_json
+  (vl_api_bridge_domain_set_mac_age_reply_t * mp)
+{
+  vat_main_t *vam = &vat_main;
+  vat_json_node_t node;
+
+  vat_json_init_object (&node);
+  vat_json_object_add_int (&node, "retval", ntohl (mp->retval));
+
+  vat_json_print (vam->ofp, &node);
+  vat_json_free (&node);
+
+  vam->retval = ntohl (mp->retval);
+  vam->result_ready = 1;
+}
+
 static void
 vl_api_l2_flags_reply_t_handler (vl_api_l2_flags_reply_t * mp)
 {
@@ -1985,7 +2058,7 @@ vl_api_dhcp_compl_event_t_handler (vl_api_dhcp_compl_event_t * mp)
 {
   errmsg ("DHCP compl event: pid %d %s hostname %s host_addr %U "
          "router_addr %U host_mac %U",
-         mp->pid, mp->is_ipv6 ? "ipv6" : "ipv4", mp->hostname,
+         ntohl (mp->pid), mp->is_ipv6 ? "ipv6" : "ipv4", mp->hostname,
          format_ip4_address, &mp->host_address,
          format_ip4_address, &mp->router_address,
          format_ethernet_address, mp->host_mac);
@@ -2610,6 +2683,92 @@ vl_api_one_eid_table_details_t_handler_json (vl_api_one_eid_table_details_t
   vec_free (eid);
 }
 
+static void
+vl_api_one_stats_details_t_handler (vl_api_one_stats_details_t * mp)
+{
+  vat_main_t *vam = &vat_main;
+  u8 *seid = 0, *deid = 0;
+  u8 *(*format_ip_address_fcn) (u8 *, va_list *) = 0;
+
+  deid = format (0, "%U", format_lisp_eid_vat,
+                mp->eid_type, mp->deid, mp->deid_pref_len, 0, 0, 0);
+
+  seid = format (0, "%U", format_lisp_eid_vat,
+                mp->eid_type, mp->seid, mp->seid_pref_len, 0, 0, 0);
+
+  vec_add1 (deid, 0);
+  vec_add1 (seid, 0);
+
+  if (mp->is_ip4)
+    format_ip_address_fcn = format_ip4_address;
+  else
+    format_ip_address_fcn = format_ip6_address;
+
+
+  print (vam->ofp, "([%d] %s %s) (%U %U) %u %u",
+        clib_net_to_host_u32 (mp->vni),
+        seid, deid,
+        format_ip_address_fcn, mp->lloc,
+        format_ip_address_fcn, mp->rloc,
+        clib_net_to_host_u32 (mp->pkt_count),
+        clib_net_to_host_u32 (mp->bytes));
+
+  vec_free (deid);
+  vec_free (seid);
+}
+
+static void
+vl_api_one_stats_details_t_handler_json (vl_api_one_stats_details_t * mp)
+{
+  struct in6_addr ip6;
+  struct in_addr ip4;
+  vat_main_t *vam = &vat_main;
+  vat_json_node_t *node = 0;
+  u8 *deid = 0, *seid = 0;
+
+  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);
+  deid = format (0, "%U", format_lisp_eid_vat,
+                mp->eid_type, mp->deid, mp->deid_pref_len, 0, 0, 0);
+
+  seid = format (0, "%U", format_lisp_eid_vat,
+                mp->eid_type, mp->seid, mp->seid_pref_len, 0, 0, 0);
+
+  vec_add1 (deid, 0);
+  vec_add1 (seid, 0);
+
+  vat_json_object_add_string_copy (node, "seid", seid);
+  vat_json_object_add_string_copy (node, "deid", deid);
+  vat_json_object_add_uint (node, "vni", clib_net_to_host_u32 (mp->vni));
+
+  if (mp->is_ip4)
+    {
+      clib_memcpy (&ip4, mp->lloc, sizeof (ip4));
+      vat_json_object_add_ip4 (node, "lloc", ip4);
+      clib_memcpy (&ip4, mp->rloc, sizeof (ip4));
+      vat_json_object_add_ip4 (node, "rloc", ip4);
+    }
+  else
+    {
+      clib_memcpy (&ip6, mp->lloc, sizeof (ip6));
+      vat_json_object_add_ip6 (node, "lloc", ip6);
+      clib_memcpy (&ip6, mp->rloc, sizeof (ip6));
+      vat_json_object_add_ip6 (node, "rloc", ip6);
+    }
+  vat_json_object_add_uint (node, "pkt_count",
+                           clib_net_to_host_u32 (mp->pkt_count));
+  vat_json_object_add_uint (node, "bytes", clib_net_to_host_u32 (mp->bytes));
+
+  vec_free (deid);
+  vec_free (seid);
+}
+
 static void
   vl_api_one_eid_table_map_details_t_handler
   (vl_api_one_eid_table_map_details_t * mp)
@@ -2740,6 +2899,42 @@ static void
   vec_free (s);
 }
 
+static void
+  vl_api_show_one_stats_enable_disable_reply_t_handler
+  (vl_api_show_one_stats_enable_disable_reply_t * mp)
+{
+  vat_main_t *vam = &vat_main;
+  int retval = clib_net_to_host_u32 (mp->retval);
+
+  if (retval)
+    goto end;
+
+  print (vam->ofp, "%s", mp->is_en ? "enabled" : "disabled");
+end:
+  vam->retval = retval;
+  vam->result_ready = 1;
+}
+
+static void
+  vl_api_show_one_stats_enable_disable_reply_t_handler_json
+  (vl_api_show_one_stats_enable_disable_reply_t * mp)
+{
+  vat_main_t *vam = &vat_main;
+  vat_json_node_t _node, *node = &_node;
+  int retval = clib_net_to_host_u32 (mp->retval);
+
+  u8 *s = format (0, "%s", mp->is_en ? "enabled" : "disabled");
+  vat_json_init_object (node);
+  vat_json_object_add_string_copy (node, "state", s);
+
+  vat_json_print (vam->ofp, node);
+  vat_json_free (node);
+
+  vam->retval = retval;
+  vam->result_ready = 1;
+  vec_free (s);
+}
+
 static void
 api_gpe_fwd_entry_net_to_host (vl_api_gpe_fwd_entry_t * e)
 {
@@ -3234,6 +3429,66 @@ static void
   vam->result_ready = 1;
 }
 
+static void
+  vl_api_show_one_use_petr_reply_t_handler
+  (vl_api_show_one_use_petr_reply_t * mp)
+{
+  vat_main_t *vam = &vat_main;
+  i32 retval = ntohl (mp->retval);
+
+  if (0 <= retval)
+    {
+      print (vam->ofp, "%s\n", mp->status ? "enabled" : "disabled");
+      if (mp->status)
+       {
+         print (vam->ofp, "Proxy-ETR address; %U",
+                mp->is_ip4 ? format_ip4_address : format_ip6_address,
+                mp->address);
+       }
+    }
+
+  vam->retval = retval;
+  vam->result_ready = 1;
+}
+
+static void
+  vl_api_show_one_use_petr_reply_t_handler_json
+  (vl_api_show_one_use_petr_reply_t * mp)
+{
+  vat_main_t *vam = &vat_main;
+  vat_json_node_t node;
+  u8 *status = 0;
+  struct in_addr ip4;
+  struct in6_addr ip6;
+
+  status = format (0, "%s", mp->status ? "enabled" : "disabled");
+  vec_add1 (status, 0);
+
+  vat_json_init_object (&node);
+  vat_json_object_add_string_copy (&node, "status", status);
+  if (mp->status)
+    {
+      if (mp->is_ip4)
+       {
+         clib_memcpy (&ip6, mp->address, sizeof (ip6));
+         vat_json_object_add_ip6 (&node, "address", ip6);
+       }
+      else
+       {
+         clib_memcpy (&ip4, mp->address, sizeof (ip4));
+         vat_json_object_add_ip4 (&node, "address", ip4);
+       }
+    }
+
+  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_pitr_reply_t_handler (vl_api_show_one_pitr_reply_t * mp)
 {
@@ -3448,8 +3703,8 @@ static void vl_api_policer_details_t_handler_json
   vat_json_object_add_string_copy (node, "name", mp->name);
   vat_json_object_add_uint (node, "cir", ntohl (mp->cir));
   vat_json_object_add_uint (node, "eir", ntohl (mp->eir));
-  vat_json_object_add_uint (node, "cb", ntohl (mp->cb));
-  vat_json_object_add_uint (node, "eb", ntohl (mp->eb));
+  vat_json_object_add_uint (node, "cb", clib_net_to_host_u64 (mp->cb));
+  vat_json_object_add_uint (node, "eb", clib_net_to_host_u64 (mp->eb));
   vat_json_object_add_string_copy (node, "rate_type", rate_type_str);
   vat_json_object_add_string_copy (node, "round_type", round_type_str);
   vat_json_object_add_string_copy (node, "type", type_str);
@@ -3896,6 +4151,8 @@ _(sw_interface_set_l2_bridge_reply)                     \
 _(bridge_domain_add_del_reply)                          \
 _(sw_interface_set_l2_xconnect_reply)                   \
 _(l2fib_add_del_reply)                                  \
+_(l2fib_flush_int_reply)                                \
+_(l2fib_flush_bd_reply)                                 \
 _(ip_add_del_route_reply)                               \
 _(ip_mroute_add_del_reply)                              \
 _(mpls_route_add_del_reply)                             \
@@ -3913,6 +4170,7 @@ _(dhcp_client_config_reply)                             \
 _(set_ip_flow_hash_reply)                               \
 _(sw_interface_ip6_enable_disable_reply)                \
 _(sw_interface_ip6_set_link_local_address_reply)        \
+_(ip6nd_proxy_add_del_reply)                            \
 _(sw_interface_ip6nd_ra_prefix_reply)                   \
 _(sw_interface_ip6nd_ra_config_reply)                   \
 _(set_arp_neighbor_limit_reply)                         \
@@ -3941,6 +4199,7 @@ _(ipsec_interface_add_del_spd_reply)                    \
 _(ipsec_spd_add_del_entry_reply)                        \
 _(ipsec_sad_add_del_entry_reply)                        \
 _(ipsec_sa_set_key_reply)                               \
+_(ipsec_tunnel_if_add_del_reply)                        \
 _(ikev2_profile_add_del_reply)                          \
 _(ikev2_profile_set_auth_reply)                         \
 _(ikev2_profile_set_id_reply)                           \
@@ -3978,6 +4237,9 @@ _(one_pitr_set_locator_set_reply)                       \
 _(one_map_request_mode_reply)                           \
 _(one_add_del_map_request_itr_rlocs_reply)              \
 _(one_eid_table_add_del_map_reply)                      \
+_(one_use_petr_reply)                                   \
+_(one_stats_enable_disable_reply)                       \
+_(one_stats_flush_reply)                                \
 _(gpe_add_del_fwd_entry_reply)                          \
 _(gpe_enable_disable_reply)                             \
 _(gpe_set_encap_mode_reply)                             \
@@ -4060,7 +4322,10 @@ _(SW_INTERFACE_SET_L2_BRIDGE_REPLY,                                     \
 _(BRIDGE_DOMAIN_ADD_DEL_REPLY, bridge_domain_add_del_reply)             \
 _(BRIDGE_DOMAIN_DETAILS, bridge_domain_details)                         \
 _(BRIDGE_DOMAIN_SW_IF_DETAILS, bridge_domain_sw_if_details)             \
+_(BRIDGE_DOMAIN_SET_MAC_AGE_REPLY, bridge_domain_set_mac_age_reply)     \
 _(L2FIB_ADD_DEL_REPLY, l2fib_add_del_reply)                             \
+_(L2FIB_FLUSH_INT_REPLY, l2fib_flush_int_reply)                         \
+_(L2FIB_FLUSH_BD_REPLY, l2fib_flush_bd_reply)                           \
 _(L2_FLAGS_REPLY, l2_flags_reply)                                       \
 _(BRIDGE_FLAGS_REPLY, bridge_flags_reply)                               \
 _(TAP_CONNECT_REPLY, tap_connect_reply)                                        \
@@ -4092,6 +4357,8 @@ _(SW_INTERFACE_IP6_ENABLE_DISABLE_REPLY,                                \
   sw_interface_ip6_enable_disable_reply)                                \
 _(SW_INTERFACE_IP6_SET_LINK_LOCAL_ADDRESS_REPLY,                        \
   sw_interface_ip6_set_link_local_address_reply)                        \
+_(IP6ND_PROXY_ADD_DEL_REPLY, ip6nd_proxy_add_del_reply)                 \
+_(IP6ND_PROXY_DETAILS, ip6nd_proxy_details)                             \
 _(SW_INTERFACE_IP6ND_RA_PREFIX_REPLY,                                   \
   sw_interface_ip6nd_ra_prefix_reply)                                   \
 _(SW_INTERFACE_IP6ND_RA_CONFIG_REPLY,                                   \
@@ -4145,6 +4412,7 @@ _(IPSEC_INTERFACE_ADD_DEL_SPD_REPLY, ipsec_interface_add_del_spd_reply) \
 _(IPSEC_SPD_ADD_DEL_ENTRY_REPLY, ipsec_spd_add_del_entry_reply)         \
 _(IPSEC_SAD_ADD_DEL_ENTRY_REPLY, ipsec_sad_add_del_entry_reply)         \
 _(IPSEC_SA_SET_KEY_REPLY, ipsec_sa_set_key_reply)                       \
+_(IPSEC_TUNNEL_IF_ADD_DEL_REPLY, ipsec_tunnel_if_add_del_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)               \
@@ -4188,6 +4456,7 @@ _(ONE_MAP_REGISTER_ENABLE_DISABLE_REPLY,                                \
 _(ONE_RLOC_PROBE_ENABLE_DISABLE_REPLY,                                  \
   one_rloc_probe_enable_disable_reply)                                  \
 _(ONE_PITR_SET_LOCATOR_SET_REPLY, one_pitr_set_locator_set_reply)       \
+_(ONE_USE_PETR_REPLY, one_use_petr_reply)                               \
 _(ONE_MAP_REQUEST_MODE_REPLY, one_map_request_mode_reply)               \
 _(ONE_EID_TABLE_ADD_DEL_MAP_REPLY, one_eid_table_add_del_map_reply)     \
 _(ONE_LOCATOR_SET_DETAILS, one_locator_set_details)                     \
@@ -4198,6 +4467,11 @@ _(ONE_EID_TABLE_VNI_DETAILS, one_eid_table_vni_details)                 \
 _(ONE_MAP_RESOLVER_DETAILS, one_map_resolver_details)                   \
 _(ONE_MAP_SERVER_DETAILS, one_map_server_details)                       \
 _(ONE_ADJACENCIES_GET_REPLY, one_adjacencies_get_reply)                 \
+_(ONE_STATS_DETAILS, one_stats_details)                                 \
+_(ONE_STATS_FLUSH_REPLY, one_stats_flush_reply)                         \
+_(ONE_STATS_ENABLE_DISABLE_REPLY, one_stats_enable_disable_reply)       \
+_(SHOW_ONE_STATS_ENABLE_DISABLE_REPLY,                                  \
+  show_one_stats_enable_disable_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)                     \
@@ -4212,6 +4486,7 @@ _(ONE_ADD_DEL_MAP_REQUEST_ITR_RLOCS_REPLY,                              \
 _(ONE_GET_MAP_REQUEST_ITR_RLOCS_REPLY,                                  \
   one_get_map_request_itr_rlocs_reply)                                  \
 _(SHOW_ONE_PITR_REPLY, show_one_pitr_reply)                             \
+_(SHOW_ONE_USE_PETR_REPLY, show_one_use_petr_reply)                     \
 _(SHOW_ONE_MAP_REQUEST_MODE_REPLY, show_one_map_request_mode_reply)     \
 _(SHOW_ONE_RLOC_PROBE_STATE_REPLY, show_one_rloc_probe_state_reply)     \
 _(SHOW_ONE_MAP_REGISTER_STATE_REPLY,                                    \
@@ -5647,6 +5922,70 @@ api_bridge_domain_add_del (vat_main_t * vam)
   return ret;
 }
 
+static int
+api_l2fib_flush_bd (vat_main_t * vam)
+{
+  unformat_input_t *i = vam->input;
+  vl_api_l2fib_flush_bd_t *mp;
+  u32 bd_id = ~0;
+  int ret;
+
+  /* Parse args required to build the message */
+  while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
+    {
+      if (unformat (i, "bd_id %d", &bd_id));
+      else
+       break;
+    }
+
+  if (bd_id == ~0)
+    {
+      errmsg ("missing bridge domain");
+      return -99;
+    }
+
+  M (L2FIB_FLUSH_BD, mp);
+
+  mp->bd_id = htonl (bd_id);
+
+  S (mp);
+  W (ret);
+  return ret;
+}
+
+static int
+api_l2fib_flush_int (vat_main_t * vam)
+{
+  unformat_input_t *i = vam->input;
+  vl_api_l2fib_flush_int_t *mp;
+  u32 sw_if_index = ~0;
+  int ret;
+
+  /* Parse args required to build the message */
+  while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
+    {
+      if (unformat (i, "sw_if_index %d", &sw_if_index));
+      else
+       if (unformat (i, "%U", api_unformat_sw_if_index, vam, &sw_if_index));
+      else
+       break;
+    }
+
+  if (sw_if_index == ~0)
+    {
+      errmsg ("missing interface name or sw_if_index");
+      return -99;
+    }
+
+  M (L2FIB_FLUSH_INT, mp);
+
+  mp->sw_if_index = ntohl (sw_if_index);
+
+  S (mp);
+  W (ret);
+  return ret;
+}
+
 static int
 api_l2fib_add_del (vat_main_t * vam)
 {
@@ -5797,6 +6136,46 @@ api_l2fib_add_del (vat_main_t * vam)
   return (vam->retval);
 }
 
+static int
+api_bridge_domain_set_mac_age (vat_main_t * vam)
+{
+  unformat_input_t *i = vam->input;
+  vl_api_bridge_domain_set_mac_age_t *mp;
+  u32 bd_id = ~0;
+  u32 mac_age = 0;
+  int ret;
+
+  /* Parse args required to build the message */
+  while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
+    {
+      if (unformat (i, "bd_id %d", &bd_id));
+      else if (unformat (i, "mac-age %d", &mac_age));
+      else
+       break;
+    }
+
+  if (bd_id == ~0)
+    {
+      errmsg ("missing bridge domain");
+      return -99;
+    }
+
+  if (mac_age > 255)
+    {
+      errmsg ("mac age must be less than 256 ");
+      return -99;
+    }
+
+  M (BRIDGE_DOMAIN_SET_MAC_AGE, mp);
+
+  mp->bd_id = htonl (bd_id);
+  mp->mac_age = (u8) mac_age;
+
+  S (mp);
+  W (ret);
+  return ret;
+}
+
 static int
 api_l2_flags (vat_main_t * vam)
 {
@@ -7129,6 +7508,7 @@ api_ip_neighbor_add_del (vat_main_t * vam)
   u8 sw_if_index_set = 0;
   u8 is_add = 1;
   u8 is_static = 0;
+  u8 is_no_fib_entry = 0;
   u8 mac_address[6];
   u8 mac_set = 0;
   u8 v4_address_set = 0;
@@ -7155,6 +7535,8 @@ api_ip_neighbor_add_del (vat_main_t * vam)
        sw_if_index_set = 1;
       else if (unformat (i, "is_static"))
        is_static = 1;
+      else if (unformat (i, "no-fib-entry"))
+       is_no_fib_entry = 1;
       else if (unformat (i, "dst %U", unformat_ip4_address, &v4address))
        v4_address_set = 1;
       else if (unformat (i, "dst %U", unformat_ip6_address, &v6address))
@@ -7188,6 +7570,7 @@ api_ip_neighbor_add_del (vat_main_t * vam)
   mp->sw_if_index = ntohl (sw_if_index);
   mp->is_add = is_add;
   mp->is_static = is_static;
+  mp->is_no_adj_fib = is_no_fib_entry;
   if (mac_set)
     clib_memcpy (mp->mac_address, mac_address, 6);
   if (v6_address_set)
@@ -7798,12 +8181,12 @@ api_dhcp_client_config (vat_main_t * vam)
   /* Construct the API message */
   M (DHCP_CLIENT_CONFIG, mp);
 
-  mp->sw_if_index = ntohl (sw_if_index);
+  mp->sw_if_index = htonl (sw_if_index);
   clib_memcpy (mp->hostname, hostname, vec_len (hostname));
   vec_free (hostname);
   mp->is_add = is_add;
   mp->want_dhcp_event = disable_event ? 0 : 1;
-  mp->pid = getpid ();
+  mp->pid = htonl (getpid ());
 
   /* send it... */
   S (mp);
@@ -7968,6 +8351,109 @@ api_sw_interface_ip6_set_link_local_address (vat_main_t * vam)
   return ret;
 }
 
+static int
+api_ip6nd_proxy_add_del (vat_main_t * vam)
+{
+  unformat_input_t *i = vam->input;
+  vl_api_ip6nd_proxy_add_del_t *mp;
+  u32 sw_if_index = ~0;
+  u8 v6_address_set = 0;
+  ip6_address_t v6address;
+  u8 is_del = 0;
+  int ret;
+
+  /* Parse args required to build the message */
+  while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
+    {
+      if (unformat (i, "%U", api_unformat_sw_if_index, vam, &sw_if_index))
+       ;
+      else if (unformat (i, "sw_if_index %d", &sw_if_index))
+       ;
+      else if (unformat (i, "%U", unformat_ip6_address, &v6address))
+       v6_address_set = 1;
+      if (unformat (i, "del"))
+       is_del = 1;
+      else
+       {
+         clib_warning ("parse error '%U'", format_unformat_error, i);
+         return -99;
+       }
+    }
+
+  if (sw_if_index == ~0)
+    {
+      errmsg ("missing interface name or sw_if_index");
+      return -99;
+    }
+  if (!v6_address_set)
+    {
+      errmsg ("no address set");
+      return -99;
+    }
+
+  /* Construct the API message */
+  M (IP6ND_PROXY_ADD_DEL, mp);
+
+  mp->is_del = is_del;
+  mp->sw_if_index = ntohl (sw_if_index);
+  clib_memcpy (mp->address, &v6address, sizeof (v6address));
+
+  /* send it... */
+  S (mp);
+
+  /* Wait for a reply, return good/bad news  */
+  W (ret);
+  return ret;
+}
+
+static int
+api_ip6nd_proxy_dump (vat_main_t * vam)
+{
+  vl_api_ip6nd_proxy_dump_t *mp;
+  vl_api_control_ping_t *mp_ping;
+  int ret;
+
+  M (IP6ND_PROXY_DUMP, mp);
+
+  S (mp);
+
+  /* Use a control ping for synchronization */
+  M (CONTROL_PING, mp_ping);
+  S (mp_ping);
+
+  W (ret);
+  return ret;
+}
+
+static void vl_api_ip6nd_proxy_details_t_handler
+  (vl_api_ip6nd_proxy_details_t * mp)
+{
+  vat_main_t *vam = &vat_main;
+
+  print (vam->ofp, "host %U sw_if_index %d",
+        format_ip6_address, mp->address, ntohl (mp->sw_if_index));
+}
+
+static void vl_api_ip6nd_proxy_details_t_handler_json
+  (vl_api_ip6nd_proxy_details_t * mp)
+{
+  vat_main_t *vam = &vat_main;
+  struct in6_addr ip6;
+  vat_json_node_t *node = NULL;
+
+  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, "sw_if_index", ntohl (mp->sw_if_index));
+
+  clib_memcpy (&ip6, mp->address, sizeof (ip6));
+  vat_json_object_add_ip6 (node, "host", ip6);
+}
 
 static int
 api_sw_interface_ip6nd_ra_prefix (vat_main_t * vam)
@@ -10498,10 +10984,8 @@ static void vl_api_vxlan_tunnel_details_t_handler
   (vl_api_vxlan_tunnel_details_t * mp)
 {
   vat_main_t *vam = &vat_main;
-  ip46_address_t src, dst;
-
-  ip46_from_addr_buf (mp->is_ipv6, mp->src_address, &src);
-  ip46_from_addr_buf (mp->is_ipv6, mp->dst_address, &dst);
+  ip46_address_t src = to_ip46 (mp->is_ipv6, mp->dst_address);
+  ip46_address_t dst = to_ip46 (mp->is_ipv6, mp->src_address);
 
   print (vam->ofp, "%11d%24U%24U%14d%18d%13d%19d",
         ntohl (mp->sw_if_index),
@@ -10606,21 +11090,45 @@ api_gre_add_del_tunnel (vat_main_t * vam)
   unformat_input_t *line_input = vam->input;
   vl_api_gre_add_del_tunnel_t *mp;
   ip4_address_t src4, dst4;
+  ip6_address_t src6, dst6;
   u8 is_add = 1;
+  u8 ipv4_set = 0;
+  u8 ipv6_set = 0;
   u8 teb = 0;
   u8 src_set = 0;
   u8 dst_set = 0;
   u32 outer_fib_id = 0;
   int ret;
 
+  memset (&src4, 0, sizeof src4);
+  memset (&dst4, 0, sizeof dst4);
+  memset (&src6, 0, sizeof src6);
+  memset (&dst6, 0, sizeof dst6);
+
   while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
     {
       if (unformat (line_input, "del"))
        is_add = 0;
       else if (unformat (line_input, "src %U", unformat_ip4_address, &src4))
-       src_set = 1;
+       {
+         src_set = 1;
+         ipv4_set = 1;
+       }
       else if (unformat (line_input, "dst %U", unformat_ip4_address, &dst4))
-       dst_set = 1;
+       {
+         dst_set = 1;
+         ipv4_set = 1;
+       }
+      else if (unformat (line_input, "src %U", unformat_ip6_address, &src6))
+       {
+         src_set = 1;
+         ipv6_set = 1;
+       }
+      else if (unformat (line_input, "dst %U", unformat_ip6_address, &dst6))
+       {
+         dst_set = 1;
+         ipv6_set = 1;
+       }
       else if (unformat (line_input, "outer-fib-id %d", &outer_fib_id))
        ;
       else if (unformat (line_input, "teb"))
@@ -10642,15 +11150,29 @@ api_gre_add_del_tunnel (vat_main_t * vam)
       errmsg ("tunnel dst address not specified");
       return -99;
     }
+  if (ipv4_set && ipv6_set)
+    {
+      errmsg ("both IPv4 and IPv6 addresses specified");
+      return -99;
+    }
 
 
   M (GRE_ADD_DEL_TUNNEL, mp);
 
-  clib_memcpy (&mp->src_address, &src4, sizeof (src4));
-  clib_memcpy (&mp->dst_address, &dst4, sizeof (dst4));
+  if (ipv4_set)
+    {
+      clib_memcpy (&mp->src_address, &src4, 4);
+      clib_memcpy (&mp->dst_address, &dst4, 4);
+    }
+  else
+    {
+      clib_memcpy (&mp->src_address, &src6, 16);
+      clib_memcpy (&mp->dst_address, &dst6, 16);
+    }
   mp->outer_fib_id = ntohl (outer_fib_id);
   mp->is_add = is_add;
   mp->teb = teb;
+  mp->is_ipv6 = ipv6_set;
 
   S (mp);
   W (ret);
@@ -10661,11 +11183,13 @@ static void vl_api_gre_tunnel_details_t_handler
   (vl_api_gre_tunnel_details_t * mp)
 {
   vat_main_t *vam = &vat_main;
+  ip46_address_t src = to_ip46 (mp->is_ipv6, mp->src_address);
+  ip46_address_t dst = to_ip46 (mp->is_ipv6, mp->dst_address);
 
-  print (vam->ofp, "%11d%15U%15U%6d%14d",
+  print (vam->ofp, "%11d%24U%24U%6d%14d",
         ntohl (mp->sw_if_index),
-        format_ip4_address, &mp->src_address,
-        format_ip4_address, &mp->dst_address,
+        format_ip46_address, &src, IP46_TYPE_ANY,
+        format_ip46_address, &dst, IP46_TYPE_ANY,
         mp->teb, ntohl (mp->outer_fib_id));
 }
 
@@ -10675,6 +11199,7 @@ static void vl_api_gre_tunnel_details_t_handler_json
   vat_main_t *vam = &vat_main;
   vat_json_node_t *node = NULL;
   struct in_addr ip4;
+  struct in6_addr ip6;
 
   if (VAT_JSON_ARRAY != vam->json_tree.type)
     {
@@ -10685,12 +11210,23 @@ static void vl_api_gre_tunnel_details_t_handler_json
 
   vat_json_init_object (node);
   vat_json_object_add_uint (node, "sw_if_index", ntohl (mp->sw_if_index));
-  clib_memcpy (&ip4, &mp->src_address, sizeof (ip4));
-  vat_json_object_add_ip4 (node, "src_address", ip4);
-  clib_memcpy (&ip4, &mp->dst_address, sizeof (ip4));
-  vat_json_object_add_ip4 (node, "dst_address", ip4);
+  if (!mp->is_ipv6)
+    {
+      clib_memcpy (&ip4, &mp->src_address, sizeof (ip4));
+      vat_json_object_add_ip4 (node, "src_address", ip4);
+      clib_memcpy (&ip4, &mp->dst_address, sizeof (ip4));
+      vat_json_object_add_ip4 (node, "dst_address", ip4);
+    }
+  else
+    {
+      clib_memcpy (&ip6, &mp->src_address, sizeof (ip6));
+      vat_json_object_add_ip6 (node, "src_address", ip6);
+      clib_memcpy (&ip6, &mp->dst_address, sizeof (ip6));
+      vat_json_object_add_ip6 (node, "dst_address", ip6);
+    }
   vat_json_object_add_uint (node, "teb", mp->teb);
   vat_json_object_add_uint (node, "outer_fib_id", ntohl (mp->outer_fib_id));
+  vat_json_object_add_uint (node, "is_ipv6", mp->is_ipv6);
 }
 
 static int
@@ -10719,7 +11255,7 @@ api_gre_tunnel_dump (vat_main_t * vam)
 
   if (!vam->json_output)
     {
-      print (vam->ofp, "%11s%15s%15s%6s%14s",
+      print (vam->ofp, "%11s%24s%24s%6s%14s",
             "sw_if_index", "src_address", "dst_address", "teb",
             "outer_fib_id");
     }
@@ -10876,6 +11412,7 @@ api_create_vhost_user_if (vat_main_t * vam)
   u8 use_custom_mac = 0;
   u8 *tag = 0;
   int ret;
+  u8 operation_mode = VHOST_USER_POLLING_MODE;
 
   /* Shut up coverity */
   memset (hwaddr, 0, sizeof (hwaddr));
@@ -10894,6 +11431,10 @@ api_create_vhost_user_if (vat_main_t * vam)
        is_server = 1;
       else if (unformat (i, "tag %s", &tag))
        ;
+      else if (unformat (i, "mode %U",
+                        api_unformat_vhost_user_operation_mode,
+                        &operation_mode))
+       ;
       else
        break;
     }
@@ -10913,6 +11454,7 @@ api_create_vhost_user_if (vat_main_t * vam)
 
   M (CREATE_VHOST_USER_IF, mp);
 
+  mp->operation_mode = operation_mode;
   mp->is_server = is_server;
   clib_memcpy (mp->sock_filename, file_name, vec_len (file_name));
   vec_free (file_name);
@@ -10944,6 +11486,7 @@ api_modify_vhost_user_if (vat_main_t * vam)
   u8 sw_if_index_set = 0;
   u32 sw_if_index = (u32) ~ 0;
   int ret;
+  u8 operation_mode = VHOST_USER_POLLING_MODE;
 
   while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
     {
@@ -10959,6 +11502,10 @@ api_modify_vhost_user_if (vat_main_t * vam)
        ;
       else if (unformat (i, "server"))
        is_server = 1;
+      else if (unformat (i, "mode %U",
+                        api_unformat_vhost_user_operation_mode,
+                        &operation_mode))
+       ;
       else
        break;
     }
@@ -10984,6 +11531,7 @@ api_modify_vhost_user_if (vat_main_t * vam)
 
   M (MODIFY_VHOST_USER_IF, mp);
 
+  mp->operation_mode = operation_mode;
   mp->sw_if_index = ntohl (sw_if_index);
   mp->is_server = is_server;
   clib_memcpy (mp->sock_filename, file_name, vec_len (file_name));
@@ -11039,11 +11587,12 @@ static void vl_api_sw_interface_vhost_user_details_t_handler
 {
   vat_main_t *vam = &vat_main;
 
-  print (vam->ofp, "%-25s %3" PRIu32 " %6" PRIu32 " %8x %6d %7d %s",
+  print (vam->ofp, "%-25s %3" PRIu32 " %6" PRIu32 " %8x %6d %7d %U %s",
         (char *) mp->interface_name,
         ntohl (mp->sw_if_index), ntohl (mp->virtio_net_hdr_sz),
         clib_net_to_host_u64 (mp->features), mp->is_server,
-        ntohl (mp->num_regions), (char *) mp->sock_filename);
+        ntohl (mp->num_regions), api_format_vhost_user_operation_mode,
+        mp->operation_mode, (char *) mp->sock_filename);
   print (vam->ofp, "    Status: '%s'", strerror (ntohl (mp->sock_errno)));
 }
 
@@ -11072,6 +11621,7 @@ static void vl_api_sw_interface_vhost_user_details_t_handler_json
   vat_json_object_add_string_copy (node, "sock_filename", mp->sock_filename);
   vat_json_object_add_uint (node, "num_regions", ntohl (mp->num_regions));
   vat_json_object_add_uint (node, "sock_errno", ntohl (mp->sock_errno));
+  vat_json_object_add_uint (node, "mode", mp->operation_mode);
 }
 
 static int
@@ -11081,7 +11631,8 @@ api_sw_interface_vhost_user_dump (vat_main_t * vam)
   vl_api_control_ping_t *mp_ping;
   int ret;
   print (vam->ofp,
-        "Interface name           idx hdr_sz features server regions filename");
+        "Interface name            idx hdr_sz features server regions mode"
+        "      filename");
 
   /* Get list of vhost-user interfaces */
   M (SW_INTERFACE_VHOST_USER_DUMP, mp);
@@ -11480,7 +12031,7 @@ api_want_ip4_arp_events (vat_main_t * vam)
 
   M (WANT_IP4_ARP_EVENTS, mp);
   mp->enable_disable = enable_disable;
-  mp->pid = getpid ();
+  mp->pid = htonl (getpid ());
   mp->address = address.as_u32;
 
   S (mp);
@@ -11516,7 +12067,7 @@ api_want_ip6_nd_events (vat_main_t * vam)
 
   M (WANT_IP6_ND_EVENTS, mp);
   mp->enable_disable = enable_disable;
-  mp->pid = getpid ();
+  mp->pid = htonl (getpid ());
   clib_memcpy (mp->address, &address, sizeof (ip6_address_t));
 
   S (mp);
@@ -12060,58 +12611,186 @@ api_ipsec_sad_add_del_entry (vat_main_t * vam)
        }
       else
        {
-         clib_memcpy (mp->tunnel_src_address, &tun_src4,
-                      sizeof (ip4_address_t));
-         clib_memcpy (mp->tunnel_dst_address, &tun_dst4,
-                      sizeof (ip4_address_t));
+         clib_memcpy (mp->tunnel_src_address, &tun_src4,
+                      sizeof (ip4_address_t));
+         clib_memcpy (mp->tunnel_dst_address, &tun_dst4,
+                      sizeof (ip4_address_t));
+       }
+    }
+
+  S (mp);
+  W (ret);
+  return ret;
+}
+
+static int
+api_ipsec_sa_set_key (vat_main_t * vam)
+{
+  unformat_input_t *i = vam->input;
+  vl_api_ipsec_sa_set_key_t *mp;
+  u32 sa_id;
+  u8 *ck = 0, *ik = 0;
+  int ret;
+
+  while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
+    {
+      if (unformat (i, "sa_id %d", &sa_id))
+       ;
+      else if (unformat (i, "crypto_key %U", unformat_hex_string, &ck))
+       ;
+      else if (unformat (i, "integ_key %U", unformat_hex_string, &ik))
+       ;
+      else
+       {
+         clib_warning ("parse error '%U'", format_unformat_error, i);
+         return -99;
+       }
+    }
+
+  M (IPSEC_SA_SET_KEY, mp);
+
+  mp->sa_id = ntohl (sa_id);
+  mp->crypto_key_length = vec_len (ck);
+  mp->integrity_key_length = vec_len (ik);
+
+  if (mp->crypto_key_length > sizeof (mp->crypto_key))
+    mp->crypto_key_length = sizeof (mp->crypto_key);
+
+  if (mp->integrity_key_length > sizeof (mp->integrity_key))
+    mp->integrity_key_length = sizeof (mp->integrity_key);
+
+  if (ck)
+    clib_memcpy (mp->crypto_key, ck, mp->crypto_key_length);
+  if (ik)
+    clib_memcpy (mp->integrity_key, ik, mp->integrity_key_length);
+
+  S (mp);
+  W (ret);
+  return ret;
+}
+
+static int
+api_ipsec_tunnel_if_add_del (vat_main_t * vam)
+{
+  unformat_input_t *i = vam->input;
+  vl_api_ipsec_tunnel_if_add_del_t *mp;
+  u32 local_spi = 0, remote_spi = 0;
+  u32 crypto_alg = 0, integ_alg = 0;
+  u8 *lck = NULL, *rck = NULL;
+  u8 *lik = NULL, *rik = NULL;
+  ip4_address_t local_ip = { {0} };
+  ip4_address_t remote_ip = { {0} };
+  u8 is_add = 1;
+  u8 esn = 0;
+  u8 anti_replay = 0;
+  int ret;
+
+  while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
+    {
+      if (unformat (i, "del"))
+       is_add = 0;
+      else if (unformat (i, "esn"))
+       esn = 1;
+      else if (unformat (i, "anti_replay"))
+       anti_replay = 1;
+      else if (unformat (i, "local_spi %d", &local_spi))
+       ;
+      else if (unformat (i, "remote_spi %d", &remote_spi))
+       ;
+      else if (unformat (i, "local_ip %U", unformat_ip4_address, &local_ip))
+       ;
+      else if (unformat (i, "remote_ip %U", unformat_ip4_address, &remote_ip))
+       ;
+      else if (unformat (i, "local_crypto_key %U", unformat_hex_string, &lck))
+       ;
+      else
+       if (unformat (i, "remote_crypto_key %U", unformat_hex_string, &rck))
+       ;
+      else if (unformat (i, "local_integ_key %U", unformat_hex_string, &lik))
+       ;
+      else if (unformat (i, "remote_integ_key %U", unformat_hex_string, &rik))
+       ;
+      else
+       if (unformat
+           (i, "crypto_alg %U", unformat_ipsec_crypto_alg, &crypto_alg))
+       {
+         if (crypto_alg < IPSEC_CRYPTO_ALG_AES_CBC_128 ||
+             crypto_alg >= IPSEC_CRYPTO_N_ALG)
+           {
+             errmsg ("unsupported crypto-alg: '%U'\n",
+                     format_ipsec_crypto_alg, crypto_alg);
+             return -99;
+           }
+       }
+      else
+       if (unformat
+           (i, "integ_alg %U", unformat_ipsec_integ_alg, &integ_alg))
+       {
+         if (integ_alg < IPSEC_INTEG_ALG_SHA1_96 ||
+             integ_alg >= IPSEC_INTEG_N_ALG)
+           {
+             errmsg ("unsupported integ-alg: '%U'\n",
+                     format_ipsec_integ_alg, integ_alg);
+             return -99;
+           }
+       }
+      else
+       {
+         errmsg ("parse error '%U'\n", format_unformat_error, i);
+         return -99;
        }
     }
 
-  S (mp);
-  W (ret);
-  return ret;
-}
+  M (IPSEC_TUNNEL_IF_ADD_DEL, mp);
 
-static int
-api_ipsec_sa_set_key (vat_main_t * vam)
-{
-  unformat_input_t *i = vam->input;
-  vl_api_ipsec_sa_set_key_t *mp;
-  u32 sa_id;
-  u8 *ck = 0, *ik = 0;
-  int ret;
+  mp->is_add = is_add;
+  mp->esn = esn;
+  mp->anti_replay = anti_replay;
 
-  while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
+  clib_memcpy (mp->local_ip, &local_ip, sizeof (ip4_address_t));
+  clib_memcpy (mp->remote_ip, &remote_ip, sizeof (ip4_address_t));
+
+  mp->local_spi = htonl (local_spi);
+  mp->remote_spi = htonl (remote_spi);
+  mp->crypto_alg = (u8) crypto_alg;
+
+  mp->local_crypto_key_len = 0;
+  if (lck)
     {
-      if (unformat (i, "sa_id %d", &sa_id))
-       ;
-      else if (unformat (i, "crypto_key %U", unformat_hex_string, &ck))
-       ;
-      else if (unformat (i, "integ_key %U", unformat_hex_string, &ik))
-       ;
-      else
-       {
-         clib_warning ("parse error '%U'", format_unformat_error, i);
-         return -99;
-       }
+      mp->local_crypto_key_len = vec_len (lck);
+      if (mp->local_crypto_key_len > sizeof (mp->local_crypto_key))
+       mp->local_crypto_key_len = sizeof (mp->local_crypto_key);
+      clib_memcpy (mp->local_crypto_key, lck, mp->local_crypto_key_len);
     }
 
-  M (IPSEC_SA_SET_KEY, mp);
-
-  mp->sa_id = ntohl (sa_id);
-  mp->crypto_key_length = vec_len (ck);
-  mp->integrity_key_length = vec_len (ik);
+  mp->remote_crypto_key_len = 0;
+  if (rck)
+    {
+      mp->remote_crypto_key_len = vec_len (rck);
+      if (mp->remote_crypto_key_len > sizeof (mp->remote_crypto_key))
+       mp->remote_crypto_key_len = sizeof (mp->remote_crypto_key);
+      clib_memcpy (mp->remote_crypto_key, rck, mp->remote_crypto_key_len);
+    }
 
-  if (mp->crypto_key_length > sizeof (mp->crypto_key))
-    mp->crypto_key_length = sizeof (mp->crypto_key);
+  mp->integ_alg = (u8) integ_alg;
 
-  if (mp->integrity_key_length > sizeof (mp->integrity_key))
-    mp->integrity_key_length = sizeof (mp->integrity_key);
+  mp->local_integ_key_len = 0;
+  if (lik)
+    {
+      mp->local_integ_key_len = vec_len (lik);
+      if (mp->local_integ_key_len > sizeof (mp->local_integ_key))
+       mp->local_integ_key_len = sizeof (mp->local_integ_key);
+      clib_memcpy (mp->local_integ_key, lik, mp->local_integ_key_len);
+    }
 
-  if (ck)
-    clib_memcpy (mp->crypto_key, ck, mp->crypto_key_length);
-  if (ik)
-    clib_memcpy (mp->integrity_key, ik, mp->integrity_key_length);
+  mp->remote_integ_key_len = 0;
+  if (rik)
+    {
+      mp->remote_integ_key_len = vec_len (rik);
+      if (mp->remote_integ_key_len > sizeof (mp->remote_integ_key))
+       mp->remote_integ_key_len = sizeof (mp->remote_integ_key);
+      clib_memcpy (mp->remote_integ_key, rik, mp->remote_integ_key_len);
+    }
 
   S (mp);
   W (ret);
@@ -14043,6 +14722,64 @@ api_show_one_rloc_probe_state (vat_main_t * vam)
 
 #define api_show_lisp_rloc_probe_state api_show_one_rloc_probe_state
 
+static int
+api_one_stats_enable_disable (vat_main_t * vam)
+{
+  vl_api_one_stats_enable_disable_t *mp;
+  unformat_input_t *input = vam->input;
+  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, "enable"))
+       {
+         is_set = 1;
+         is_en = 1;
+       }
+      else if (unformat (input, "disable"))
+       {
+         is_set = 1;
+       }
+      else
+       break;
+    }
+
+  if (!is_set)
+    {
+      errmsg ("Value not set");
+      return -99;
+    }
+
+  M (ONE_STATS_ENABLE_DISABLE, mp);
+  mp->is_en = is_en;
+
+  /* send */
+  S (mp);
+
+  /* wait for reply */
+  W (ret);
+  return ret;
+}
+
+static int
+api_show_one_stats_enable_disable (vat_main_t * vam)
+{
+  vl_api_show_one_stats_enable_disable_t *mp;
+  int ret;
+
+  M (SHOW_ONE_STATS_ENABLE_DISABLE, mp);
+
+  /* send */
+  S (mp);
+
+  /* wait for reply */
+  W (ret);
+  return ret;
+}
+
 static int
 api_show_one_map_request_mode (vat_main_t * vam)
 {
@@ -14171,6 +14908,85 @@ api_show_one_pitr (vat_main_t * vam)
 
 #define api_show_lisp_pitr api_show_one_pitr
 
+static int
+api_one_use_petr (vat_main_t * vam)
+{
+  unformat_input_t *input = vam->input;
+  vl_api_one_use_petr_t *mp;
+  u8 is_add = 0;
+  ip_address_t ip;
+  int ret;
+
+  memset (&ip, 0, sizeof (ip));
+
+  /* Parse args required to build the message */
+  while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
+    {
+      if (unformat (input, "disable"))
+       is_add = 0;
+      else
+       if (unformat (input, "%U", unformat_ip4_address, &ip_addr_v4 (&ip)))
+       {
+         is_add = 1;
+         ip_addr_version (&ip) = IP4;
+       }
+      else
+       if (unformat (input, "%U", unformat_ip6_address, &ip_addr_v6 (&ip)))
+       {
+         is_add = 1;
+         ip_addr_version (&ip) = IP6;
+       }
+      else
+       {
+         errmsg ("parse error '%U'", format_unformat_error, input);
+         return -99;
+       }
+    }
+
+  M (ONE_USE_PETR, mp);
+
+  mp->is_add = is_add;
+  if (is_add)
+    {
+      mp->is_ip4 = ip_addr_version (&ip) == IP4 ? 1 : 0;
+      if (mp->is_ip4)
+       clib_memcpy (mp->address, &ip, 4);
+      else
+       clib_memcpy (mp->address, &ip, 16);
+    }
+
+  /* send */
+  S (mp);
+
+  /* wait for reply */
+  W (ret);
+  return ret;
+}
+
+#define api_lisp_use_petr api_one_use_petr
+
+static int
+api_show_one_use_petr (vat_main_t * vam)
+{
+  vl_api_show_one_use_petr_t *mp;
+  int ret;
+
+  if (!vam->json_output)
+    {
+      print (vam->ofp, "%=20s", "Proxy-ETR status:");
+    }
+
+  M (SHOW_ONE_USE_PETR, mp);
+  /* send it... */
+  S (mp);
+
+  /* Wait for a reply... */
+  W (ret);
+  return ret;
+}
+
+#define api_show_lisp_use_petr api_show_one_use_petr
+
 /**
  * Add/delete mapping between vni and vrf
  */
@@ -15171,6 +15987,38 @@ api_one_map_resolver_dump (vat_main_t * vam)
 
 #define api_lisp_map_resolver_dump api_one_map_resolver_dump
 
+static int
+api_one_stats_flush (vat_main_t * vam)
+{
+  vl_api_one_stats_flush_t *mp;
+  int ret = 0;
+
+  M (ONE_STATS_FLUSH, mp);
+  S (mp);
+  W (ret);
+  return ret;
+}
+
+static int
+api_one_stats_dump (vat_main_t * vam)
+{
+  vl_api_one_stats_dump_t *mp;
+  vl_api_control_ping_t *mp_ping;
+  int ret;
+
+  M (ONE_STATS_DUMP, mp);
+  /* send it... */
+  S (mp);
+
+  /* Use a control ping for synchronization */
+  M (CONTROL_PING, mp_ping);
+  S (mp_ping);
+
+  /* Wait for a reply... */
+  W (ret);
+  return ret;
+}
+
 static int
 api_show_one_status (vat_main_t * vam)
 {
@@ -15665,32 +16513,82 @@ api_netmap_delete (vat_main_t * vam)
   return ret;
 }
 
-static void vl_api_mpls_tunnel_details_t_handler
-  (vl_api_mpls_tunnel_details_t * mp)
+static void
+vl_api_mpls_fib_path_print (vat_main_t * vam, vl_api_fib_path2_t * fp)
+{
+  if (fp->afi == IP46_TYPE_IP6)
+    print (vam->ofp,
+          "  weight %d, sw_if_index %d, is_local %d, is_drop %d, "
+          "is_unreach %d, is_prohitbit %d, afi %d, next_hop %U",
+          ntohl (fp->weight), ntohl (fp->sw_if_index), fp->is_local,
+          fp->is_drop, fp->is_unreach, fp->is_prohibit, fp->afi,
+          format_ip6_address, fp->next_hop);
+  else if (fp->afi == IP46_TYPE_IP4)
+    print (vam->ofp,
+          "  weight %d, sw_if_index %d, is_local %d, is_drop %d, "
+          "is_unreach %d, is_prohitbit %d, afi %d, next_hop %U",
+          ntohl (fp->weight), ntohl (fp->sw_if_index), fp->is_local,
+          fp->is_drop, fp->is_unreach, fp->is_prohibit, fp->afi,
+          format_ip4_address, fp->next_hop);
+}
+
+static void
+vl_api_mpls_fib_path_json_print (vat_json_node_t * node,
+                                vl_api_fib_path2_t * fp)
+{
+  struct in_addr ip4;
+  struct in6_addr ip6;
+
+  vat_json_object_add_uint (node, "weight", ntohl (fp->weight));
+  vat_json_object_add_uint (node, "sw_if_index", ntohl (fp->sw_if_index));
+  vat_json_object_add_uint (node, "is_local", fp->is_local);
+  vat_json_object_add_uint (node, "is_drop", fp->is_drop);
+  vat_json_object_add_uint (node, "is_unreach", fp->is_unreach);
+  vat_json_object_add_uint (node, "is_prohibit", fp->is_prohibit);
+  vat_json_object_add_uint (node, "next_hop_afi", fp->afi);
+  if (fp->afi == IP46_TYPE_IP4)
+    {
+      clib_memcpy (&ip4, &fp->next_hop, sizeof (ip4));
+      vat_json_object_add_ip4 (node, "next_hop", ip4);
+    }
+  else if (fp->afi == IP46_TYPE_IP6)
+    {
+      clib_memcpy (&ip6, &fp->next_hop, sizeof (ip6));
+      vat_json_object_add_ip6 (node, "next_hop", ip6);
+    }
+}
+
+static void
+vl_api_mpls_tunnel_details_t_handler (vl_api_mpls_tunnel_details_t * mp)
 {
   vat_main_t *vam = &vat_main;
-  i32 len = mp->mt_next_hop_n_labels;
+  int count = ntohl (mp->mt_count);
+  vl_api_fib_path2_t *fp;
   i32 i;
 
-  print (vam->ofp, "[%d]: via %U %d labels ",
-        mp->tunnel_index,
-        format_ip4_address, mp->mt_next_hop,
-        ntohl (mp->mt_next_hop_sw_if_index));
-  for (i = 0; i < len; i++)
+  print (vam->ofp, "[%d]: sw_if_index %d via:",
+        ntohl (mp->mt_tunnel_index), ntohl (mp->mt_sw_if_index));
+  fp = mp->mt_paths;
+  for (i = 0; i < count; i++)
     {
-      print (vam->ofp, "%u ", ntohl (mp->mt_next_hop_out_labels[i]));
+      vl_api_mpls_fib_path_print (vam, fp);
+      fp++;
     }
+
   print (vam->ofp, "");
 }
 
-static void vl_api_mpls_tunnel_details_t_handler_json
-  (vl_api_mpls_tunnel_details_t * mp)
+#define vl_api_mpls_tunnel_details_t_endian vl_noop_handler
+#define vl_api_mpls_tunnel_details_t_print vl_noop_handler
+
+static void
+vl_api_mpls_tunnel_details_t_handler_json (vl_api_mpls_tunnel_details_t * mp)
 {
   vat_main_t *vam = &vat_main;
   vat_json_node_t *node = NULL;
-  struct in_addr ip4;
+  int count = ntohl (mp->mt_count);
+  vl_api_fib_path2_t *fp;
   i32 i;
-  i32 len = mp->mt_next_hop_n_labels;
 
   if (VAT_JSON_ARRAY != vam->json_tree.type)
     {
@@ -15700,17 +16598,17 @@ static void vl_api_mpls_tunnel_details_t_handler_json
   node = vat_json_array_add (&vam->json_tree);
 
   vat_json_init_object (node);
-  vat_json_object_add_uint (node, "tunnel_index", ntohl (mp->tunnel_index));
-  clib_memcpy (&ip4, &(mp->mt_next_hop), sizeof (ip4));
-  vat_json_object_add_ip4 (node, "next_hop", ip4);
-  vat_json_object_add_uint (node, "next_hop_sw_if_index",
-                           ntohl (mp->mt_next_hop_sw_if_index));
-  vat_json_object_add_uint (node, "l2_only", ntohl (mp->mt_l2_only));
-  vat_json_object_add_uint (node, "label_count", len);
-  for (i = 0; i < len; i++)
+  vat_json_object_add_uint (node, "tunnel_index",
+                           ntohl (mp->mt_tunnel_index));
+  vat_json_object_add_uint (node, "sw_if_index", ntohl (mp->mt_sw_if_index));
+
+  vat_json_object_add_uint (node, "l2_only", mp->mt_l2_only);
+
+  fp = mp->mt_paths;
+  for (i = 0; i < count; i++)
     {
-      vat_json_object_add_uint (node, "label",
-                               ntohl (mp->mt_next_hop_out_labels[i]));
+      vl_api_mpls_fib_path_json_print (node, fp);
+      fp++;
     }
 }
 
@@ -15749,6 +16647,7 @@ api_mpls_tunnel_dump (vat_main_t * vam)
 #define vl_api_mpls_fib_details_t_endian vl_noop_handler
 #define vl_api_mpls_fib_details_t_print vl_noop_handler
 
+
 static void
 vl_api_mpls_fib_details_t_handler (vl_api_mpls_fib_details_t * mp)
 {
@@ -15763,20 +16662,7 @@ vl_api_mpls_fib_details_t_handler (vl_api_mpls_fib_details_t * mp)
   fp = mp->path;
   for (i = 0; i < count; i++)
     {
-      if (fp->afi == IP46_TYPE_IP6)
-       print (vam->ofp,
-              "  weight %d, sw_if_index %d, is_local %d, is_drop %d, "
-              "is_unreach %d, is_prohitbit %d, afi %d, next_hop %U",
-              ntohl (fp->weight), ntohl (fp->sw_if_index), fp->is_local,
-              fp->is_drop, fp->is_unreach, fp->is_prohibit, fp->afi,
-              format_ip6_address, fp->next_hop);
-      else if (fp->afi == IP46_TYPE_IP4)
-       print (vam->ofp,
-              "  weight %d, sw_if_index %d, is_local %d, is_drop %d, "
-              "is_unreach %d, is_prohitbit %d, afi %d, next_hop %U",
-              ntohl (fp->weight), ntohl (fp->sw_if_index), fp->is_local,
-              fp->is_drop, fp->is_unreach, fp->is_prohibit, fp->afi,
-              format_ip4_address, fp->next_hop);
+      vl_api_mpls_fib_path_print (vam, fp);
       fp++;
     }
 }
@@ -15787,8 +16673,6 @@ static void vl_api_mpls_fib_details_t_handler_json
   vat_main_t *vam = &vat_main;
   int count = ntohl (mp->count);
   vat_json_node_t *node = NULL;
-  struct in_addr ip4;
-  struct in6_addr ip6;
   vl_api_fib_path2_t *fp;
   int i;
 
@@ -15807,23 +16691,8 @@ static void vl_api_mpls_fib_details_t_handler_json
   fp = mp->path;
   for (i = 0; i < count; i++)
     {
-      vat_json_object_add_uint (node, "weight", ntohl (fp->weight));
-      vat_json_object_add_uint (node, "sw_if_index", ntohl (fp->sw_if_index));
-      vat_json_object_add_uint (node, "is_local", fp->is_local);
-      vat_json_object_add_uint (node, "is_drop", fp->is_drop);
-      vat_json_object_add_uint (node, "is_unreach", fp->is_unreach);
-      vat_json_object_add_uint (node, "is_prohibit", fp->is_prohibit);
-      vat_json_object_add_uint (node, "next_hop_afi", fp->afi);
-      if (fp->afi == IP46_TYPE_IP4)
-       {
-         clib_memcpy (&ip4, &fp->next_hop, sizeof (ip4));
-         vat_json_object_add_ip4 (node, "next_hop", ip4);
-       }
-      else if (fp->afi == IP46_TYPE_IP6)
-       {
-         clib_memcpy (&ip6, &fp->next_hop, sizeof (ip6));
-         vat_json_object_add_ip6 (node, "next_hop", ip6);
-       }
+      vl_api_mpls_fib_path_json_print (node, fp);
+      fp++;
     }
 }
 
@@ -17906,14 +18775,17 @@ _(sw_interface_set_l2_xconnect,                                         \
   "rx <intfc> | rx_sw_if_index <id> tx <intfc> | tx_sw_if_index <id>\n" \
   "enable | disable")                                                   \
 _(sw_interface_set_l2_bridge,                                           \
-  "<intfc> | sw_if_index <id> bd_id <bridge-domain-id>\n"               \
+  "{<intfc> | sw_if_index <id>} bd_id <bridge-domain-id>\n"             \
   "[shg <split-horizon-group>] [bvi]\n"                                 \
   "enable | disable")                                                   \
+_(bridge_domain_set_mac_age, "bd_id <bridge-domain-id> mac-age 0-255")  \
 _(bridge_domain_add_del,                                                \
-  "bd_id <bridge-domain-id> [flood 1|0] [uu-flood 1|0] [forward 1|0] [learn 1|0] [arp-term 1|0] [del]\n") \
+  "bd_id <bridge-domain-id> [flood 1|0] [uu-flood 1|0] [forward 1|0] [learn 1|0] [arp-term 1|0] [mac-age 0-255] [del]\n") \
 _(bridge_domain_dump, "[bd_id <bridge-domain-id>]\n")                   \
 _(l2fib_add_del,                                                        \
   "mac <mac-addr> bd_id <bridge-domain-id> [del] | sw_if <intfc> | sw_if_index <id> [static] [filter] [bvi] [count <nn>]\n") \
+_(l2fib_flush_bd, "bd_id <bridge-domain-id>")                           \
+_(l2fib_flush_int, "<intfc> | sw_if_index <id>")                        \
 _(l2_flags,                                                             \
   "sw_if <intfc> | sw_if_index <id> [learn] [forward] [uu-flood] [flood]\n") \
 _(bridge_flags,                                                         \
@@ -17974,6 +18846,9 @@ _(sw_interface_ip6_enable_disable,                                      \
   "<intfc> | sw_if_index <id> enable | disable")                        \
 _(sw_interface_ip6_set_link_local_address,                              \
   "<intfc> | sw_if_index <id> <ip6-address>/<mask-width>")              \
+_(ip6nd_proxy_add_del,                                                  \
+  "<intfc> | sw_if_index <id> <ip6-address>")                           \
+_(ip6nd_proxy_dump, "")                                                 \
 _(sw_interface_ip6nd_ra_prefix,                                         \
   "<intfc> | sw_if_index <id> <ip6-address>/<mask-width>\n"             \
   "val_life <n> pref_life <n> [def] [noadv] [offl] [noauto]\n"          \
@@ -18024,7 +18899,7 @@ _(vxlan_add_del_tunnel,                                                 \
   "vni <vni> [encap-vrf-id <nn>] [decap-next <l2|nn>] [del]")           \
 _(vxlan_tunnel_dump, "[<intfc> | sw_if_index <nn>]")                    \
 _(gre_add_del_tunnel,                                                   \
-  "src <ip4-addr> dst <ip4-addr> [outer-fib-id <nn>] [teb] [del]\n")    \
+  "src <ip-addr> dst <ip-addr> [outer-fib-id <nn>] [teb] [del]\n")    \
 _(gre_tunnel_dump, "[<intfc> | sw_if_index <nn>]")                      \
 _(l2_fib_clear_table, "")                                               \
 _(l2_interface_efp_filter, "sw_if_index <nn> enable | disable")         \
@@ -18034,10 +18909,12 @@ _(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>] "         \
-        "[mac <mac_address>]")                                          \
+        "[mac <mac_address>] "                                          \
+        "[mode <interrupt | polling>]")                                 \
 _(modify_vhost_user_if,                                                 \
         "<intfc> | sw_if_index <nn> socket <filename>\n"                \
-        "[server] [renumber <dev_instance>]")                           \
+        "[server] [renumber <dev_instance>] "                           \
+        "[mode <interrupt | polling>]")                                 \
 _(delete_vhost_user_if, "<intfc> | sw_if_index <nn>")                   \
 _(sw_interface_vhost_user_dump, "")                                     \
 _(show_version, "")                                                     \
@@ -18067,6 +18944,10 @@ _(ipsec_spd_add_del_entry, "spd_id <n> priority <n> action <action>\n"  \
   "  laddr_stop <ip4|ip6> raddr_start <ip4|ip6> raddr_stop <ip4|ip6>\n" \
   "  [lport_start <n> lport_stop <n>] [rport_start <n> rport_stop <n>]" ) \
 _(ipsec_sa_set_key, "sa_id <n> crypto_key <hex> integ_key <hex>")       \
+_(ipsec_tunnel_if_add_del, "local_spi <n> remote_spi <n>\n"             \
+  "  crypto_alg <alg> local_crypto_key <hex> remote_crypto_key <hex>\n" \
+  "  integ_alg <alg> local_integ_key <hex> remote_integ_key <hex>\n"    \
+  "  local_ip <addr> remote_ip <addr> [esn] [anti_replay] [del]\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>)")                            \
@@ -18128,6 +19009,7 @@ _(one_add_del_remote_mapping, "add|del vni <vni> eid <dest-eid> "       \
 _(one_add_del_adjacency, "add|del vni <vni> reid <remote-eid> leid "    \
                           "<local-eid>")                                \
 _(one_pitr_set_locator_set, "locator-set <loc-set-name> | del")         \
+_(one_use_petr, "ip-address> | disable")                                \
 _(one_map_request_mode, "src-dst|dst-only")                             \
 _(one_add_del_map_request_itr_rlocs, "<loc-set-name> [del]")            \
 _(one_eid_table_add_del_map, "[del] vni <vni> vrf <vrf>")               \
@@ -18135,6 +19017,8 @@ _(one_locator_set_dump, "[local | remote]")                             \
 _(one_locator_dump, "ls_index <index> | ls_name <name>")                \
 _(one_eid_table_dump, "[eid <ipv4|ipv6>/<prefix> | <mac>] [vni] "       \
                        "[local] | [remote]")                            \
+_(one_stats_enable_disable, "enable|disalbe")                           \
+_(show_one_stats_enable_disable, "")                                    \
 _(one_eid_table_vni_dump, "")                                           \
 _(one_eid_table_map_dump, "l2|l3")                                      \
 _(one_map_resolver_dump, "")                                            \
@@ -18143,8 +19027,11 @@ _(one_adjacencies_get, "vni <vni>")                                     \
 _(show_one_rloc_probe_state, "")                                        \
 _(show_one_map_register_state, "")                                      \
 _(show_one_status, "")                                                  \
+_(one_stats_dump, "")                                                   \
+_(one_stats_flush, "")                                                  \
 _(one_get_map_request_itr_rlocs, "")                                    \
 _(show_one_pitr, "")                                                    \
+_(show_one_use_petr, "")                                                \
 _(show_one_map_request_mode, "")                                        \
 _(lisp_add_del_locator_set, "locator-set <locator_name> [iface <intf> |"\
                             " sw_if_index <sw_if_index> p <priority> "  \
@@ -18169,6 +19056,7 @@ _(lisp_add_del_remote_mapping, "add|del vni <vni> eid <dest-eid> "      \
 _(lisp_add_del_adjacency, "add|del vni <vni> reid <remote-eid> leid "   \
                           "<local-eid>")                                \
 _(lisp_pitr_set_locator_set, "locator-set <loc-set-name> | del")        \
+_(lisp_use_petr, "<ip-address> | disable")                              \
 _(lisp_map_request_mode, "src-dst|dst-only")                            \
 _(lisp_add_del_map_request_itr_rlocs, "<loc-set-name> [del]")           \
 _(lisp_eid_table_add_del_map, "[del] vni <vni> vrf <vrf>")              \
@@ -18194,6 +19082,7 @@ _(show_lisp_map_register_state, "")                                     \
 _(show_lisp_status, "")                                                 \
 _(lisp_get_map_request_itr_rlocs, "")                                   \
 _(show_lisp_pitr, "")                                                   \
+_(show_lisp_use_petr, "")                                               \
 _(show_lisp_map_request_mode, "")                                       \
 _(af_packet_create, "name <host interface name> [hw_addr <mac>]")       \
 _(af_packet_delete, "name <host interface name>")                       \
@@ -18314,13 +19203,13 @@ vat_api_hookup (vat_main_t * vam)
 
 #if (VPP_API_TEST_BUILTIN==0)
   vl_msg_api_set_first_available_msg_id (VL_MSG_FIRST_AVAILABLE);
-#endif
 
   vam->sw_if_index_by_interface_name = hash_create_string (0, sizeof (uword));
 
   vam->function_by_name = hash_create_string (0, sizeof (uword));
 
   vam->help_by_name = hash_create_string (0, sizeof (uword));
+#endif
 
   /* API messages we can send */
 #define _(n,h) hash_set_mem (vam->function_by_name, #n, api_##n);