FIB table add/delete API only
[vpp.git] / src / vat / api_format.c
index 932e162..9381ec5 100644 (file)
@@ -972,8 +972,8 @@ static void vl_api_sw_interface_details_t_handler_json
 }
 
 #if VPP_API_TEST_BUILTIN == 0
-static void vl_api_sw_interface_set_flags_t_handler
-  (vl_api_sw_interface_set_flags_t * mp)
+static void vl_api_sw_interface_event_t_handler
+  (vl_api_sw_interface_event_t * mp)
 {
   vat_main_t *vam = &vat_main;
   if (vam->interface_event_display)
@@ -984,8 +984,8 @@ static void vl_api_sw_interface_set_flags_t_handler
 }
 #endif
 
-static void vl_api_sw_interface_set_flags_t_handler_json
-  (vl_api_sw_interface_set_flags_t * mp)
+static void vl_api_sw_interface_event_t_handler_json
+  (vl_api_sw_interface_event_t * mp)
 {
   /* JSON output not supported */
 }
@@ -1283,6 +1283,30 @@ vl_api_ip6_nd_event_t_handler_json (vl_api_ip6_nd_event_t * mp)
   /* JSON output not supported */
 }
 
+static void
+vl_api_l2_macs_event_t_handler (vl_api_l2_macs_event_t * mp)
+{
+  u32 n_macs = ntohl (mp->n_macs);
+  errmsg ("L2MAC event recived with pid %d cl-idx %d for %d macs: \n",
+         ntohl (mp->pid), mp->client_index, n_macs);
+  int i;
+  for (i = 0; i < n_macs; i++)
+    {
+      vl_api_mac_entry_t *mac = &mp->mac[i];
+      errmsg (" [%d] sw_if_index %d  mac_addr %U  is_del %d \n",
+             i + 1, ntohl (mac->sw_if_index),
+             format_ethernet_address, mac->mac_addr, mac->is_del);
+      if (i == 1000)
+       break;
+    }
+}
+
+static void
+vl_api_l2_macs_event_t_handler_json (vl_api_l2_macs_event_t * mp)
+{
+  /* JSON output not supported */
+}
+
 #define vl_api_bridge_domain_details_t_endian vl_noop_handler
 #define vl_api_bridge_domain_details_t_print vl_noop_handler
 
@@ -2906,6 +2930,39 @@ static void
   vat_json_object_add_uint (node, "vni", clib_net_to_host_u32 (mp->vni));
 }
 
+static void
+  vl_api_show_one_map_register_fallback_threshold_reply_t_handler
+  (vl_api_show_one_map_register_fallback_threshold_reply_t * mp)
+{
+  vat_main_t *vam = &vat_main;
+  int retval = clib_net_to_host_u32 (mp->retval);
+
+  vl_api_show_one_map_register_fallback_threshold_reply_t_endian (mp);
+  print (vam->ofp, "fallback threshold value: %d", mp->value);
+
+  vam->retval = retval;
+  vam->result_ready = 1;
+}
+
+static void
+  vl_api_show_one_map_register_fallback_threshold_reply_t_handler_json
+  (vl_api_show_one_map_register_fallback_threshold_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);
+
+  vl_api_show_one_map_register_fallback_threshold_reply_t_endian (mp);
+  vat_json_init_object (node);
+  vat_json_object_add_uint (node, "value", mp->value);
+
+  vat_json_print (vam->ofp, node);
+  vat_json_free (node);
+
+  vam->retval = retval;
+  vam->result_ready = 1;
+}
+
 static void
   vl_api_show_one_map_register_state_reply_t_handler
   (vl_api_show_one_map_register_state_reply_t * mp)
@@ -3850,6 +3907,42 @@ static void
   vam->result_ready = 1;
 }
 
+static void
+  vl_api_show_one_map_register_ttl_reply_t_handler
+  (vl_api_show_one_map_register_ttl_reply_t * mp)
+{
+  vat_main_t *vam = &vat_main;
+  i32 retval = ntohl (mp->retval);
+
+  vl_api_show_one_map_register_ttl_reply_t_endian (mp);
+
+  if (0 <= retval)
+    {
+      print (vam->ofp, "ttl: %u", mp->ttl);
+    }
+
+  vam->retval = retval;
+  vam->result_ready = 1;
+}
+
+static void
+  vl_api_show_one_map_register_ttl_reply_t_handler_json
+  (vl_api_show_one_map_register_ttl_reply_t * mp)
+{
+  vat_main_t *vam = &vat_main;
+  vat_json_node_t node;
+
+  vl_api_show_one_map_register_ttl_reply_t_endian (mp);
+  vat_json_init_object (&node);
+  vat_json_object_add_uint (&node, "ttl", mp->ttl);
+
+  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)
 {
@@ -4522,8 +4615,10 @@ _(l2fib_add_del_reply)                                  \
 _(l2fib_flush_int_reply)                                \
 _(l2fib_flush_bd_reply)                                 \
 _(ip_add_del_route_reply)                               \
+_(ip_table_add_del_reply)                               \
 _(ip_mroute_add_del_reply)                              \
 _(mpls_route_add_del_reply)                             \
+_(mpls_table_add_del_reply)                             \
 _(mpls_ip_bind_unbind_reply)                            \
 _(proxy_arp_add_del_reply)                              \
 _(proxy_arp_intfc_enable_disable_reply)                 \
@@ -4561,6 +4656,7 @@ _(modify_vhost_user_if_reply)                           \
 _(delete_vhost_user_if_reply)                           \
 _(want_ip4_arp_events_reply)                            \
 _(want_ip6_nd_events_reply)                             \
+_(want_l2_macs_events_reply)                            \
 _(input_acl_set_interface_reply)                        \
 _(ipsec_spd_add_del_reply)                              \
 _(ipsec_interface_add_del_spd_reply)                    \
@@ -4601,6 +4697,8 @@ _(one_add_del_map_server_reply)                         \
 _(one_enable_disable_reply)                             \
 _(one_rloc_probe_enable_disable_reply)                  \
 _(one_map_register_enable_disable_reply)                \
+_(one_map_register_set_ttl_reply)                       \
+_(one_map_register_fallback_threshold_reply)            \
 _(one_pitr_set_locator_set_reply)                       \
 _(one_map_request_mode_reply)                           \
 _(one_add_del_map_request_itr_rlocs_reply)              \
@@ -4705,7 +4803,9 @@ _(TAP_MODIFY_REPLY, tap_modify_reply)                                     \
 _(TAP_DELETE_REPLY, tap_delete_reply)                                  \
 _(SW_INTERFACE_TAP_DETAILS, sw_interface_tap_details)                   \
 _(IP_ADD_DEL_ROUTE_REPLY, ip_add_del_route_reply)                      \
+_(IP_TABLE_ADD_DEL_REPLY, ip_table_add_del_reply)                      \
 _(IP_MROUTE_ADD_DEL_REPLY, ip_mroute_add_del_reply)                    \
+_(MPLS_TABLE_ADD_DEL_REPLY, mpls_table_add_del_reply)                  \
 _(MPLS_ROUTE_ADD_DEL_REPLY, mpls_route_add_del_reply)                  \
 _(MPLS_IP_BIND_UNBIND_REPLY, mpls_ip_bind_unbind_reply)                        \
 _(PROXY_ARP_ADD_DEL_REPLY, proxy_arp_add_del_reply)                     \
@@ -4776,6 +4876,8 @@ _(WANT_IP4_ARP_EVENTS_REPLY, want_ip4_arp_events_reply)                   \
 _(IP4_ARP_EVENT, ip4_arp_event)                                         \
 _(WANT_IP6_ND_EVENTS_REPLY, want_ip6_nd_events_reply)                  \
 _(IP6_ND_EVENT, ip6_nd_event)                                          \
+_(WANT_L2_MACS_EVENTS_REPLY, want_l2_macs_events_reply)                        \
+_(L2_MACS_EVENT, l2_macs_event)                                                \
 _(INPUT_ACL_SET_INTERFACE_REPLY, input_acl_set_interface_reply)         \
 _(IP_ADDRESS_DETAILS, ip_address_details)                               \
 _(IP_DETAILS, ip_details)                                               \
@@ -4825,6 +4927,9 @@ _(ONE_ADD_DEL_MAP_SERVER_REPLY, one_add_del_map_server_reply)           \
 _(ONE_ENABLE_DISABLE_REPLY, one_enable_disable_reply)                   \
 _(ONE_MAP_REGISTER_ENABLE_DISABLE_REPLY,                                \
   one_map_register_enable_disable_reply)                                \
+_(ONE_MAP_REGISTER_SET_TTL_REPLY, one_map_register_set_ttl_reply)       \
+_(ONE_MAP_REGISTER_FALLBACK_THRESHOLD_REPLY,                            \
+  one_map_register_fallback_threshold_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)       \
@@ -4871,6 +4976,9 @@ _(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,                                    \
   show_one_map_register_state_reply)                                    \
+_(SHOW_ONE_MAP_REGISTER_TTL_REPLY, show_one_map_register_ttl_reply)     \
+_(SHOW_ONE_MAP_REGISTER_FALLBACK_THRESHOLD_REPLY,                       \
+  show_one_map_register_fallback_threshold_reply)                       \
 _(AF_PACKET_CREATE_REPLY, af_packet_create_reply)                       \
 _(AF_PACKET_DELETE_REPLY, af_packet_delete_reply)                       \
 _(POLICER_ADD_DEL_REPLY, policer_add_del_reply)                         \
@@ -4922,7 +5030,7 @@ _(LLDP_CONFIG_REPLY, lldp_config_reply)                                 \
 _(SW_INTERFACE_SET_LLDP_REPLY, sw_interface_set_lldp_reply)
 
 #define foreach_standalone_reply_msg                                   \
-_(SW_INTERFACE_SET_FLAGS, sw_interface_set_flags)                       \
+_(SW_INTERFACE_EVENT, sw_interface_event)                               \
 _(VNET_INTERFACE_SIMPLE_COUNTERS, vnet_interface_simple_counters)       \
 _(VNET_INTERFACE_COMBINED_COUNTERS, vnet_interface_combined_counters)   \
 _(VNET_IP4_FIB_COUNTERS, vnet_ip4_fib_counters)                         \
@@ -5668,7 +5776,7 @@ api_sw_interface_set_flags (vat_main_t * vam)
   vl_api_sw_interface_set_flags_t *mp;
   u32 sw_if_index;
   u8 sw_if_index_set = 0;
-  u8 admin_up = 0, link_up = 0;
+  u8 admin_up = 0;
   int ret;
 
   /* Parse args required to build the message */
@@ -5678,10 +5786,6 @@ api_sw_interface_set_flags (vat_main_t * vam)
        admin_up = 1;
       else if (unformat (i, "admin-down"))
        admin_up = 0;
-      else if (unformat (i, "link-up"))
-       link_up = 1;
-      else if (unformat (i, "link-down"))
-       link_up = 0;
       else
        if (unformat (i, "%U", api_unformat_sw_if_index, vam, &sw_if_index))
        sw_if_index_set = 1;
@@ -5701,7 +5805,6 @@ api_sw_interface_set_flags (vat_main_t * vam)
   M (SW_INTERFACE_SET_FLAGS, mp);
   mp->sw_if_index = ntohl (sw_if_index);
   mp->admin_up_down = admin_up;
-  mp->link_up_down = link_up;
 
   /* send it... */
   S (mp);
@@ -6568,8 +6671,9 @@ api_l2_flags (vat_main_t * vam)
   unformat_input_t *i = vam->input;
   vl_api_l2_flags_t *mp;
   u32 sw_if_index;
-  u32 feature_bitmap = 0;
+  u32 flags = 0;
   u8 sw_if_index_set = 0;
+  u8 is_set = 0;
   int ret;
 
   /* Parse args required to build the message */
@@ -6589,13 +6693,19 @@ api_l2_flags (vat_main_t * vam)
            break;
        }
       else if (unformat (i, "learn"))
-       feature_bitmap |= L2INPUT_FEAT_LEARN;
+       flags |= L2_LEARN;
       else if (unformat (i, "forward"))
-       feature_bitmap |= L2INPUT_FEAT_FWD;
+       flags |= L2_FWD;
       else if (unformat (i, "flood"))
-       feature_bitmap |= L2INPUT_FEAT_FLOOD;
+       flags |= L2_FLOOD;
       else if (unformat (i, "uu-flood"))
-       feature_bitmap |= L2INPUT_FEAT_UU_FLOOD;
+       flags |= L2_UU_FLOOD;
+      else if (unformat (i, "arp-term"))
+       flags |= L2_ARP_TERM;
+      else if (unformat (i, "off"))
+       is_set = 0;
+      else if (unformat (i, "disable"))
+       is_set = 0;
       else
        break;
     }
@@ -6609,7 +6719,8 @@ api_l2_flags (vat_main_t * vam)
   M (L2_FLAGS, mp);
 
   mp->sw_if_index = ntohl (sw_if_index);
-  mp->feature_bitmap = ntohl (feature_bitmap);
+  mp->feature_bitmap = ntohl (flags);
+  mp->is_set = is_set;
 
   S (mp);
   W (ret);
@@ -6941,6 +7052,56 @@ api_tap_delete (vat_main_t * vam)
   return ret;
 }
 
+static int
+api_ip_table_add_del (vat_main_t * vam)
+{
+  unformat_input_t *i = vam->input;
+  vl_api_ip_table_add_del_t *mp;
+  u32 table_id = ~0;
+  u8 is_ipv6 = 0;
+  u8 is_add = 1;
+  int ret = 0;
+
+  /* Parse args required to build the message */
+  while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
+    {
+      if (unformat (i, "ipv6"))
+       is_ipv6 = 1;
+      else if (unformat (i, "del"))
+       is_add = 0;
+      else if (unformat (i, "add"))
+       is_add = 1;
+      else if (unformat (i, "table %d", &table_id))
+       ;
+      else
+       {
+         clib_warning ("parse error '%U'", format_unformat_error, i);
+         return -99;
+       }
+    }
+
+  if (~0 == table_id)
+    {
+      errmsg ("missing table-ID");
+      return -99;
+    }
+
+  /* Construct the API message */
+  M (IP_TABLE_ADD_DEL, mp);
+
+  mp->table_id = ntohl (table_id);
+  mp->is_ipv6 = is_ipv6;
+  mp->is_add = is_add;
+
+  /* send it... */
+  S (mp);
+
+  /* Wait for a reply... */
+  W (ret);
+
+  return ret;
+}
+
 static int
 api_ip_add_del_route (vat_main_t * vam)
 {
@@ -7359,6 +7520,52 @@ api_ip_mroute_add_del (vat_main_t * vam)
   return ret;
 }
 
+static int
+api_mpls_table_add_del (vat_main_t * vam)
+{
+  unformat_input_t *i = vam->input;
+  vl_api_mpls_table_add_del_t *mp;
+  u32 table_id = ~0;
+  u8 is_add = 1;
+  int ret = 0;
+
+  /* Parse args required to build the message */
+  while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
+    {
+      if (unformat (i, "table %d", &table_id))
+       ;
+      else if (unformat (i, "del"))
+       is_add = 0;
+      else if (unformat (i, "add"))
+       is_add = 1;
+      else
+       {
+         clib_warning ("parse error '%U'", format_unformat_error, i);
+         return -99;
+       }
+    }
+
+  if (~0 == table_id)
+    {
+      errmsg ("missing table-ID");
+      return -99;
+    }
+
+  /* Construct the API message */
+  M (MPLS_TABLE_ADD_DEL, mp);
+
+  mp->mt_table_id = ntohl (table_id);
+  mp->mt_is_add = is_add;
+
+  /* send it... */
+  S (mp);
+
+  /* Wait for a reply... */
+  W (ret);
+
+  return ret;
+}
+
 static int
 api_mpls_route_add_del (vat_main_t * vam)
 {
@@ -7386,7 +7593,7 @@ api_mpls_route_add_del (vat_main_t * vam)
   mpls_label_t *next_hop_out_label_stack = NULL;
   mpls_label_t local_label = MPLS_LABEL_INVALID;
   u8 is_eos = 0;
-  u8 next_hop_proto_is_ip4 = 1;
+  dpo_proto_t next_hop_proto = DPO_PROTO_IP4;
 
   /* Parse args required to build the message */
   while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
@@ -7405,13 +7612,13 @@ api_mpls_route_add_del (vat_main_t * vam)
                         &v4_next_hop_address))
        {
          next_hop_set = 1;
-         next_hop_proto_is_ip4 = 1;
+         next_hop_proto = DPO_PROTO_IP4;
        }
       else if (unformat (i, "via %U", unformat_ip6_address,
                         &v6_next_hop_address))
        {
          next_hop_set = 1;
-         next_hop_proto_is_ip4 = 0;
+         next_hop_proto = DPO_PROTO_IP6;
        }
       else if (unformat (i, "weight %d", &next_hop_weight))
        ;
@@ -7436,12 +7643,12 @@ api_mpls_route_add_del (vat_main_t * vam)
       else if (unformat (i, "lookup-in-ip4-table %d", &next_hop_table_id))
        {
          next_hop_set = 1;
-         next_hop_proto_is_ip4 = 1;
+         next_hop_proto = DPO_PROTO_IP4;
        }
       else if (unformat (i, "lookup-in-ip6-table %d", &next_hop_table_id))
        {
          next_hop_set = 1;
-         next_hop_proto_is_ip4 = 0;
+         next_hop_proto = DPO_PROTO_IP6;
        }
       else if (unformat (i, "next-hop-table %d", &next_hop_table_id))
        ;
@@ -7487,7 +7694,7 @@ api_mpls_route_add_del (vat_main_t * vam)
       mp->mr_create_table_if_needed = create_table_if_needed;
 
       mp->mr_is_add = is_add;
-      mp->mr_next_hop_proto_is_ip4 = next_hop_proto_is_ip4;
+      mp->mr_next_hop_proto = next_hop_proto;
       mp->mr_is_classify = is_classify;
       mp->mr_is_multipath = is_multipath;
       mp->mr_is_resolve_host = resolve_host;
@@ -7510,13 +7717,14 @@ api_mpls_route_add_del (vat_main_t * vam)
 
       if (next_hop_set)
        {
-         if (next_hop_proto_is_ip4)
+         if (DPO_PROTO_IP4 == next_hop_proto)
            {
              clib_memcpy (mp->mr_next_hop,
                           &v4_next_hop_address,
                           sizeof (v4_next_hop_address));
            }
-         else
+         else if (DPO_PROTO_IP6 == next_hop_proto)
+
            {
              clib_memcpy (mp->mr_next_hop,
                           &v6_next_hop_address,
@@ -12495,6 +12703,42 @@ api_want_ip6_nd_events (vat_main_t * vam)
   return ret;
 }
 
+static int
+api_want_l2_macs_events (vat_main_t * vam)
+{
+  unformat_input_t *line_input = vam->input;
+  vl_api_want_l2_macs_events_t *mp;
+  u8 enable_disable = 1;
+  u32 scan_delay = 0;
+  u32 max_macs_in_event = 0;
+  u32 learn_limit = 0;
+  int ret;
+
+  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
+    {
+      if (unformat (line_input, "learn-limit %d", &learn_limit))
+       ;
+      else if (unformat (line_input, "scan-delay %d", &scan_delay))
+       ;
+      else if (unformat (line_input, "max-entries %d", &max_macs_in_event))
+       ;
+      else if (unformat (line_input, "disable"))
+       enable_disable = 0;
+      else
+       break;
+    }
+
+  M (WANT_L2_MACS_EVENTS, mp);
+  mp->enable_disable = enable_disable;
+  mp->pid = htonl (getpid ());
+  mp->learn_limit = htonl (learn_limit);
+  mp->scan_delay = (u8) scan_delay;
+  mp->max_macs_in_event = (u8) (max_macs_in_event / 10);
+  S (mp);
+  W (ret);
+  return ret;
+}
+
 static int
 api_input_acl_set_interface (vat_main_t * vam)
 {
@@ -16051,6 +16295,114 @@ api_lisp_gpe_add_del_iface (vat_main_t * vam)
   return ret;
 }
 
+static int
+api_one_map_register_fallback_threshold (vat_main_t * vam)
+{
+  unformat_input_t *input = vam->input;
+  vl_api_one_map_register_fallback_threshold_t *mp;
+  u32 value = 0;
+  u8 is_set = 0;
+  int ret;
+
+  /* Parse args required to build the message */
+  while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
+    {
+      if (unformat (input, "%u", &value))
+       is_set = 1;
+      else
+       {
+         clib_warning ("parse error '%U'", format_unformat_error, input);
+         return -99;
+       }
+    }
+
+  if (!is_set)
+    {
+      errmsg ("fallback threshold value is missing!");
+      return -99;
+    }
+
+  M (ONE_MAP_REGISTER_FALLBACK_THRESHOLD, mp);
+  mp->value = clib_host_to_net_u32 (value);
+
+  /* send it... */
+  S (mp);
+
+  /* Wait for a reply... */
+  W (ret);
+  return ret;
+}
+
+static int
+api_show_one_map_register_fallback_threshold (vat_main_t * vam)
+{
+  vl_api_show_one_map_register_fallback_threshold_t *mp;
+  int ret;
+
+  M (SHOW_ONE_MAP_REGISTER_FALLBACK_THRESHOLD, mp);
+
+  /* send it... */
+  S (mp);
+
+  /* Wait for a reply... */
+  W (ret);
+  return ret;
+}
+
+static int
+api_one_map_register_set_ttl (vat_main_t * vam)
+{
+  unformat_input_t *input = vam->input;
+  vl_api_one_map_register_set_ttl_t *mp;
+  u32 ttl = 0;
+  u8 is_set = 0;
+  int ret;
+
+  /* Parse args required to build the message */
+  while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
+    {
+      if (unformat (input, "%u", &ttl))
+       is_set = 1;
+      else
+       {
+         clib_warning ("parse error '%U'", format_unformat_error, input);
+         return -99;
+       }
+    }
+
+  if (!is_set)
+    {
+      errmsg ("TTL value missing!");
+      return -99;
+    }
+
+  M (ONE_MAP_REGISTER_SET_TTL, mp);
+  mp->ttl = clib_host_to_net_u32 (ttl);
+
+  /* send it... */
+  S (mp);
+
+  /* Wait for a reply... */
+  W (ret);
+  return ret;
+}
+
+static int
+api_show_one_map_register_ttl (vat_main_t * vam)
+{
+  vl_api_show_one_map_register_ttl_t *mp;
+  int ret;
+
+  M (SHOW_ONE_MAP_REGISTER_TTL, mp);
+
+  /* send it... */
+  S (mp);
+
+  /* Wait for a reply... */
+  W (ret);
+  return ret;
+}
+
 /**
  * Add/del map request itr rlocs from ONE control plane and updates
  *
@@ -18207,11 +18559,22 @@ static void
 static int
 api_sw_interface_span_dump (vat_main_t * vam)
 {
+  unformat_input_t *input = vam->input;
   vl_api_sw_interface_span_dump_t *mp;
   vl_api_control_ping_t *mp_ping;
+  u8 is_l2 = 0;
   int ret;
 
+  while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
+    {
+      if (unformat (input, "l2"))
+       is_l2 = 1;
+      else
+       break;
+    }
+
   M (SW_INTERFACE_SPAN_DUMP, mp);
+  mp->is_l2 = is_l2;
   S (mp);
 
   /* Use a control ping for synchronization */
@@ -19150,6 +19513,7 @@ api_p2p_ethernet_add (vat_main_t * vam)
   unformat_input_t *i = vam->input;
   vl_api_p2p_ethernet_add_t *mp;
   u32 parent_if_index = ~0;
+  u32 sub_id = ~0;
   u8 remote_mac[6];
   u8 mac_set = 0;
   int ret;
@@ -19165,6 +19529,8 @@ api_p2p_ethernet_add (vat_main_t * vam)
        if (unformat
            (i, "remote_mac %U", unformat_ethernet_address, remote_mac))
        mac_set++;
+      else if (unformat (i, "sub_id %d", &sub_id))
+       ;
       else
        {
          clib_warning ("parse error '%U'", format_unformat_error, i);
@@ -19182,9 +19548,15 @@ api_p2p_ethernet_add (vat_main_t * vam)
       errmsg ("missing remote mac address");
       return -99;
     }
+  if (sub_id == ~0)
+    {
+      errmsg ("missing sub-interface id");
+      return -99;
+    }
 
   M (P2P_ETHERNET_ADD, mp);
   mp->parent_if_index = ntohl (parent_if_index);
+  mp->subif_id = ntohl (sub_id);
   clib_memcpy (mp->remote_mac, remote_mac, sizeof (remote_mac));
 
   S (mp);
@@ -19718,7 +20090,7 @@ _(l2fib_add_del,                                                        \
 _(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") \
+  "sw_if <intfc> | sw_if_index <id> [learn] [forward] [uu-flood] [flood] [arp-term] [disable]\n") \
 _(bridge_flags,                                                         \
   "bd_id <bridge-domain-id> [learn] [forward] [uu-flood] [flood] [arp-term] [disable]\n") \
 _(tap_connect,                                                          \
@@ -19728,6 +20100,8 @@ _(tap_modify,                                                           \
 _(tap_delete,                                                           \
   "<vpp-if-name> | sw_if_index <id>")                                   \
 _(sw_interface_tap_dump, "")                                            \
+_(ip_table_add_del,                                                     \
+  "table-id <n> [ipv6]\n")                                              \
 _(ip_add_del_route,                                                     \
   "<addr>/<mask> via <addr> [table-id <n>]\n"                           \
   "[<intfc> | sw_if_index <id>] [resolve-attempts <n>]\n"               \
@@ -19736,6 +20110,8 @@ _(ip_add_del_route,                                                     \
 _(ip_mroute_add_del,                                                    \
   "<src> <grp>/<mask> [table-id <n>]\n"                                 \
   "[<intfc> | sw_if_index <id>] [local] [del]")                         \
+_(mpls_table_add_del,                                                   \
+  "table-id <n>\n")                                                     \
 _(mpls_route_add_del,                                                   \
   "<label> <eos> via <addr> [table-id <n>]\n"                           \
   "[<intfc> | sw_if_index <id>] [resolve-attempts <n>]\n"               \
@@ -19861,6 +20237,7 @@ _(input_acl_set_interface,                                              \
   "  [l2-table <nn>] [del]")                                            \
 _(want_ip4_arp_events, "address <ip4-address> [del]")                   \
 _(want_ip6_nd_events, "address <ip6-address> [del]")                    \
+_(want_l2_macs_events, "[disable] [learn-limit <n>] [scan-delay <n>] [max-entries <n>]") \
 _(ip_address_dump, "(ipv4 | ipv6) (<intfc> | sw_if_index <id>)")        \
 _(ip_dump, "ipv4 | ipv6")                                               \
 _(ipsec_spd_add_del, "spd_id <n> [del]")                                \
@@ -19930,6 +20307,7 @@ _(one_add_del_map_resolver, "<ip4|6-addr> [del]")                       \
 _(one_add_del_map_server, "<ip4|6-addr> [del]")                         \
 _(one_enable_disable, "enable|disable")                                 \
 _(one_map_register_enable_disable, "enable|disable")                    \
+_(one_map_register_fallback_threshold, "<value>")                       \
 _(one_rloc_probe_enable_disable, "enable|disable")                      \
 _(one_add_del_remote_mapping, "add|del vni <vni> eid <dest-eid> "       \
                                "[seid <seid>] "                         \
@@ -19964,10 +20342,13 @@ _(show_one_status, "")                                                  \
 _(one_stats_dump, "")                                                   \
 _(one_stats_flush, "")                                                  \
 _(one_get_map_request_itr_rlocs, "")                                    \
+_(one_map_register_set_ttl, "<ttl>")                                    \
 _(show_one_nsh_mapping, "")                                             \
 _(show_one_pitr, "")                                                    \
 _(show_one_use_petr, "")                                                \
 _(show_one_map_request_mode, "")                                        \
+_(show_one_map_register_ttl, "")                                        \
+_(show_one_map_register_fallback_threshold, "")                         \
 _(lisp_add_del_locator_set, "locator-set <locator_name> [iface <intf> |"\
                             " sw_if_index <sw_if_index> p <priority> "  \
                             "w <weight>] [del]")                        \
@@ -20049,7 +20430,7 @@ _(ipfix_classify_stream_dump, "")                                       \
 _(ipfix_classify_table_add_del, "table <table-index> ip4|ip6 [tcp|udp]") \
 _(ipfix_classify_table_dump, "")                                        \
 _(sw_interface_span_enable_disable, "[l2] [src <intfc> | src_sw_if_index <id>] [disable | [[dst <intfc> | dst_sw_if_index <id>] [both|rx|tx]]]") \
-_(sw_interface_span_dump, "")                                           \
+_(sw_interface_span_dump, "[l2]")                                           \
 _(get_next_index, "node-name <node-name> next-node-name <node-name>")   \
 _(pg_create_interface, "if_id <nn>")                                    \
 _(pg_capture, "if_id <nnn> pcap <file_name> count <nnn> [disable]")     \
@@ -20083,11 +20464,10 @@ _(l2_xconnect_dump, "")                                               \
 _(sw_interface_set_mtu, "<intfc> | sw_if_index <nn> mtu <nn>")        \
 _(ip_neighbor_dump, "[ip6] <intfc> | sw_if_index <nn>")                 \
 _(sw_interface_get_table, "<intfc> | sw_if_index <id> [ipv6]")          \
-_(p2p_ethernet_add, "<intfc> | sw_if_index <nn> remote_mac <mac-address>") \
+_(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]")
+_(lldp_config, "system-name <name> tx-hold <nn> tx-interval <nn>") \
+_(sw_interface_set_lldp, "<intfc> | sw_if_index <nn> [port-desc <description>] [disable]")
 
 /* List of command functions, CLI names map directly to functions */
 #define foreach_cli_function                                    \
@@ -20111,7 +20491,6 @@ _(search_node_table, "usage: search_node_table <name>...")      \
 _(set, "usage: set <variable-name> <value>")                    \
 _(script, "usage: script <file-name>")                          \
 _(unset, "usage: unset <variable-name>")
-
 #define _(N,n)                                  \
     static void vl_api_##n##_t_handler_uni      \
     (vl_api_##n##_t * mp)                       \