VPP-226 - adding UDP TCP to port-range
[vpp.git] / vpp-api-test / vat / api_format.c
index a220066..d410955 100644 (file)
@@ -45,6 +45,7 @@
 #include <vnet/map/map.h>
 #include <vnet/cop/cop.h>
 #include <vnet/ip/ip6_hop_by_hop.h>
+#include <vnet/ip/ip_source_and_port_range_check.h>
 #include <vnet/policer/xlate.h>
 #include <vnet/policer/policer.h>
 #include <vnet/policer/police.h>
@@ -1218,6 +1219,46 @@ static void vl_api_control_ping_reply_t_handler_json
     vam->result_ready = 1;
 }
 
+static void vl_api_noprint_control_ping_reply_t_handler
+(vl_api_noprint_control_ping_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_noprint_control_ping_reply_t_handler_json
+(vl_api_noprint_control_ping_reply_t * mp)
+{
+    vat_main_t * vam = &vat_main;
+    i32 retval = ntohl(mp->retval);
+
+    if (vam->noprint_msg) {
+      vam->retval = retval;
+      vam->result_ready = 1;
+      return;
+    }
+
+    if (VAT_JSON_NONE != vam->json_tree.type) {
+        vat_json_print(vam->ofp, &vam->json_tree);
+        vat_json_free(&vam->json_tree);
+        vam->json_tree.type = VAT_JSON_NONE;
+    } else {
+        /* just print [] */
+        vat_json_init_array(&vam->json_tree);
+        vat_json_print(vam->ofp, &vam->json_tree);
+        vam->json_tree.type = VAT_JSON_NONE;
+    }
+
+    vam->retval = retval;
+    vam->result_ready = 1;
+}
+
 static void vl_api_l2_flags_reply_t_handler
 (vl_api_l2_flags_reply_t * mp)
 {
@@ -2014,42 +2055,71 @@ static void vl_api_get_node_graph_reply_t_handler_json
 }
 
 static void
-vl_api_lisp_locator_set_details_t_handler (
-    vl_api_lisp_locator_set_details_t *mp)
+vl_api_lisp_locator_details_t_handler (
+    vl_api_lisp_locator_details_t *mp)
 {
     vat_main_t *vam = &vat_main;
-    u8 * tmp_str = NULL;
-
-    if (mp->local) {
-      fformat(vam->ofp, "%=20s%=16d%=16d%=16d\n",
-              mp->locator_set_name,
-              ntohl(mp->sw_if_index),
-              mp->priority,
-              mp->weight);
+    locator_msg_t loc;
+    u8 * tmp_str = 0;
+
+    memset(&loc, 0, sizeof(loc));
+    if (vam->noprint_msg) {
+      loc.local = mp->local;
+      loc.priority = mp->priority;
+      loc.weight = mp->weight;
+      if (loc.local) {
+        loc.sw_if_index = ntohl(mp->sw_if_index);
+      } else {
+        loc.is_ipv6 = mp->is_ipv6;
+        clib_memcpy(loc.ip_address, mp->ip_address, sizeof(loc.ip_address));
+      }
+      vec_add1(vam->locator_msg, loc);
     } else {
-      tmp_str = format(0,"%U/%d",
-              mp->is_ipv6 ? format_ip6_address : format_ip4_address,
-              mp->ip_address,
-              mp->prefix_len);
-
-      fformat(vam->ofp, "%=20s%=16s%=16d%=16d\n",
-              mp->locator_set_name,
-              tmp_str,
-              mp->priority,
-              mp->weight);
+      if (mp->local) {
+        tmp_str = format(tmp_str, "%=16d%=16d%=16d\n",
+                         ntohl(mp->sw_if_index),
+                         mp->priority,
+                         mp->weight);
+      } else {
+        tmp_str = format(tmp_str, "%=16U%=16d%=16d\n",
+                         mp->is_ipv6 ? format_ip6_address :
+                         format_ip4_address,
+                         mp->ip_address,
+                         mp->priority,
+                         mp->weight);
+      }
+
+      fformat(vam->ofp, "%s", tmp_str);
+
       vec_free(tmp_str);
     }
 }
 
 static void
-vl_api_lisp_locator_set_details_t_handler_json (
-    vl_api_lisp_locator_set_details_t *mp)
+vl_api_lisp_locator_details_t_handler_json (
+    vl_api_lisp_locator_details_t *mp)
 {
     vat_main_t *vam = &vat_main;
     vat_json_node_t *node = NULL;
+    locator_msg_t loc;
     struct in6_addr ip6;
     struct in_addr ip4;
 
+    memset(&loc, 0, sizeof(loc));
+    if (vam->noprint_msg) {
+        loc.local = mp->local;
+        loc.priority = mp->priority;
+        loc.weight = mp->weight;
+        if (loc.local) {
+            loc.sw_if_index = ntohl(mp->sw_if_index);
+        } else {
+            loc.is_ipv6 = mp->is_ipv6;
+            clib_memcpy(loc.ip_address, mp->ip_address, sizeof(loc.ip_address));
+        }
+        vec_add1(vam->locator_msg, loc);
+        return;
+    }
+
     if (VAT_JSON_ARRAY != vam->json_tree.type) {
         ASSERT(VAT_JSON_NONE == vam->json_tree.type);
         vat_json_init_array(&vam->json_tree);
@@ -2057,49 +2127,82 @@ vl_api_lisp_locator_set_details_t_handler_json (
     node = vat_json_array_add(&vam->json_tree);
 
     vat_json_init_object(node);
-    vat_json_object_add_string_copy(node, "locator-set", mp->locator_set_name);
+
     if (mp->local) {
-        vat_json_object_add_uint(node, "locator", ntohl(mp->sw_if_index));
+        vat_json_object_add_uint(node, "locator_index", ntohl(mp->sw_if_index));
     } else {
-        if (mp->is_ipv6) {
-            clib_memcpy(&ip6, mp->ip_address, sizeof(ip6));
-            vat_json_object_add_ip6(node, "locator", ip6);
-        } else {
-            clib_memcpy(&ip4, mp->ip_address, sizeof(ip4));
-            vat_json_object_add_ip4(node, "locator", ip4);
-        }
-        vat_json_object_add_uint(node, "prefix-length", mp->prefix_len);
+      if (mp->is_ipv6) {
+        clib_memcpy(&ip6, mp->ip_address, sizeof(ip6));
+        vat_json_object_add_ip6(node, "locator", ip6);
+      } else {
+        clib_memcpy(&ip4, mp->ip_address, sizeof(ip4));
+        vat_json_object_add_ip4(node, "locator", ip4);
+      }
     }
     vat_json_object_add_uint(node, "priority", mp->priority);
     vat_json_object_add_uint(node, "weight", mp->weight);
 }
 
 static void
-vl_api_lisp_local_eid_table_details_t_handler (
-    vl_api_lisp_local_eid_table_details_t *mp)
+vl_api_lisp_locator_set_details_t_handler (
+    vl_api_lisp_locator_set_details_t *mp)
 {
     vat_main_t *vam = &vat_main;
-    u8 *prefix;
-    u8 * (*format_eid)(u8 *, va_list *) = 0;
+    locator_set_msg_t ls;
 
-    switch (mp->eid_type)
-      {
-      case 0: format_eid = format_ip4_address; break;
-      case 1: format_eid = format_ip6_address; break;
-      case 2: format_eid = format_ethernet_address; break;
-      default:
-        errmsg ("unknown EID type %d!", mp->eid_type);
-        return;
-      }
+    ls.locator_set_index = ntohl(mp->locator_set_index);
+    ls.locator_set_name = format(0, "%s", mp->locator_set_name);
+    vec_add1(vam->locator_set_msg, ls);
+}
+
+static void
+vl_api_lisp_locator_set_details_t_handler_json (
+    vl_api_lisp_locator_set_details_t *mp)
+{
+    vat_main_t *vam = &vat_main;
+    locator_set_msg_t ls;
+
+    ls.locator_set_index = ntohl(mp->locator_set_index);
+    ls.locator_set_name = format(0, "%s", mp->locator_set_name);
+    vec_add1(vam->locator_set_msg, ls);
+}
+
+static void
+vl_api_lisp_eid_table_details_t_handler (
+    vl_api_lisp_eid_table_details_t * mp)
+{
+    vat_main_t *vam = &vat_main;
+    eid_table_t eid_table;
 
-    prefix = format(0, "[%d] %U/%d",
-                    clib_net_to_host_u32 (mp->vni),
-                    format_eid, mp->eid, mp->eid_prefix_len);
+    memset(&eid_table, 0, sizeof(eid_table));
+    eid_table.is_local = mp->is_local;
+    eid_table.locator_set_index = mp->locator_set_index;
+    eid_table.eid_type = mp->eid_type;
+    eid_table.vni = mp->vni;
+    eid_table.eid_prefix_len = mp->eid_prefix_len;
+    eid_table.ttl = mp->ttl;
+    eid_table.authoritative = mp->authoritative;
+    clib_memcpy(eid_table.eid, mp->eid, sizeof(eid_table.eid));
+    vec_add1(vam->eid_tables, eid_table);
+}
 
-    fformat(vam->ofp, "%=20s%=30s\n",
-            mp->locator_set_name, prefix);
+static void
+vl_api_lisp_eid_table_details_t_handler_json (
+    vl_api_lisp_eid_table_details_t * mp)
+{
+    vat_main_t *vam = &vat_main;
+    eid_table_t eid_table;
 
-    vec_free(prefix);
+    memset(&eid_table, 0, sizeof(eid_table));
+    eid_table.is_local = mp->is_local;
+    eid_table.locator_set_index = mp->locator_set_index;
+    eid_table.eid_type = mp->eid_type;
+    eid_table.vni = mp->vni;
+    eid_table.eid_prefix_len = mp->eid_prefix_len;
+    eid_table.ttl = mp->ttl;
+    eid_table.authoritative = mp->authoritative;
+    clib_memcpy(eid_table.eid, mp->eid, sizeof(eid_table.eid));
+    vec_add1(vam->eid_tables, eid_table);
 }
 
 static void
@@ -2132,47 +2235,7 @@ vl_api_lisp_eid_table_map_details_t_handler_json (
     vat_json_object_add_uint(node, "vni", clib_net_to_host_u32 (mp->vni));
 }
 
-static void
-vl_api_lisp_local_eid_table_details_t_handler_json (
-    vl_api_lisp_local_eid_table_details_t *mp)
-{
-    vat_main_t *vam = &vat_main;
-    vat_json_node_t *node = NULL;
-    struct in6_addr ip6;
-    struct in_addr ip4;
-    u8 * s = 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);
-    vat_json_object_add_string_copy(node, "locator-set", mp->locator_set_name);
-    switch (mp->eid_type)
-      {
-      case 0:
-        clib_memcpy(&ip4, mp->eid, sizeof(ip4));
-        vat_json_object_add_ip4(node, "eid-address", ip4);
-        break;
-      case 1:
-        clib_memcpy(&ip6, mp->eid, sizeof(ip6));
-        vat_json_object_add_ip6(node, "eid-address", ip6);
-        break;
-      case 2:
-        s = format (0, "%U", format_ethernet_address, mp->eid);
-        vec_add1(s, 0);
-        vat_json_object_add_string_copy(node, "eid-address", s);
-        vec_free(s);
-        break;
-      default:
-        errmsg ("unknown EID type %d!", mp->eid_type);
-        return;
-      }
-    vat_json_object_add_uint(node, "vni", clib_net_to_host_u32 (mp->vni));
-    vat_json_object_add_uint(node, "eid-prefix-len", mp->eid_prefix_len);
-}
 
 static u8 *
 format_decap_next (u8 * s, va_list * args)
@@ -2307,22 +2370,28 @@ vl_api_lisp_map_resolver_details_t_handler_json (
 }
 
 static void
-vl_api_lisp_enable_disable_status_details_t_handler
-(vl_api_lisp_enable_disable_status_details_t *mp)
+vl_api_show_lisp_status_reply_t_handler
+(vl_api_show_lisp_status_reply_t * mp)
 {
     vat_main_t *vam = &vat_main;
+    i32 retval = ntohl(mp->retval);
+
+    if (0 <= retval) {
+      fformat(vam->ofp, "feature: %s\ngpe: %s\n",
+              mp->feature_status ? "enabled" : "disabled",
+              mp->gpe_status ? "enabled" : "disabled");
+    }
 
-    fformat(vam->ofp, "feature: %s\ngpe: %s\n",
-            mp->feature_status ? "enabled" : "disabled",
-            mp->gpe_status ? "enabled" : "disabled");
+    vam->retval = retval;
+    vam->result_ready = 1;
 }
 
 static void
-vl_api_lisp_enable_disable_status_details_t_handler_json
-(vl_api_lisp_enable_disable_status_details_t *mp)
+vl_api_show_lisp_status_reply_t_handler_json
+(vl_api_show_lisp_status_reply_t *mp)
 {
     vat_main_t *vam = &vat_main;
-    vat_json_node_t *node = NULL;
+    vat_json_node_t node;
     u8 * gpe_status = NULL;
     u8 * feature_status = NULL;
 
@@ -2332,18 +2401,18 @@ vl_api_lisp_enable_disable_status_details_t_handler_json
     vec_add1 (gpe_status, 0);
     vec_add1 (feature_status, 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);
-    vat_json_object_add_string_copy(node, "gpe_status", gpe_status);
-    vat_json_object_add_string_copy(node, "feature_status", feature_status);
+    vat_json_init_object(&node);
+    vat_json_object_add_string_copy(&node, "gpe_status", gpe_status);
+    vat_json_object_add_string_copy(&node, "feature_status", feature_status);
 
     vec_free (gpe_status);
     vec_free (feature_status);
+
+    vat_json_print(vam->ofp, &node);
+    vat_json_free(&node);
+
+    vam->retval = ntohl(mp->retval);
+    vam->result_ready = 1;
 }
 
 static void
@@ -2991,14 +3060,16 @@ _(lisp_enable_disable_reply)                            \
 _(lisp_pitr_set_locator_set_reply)                      \
 _(lisp_add_del_map_request_itr_rlocs_reply)             \
 _(lisp_eid_table_add_del_map_reply)                     \
-_(vxlan_gpe_add_del_tunnel_reply)                      \
+_(vxlan_gpe_add_del_tunnel_reply)                       \
 _(af_packet_delete_reply)                               \
 _(policer_classify_set_interface_reply)                 \
 _(netmap_create_reply)                                  \
 _(netmap_delete_reply)                                  \
 _(ipfix_enable_reply)                                   \
 _(pg_capture_reply)                                     \
-_(pg_enable_disable_reply)
+_(pg_enable_disable_reply)                              \
+_(ip_source_and_port_range_check_add_del_reply)         \
+_(ip_source_and_port_range_check_interface_add_del_reply)
 
 #define _(n)                                    \
     static void vl_api_##n##_t_handler          \
@@ -3042,6 +3113,7 @@ _(SW_INTERFACE_DETAILS, sw_interface_details)                           \
 _(SW_INTERFACE_SET_FLAGS, sw_interface_set_flags)                       \
 _(SW_INTERFACE_SET_FLAGS_REPLY, sw_interface_set_flags_reply)           \
 _(CONTROL_PING_REPLY, control_ping_reply)                               \
+_(NOPRINT_CONTROL_PING_REPLY, noprint_control_ping_reply)               \
 _(CLI_REPLY, cli_reply)                                                 \
 _(SW_INTERFACE_ADD_DEL_ADDRESS_REPLY,                                   \
   sw_interface_add_del_address_reply)                                   \
@@ -3177,12 +3249,12 @@ _(LISP_PITR_SET_LOCATOR_SET_REPLY, lisp_pitr_set_locator_set_reply)     \
 _(LISP_EID_TABLE_ADD_DEL_MAP_REPLY, lisp_eid_table_add_del_map_reply)   \
 _(LISP_GPE_ADD_DEL_IFACE_REPLY, lisp_gpe_add_del_iface_reply)           \
 _(LISP_LOCATOR_SET_DETAILS, lisp_locator_set_details)                   \
-_(LISP_LOCAL_EID_TABLE_DETAILS, lisp_local_eid_table_details)           \
+_(LISP_LOCATOR_DETAILS, lisp_locator_details)                           \
+_(LISP_EID_TABLE_DETAILS, lisp_eid_table_details)                       \
 _(LISP_EID_TABLE_MAP_DETAILS, lisp_eid_table_map_details)               \
 _(LISP_GPE_TUNNEL_DETAILS, lisp_gpe_tunnel_details)                     \
 _(LISP_MAP_RESOLVER_DETAILS, lisp_map_resolver_details)                 \
-_(LISP_ENABLE_DISABLE_STATUS_DETAILS,                                   \
-  lisp_enable_disable_status_details)                                   \
+_(SHOW_LISP_STATUS_REPLY, show_lisp_status_reply)                       \
 _(LISP_ADD_DEL_MAP_REQUEST_ITR_RLOCS_REPLY,                             \
   lisp_add_del_map_request_itr_rlocs_reply)                             \
 _(LISP_GET_MAP_REQUEST_ITR_RLOCS_REPLY,                                 \
@@ -3209,7 +3281,11 @@ _(IPFIX_DETAILS, ipfix_details)                                         \
 _(GET_NEXT_INDEX_REPLY, get_next_index_reply)                           \
 _(PG_CREATE_INTERFACE_REPLY, pg_create_interface_reply)                 \
 _(PG_CAPTURE_REPLY, pg_capture_reply)                                   \
-_(PG_ENABLE_DISABLE_REPLY, pg_enable_disable_reply)
+_(PG_ENABLE_DISABLE_REPLY, pg_enable_disable_reply)                     \
+_(IP_SOURCE_AND_PORT_RANGE_CHECK_ADD_DEL_REPLY,                         \
+ ip_source_and_port_range_check_add_del_reply)                          \
+_(IP_SOURCE_AND_PORT_RANGE_CHECK_INTERFACE_ADD_DEL_REPLY,               \
+ ip_source_and_port_range_check_interface_add_del_reply)
 
 /* M: construct, but don't yet send a message */
 
@@ -3262,6 +3338,21 @@ do {                                            \
     return -99;                                 \
 } while(0);
 
+/* W_L: wait for results, with timeout */
+#define W_L(body)                               \
+do {                                            \
+    timeout = vat_time_now (vam) + 1.0;         \
+                                                \
+    while (vat_time_now (vam) < timeout) {      \
+        if (vam->result_ready == 1) {           \
+          (body);                               \
+          return (vam->retval);                 \
+        }                                       \
+    }                                           \
+    vam->noprint_msg = 0;     \
+    return -99;                                 \
+} while(0);
+
 typedef struct {
     u8 * name;
     u32 value;
@@ -10488,6 +10579,58 @@ static int api_get_node_graph (vat_main_t * vam)
     W;
 }
 
+/** Used for parsing LISP eids */
+typedef CLIB_PACKED(struct{
+  u8 addr[16];   /**< eid address */
+  u32 len;       /**< prefix length if IP */
+  u8 type;      /**< type of eid */
+}) lisp_eid_vat_t;
+
+static uword
+unformat_lisp_eid_vat (unformat_input_t * input, va_list * args)
+{
+  lisp_eid_vat_t * a = va_arg(*args, lisp_eid_vat_t *);
+
+  memset(a, 0, sizeof(a[0]));
+
+  if (unformat (input, "%U/%d", unformat_ip4_address, a->addr, &a->len)) {
+      a->type = 0; /* ipv4 type */
+  } else if (unformat (input, "%U/%d", unformat_ip6_address, a->addr,
+                       &a->len)) {
+      a->type = 1; /* ipv6 type */
+  } else if (unformat (input, "%U", unformat_ethernet_address, a->addr)) {
+      a->type = 2; /* mac type */
+  } else {
+      return 0;
+  }
+
+  if ((a->type == 0 && a->len > 32) || (a->type == 1 && a->len > 128)) {
+      return 0;
+  }
+
+  return 1;
+}
+
+static int
+lisp_eid_size_vat (u8 type)
+{
+  switch (type) {
+    case 0:
+      return 4;
+    case 1:
+      return 16;
+    case 2:
+      return 6;
+  }
+  return 0;
+}
+
+static void
+lisp_eid_put_vat (u8 * dst, u8 eid[16], u8 type)
+{
+  clib_memcpy(dst, eid, lisp_eid_size_vat(type));
+}
+
 /** Used for transferring locators via VPP API */
 typedef CLIB_PACKED(struct
 {
@@ -10670,15 +10813,9 @@ api_lisp_add_del_local_eid(vat_main_t * vam)
     vl_api_lisp_add_del_local_eid_t *mp;
     f64 timeout = ~0;
     u8 is_add = 1;
-    u8 eidv4_set = 0;
-    u8 eidv6_set = 0;
-    u8 eid_type = (u8)~0;
-    ip4_address_t eidv4;
-    ip6_address_t eidv6;
-    u8 mac[6] = {0};
-    u32 tmp_eid_lenght = ~0;
-    u8 eid_lenght = ~0;
-    u8 *locator_set_name = NULL;
+    u8 eid_set = 0;
+    lisp_eid_vat_t _eid, *eid = &_eid;
+    u8 *locator_set_name = 0;
     u8 locator_set_name_set = 0;
     u32 vni = 0;
 
@@ -10688,18 +10825,8 @@ api_lisp_add_del_local_eid(vat_main_t * vam)
             is_add = 0;
         } else if (unformat(input, "vni %d", &vni)) {
             ;
-        } else if (unformat(input, "eid %U/%d", unformat_ip4_address,
-            &eidv4, &tmp_eid_lenght)) {
-            eid_lenght = tmp_eid_lenght;
-            eidv4_set = 1;
-            eid_type = 0; /* ipv4 type */
-        } else if (unformat(input, "eid %U/%d", unformat_ip6_address,
-            &eidv6, &tmp_eid_lenght)) {
-            eid_lenght = tmp_eid_lenght;
-            eidv6_set = 1;
-            eid_type = 1; /* ipv6 type */
-        } else if (unformat(input, "eid %U", unformat_ethernet_address, mac)) {
-            eid_type = 2; /* mac type */
+        } else if (unformat(input, "eid %U", unformat_lisp_eid_vat, eid)) {
+            eid_set = 1;
         } else if (unformat(input, "locator-set %s", &locator_set_name)) {
             locator_set_name_set = 1;
         } else
@@ -10711,7 +10838,7 @@ api_lisp_add_del_local_eid(vat_main_t * vam)
         return -99;
     }
 
-    if ((u8)~0 == eid_type) {
+    if (0 == eid_set) {
         errmsg ("EID address not set!");
         vec_free(locator_set_name);
         return -99;
@@ -10724,44 +10851,17 @@ api_lisp_add_del_local_eid(vat_main_t * vam)
     }
     vec_add1(locator_set_name, 0);
 
-    if (eidv4_set && eidv6_set) {
-        errmsg ("both eid v4 and v6 addresses set\n");
-        vec_free(locator_set_name);
-        return -99;
-    }
-
-    if (eidv4_set && eid_lenght > 32) {
-        errmsg ("eid prefix to big\n");
-        vec_free(locator_set_name);
-        return -99;
-    }
-
-    if (eidv6_set && eid_lenght > 128) {
-        errmsg ("eid prefix to big\n");
-        vec_free(locator_set_name);
-        return -99;
-    }
-
     /* Construct the API message */
     M(LISP_ADD_DEL_LOCAL_EID, lisp_add_del_local_eid);
 
     mp->is_add = is_add;
-    switch (eid_type) {
-    case 0: /* ipv4 */
-      clib_memcpy (mp->eid, &eidv4, sizeof(eidv4));
-      break;
-    case 1: /* ipv6 */
-      clib_memcpy (mp->eid, &eidv6, sizeof(eidv6));
-      break;
-    case 2: /* mac */
-      clib_memcpy (mp->eid, mac, 6);
-      break;
-    }
-    mp->eid_type = eid_type;
-    mp->prefix_len = eid_lenght;
+    lisp_eid_put_vat (mp->eid, eid->addr, eid->type);
+    mp->eid_type = eid->type;
+    mp->prefix_len = eid->len;
     mp->vni = clib_host_to_net_u32(vni);
     clib_memcpy(mp->locator_set_name, locator_set_name,
            vec_len(locator_set_name));
+
     vec_free(locator_set_name);
 
     /* send it... */
@@ -10774,6 +10874,15 @@ api_lisp_add_del_local_eid(vat_main_t * vam)
     return 0;
 }
 
+/** Used for transferring locators via VPP API */
+typedef CLIB_PACKED(struct
+{
+    u8 is_ip4; /**< is locator an IPv4 address? */
+    u8 priority; /**< locator priority */
+    u8 weight;   /**< locator weight */
+    u8 addr[16]; /**< IPv4/IPv6 address */
+}) rloc_t;
+
 static int
 api_lisp_gpe_add_del_fwd_entry(vat_main_t * vam)
 {
@@ -10781,69 +10890,62 @@ api_lisp_gpe_add_del_fwd_entry(vat_main_t * vam)
     vl_api_lisp_gpe_add_del_fwd_entry_t *mp;
     f64 timeout = ~0;
     u8 is_add = 1;
-    u8 eidv4_set = 0, slocv4_set = 0, dlocv4_set = 0;
-    u8 eidv6_set = 0, slocv6_set = 0, dlocv6_set = 0;
-    ip4_address_t eidv4, slocv4, dlocv4;
-    ip6_address_t eidv6, slocv6, dlocv6;
-    u32 tmp_eid_lenght = ~0;
-    u8 eid_lenght = ~0;
+    lisp_eid_vat_t _rmt_eid, * rmt_eid = &_rmt_eid;
+    lisp_eid_vat_t _lcl_eid, * lcl_eid = &_lcl_eid;
+    u8 rmt_eid_set = 0, lcl_eid_set = 0;
+    u32 action = ~0, p, w;
+    ip4_address_t rmt_rloc4, lcl_rloc4;
+    ip6_address_t rmt_rloc6, lcl_rloc6;
+    rloc_t * rmt_locs = 0, * lcl_locs = 0, rloc, * curr_rloc = 0;
 
     /* 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, "eid %U/%d", unformat_ip4_address,
-                            &eidv4, &tmp_eid_lenght)) {
-            eid_lenght = tmp_eid_lenght;
-            eidv4_set = 1;
-        } else if (unformat(input, "eid %U/%d", unformat_ip6_address,
-                            &eidv6, &tmp_eid_lenght)) {
-            eid_lenght = tmp_eid_lenght;
-            eidv6_set = 1;
-        } else if (unformat(input, "sloc %U", unformat_ip4_address, &slocv4)) {
-            slocv4_set = 1;
-        } else if (unformat(input, "sloc %U", unformat_ip6_address, &slocv6)) {
-            slocv6_set = 1;
-        } else if (unformat(input, "dloc %U", unformat_ip4_address, &dlocv4)) {
-            dlocv4_set = 1;
-        } else if (unformat(input, "dloc %U", unformat_ip6_address, &dlocv6)) {
-            dlocv6_set = 1;
-        } else
-            break;
-    }
-
-    if (eidv4_set && eidv6_set) {
-        errmsg ("both eid v4 and v6 addresses set\n");
-        return -99;
-    }
-
-    if (!eidv4_set && !eidv6_set) {
-        errmsg ("eid addresses not set\n");
-        return -99;
-    }
-
-    if (slocv4_set && slocv6_set) {
-        errmsg ("both source v4 and v6 addresses set\n");
-        return -99;
-    }
-
-    if (!slocv4_set && !slocv6_set) {
-        errmsg ("source addresses not set\n");
-        return -99;
-    }
-
-    if (dlocv4_set && dlocv6_set) {
-        errmsg ("both destination v4 and v6 addresses set\n");
-        return -99;
+        } else if (unformat(input, "rmt_eid %U", unformat_lisp_eid_vat,
+                            rmt_eid)) {
+            rmt_eid_set = 1;
+        } else if (unformat(input, "lcl_eid %U", unformat_lisp_eid_vat,
+                            lcl_eid)) {
+            lcl_eid_set = 1;
+        } else if (unformat(input, "p %d w %d", &p, &w)) {
+            if (!curr_rloc) {
+              errmsg ("No RLOC configured for setting priority/weight!");
+              return -99;
+            }
+            curr_rloc->priority = p;
+            curr_rloc->weight = w;
+        } else if (unformat(input, "loc-pair %U %U", unformat_ip4_address,
+                            &lcl_rloc4, unformat_ip4_address, &rmt_rloc4)) {
+            rloc.is_ip4 = 1;
+            clib_memcpy (&rloc.addr, &lcl_rloc4, sizeof (lcl_rloc4));
+            vec_add1 (lcl_locs, rloc);
+            clib_memcpy (&rloc.addr, &rmt_rloc4, sizeof (rmt_rloc4));
+            vec_add1 (rmt_locs, rloc);
+            curr_rloc = &rmt_locs[vec_len (rmt_locs) - 1];
+        } else if (unformat(input, "loc-pair %U", unformat_ip6_address,
+                            &lcl_rloc6, unformat_ip6_address, &rmt_rloc6)) {
+            rloc.is_ip4 = 0;
+            clib_memcpy (&rloc.addr, &lcl_rloc6, sizeof (lcl_rloc6));
+            vec_add1 (lcl_locs, rloc);
+            clib_memcpy (&rloc.addr, &rmt_rloc6, sizeof (rmt_rloc6));
+            vec_add1 (rmt_locs, rloc);
+            curr_rloc = &rmt_locs[vec_len (rmt_locs) - 1];
+        } else if (unformat(input, "action %d", &action)) {
+            ;
+        } else {
+            clib_warning ("parse error '%U'", format_unformat_error, input);
+            return -99;
+        }
     }
 
-    if (dlocv4_set && dlocv6_set) {
-        errmsg ("destination addresses not set\n");
+    if (!rmt_eid_set) {
+        errmsg ("remote eid addresses not set\n");
         return -99;
     }
 
-    if (!(slocv4_set == dlocv4_set && slocv6_set == dlocv6_set)) {
-        errmsg ("mixing type of source and destination address\n");
+    if (lcl_eid_set && rmt_eid->type != lcl_eid->type) {
+        errmsg ("eid types don't match\n");
         return -99;
     }
 
@@ -10851,23 +10953,19 @@ api_lisp_gpe_add_del_fwd_entry(vat_main_t * vam)
     M(LISP_GPE_ADD_DEL_FWD_ENTRY, lisp_gpe_add_del_fwd_entry);
 
     mp->is_add = is_add;
-    if (eidv6_set) {
-        mp->eid_is_ipv6 = 1;
-        clib_memcpy(mp->eid_ip_address, &eidv6, sizeof(eidv6));
-    } else {
-        mp->eid_is_ipv6 = 0;
-        clib_memcpy(mp->eid_ip_address, &eidv4, sizeof(eidv4));
-    }
-    mp->eid_prefix_len = eid_lenght;
-    if (slocv6_set) {
-        mp->address_is_ipv6 = 1;
-        clib_memcpy(mp->source_ip_address, &slocv6, sizeof(slocv6));
-        clib_memcpy(mp->destination_ip_address, &dlocv6, sizeof(dlocv6));
-    } else {
-        mp->address_is_ipv6 = 0;
-        clib_memcpy(mp->source_ip_address, &slocv4, sizeof(slocv4));
-        clib_memcpy(mp->destination_ip_address, &dlocv4, sizeof(dlocv4));
-    }
+    lisp_eid_put_vat (mp->rmt_eid, rmt_eid->addr, rmt_eid->type);
+    lisp_eid_put_vat (mp->lcl_eid, lcl_eid->addr, lcl_eid->type);
+    mp->eid_type = rmt_eid->type;
+    mp->rmt_len = rmt_eid->len;
+    mp->lcl_len = lcl_eid->len;
+
+    mp->loc_num = vec_len (rmt_locs);
+    clib_memcpy (mp->lcl_locs, lcl_locs,
+                 (sizeof(rloc_t) * vec_len(lcl_locs)));
+    clib_memcpy (mp->rmt_locs, rmt_locs,
+                 (sizeof(rloc_t) * vec_len(rmt_locs)));
+    vec_free(lcl_locs);
+    vec_free(rmt_locs);
 
     /* send it... */
     S;
@@ -11022,15 +11120,6 @@ api_lisp_enable_disable (vat_main_t * vam)
   return 0;
 }
 
-/** Used for transferring locators via VPP API */
-typedef CLIB_PACKED(struct
-{
-    u8 is_ip4; /**< is locator an IPv4 address? */
-    u8 priority; /**< locator priority */
-    u8 weight;   /**< locator weight */
-    u8 addr[16]; /**< IPv4/IPv6 address */
-}) rloc_t;
-
 /**
  * Enable/disable LISP proxy ITR.
  *
@@ -11114,8 +11203,8 @@ api_lisp_eid_table_add_del_map (vat_main_t * vam)
   f64 timeout = ~0;
   unformat_input_t * input = vam->input;
   vl_api_lisp_eid_table_add_del_map_t *mp;
-  u8 is_add = 1, vni_set = 0, vrf_set = 0;
-  u32 vni, vrf;
+  u8 is_add = 1, vni_set = 0, vrf_set = 0, bd_index_set = 0;
+  u32 vni, vrf, bd_index;
 
   /* Parse args required to build the message */
   while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
@@ -11124,13 +11213,15 @@ api_lisp_eid_table_add_del_map (vat_main_t * vam)
         is_add = 0;
       else if (unformat(input, "vrf %d", &vrf))
         vrf_set = 1;
+      else if (unformat(input, "bd_index %d", &bd_index))
+        bd_index_set = 1;
       else if (unformat(input, "vni %d", &vni))
         vni_set = 1;
       else
         break;
     }
 
-  if (!vni_set || !vrf_set)
+  if (!vni_set || (!vrf_set && !bd_index_set))
     {
       errmsg ("missing arguments!");
       return -99;
@@ -11140,7 +11231,8 @@ api_lisp_eid_table_add_del_map (vat_main_t * vam)
 
   mp->is_add = is_add;
   mp->vni = htonl (vni);
-  mp->vrf = htonl (vrf);
+  mp->dp_table = htonl (vrf);
+  mp->is_l2 = bd_index_set;
 
   /* send */
   S;
@@ -11165,18 +11257,15 @@ api_lisp_add_del_remote_mapping (vat_main_t * vam)
     vl_api_lisp_add_del_remote_mapping_t *mp;
     f64 timeout = ~0;
     u32 vni = 0;
-    ip4_address_t seid4, deid4, rloc4;
-    ip6_address_t seid6, deid6, rloc6;
-    u8 deid_mac[6] = {0};
-    u8 seid_mac[6] = {0};
-    u8 deid_type, seid_type;
-    u32 seid_len = 0, deid_len = 0, len;
-    u8 is_add = 1, del_all = 0;
+    //TODO: seid need remove
+    lisp_eid_vat_t _eid, * eid = &_eid;
+    lisp_eid_vat_t _seid, * seid = &_seid;
+    u8 is_add = 1, del_all = 0, eid_set = 0;
     u32 action = ~0, p, w;
+    ip4_address_t rloc4;
+    ip6_address_t rloc6;
     rloc_t * rlocs = 0, rloc, * curr_rloc = 0;
 
-    seid_type = deid_type =  (u8)~0;
-
     /* Parse args required to build the message */
     while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) {
         if (unformat(input, "del-all")) {
@@ -11185,28 +11274,10 @@ api_lisp_add_del_remote_mapping (vat_main_t * vam)
             is_add = 0;
         } else if (unformat(input, "add")) {
             is_add = 1;
-        } else if (unformat(input, "deid %U/%d", unformat_ip4_address,
-                            &deid4, &len)) {
-            deid_type = 0; /* ipv4 */
-            deid_len = len;
-        } else if (unformat(input, "deid %U/%d", unformat_ip6_address,
-                            &deid6, &len)) {
-            deid_type = 1; /* ipv6 */
-            deid_len = len;
-        } else if (unformat(input, "deid %U", unformat_ethernet_address,
-                            deid_mac)) {
-            deid_type = 2; /* mac */
-        } else if (unformat(input, "seid %U/%d", unformat_ip4_address,
-                            &seid4, &len)) {
-            seid_type = 0; /* ipv4 */
-            seid_len = len;
-        } else if (unformat(input, "seid %U/%d", unformat_ip6_address,
-                            &seid6, &len)) {
-            seid_type = 1; /* ipv6 */
-            seid_len = len;
-        } else if (unformat(input, "seid %U", unformat_ethernet_address,
-                            seid_mac)) {
-            seid_type = 2; /* mac */
+        } else if (unformat(input, "deid %U", unformat_lisp_eid_vat, eid)) {
+            eid_set = 1;
+        } else if (unformat(input, "seid %U", unformat_lisp_eid_vat, &seid)) {
+            //TODO: Need remove, but first must be remove from CSIT test
         } else if (unformat(input, "vni %d", &vni)) {
             ;
         } else if (unformat(input, "p %d w %d", &p, &w)) {
@@ -11234,16 +11305,11 @@ api_lisp_add_del_remote_mapping (vat_main_t * vam)
         }
     }
 
-    if ((u8)~0 == deid_type) {
+    if (0 == eid_set) {
         errmsg ("missing params!");
         return -99;
     }
 
-    if (seid_type != deid_type) {
-        errmsg ("source and destination EIDs are of different types!");
-        return -99;
-    }
-
     if (is_add && (~0 == action)
         && 0 == vec_len (rlocs)) {
           errmsg ("no action set for negative map-reply!");
@@ -11253,29 +11319,11 @@ api_lisp_add_del_remote_mapping (vat_main_t * vam)
     M(LISP_ADD_DEL_REMOTE_MAPPING, lisp_add_del_remote_mapping);
     mp->is_add = is_add;
     mp->vni = htonl (vni);
-    mp->seid_len = seid_len;
     mp->action = (u8) action;
-    mp->deid_len = deid_len;
+    mp->eid_len = eid->len;
     mp->del_all = del_all;
-    mp->eid_type = deid_type;
-
-    switch (mp->eid_type) {
-    case 0:
-        clib_memcpy (mp->seid, &seid4, sizeof (seid4));
-        clib_memcpy (mp->deid, &deid4, sizeof (deid4));
-        break;
-    case 1:
-        clib_memcpy (mp->seid, &seid6, sizeof (seid6));
-        clib_memcpy (mp->deid, &deid6, sizeof (deid6));
-        break;
-    case 2:
-        clib_memcpy (mp->seid, seid_mac, 6);
-        clib_memcpy (mp->deid, deid_mac, 6);
-        break;
-    default:
-        errmsg ("unknown EID type %d!", mp->eid_type);
-        return 0;
-    }
+    mp->eid_type = eid->type;
+    lisp_eid_put_vat(mp->eid, eid->addr, eid->type);
 
     mp->rloc_num = vec_len (rlocs);
     clib_memcpy (mp->rlocs, rlocs, (sizeof (rloc_t) * vec_len (rlocs)));
@@ -11402,9 +11450,8 @@ api_lisp_gpe_add_del_iface(vat_main_t * vam)
     unformat_input_t * input = vam->input;
     vl_api_lisp_gpe_add_del_iface_t *mp;
     f64 timeout = ~0;
-    u8 is_set = 0;
-    u8 is_add = 1;
-    u32 table_id, vni;
+    u8 is_set = 0, is_add = 1, is_l2 = 0;
+    u32 dp_table, vni;
 
     /* Parse args required to build the message */
     while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) {
@@ -11414,8 +11461,10 @@ api_lisp_gpe_add_del_iface(vat_main_t * vam)
         } else if (unformat(input, "down")) {
             is_set = 1;
             is_add = 0;
-        } else if (unformat(input, "table_id %d", &table_id)) {
+        } else if (unformat(input, "table_id %d", &dp_table)) {
             ;
+        } else if (unformat(input, "bd_id %d", &dp_table)) {
+            is_l2 = 1;
         } else if (unformat(input, "vni %d", &vni)) {
             ;
         } else
@@ -11431,7 +11480,8 @@ api_lisp_gpe_add_del_iface(vat_main_t * vam)
     M(LISP_GPE_ADD_DEL_IFACE, lisp_gpe_add_del_iface);
 
     mp->is_add = is_add;
-    mp->table_id = table_id;
+    mp->dp_table = dp_table;
+    mp->is_l2 = is_l2;
     mp->vni = vni;
 
     /* send it... */
@@ -11504,33 +11554,336 @@ api_lisp_add_del_map_request_itr_rlocs(vat_main_t * vam)
 }
 
 static int
-api_lisp_locator_set_dump(vat_main_t *vam)
+lisp_locator_dump_send_msg(vat_main_t * vam, u32 locator_set_index, u8 filter)
 {
-    vl_api_lisp_locator_set_dump_t *mp;
+    vl_api_lisp_locator_dump_t *mp;
     f64 timeout = ~0;
 
-    if (!vam->json_output) {
-        fformat(vam->ofp, "%=20s%=16s%=16s%=16s\n",
-                "Locator-set", "Locator", "Priority", "Weight");
-    }
+    M(LISP_LOCATOR_DUMP, lisp_locator_dump);
+
+    mp->locator_set_index = htonl(locator_set_index);
+    mp->filter = filter;
 
-    M(LISP_LOCATOR_SET_DUMP, lisp_locator_set_dump);
     /* send it... */
     S;
 
     /* Use a control ping for synchronization */
     {
-        vl_api_control_ping_t * mp;
-        M(CONTROL_PING, control_ping);
-        S;
+      vl_api_noprint_control_ping_t * mp;
+      M(NOPRINT_CONTROL_PING, noprint_control_ping);
+      S;
     }
     /* Wait for a reply... */
     W;
+}
+
+static inline void
+clean_locator_set_message(vat_main_t * vam)
+{
+    locator_set_msg_t * ls = 0;
+
+    vec_foreach (ls, vam->locator_set_msg) {
+        vec_free(ls->locator_set_name);
+    }
+
+    vec_free(vam->locator_set_msg);
+}
+
+static int
+print_locator_in_locator_set(vat_main_t * vam, u8 filter)
+{
+    locator_set_msg_t * ls;
+    locator_msg_t * loc;
+    u8 * tmp_str = 0;
+    int i = 0, ret = 0;
+
+    vec_foreach(ls, vam->locator_set_msg) {
+        ret = lisp_locator_dump_send_msg(vam, ls->locator_set_index, filter);
+        if (ret) {
+            vec_free(vam->locator_msg);
+            clean_locator_set_message(vam);
+            return ret;
+        }
+
+        tmp_str = format(0, "%=20s%=16d%s", ls->locator_set_name,
+                         ls->locator_set_index,
+                         vec_len(vam->locator_msg) ? "" : "\n");
+        i = 0;
+        vec_foreach(loc, vam->locator_msg) {
+            if (i) {
+                tmp_str = format(tmp_str, "%=37s", " ");
+            }
+            if (loc->local) {
+                tmp_str = format(tmp_str, "%=16d%=16d%=16d\n",
+                                 loc->sw_if_index,
+                                 loc->priority,
+                                 loc->weight);
+            } else {
+                tmp_str = format(tmp_str, "%=16U%=16d%=16d\n",
+                                 loc->is_ipv6 ? format_ip6_address :
+                                 format_ip4_address,
+                                 loc->ip_address,
+                                 loc->priority,
+                                 loc->weight);
+            }
+            i++;
+        }
+
+        fformat(vam->ofp, "%s", tmp_str);
+        vec_free(tmp_str);
+        vec_free(vam->locator_msg);
+    }
+
+    clean_locator_set_message(vam);
+
+    return ret;
+}
+
+static int
+json_locator_in_locator_set(vat_main_t * vam, u8 filter)
+{
+    locator_set_msg_t * ls;
+    locator_msg_t * loc;
+    vat_json_node_t * node = NULL;
+    vat_json_node_t * locator_array;
+    vat_json_node_t * locator;
+    struct in6_addr ip6;
+    struct in_addr ip4;
+    int ret = 0;
+
+    if (!vec_len(vam->locator_set_msg)) {
+        /* just print [] */
+        vat_json_init_array(&vam->json_tree);
+        vat_json_print(vam->ofp, &vam->json_tree);
+        vam->json_tree.type = VAT_JSON_NONE;
+        return ret;
+    }
+
+    if (VAT_JSON_ARRAY != vam->json_tree.type) {
+      ASSERT(VAT_JSON_NONE == vam->json_tree.type);
+      vat_json_init_array(&vam->json_tree);
+    }
+
+    vec_foreach(ls, vam->locator_set_msg) {
+        ret = lisp_locator_dump_send_msg(vam, ls->locator_set_index, filter);
+        if (ret) {
+            vec_free(ls->locator_set_name);
+            vec_free(vam->locator_msg);
+            vec_free(vam->locator_set_msg);
+            vat_json_free(&vam->json_tree);
+            vam->json_tree.type = VAT_JSON_NONE;
+            return ret;
+        }
+
+        node = vat_json_array_add(&vam->json_tree);
+        vat_json_init_object(node);
+
+        vat_json_object_add_uint(node, "locator-set-index",
+                                 ls->locator_set_index);
+        vat_json_object_add_string_copy(node, "locator-set",
+                                        ls->locator_set_name);
+        locator_array = vat_json_object_add_list(node, "locator");
+        vec_foreach(loc, vam->locator_msg) {
+            locator = vat_json_array_add(locator_array);
+            vat_json_init_object(locator);
+            if (loc->local) {
+                vat_json_object_add_uint(locator, "locator-index",
+                                         loc->sw_if_index);
+            } else {
+                if (loc->is_ipv6) {
+                    clib_memcpy(&ip6, loc->ip_address, sizeof(ip6));
+                    vat_json_object_add_ip6(locator, "locator", ip6);
+                } else {
+                    clib_memcpy(&ip4, loc->ip_address, sizeof(ip4));
+                    vat_json_object_add_ip4(locator, "locator", ip4);
+                }
+            }
+            vat_json_object_add_uint(locator, "priority", loc->priority);
+            vat_json_object_add_uint(locator, "weight", loc->weight);
+        }
+
+        vec_free(ls->locator_set_name);
+        vec_free(vam->locator_msg);
+    }
+
+    vat_json_print(vam->ofp, &vam->json_tree);
+    vat_json_free(&vam->json_tree);
+    vam->json_tree.type = VAT_JSON_NONE;
+
+    vec_free(vam->locator_set_msg);
+
+    return ret;
+}
+
+static int
+get_locator_set_index_from_msg(vat_main_t * vam, u8 * locator_set,
+                               u32 * locator_set_index)
+{
+    locator_set_msg_t * ls;
+    int ret = 0;
+
+    * locator_set_index = ~0;
+
+    if (!vec_len(vam->locator_set_msg)) {
+      return ret;
+    }
+
+    vec_foreach(ls, vam->locator_set_msg) {
+        if (!strcmp((char *) locator_set, (char *) ls->locator_set_name)) {
+            * locator_set_index = ls->locator_set_index;
+            vec_free(vam->locator_set_msg);
+            return ret;
+        }
+    }
+
+    vec_free(vam->locator_set_msg);
+
+    return ret;
+}
+
+static int
+get_locator_set_index(vat_main_t * vam, u8 * locator_set,
+                      u32 * locator_set_index)
+{
+    vl_api_lisp_locator_set_dump_t *mp;
+    f64 timeout = ~0;
+
+    M(LISP_LOCATOR_SET_DUMP, lisp_locator_set_dump);
+    /* send it... */
+    S;
+
+   /* Use a control ping for synchronization */
+   {
+     vl_api_noprint_control_ping_t * mp;
+     M(NOPRINT_CONTROL_PING, noprint_control_ping);
+     S;
+   }
+
+   vam->noprint_msg = 1;
+    /* Wait for a reply... */
+    W_L({
+      get_locator_set_index_from_msg(vam, locator_set, locator_set_index);
+      vam->noprint_msg = 0;
+    })
+
+    /* NOTREACHED */
+    return 0;
+}
+
+static inline int
+lisp_locator_dump(vat_main_t * vam, u32 locator_set_index, u8 * locator_set,
+                  u8 filter)
+{
+    int ret = 0;
+
+    ASSERT(vam);
+
+    if (!vam->json_output) {
+      fformat(vam->ofp, "%=20s%=16s%=16s\n",
+              "locator", "priority", "weight");
+    }
+
+    if (locator_set) {
+      ret = get_locator_set_index(vam, locator_set, &locator_set_index);
+    }
+
+    if (!ret && ~0 == locator_set_index) {
+      return -99;
+    }
+
+    ret = lisp_locator_dump_send_msg(vam, locator_set_index, filter);
+
+    return ret;
+}
+
+static int
+lisp_locator_set_dump(vat_main_t * vam, u8 filter)
+{
+    vl_api_lisp_locator_set_dump_t *mp;
+    f64 timeout = ~0;
+
+    if (!vam->json_output) {
+        fformat(vam->ofp, "%=20s%=16s%=16s%=16s%=16s\n",
+                "locator-set", "locator-set-index", "locator", "priority",
+                "weight");
+    }
+
+    vam->noprint_msg = 1;
+
+    M(LISP_LOCATOR_SET_DUMP, lisp_locator_set_dump);
+
+    mp->filter = filter;
+
+    /* send it... */
+    S;
+
+   /* Use a control ping for synchronization */
+   {
+     vl_api_noprint_control_ping_t * mp;
+     M(NOPRINT_CONTROL_PING, noprint_control_ping);
+     S;
+   }
+
+    /* Wait for a reply... */
+    W_L({
+      if (vam->noprint_msg) {
+          if (!vam->json_output) {
+              print_locator_in_locator_set(vam, filter);
+          } else {
+              json_locator_in_locator_set(vam, filter);
+          }
+      }
+
+      vam->noprint_msg = 0;
+    });
 
     /* NOTREACHED */
     return 0;
 }
 
+static int
+api_lisp_locator_set_dump(vat_main_t *vam)
+{
+    unformat_input_t * input = vam->input;
+    vam->noprint_msg = 0;
+    u32 locator_set_index = ~0;
+    u8 locator_set_index_set = 0;
+    u8 * locator_set = 0;
+    u8 locator_set_set = 0;
+    u8 filter = 0;
+    int ret = 0;
+
+    /* Parse args required to build the message */
+    while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) {
+        if (unformat(input, "locator-set-index %u", &locator_set_index)) {
+            locator_set_index_set = 1;
+        } else if (unformat(input, "locator-set %s", &locator_set)) {
+            locator_set_set = 1;
+        } else if (unformat(input, "local")) {
+            filter = 1;
+        } else if (unformat(input, "remote")) {
+            filter = 2;
+        } else {
+            break;
+        }
+    }
+
+    if (locator_set_index_set && locator_set_set) {
+        errmsg ("use only input parameter!\n");
+        return -99;
+    }
+
+    if (locator_set_index_set || locator_set_set) {
+        ret = lisp_locator_dump(vam, locator_set_index, locator_set, filter);
+    } else {
+        ret = lisp_locator_set_dump(vam, filter);
+    }
+
+    vec_free(locator_set);
+
+    return ret;
+}
+
 static int
 api_lisp_eid_table_map_dump(vat_main_t *vam)
 {
@@ -11560,16 +11913,381 @@ api_lisp_eid_table_map_dump(vat_main_t *vam)
 }
 
 static int
-api_lisp_local_eid_table_dump(vat_main_t *vam)
+get_locator_set(vat_main_t * vam)
+{
+    vl_api_lisp_locator_set_dump_t *mp;
+    f64 timeout = ~0;
+
+    M(LISP_LOCATOR_SET_DUMP, lisp_locator_set_dump);
+    /* send it... */
+    S;
+
+   /* Use a control ping for synchronization */
+   {
+     vl_api_noprint_control_ping_t * mp;
+     M(NOPRINT_CONTROL_PING, noprint_control_ping);
+     S;
+   }
+
+    /* Wait for a reply... */
+    W;
+
+    /* NOTREACHED */
+    return 0;
+}
+
+static inline u8 *
+format_eid_for_eid_table(vat_main_t *vam, u8 * str, eid_table_t * eid_table,
+                         int *ret)
+{
+    u8 * (*format_eid)(u8 *, va_list *) = 0;
+
+    ASSERT(vam != NULL);
+    ASSERT(eid_table != NULL);
+
+    if (ret) {
+        *ret = 0;
+    }
+
+    switch (eid_table->eid_type)
+    {
+      case 0:
+      case 1:
+        format_eid = (eid_table->eid_type ? format_ip6_address :
+          format_ip4_address);
+        str = format(0, "[%d] %U/%d",
+                          clib_net_to_host_u32 (eid_table->vni),
+                          format_eid, eid_table->eid, eid_table->eid_prefix_len);
+        break;
+      case 2:
+        str = format(0, "[%d] %U",
+                          clib_net_to_host_u32 (eid_table->vni),
+                          format_ethernet_address, eid_table->eid);
+        break;
+      default:
+        errmsg ("unknown EID type %d!", eid_table->eid_type);
+        if (ret) {
+            *ret = -99;
+        }
+        return 0;
+    }
+
+    return str;
+}
+
+static inline u8 *
+format_locator_set_for_eid_table(vat_main_t * vam, u8 * str,
+                                 eid_table_t * eid_table)
+{
+    locator_set_msg_t * ls = 0;
+
+    ASSERT(vam != NULL);
+    ASSERT(eid_table != NULL);
+
+    if (eid_table->is_local) {
+        vec_foreach (ls, vam->locator_set_msg) {
+            if (ls->locator_set_index == eid_table->locator_set_index) {
+                str = format(0, "local(%s)", ls->locator_set_name);
+                return str;
+            }
+        }
+
+        str = format(0, "local(N/A)");
+    } else {
+        str = format(0, "remote");
+    }
+
+    return str;
+}
+
+static inline u8 *
+format_locator_for_eid_table(vat_main_t * vam, u8 * str,
+                             eid_table_t * eid_table)
+{
+    locator_msg_t * loc = 0;
+    int first_line = 1;
+
+    ASSERT(vam != NULL);
+    ASSERT(eid_table != NULL);
+
+    vec_foreach(loc, vam->locator_msg) {
+        if (!first_line) {
+            if (loc->local) {
+                str = format(str, "%-55s%-d\n", " ", loc->sw_if_index);
+            } else {
+                str = format(str, "%=55s%-U\n", " ",
+                             loc->is_ipv6 ? format_ip6_address :
+                             format_ip4_address,
+                               loc->ip_address);
+            }
+
+            continue;
+        }
+
+        if (loc->local) {
+            str = format(str, "%-30d%-20u%-u\n", loc->sw_if_index,
+                         eid_table->ttl, eid_table->authoritative);
+        } else {
+            str = format(str, "%-30U%-20u%-u\n",
+                         loc->is_ipv6 ? format_ip6_address :
+                         format_ip4_address,
+                         loc->ip_address, eid_table->ttl,
+                         eid_table->authoritative);
+        }
+        first_line = 0;
+    }
+
+    return str;
+}
+
+static int
+print_lisp_eid_table_dump(vat_main_t * vam)
+{
+    eid_table_t * eid_table = 0;
+    u8 * tmp_str = 0, * tmp_str2 = 0;
+    int ret = 0;
+
+    ASSERT(vam != NULL);
+
+    ret = get_locator_set(vam);
+    if (ret) {
+        vec_free(vam->eid_tables);
+        return ret;
+    }
+
+    fformat(vam->ofp, "%-35s%-20s%-30s%-20s%-s\n", "EID", "type", "locators",
+                                                   "ttl", "authoritative");
+
+    vec_foreach(eid_table, vam->eid_tables) {
+        ret = lisp_locator_dump_send_msg(vam, eid_table->locator_set_index, 0);
+        if (ret) {
+          vec_free(vam->locator_msg);
+          clean_locator_set_message(vam);
+          vec_free(vam->eid_tables);
+          return ret;
+        }
+
+        tmp_str2 = format_eid_for_eid_table(vam, tmp_str2, eid_table, &ret);
+        if (ret) {
+          vec_free(vam->locator_msg);
+          clean_locator_set_message(vam);
+          vec_free(vam->eid_tables);
+          return ret;
+        }
+
+        tmp_str = format(0, "%-35s", tmp_str2);
+        vec_free(tmp_str2);
+
+        tmp_str2 = format_locator_set_for_eid_table(vam, tmp_str2, eid_table);
+        tmp_str = format(tmp_str, "%-20s", tmp_str2);
+        vec_free(tmp_str2);
+
+        tmp_str2 = format_locator_for_eid_table(vam, tmp_str2, eid_table);
+        tmp_str = format(tmp_str, "%-s", tmp_str2);
+        vec_free(tmp_str2);
+
+        fformat(vam->ofp, "%s", tmp_str);
+        vec_free(tmp_str);
+        vec_free(vam->locator_msg);
+    }
+
+    clean_locator_set_message(vam);
+    vec_free(vam->eid_tables);
+
+    return ret;
+}
+
+static inline void
+json_locator_set_for_eid_table(vat_main_t * vam, vat_json_node_t * node,
+                               eid_table_t * eid_table)
+{
+    locator_set_msg_t * ls = 0;
+    u8 * s = 0;
+
+    ASSERT(vam != NULL);
+    ASSERT(node != NULL);
+    ASSERT(eid_table != NULL);
+
+    if (eid_table->is_local) {
+        vec_foreach (ls, vam->locator_set_msg) {
+            if (ls->locator_set_index == eid_table->locator_set_index) {
+                vat_json_object_add_string_copy(node, "locator-set",
+                                                ls->locator_set_name);
+                return;
+            }
+        }
+
+        s = format(0, "N/A");
+        vec_add1(s, 0);
+        vat_json_object_add_string_copy(node, "locator-set", s);
+        vec_free(s);
+    } else {
+        s = format(0, "remote");
+        vec_add1(s, 0);
+        vat_json_object_add_string_copy(node, "locator-set", s);
+        vec_free(s);
+    }
+}
+
+static inline int
+json_eid_for_eid_table(vat_main_t * vam, vat_json_node_t * node,
+                       eid_table_t * eid_table)
+{
+    u8 * s = 0;
+    struct in6_addr ip6;
+    struct in_addr ip4;
+
+    ASSERT(vam != NULL);
+    ASSERT(node != NULL);
+    ASSERT(eid_table != NULL);
+
+    switch (eid_table->eid_type)
+    {
+      case 0:
+        clib_memcpy(&ip4, eid_table->eid, sizeof(ip4));
+        vat_json_object_add_ip4(node, "eid", ip4);
+        vat_json_object_add_uint(node, "eid-prefix-len",
+                                 eid_table->eid_prefix_len);
+        break;
+      case 1:
+        clib_memcpy(&ip6, eid_table->eid, sizeof(ip6));
+        vat_json_object_add_ip6(node, "eid", ip6);
+        vat_json_object_add_uint(node, "eid-prefix-len",
+                                 eid_table->eid_prefix_len);
+        break;
+      case 2:
+        s = format (0, "%U", format_ethernet_address, eid_table->eid);
+        vec_add1(s, 0);
+        vat_json_object_add_string_copy(node, "eid", s);
+        vec_free(s);
+        break;
+      default:
+        errmsg ("unknown EID type %d!", eid_table->eid_type);
+        return -99;
+    }
+
+    return 0;
+}
+
+static inline void
+json_locator_for_eid_table(vat_main_t * vam, vat_json_node_t * node,
+                           eid_table_t * eid_table)
+{
+    locator_msg_t * loc = 0;
+    vat_json_node_t * locator_array = 0;
+    vat_json_node_t * locator = 0;
+    struct in6_addr ip6;
+    struct in_addr ip4;
+
+    ASSERT(vam != NULL);
+    ASSERT(node != NULL);
+    ASSERT(eid_table != NULL);
+
+    locator_array = vat_json_object_add_list(node, "locator");
+    vec_foreach(loc, vam->locator_msg) {
+        locator = vat_json_array_add(locator_array);
+        vat_json_init_object(locator);
+        if (loc->local) {
+            vat_json_object_add_uint(locator, "locator-index",
+                                     loc->sw_if_index);
+        } else {
+            if (loc->is_ipv6) {
+                clib_memcpy(&ip6, loc->ip_address, sizeof(ip6));
+                vat_json_object_add_ip6(locator, "locator", ip6);
+            } else {
+                clib_memcpy(&ip4, loc->ip_address, sizeof(ip4));
+                vat_json_object_add_ip4(locator, "locator", ip4);
+            }
+        }
+    }
+}
+
+static int
+json_lisp_eid_table_dump(vat_main_t * vam)
+{
+    eid_table_t * eid_table;
+    vat_json_node_t * node = 0;
+    int ret = 0;
+
+    ASSERT(vam != NULL);
+
+    ret = get_locator_set(vam);
+    if (ret) {
+        vec_free(vam->eid_tables);
+        return ret;
+    }
+
+    if (!vec_len(vam->eid_tables)) {
+        /* just print [] */
+        vat_json_init_array(&vam->json_tree);
+        vat_json_print(vam->ofp, &vam->json_tree);
+        vam->json_tree.type = VAT_JSON_NONE;
+        return ret;
+    }
+
+    if (VAT_JSON_ARRAY != vam->json_tree.type) {
+      ASSERT(VAT_JSON_NONE == vam->json_tree.type);
+      vat_json_init_array(&vam->json_tree);
+    }
+
+    vec_foreach(eid_table, vam->eid_tables) {
+        ret = lisp_locator_dump_send_msg(vam, eid_table->locator_set_index, 0);
+        if (ret) {
+            vec_free(vam->locator_msg);
+            vec_free(vam->eid_tables);
+            clean_locator_set_message(vam);
+            vat_json_free(&vam->json_tree);
+            vam->json_tree.type = VAT_JSON_NONE;
+            return ret;
+        }
+
+        node = vat_json_array_add(&vam->json_tree);
+        vat_json_init_object(node);
+
+        vat_json_object_add_uint(node, "vni", eid_table->vni);
+
+        json_locator_set_for_eid_table(vam, node, eid_table);
+        ret = json_eid_for_eid_table(vam, node, eid_table);
+        if (ret) {
+            vec_free(vam->locator_msg);
+            vec_free(vam->eid_tables);
+            clean_locator_set_message(vam);
+            vat_json_free(&vam->json_tree);
+            vam->json_tree.type = VAT_JSON_NONE;
+            return ret;
+        }
+
+        json_locator_for_eid_table(vam, node, eid_table);
+
+        vat_json_object_add_uint(node, "ttl", eid_table->ttl);
+        vat_json_object_add_uint(node, "authoritative",
+                                eid_table->authoritative);
+
+        vec_free(vam->locator_msg);
+    }
+
+    vat_json_print(vam->ofp, &vam->json_tree);
+    vat_json_free(&vam->json_tree);
+    vam->json_tree.type = VAT_JSON_NONE;
+
+    clean_locator_set_message(vam);
+    vec_free(vam->eid_tables);
+
+    return ret;
+}
+
+static int
+api_lisp_eid_table_dump(vat_main_t *vam)
 {
     unformat_input_t * i = vam->input;
-    vl_api_lisp_local_eid_table_dump_t *mp;
+    vl_api_lisp_eid_table_dump_t *mp;
     f64 timeout = ~0;
     struct in_addr ip4;
     struct in6_addr ip6;
     u8 mac[6];
-    u8 eid_type = ~0, eid_set;
+    u8 eid_type = ~0, eid_set = 0;
     u32 prefix_length = ~0, t, vni = 0;
+    u8 filter = 0;
 
     while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) {
         if (unformat (i, "eid %U/%d", unformat_ip4_address, &ip4, &t)) {
@@ -11583,21 +12301,21 @@ api_lisp_local_eid_table_dump(vat_main_t *vam)
         } else if (unformat (i, "eid %U", unformat_ethernet_address, mac)) {
             eid_set = 1;
             eid_type = 2;
-        } else if (unformat (i, "vni %d", &t))
+        } else if (unformat (i, "vni %d", &t)) {
             vni = t;
-        else {
+        } else if (unformat (i, "local")) {
+            filter = 1;
+        } else if (unformat (i, "remote")) {
+            filter = 2;
+        } else {
             errmsg ("parse error '%U'", format_unformat_error, i);
             return -99;
         }
     }
 
-    if (!vam->json_output) {
-        fformat(vam->ofp, "%=20s%=30s\n",
-                "Locator-set", "Eid");
-    }
-
-    M(LISP_LOCAL_EID_TABLE_DUMP, lisp_local_eid_table_dump);
+    M(LISP_EID_TABLE_DUMP, lisp_eid_table_dump);
 
+    mp->filter = filter;
     if (eid_set) {
         mp->eid_set = 1;
         mp->vni = htonl (vni);
@@ -11620,17 +12338,30 @@ api_lisp_local_eid_table_dump(vat_main_t *vam)
         }
     }
 
+    vam->noprint_msg = 1;
+
     /* send it... */
     S;
 
     /* Use a control ping for synchronization */
     {
-        vl_api_control_ping_t * mp;
-        M(CONTROL_PING, control_ping);
+        vl_api_noprint_control_ping_t * mp;
+        M(NOPRINT_CONTROL_PING, noprint_control_ping);
         S;
     }
+
     /* Wait for a reply... */
-    W;
+    W_L({
+      if (vam->noprint_msg) {
+          if (!vam->json_output) {
+              vam->retval = print_lisp_eid_table_dump(vam);
+          } else {
+              vam->retval = json_lisp_eid_table_dump(vam);
+          }
+      }
+
+      vam->noprint_msg = 0;
+    });
 
     /* NOTREACHED */
     return 0;
@@ -11696,9 +12427,9 @@ api_lisp_map_resolver_dump(vat_main_t *vam)
 }
 
 static int
-api_lisp_enable_disable_status_dump(vat_main_t *vam)
+api_show_lisp_status(vat_main_t *vam)
 {
-    vl_api_lisp_enable_disable_status_dump_t *mp;
+    vl_api_show_lisp_status_t *mp;
     f64 timeout = ~0;
 
     if (!vam->json_output) {
@@ -11706,17 +12437,9 @@ api_lisp_enable_disable_status_dump(vat_main_t *vam)
                 "lisp status", "locator-set");
     }
 
-    M(LISP_ENABLE_DISABLE_STATUS_DUMP,
-      lisp_enable_disable_status_dump);
+    M(SHOW_LISP_STATUS, show_lisp_status);
     /* send it... */
     S;
-
-    /* Use a control ping for synchronization */
-    {
-        vl_api_control_ping_t * mp;
-        M(CONTROL_PING, control_ping);
-        S;
-    }
     /* Wait for a reply... */
     W;
 
@@ -12709,6 +13432,191 @@ int api_pg_enable_disable (vat_main_t *vam)
     return 0;
 }
 
+int api_ip_source_and_port_range_check_add_del (vat_main_t *vam)
+{
+    unformat_input_t * input = vam->input;
+    vl_api_ip_source_and_port_range_check_add_del_t *mp;
+    f64 timeout;
+
+    u16 * low_ports = 0;
+    u16 * high_ports = 0;
+    u16 this_low;
+    u16 this_hi;
+    ip4_address_t ip4_addr;
+    ip6_address_t ip6_addr;
+    u32 length;
+    u32 tmp, tmp2;
+    u8 prefix_set = 0;
+    u32 vrf_id =~0;
+    u8 is_add = 1;
+    u8 is_ipv6 = 0;
+
+    while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
+        {
+            if (unformat (input, "%U/%d", unformat_ip4_address, &ip4_addr, &length))
+                {
+                    prefix_set = 1;
+                }
+            else if (unformat (input, "%U/%d", unformat_ip6_address, &ip6_addr, &length))
+                {
+                    prefix_set = 1;
+                    is_ipv6 = 1;
+                }
+            else if (unformat (input, "vrf %d", &vrf_id))
+                ;
+            else if (unformat (input, "del"))
+                is_add = 0;
+            else if (unformat (input, "port %d", &tmp))
+                {
+                    if (tmp == 0 || tmp > 65535) {
+                        errmsg ("port %d out of range", tmp);
+                        return -99;
+                    }
+                    this_low = tmp;
+                    this_hi = this_low + 1;
+                    vec_add1 (low_ports, this_low);
+                    vec_add1 (high_ports, this_hi);
+                }
+            else if (unformat (input, "range %d - %d", &tmp, &tmp2))
+                {
+                    if ((tmp > tmp2) ||
+                        (tmp == 0) ||
+                        (tmp2 > 65535)) {
+                        errmsg ("incorrect range parameters\n");
+                        return -99;
+                    }
+                    this_low = tmp;
+                    /* Note: in debug CLI +1 is added to high before
+                       passing to real fn that does "the work"
+                       (ip_source_and_port_range_check_add_del).
+                       This fn is a wrapper around the binary API fn a
+                       control plane will call, which expects this increment
+                       to have occurred. Hence letting the binary API control
+                       plane fn do the increment for consistency between VAT
+                       and other control planes.
+                     */
+                    this_hi = tmp2;
+                    vec_add1 (low_ports, this_low);
+                    vec_add1 (high_ports, this_hi);
+                }
+            else
+                break;
+        }
+
+    if (prefix_set == 0) {
+        errmsg ("<address>/<mask> not specified\n");
+        return -99;
+    }
+
+    if (vrf_id == ~0) {
+        errmsg ("VRF ID required, not specified\n");
+        return -99;
+    }
+
+    if (vrf_id == 0) {
+        errmsg ("VRF ID should not be default. Should be distinct VRF for this purpose.\n");
+        return -99;
+    }
+
+    if (vec_len(low_ports) == 0) {
+        errmsg ("At least one port or port range required\n");
+        return -99;
+    }
+
+    M(IP_SOURCE_AND_PORT_RANGE_CHECK_ADD_DEL, ip_source_and_port_range_check_add_del);
+
+    mp->is_add = is_add;
+
+    if (is_ipv6) {
+        mp->is_ipv6 = 1;
+        clib_memcpy (mp->address, &ip6_addr, sizeof (ip6_addr));
+    } else {
+        mp->is_ipv6 = 0;
+        clib_memcpy (mp->address, &ip4_addr, sizeof (ip4_addr));
+    }
+
+    mp->mask_length = length;
+    mp->number_of_ranges = vec_len (low_ports);
+
+    clib_memcpy (mp->low_ports, low_ports, vec_len(low_ports));
+    vec_free(low_ports);
+
+    clib_memcpy (mp->high_ports, high_ports, vec_len(high_ports));
+    vec_free (high_ports);
+
+    mp->vrf_id = ntohl(vrf_id);
+
+    S; W;
+    /* NOTREACHED */
+    return 0;
+}
+
+int api_ip_source_and_port_range_check_interface_add_del (vat_main_t * vam)
+{
+    unformat_input_t * input = vam->input;
+    vl_api_ip_source_and_port_range_check_interface_add_del_t *mp;
+    f64 timeout;
+    u32 sw_if_index = ~0;
+    int vrf_set = 0;
+    u32 tcp_out_vrf_id = ~0, udp_out_vrf_id = ~0;
+    u32 tcp_in_vrf_id = ~0, udp_in_vrf_id = ~0;
+    u8 is_add = 1;
+
+    while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
+      {
+        if (unformat (input, "%U", unformat_sw_if_index, vam, &sw_if_index))
+            ;
+        else if (unformat (input, "sw_if_index %d", &sw_if_index))
+            ;
+        else if (unformat (input, "tcp-out-vrf %d", &tcp_out_vrf_id))
+            vrf_set=1;
+        else if (unformat (input, "udp-out-vrf %d", &udp_out_vrf_id))
+            vrf_set=1;
+        else if (unformat (input, "tcp-in-vrf %d", &tcp_in_vrf_id))
+            vrf_set=1;
+        else if (unformat (input, "udp-in-vrf %d", &udp_in_vrf_id))
+            vrf_set=1;
+        else if (unformat (input, "del"))
+            is_add = 0;
+        else
+              break;
+      }
+
+    if (sw_if_index == ~0) {
+          errmsg ("Interface required but not specified\n");
+          return -99;
+    }
+
+    if (vrf_set == 0) {
+        errmsg ("VRF ID required but not specified\n");
+        return -99;
+    }
+
+    if (tcp_out_vrf_id == 0
+        || udp_out_vrf_id == 0
+        || tcp_in_vrf_id == 0
+        || udp_in_vrf_id == 0) {
+        errmsg ("VRF ID should not be default. Should be distinct VRF for this purpose.\n");
+        return -99;
+    }
+
+    /* Construct the API message */
+    M(IP_SOURCE_AND_PORT_RANGE_CHECK_INTERFACE_ADD_DEL, ip_source_and_port_range_check_interface_add_del);
+
+    mp->sw_if_index = ntohl (sw_if_index);
+    mp->is_add = is_add;
+    mp->tcp_out_vrf_id = ntohl (tcp_out_vrf_id);
+    mp->udp_out_vrf_id = ntohl (udp_out_vrf_id);
+    mp->tcp_in_vrf_id = ntohl (tcp_in_vrf_id);
+    mp->udp_in_vrf_id = ntohl (udp_in_vrf_id);
+
+    /* send it... */
+    S;
+
+    /* Wait for a reply... */
+    W;
+}
+
 static int q_or_quit (vat_main_t * vam)
 {
     longjmp (vam->jump_buf, 1);
@@ -13182,30 +14090,33 @@ _(lisp_add_del_locator_set, "locator-set <locator_name> [iface <intf> |"\
 _(lisp_add_del_locator, "locator-set <locator_name> "                   \
                         "iface <intf> | sw_if_index <sw_if_index> "     \
                         "p <priority> w <weight> [del]")                \
-_(lisp_add_del_local_eid, "<ipv4|ipv6>/<prefix> "                       \
+_(lisp_add_del_local_eid,"vni <vni> eid "                               \
+                         "<ipv4|ipv6>/<prefix> | <L2 address> "         \
                           "locator-set <locator_name> [del]")           \
-_(lisp_gpe_add_del_fwd_entry, "eid <ip4|6-addr>/<prefix> "              \
-    "sloc <ip4/6-addr> dloc <ip4|6-addr> [del]")                        \
+_(lisp_gpe_add_del_fwd_entry, "rmt_eid <eid> [lcl_eid <eid>] vni <vni>" \
+  "dp_table <table> loc-pair <lcl_loc> <rmt_loc> ... [del]")            \
 _(lisp_add_del_map_resolver, "<ip4|6-addr> [del]")                      \
 _(lisp_gpe_enable_disable, "enable|disable")                            \
 _(lisp_enable_disable, "enable|disable")                                \
 _(lisp_gpe_add_del_iface, "up|down")                                    \
-_(lisp_add_del_remote_mapping, "add|del vni <vni> deid <dest-eid> seid" \
-                               " <src-eid> rloc <locator> p <prio> "    \
+_(lisp_add_del_remote_mapping, "add|del vni <vni> deid <dest-eid> "     \
+                               "rloc <locator> p <prio> "               \
                                "w <weight> [rloc <loc> ... ] "          \
-                               "action <action>")                       \
+                               "action <action> [del-all]")             \
 _(lisp_add_del_adjacency, "add|del vni <vni> deid <dest-eid> seid "     \
                           "<src-eid> rloc <locator> p <prio> w <weight>"\
                           "[rloc <loc> ... ] action <action>")          \
 _(lisp_pitr_set_locator_set, "locator-set <loc-set-name> | del")        \
 _(lisp_add_del_map_request_itr_rlocs, "<loc-set-name> [del]")           \
 _(lisp_eid_table_add_del_map, "[del] vni <vni> vrf <vrf>")              \
-_(lisp_locator_set_dump, "")                                            \
-_(lisp_local_eid_table_dump, "")                                        \
+_(lisp_locator_set_dump, "[locator-set-index <ls-index> | "             \
+                         "locator-set <loc-set-name>] [local | remote]")\
+_(lisp_eid_table_dump, "[eid <ipv4|ipv6>/<prefix> | <mac>] [vni] "      \
+                       "[local] | [remote]")                            \
 _(lisp_eid_table_map_dump, "")                                          \
 _(lisp_gpe_tunnel_dump, "")                                             \
 _(lisp_map_resolver_dump, "")                                           \
-_(lisp_enable_disable_status_dump, "")                                  \
+_(show_lisp_status, "")                                                 \
 _(lisp_get_map_request_itr_rlocs, "")                                   \
 _(show_lisp_pitr, "")                                                   \
 _(af_packet_create, "name <host interface name> [hw_addr <mac>]")       \
@@ -13234,7 +14145,12 @@ _(ipfix_dump, "")                                                       \
 _(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]")     \
-_(pg_enable_disable, "[stream <id>] disable")
+_(pg_enable_disable, "[stream <id>] disable")                           \
+_(ip_source_and_port_range_check_add_del,                               \
+  "<ip-addr>/<mask> range <nn>-<nn> vrf <id>")                          \
+_(ip_source_and_port_range_check_interface_add_del,                     \
+  "<intf> | sw_if_index <nn> [tcp-out-vrf <id>] [tcp-in-vrf <id>]"      \
+  "[udp-in-vrf <id>] [udp-out-vrf <id>]")
 
 /* List of command functions, CLI names map directly to functions */
 #define foreach_cli_function                                    \