VPP-362 Implement dumping of LISP adjacencies
[vpp.git] / vpp-api-test / vat / api_format.c
index 7dc7cea..71c6f24 100644 (file)
@@ -2,7 +2,7 @@
  *------------------------------------------------------------------
  * api_format.c
  *
- * Copyright (c) 2014 Cisco and/or its affiliates.
+ * Copyright (c) 2014-2016 Cisco and/or its affiliates.
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at:
@@ -35,6 +35,7 @@
 #include <vnet/l2/l2_vtr.h>
 #include <vnet/classify/input_acl.h>
 #include <vnet/classify/policer_classify.h>
+#include <vnet/classify/flow_classify.h>
 #include <vnet/mpls/mpls.h>
 #if DPDK > 0
 #include <vnet/ipsec/ipsec.h>
@@ -456,7 +457,7 @@ unformat_policer_action_type (unformat_input_t * input, va_list * va)
 }
 
 uword
-unformat_classify_table_type (unformat_input_t * input, va_list * va)
+unformat_policer_classify_table_type (unformat_input_t * input, va_list * va)
 {
   u32 *r = va_arg (*va, u32 *);
   u32 tid;
@@ -474,6 +475,23 @@ unformat_classify_table_type (unformat_input_t * input, va_list * va)
   return 1;
 }
 
+uword
+unformat_flow_classify_table_type (unformat_input_t * input, va_list * va)
+{
+  u32 *r = va_arg (*va, u32 *);
+  u32 tid;
+
+  if (unformat (input, "ip4"))
+    tid = FLOW_CLASSIFY_TABLE_IP4;
+  else if (unformat (input, "ip6"))
+    tid = FLOW_CLASSIFY_TABLE_IP6;
+  else
+    return 0;
+
+  *r = tid;
+  return 1;
+}
+
 u8 *
 format_ip4_address (u8 * s, va_list * args)
 {
@@ -2584,6 +2602,78 @@ static void
   vec_free (next_decap_str);
 }
 
+static void
+  vl_api_lisp_adjacencies_get_reply_t_handler
+  (vl_api_lisp_adjacencies_get_reply_t * mp)
+{
+  vat_main_t *vam = &vat_main;
+  u32 i, n;
+  int retval = clib_net_to_host_u32 (mp->retval);
+  vl_api_lisp_adjacency_t *a;
+
+  if (retval)
+    goto end;
+
+  n = clib_net_to_host_u32 (mp->count);
+
+  for (i = 0; i < n; i++)
+    {
+      a = &mp->adjacencies[i];
+      fformat (vam->ofp, "%U %40U\n",
+              format_lisp_flat_eid, a->eid_type, a->leid, a->leid_prefix_len,
+              format_lisp_flat_eid, a->eid_type, a->reid,
+              a->reid_prefix_len);
+    }
+
+end:
+  vam->retval = retval;
+  vam->result_ready = 1;
+}
+
+static void
+  vl_api_lisp_adjacencies_get_reply_t_handler_json
+  (vl_api_lisp_adjacencies_get_reply_t * mp)
+{
+  u8 *s = 0;
+  vat_main_t *vam = &vat_main;
+  vat_json_node_t *e = 0, root;
+  u32 i, n;
+  int retval = clib_net_to_host_u32 (mp->retval);
+  vl_api_lisp_adjacency_t *a;
+
+  if (retval)
+    goto end;
+
+  n = clib_net_to_host_u32 (mp->count);
+  vat_json_init_array (&root);
+
+  for (i = 0; i < n; i++)
+    {
+      e = vat_json_array_add (&root);
+      a = &mp->adjacencies[i];
+
+      vat_json_init_object (e);
+      s = format (0, "%U", format_lisp_flat_eid, a->eid_type, a->leid,
+                 a->leid_prefix_len);
+      vec_add1 (s, 0);
+      vat_json_object_add_string_copy (e, "leid", s);
+      vec_free (s);
+
+      s = format (0, "%U", format_lisp_flat_eid, a->eid_type, a->reid,
+                 a->reid_prefix_len);
+      vec_add1 (s, 0);
+      vat_json_object_add_string_copy (e, "reid", s);
+      vec_free (s);
+    }
+
+  vat_json_print (vam->ofp, &root);
+  vat_json_free (&root);
+
+end:
+  vam->retval = retval;
+  vam->result_ready = 1;
+}
+
 static void
 vl_api_lisp_map_resolver_details_t_handler (vl_api_lisp_map_resolver_details_t
                                            * mp)
@@ -3370,10 +3460,41 @@ static void vl_api_ipsec_gre_add_del_tunnel_reply_t_handler_json
   vam->result_ready = 1;
 }
 
+static void vl_api_flow_classify_details_t_handler
+  (vl_api_flow_classify_details_t * mp)
+{
+  vat_main_t *vam = &vat_main;
+
+  fformat (vam->ofp, "%10d%20d\n", ntohl (mp->sw_if_index),
+          ntohl (mp->table_index));
+}
+
+static void vl_api_flow_classify_details_t_handler_json
+  (vl_api_flow_classify_details_t * mp)
+{
+  vat_main_t *vam = &vat_main;
+  vat_json_node_t *node;
+
+  if (VAT_JSON_ARRAY != vam->json_tree.type)
+    {
+      ASSERT (VAT_JSON_NONE == vam->json_tree.type);
+      vat_json_init_array (&vam->json_tree);
+    }
+  node = vat_json_array_add (&vam->json_tree);
+
+  vat_json_init_object (node);
+  vat_json_object_add_uint (node, "sw_if_index", ntohl (mp->sw_if_index));
+  vat_json_object_add_uint (node, "table_index", ntohl (mp->table_index));
+}
+
+
+
 #define vl_api_vnet_ip4_fib_counters_t_endian vl_noop_handler
 #define vl_api_vnet_ip4_fib_counters_t_print vl_noop_handler
 #define vl_api_vnet_ip6_fib_counters_t_endian vl_noop_handler
 #define vl_api_vnet_ip6_fib_counters_t_print vl_noop_handler
+#define vl_api_lisp_adjacencies_get_reply_t_endian vl_noop_handler
+#define vl_api_lisp_adjacencies_get_reply_t_print vl_noop_handler
 
 /*
  * Generate boilerplate reply handlers, which
@@ -3477,12 +3598,14 @@ _(netmap_delete_reply)                                  \
 _(set_ipfix_exporter_reply)                             \
 _(set_ipfix_classify_stream_reply)                      \
 _(ipfix_classify_table_add_del_reply)                   \
+_(flow_classify_set_interface_reply)                    \
 _(pg_capture_reply)                                     \
 _(pg_enable_disable_reply)                              \
 _(ip_source_and_port_range_check_add_del_reply)         \
 _(ip_source_and_port_range_check_interface_add_del_reply)\
 _(delete_subif_reply)                                   \
-_(l2_interface_pbb_tag_rewrite_reply)
+_(l2_interface_pbb_tag_rewrite_reply)                   \
+_(punt_reply)
 
 #define _(n)                                    \
     static void vl_api_##n##_t_handler          \
@@ -3676,6 +3799,7 @@ _(LISP_EID_TABLE_MAP_DETAILS, lisp_eid_table_map_details)               \
 _(LISP_EID_TABLE_VNI_DETAILS, lisp_eid_table_vni_details)               \
 _(LISP_GPE_TUNNEL_DETAILS, lisp_gpe_tunnel_details)                     \
 _(LISP_MAP_RESOLVER_DETAILS, lisp_map_resolver_details)                 \
+_(LISP_ADJACENCIES_GET_REPLY, lisp_adjacencies_get_reply)               \
 _(SHOW_LISP_STATUS_REPLY, show_lisp_status_reply)                       \
 _(LISP_ADD_DEL_MAP_REQUEST_ITR_RLOCS_REPLY,                             \
   lisp_add_del_map_request_itr_rlocs_reply)                             \
@@ -3705,6 +3829,8 @@ _(SET_IPFIX_CLASSIFY_STREAM_REPLY, set_ipfix_classify_stream_reply)     \
 _(IPFIX_CLASSIFY_STREAM_DETAILS, ipfix_classify_stream_details)         \
 _(IPFIX_CLASSIFY_TABLE_ADD_DEL_REPLY, ipfix_classify_table_add_del_reply) \
 _(IPFIX_CLASSIFY_TABLE_DETAILS, ipfix_classify_table_details)           \
+_(FLOW_CLASSIFY_SET_INTERFACE_REPLY, flow_classify_set_interface_reply) \
+_(FLOW_CLASSIFY_DETAILS, flow_classify_details)                         \
 _(GET_NEXT_INDEX_REPLY, get_next_index_reply)                           \
 _(PG_CREATE_INTERFACE_REPLY, pg_create_interface_reply)                 \
 _(PG_CAPTURE_REPLY, pg_capture_reply)                                   \
@@ -3716,7 +3842,8 @@ _(IP_SOURCE_AND_PORT_RANGE_CHECK_INTERFACE_ADD_DEL_REPLY,               \
 _(IPSEC_GRE_ADD_DEL_TUNNEL_REPLY, ipsec_gre_add_del_tunnel_reply)       \
 _(IPSEC_GRE_TUNNEL_DETAILS, ipsec_gre_tunnel_details)                   \
 _(DELETE_SUBIF_REPLY, delete_subif_reply)                               \
-_(L2_INTERFACE_PBB_TAG_REWRITE_REPLY, l2_interface_pbb_tag_rewrite_reply)
+_(L2_INTERFACE_PBB_TAG_REWRITE_REPLY, l2_interface_pbb_tag_rewrite_reply) \
+_(PUNT_REPLY, punt_reply)
 
 /* M: construct, but don't yet send a message */
 
@@ -5640,7 +5767,7 @@ api_ip_add_del_route (vat_main_t * vam)
   u32 random_seed = 0xdeaddabe;
   u32 classify_table_index = ~0;
   u8 is_classify = 0;
-  u8 resolve_host, resolve_attached;
+  u8 resolve_host = 0, resolve_attached = 0;
 
   /* Parse args required to build the message */
   while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
@@ -5827,6 +5954,9 @@ api_ip_add_del_route (vat_main_t * vam)
        }
       /* send it... */
       S;
+      /* If we receive SIGTERM, stop now... */
+      if (vam->do_exit)
+       break;
     }
 
   /* When testing multiple add/del ops, use a control-ping to sync */
@@ -5859,6 +5989,10 @@ api_ip_add_del_route (vat_main_t * vam)
       vam->async_errors = 0;
       after = vat_time_now (vam);
 
+      /* slim chance, but we might have eaten SIGTERM on the first iteration */
+      if (j > 0)
+       count = j;
+
       fformat (vam->ofp, "%d routes in %.6f secs, %.2f routes/sec\n",
               count, after - before, count / (after - before));
     }
@@ -7777,16 +7911,147 @@ api_sr_multicast_map_add_del (vat_main_t * vam)
 }
 
 
+#define foreach_tcp_proto_field                 \
+_(src_port)                                     \
+_(dst_port)
+
+#define foreach_udp_proto_field                 \
+_(src_port)                                     \
+_(dst_port)
+
 #define foreach_ip4_proto_field                 \
 _(src_address)                                  \
 _(dst_address)                                  \
 _(tos)                                          \
-_(length)                                      \
+_(length)                                       \
 _(fragment_id)                                  \
 _(ttl)                                          \
 _(protocol)                                     \
 _(checksum)
 
+uword
+unformat_tcp_mask (unformat_input_t * input, va_list * args)
+{
+  u8 **maskp = va_arg (*args, u8 **);
+  u8 *mask = 0;
+  u8 found_something = 0;
+  tcp_header_t *tcp;
+
+#define _(a) u8 a=0;
+  foreach_tcp_proto_field;
+#undef _
+
+  while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
+    {
+      if (0);
+#define _(a) else if (unformat (input, #a)) a=1;
+      foreach_tcp_proto_field
+#undef _
+       else
+       break;
+    }
+
+#define _(a) found_something += a;
+  foreach_tcp_proto_field;
+#undef _
+
+  if (found_something == 0)
+    return 0;
+
+  vec_validate (mask, sizeof (*tcp) - 1);
+
+  tcp = (tcp_header_t *) mask;
+
+#define _(a) if (a) memset (&tcp->a, 0xff, sizeof (tcp->a));
+  foreach_tcp_proto_field;
+#undef _
+
+  *maskp = mask;
+  return 1;
+}
+
+uword
+unformat_udp_mask (unformat_input_t * input, va_list * args)
+{
+  u8 **maskp = va_arg (*args, u8 **);
+  u8 *mask = 0;
+  u8 found_something = 0;
+  udp_header_t *udp;
+
+#define _(a) u8 a=0;
+  foreach_udp_proto_field;
+#undef _
+
+  while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
+    {
+      if (0);
+#define _(a) else if (unformat (input, #a)) a=1;
+      foreach_udp_proto_field
+#undef _
+       else
+       break;
+    }
+
+#define _(a) found_something += a;
+  foreach_udp_proto_field;
+#undef _
+
+  if (found_something == 0)
+    return 0;
+
+  vec_validate (mask, sizeof (*udp) - 1);
+
+  udp = (udp_header_t *) mask;
+
+#define _(a) if (a) memset (&udp->a, 0xff, sizeof (udp->a));
+  foreach_udp_proto_field;
+#undef _
+
+  *maskp = mask;
+  return 1;
+}
+
+typedef struct
+{
+  u16 src_port, dst_port;
+} tcpudp_header_t;
+
+uword
+unformat_l4_mask (unformat_input_t * input, va_list * args)
+{
+  u8 **maskp = va_arg (*args, u8 **);
+  u16 src_port = 0, dst_port = 0;
+  tcpudp_header_t *tcpudp;
+
+  while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
+    {
+      if (unformat (input, "tcp %U", unformat_tcp_mask, maskp))
+       return 1;
+      else if (unformat (input, "udp %U", unformat_udp_mask, maskp))
+       return 1;
+      else if (unformat (input, "src_port"))
+       src_port = 0xFFFF;
+      else if (unformat (input, "dst_port"))
+       dst_port = 0xFFFF;
+      else
+       return 0;
+    }
+
+  if (!src_port && !dst_port)
+    return 0;
+
+  u8 *mask = 0;
+  vec_validate (mask, sizeof (tcpudp_header_t) - 1);
+
+  tcpudp = (tcpudp_header_t *) mask;
+  tcpudp->src_port = src_port;
+  tcpudp->dst_port = dst_port;
+
+  *maskp = mask;
+
+  return 1;
+}
+
 uword
 unformat_ip4_mask (unformat_input_t * input, va_list * args)
 {
@@ -8064,6 +8329,7 @@ unformat_classify_mask (unformat_input_t * input, va_list * args)
   u8 *mask = 0;
   u8 *l2 = 0;
   u8 *l3 = 0;
+  u8 *l4 = 0;
   int i;
 
   while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
@@ -8074,13 +8340,23 @@ unformat_classify_mask (unformat_input_t * input, va_list * args)
        ;
       else if (unformat (input, "l3 %U", unformat_l3_mask, &l3))
        ;
+      else if (unformat (input, "l4 %U", unformat_l4_mask, &l4))
+       ;
       else
        break;
     }
 
-  if (mask || l2 || l3)
+  if (l4 && !l3)
+    {
+      vec_free (mask);
+      vec_free (l2);
+      vec_free (l4);
+      return 0;
+    }
+
+  if (mask || l2 || l3 || l4)
     {
-      if (l2 || l3)
+      if (l2 || l3 || l4)
        {
          /* "With a free Ethernet header in every package" */
          if (l2 == 0)
@@ -8091,6 +8367,11 @@ unformat_classify_mask (unformat_input_t * input, va_list * args)
              vec_append (mask, l3);
              vec_free (l3);
            }
+         if (vec_len (l4))
+           {
+             vec_append (mask, l4);
+             vec_free (l4);
+           }
        }
 
       /* Scan forward looking for the first significant mask octet */
@@ -8330,6 +8611,37 @@ api_classify_add_del_table (vat_main_t * vam)
   /* NOTREACHED */
 }
 
+uword
+unformat_l4_match (unformat_input_t * input, va_list * args)
+{
+  u8 **matchp = va_arg (*args, u8 **);
+
+  u8 *proto_header = 0;
+  int src_port = 0;
+  int dst_port = 0;
+
+  tcpudp_header_t h;
+
+  while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
+    {
+      if (unformat (input, "src_port %d", &src_port))
+       ;
+      else if (unformat (input, "dst_port %d", &dst_port))
+       ;
+      else
+       return 0;
+    }
+
+  h.src_port = clib_host_to_net_u16 (src_port);
+  h.dst_port = clib_host_to_net_u16 (dst_port);
+  vec_validate (proto_header, sizeof (h) - 1);
+  memcpy (proto_header, &h, sizeof (h));
+
+  *matchp = proto_header;
+
+  return 1;
+}
+
 uword
 unformat_ip4_match (unformat_input_t * input, va_list * args)
 {
@@ -8414,13 +8726,13 @@ unformat_ip4_match (unformat_input_t * input, va_list * args)
     ip->tos = tos_val;
 
   if (length)
-    ip->length = length_val;
+    ip->length = clib_host_to_net_u16 (length_val);
 
   if (ttl)
     ip->ttl = ttl_val;
 
   if (checksum)
-    ip->checksum = checksum_val;
+    ip->checksum = clib_host_to_net_u16 (checksum_val);
 
   *matchp = match;
   return 1;
@@ -8675,6 +8987,7 @@ unformat_classify_match (unformat_input_t * input, va_list * args)
   u8 *match = 0;
   u8 *l2 = 0;
   u8 *l3 = 0;
+  u8 *l4 = 0;
 
   while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
     {
@@ -8684,13 +8997,23 @@ unformat_classify_match (unformat_input_t * input, va_list * args)
        ;
       else if (unformat (input, "l3 %U", unformat_l3_match, &l3))
        ;
+      else if (unformat (input, "l4 %U", unformat_l4_match, &l4))
+       ;
       else
        break;
     }
 
-  if (match || l2 || l3)
+  if (l4 && !l3)
     {
-      if (l2 || l3)
+      vec_free (match);
+      vec_free (l2);
+      vec_free (l4);
+      return 0;
+    }
+
+  if (match || l2 || l3 || l4)
+    {
+      if (l2 || l3 || l4)
        {
          /* "Win a free Ethernet header in every packet" */
          if (l2 == 0)
@@ -8701,6 +9024,11 @@ unformat_classify_match (unformat_input_t * input, va_list * args)
              vec_append_aligned (match, l3, sizeof (u32x4));
              vec_free (l3);
            }
+         if (vec_len (l4))
+           {
+             vec_append_aligned (match, l4, sizeof (u32x4));
+             vec_free (l4);
+           }
        }
 
       /* Make sure the vector is big enough even if key is all 0's */
@@ -13632,6 +13960,52 @@ api_lisp_gpe_tunnel_dump (vat_main_t * vam)
   return 0;
 }
 
+static int
+api_lisp_adjacencies_get (vat_main_t * vam)
+{
+  unformat_input_t *i = vam->input;
+  vl_api_lisp_adjacencies_get_t *mp;
+  f64 timeout = ~0;
+  u8 vni_set = 0;
+  u32 vni = ~0;
+
+  while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
+    {
+      if (unformat (i, "vni %d", &vni))
+       {
+         vni_set = 1;
+       }
+      else
+       {
+         errmsg ("parse error '%U'\n", format_unformat_error, i);
+         return -99;
+       }
+    }
+
+  if (!vni_set)
+    {
+      errmsg ("vni not set!\n");
+      return -99;
+    }
+
+  if (!vam->json_output)
+    {
+      fformat (vam->ofp, "%s %40s\n", "leid", "reid");
+    }
+
+  M (LISP_ADJACENCIES_GET, lisp_adjacencies_get);
+  mp->vni = clib_host_to_net_u32 (vni);
+
+  /* send it... */
+  S;
+
+  /* Wait for a reply... */
+  W;
+
+  /* NOTREACHED */
+  return 0;
+}
+
 static int
 api_lisp_map_resolver_dump (vat_main_t * vam)
 {
@@ -13990,7 +14364,7 @@ api_policer_classify_dump (vat_main_t * vam)
   f64 timeout = ~0;
   u8 type = POLICER_CLASSIFY_N_TABLES;
 
-  if (unformat (i, "type %U", unformat_classify_table_type, &type))
+  if (unformat (i, "type %U", unformat_policer_classify_table_type, &type))
     ;
   else
     {
@@ -15106,6 +15480,47 @@ api_ipsec_gre_add_del_tunnel (vat_main_t * vam)
   return 0;
 }
 
+static int
+api_punt (vat_main_t * vam)
+{
+  unformat_input_t *i = vam->input;
+  vl_api_punt_t *mp;
+  f64 timeout;
+  u32 ipv = ~0;
+  u32 protocol = ~0;
+  u32 port = ~0;
+  int is_add = 1;
+
+  while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
+    {
+      if (unformat (i, "ip %d", &ipv))
+       ;
+      else if (unformat (i, "protocol %d", &protocol))
+       ;
+      else if (unformat (i, "port %d", &port))
+       ;
+      else if (unformat (i, "del"))
+       is_add = 0;
+      else
+       {
+         clib_warning ("parse error '%U'", format_unformat_error, i);
+         return -99;
+       }
+    }
+
+  M (PUNT, punt);
+
+  mp->is_add = (u8) is_add;
+  mp->ipv = (u8) ipv;
+  mp->l4_protocol = (u8) protocol;
+  mp->l4_port = htons ((u16) port);
+
+  S;
+  W;
+  /* NOTREACHED */
+  return 0;
+}
+
 static void vl_api_ipsec_gre_tunnel_details_t_handler
   (vl_api_ipsec_gre_tunnel_details_t * mp)
 {
@@ -15305,6 +15720,95 @@ api_l2_interface_pbb_tag_rewrite (vat_main_t * vam)
   return 0;
 }
 
+static int
+api_flow_classify_set_interface (vat_main_t * vam)
+{
+  unformat_input_t *i = vam->input;
+  vl_api_flow_classify_set_interface_t *mp;
+  f64 timeout;
+  u32 sw_if_index;
+  int sw_if_index_set;
+  u32 ip4_table_index = ~0;
+  u32 ip6_table_index = ~0;
+  u8 is_add = 1;
+
+  while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
+    {
+      if (unformat (i, "%U", unformat_sw_if_index, vam, &sw_if_index))
+       sw_if_index_set = 1;
+      else if (unformat (i, "sw_if_index %d", &sw_if_index))
+       sw_if_index_set = 1;
+      else if (unformat (i, "del"))
+       is_add = 0;
+      else if (unformat (i, "ip4-table %d", &ip4_table_index))
+       ;
+      else if (unformat (i, "ip6-table %d", &ip6_table_index))
+       ;
+      else
+       {
+         clib_warning ("parse error '%U'", format_unformat_error, i);
+         return -99;
+       }
+    }
+
+  if (sw_if_index_set == 0)
+    {
+      errmsg ("missing interface name or sw_if_index\n");
+      return -99;
+    }
+
+  M (FLOW_CLASSIFY_SET_INTERFACE, flow_classify_set_interface);
+
+  mp->sw_if_index = ntohl (sw_if_index);
+  mp->ip4_table_index = ntohl (ip4_table_index);
+  mp->ip6_table_index = ntohl (ip6_table_index);
+  mp->is_add = is_add;
+
+  S;
+  W;
+  /* NOTREACHED */
+  return 0;
+}
+
+static int
+api_flow_classify_dump (vat_main_t * vam)
+{
+  unformat_input_t *i = vam->input;
+  vl_api_flow_classify_dump_t *mp;
+  f64 timeout = ~0;
+  u8 type = FLOW_CLASSIFY_N_TABLES;
+
+  if (unformat (i, "type %U", unformat_flow_classify_table_type, &type))
+    ;
+  else
+    {
+      errmsg ("classify table type must be specified\n");
+      return -99;
+    }
+
+  if (!vam->json_output)
+    {
+      fformat (vam->ofp, "%10s%20s\n", "Intfc idx", "Classify table");
+    }
+
+  M (FLOW_CLASSIFY_DUMP, flow_classify_dump);
+  mp->type = type;
+  /* 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;
+
+  /* NOTREACHED */
+  return 0;
+}
+
 static int
 q_or_quit (vat_main_t * vam)
 {
@@ -15854,6 +16358,7 @@ _(lisp_eid_table_vni_dump, "")                                          \
 _(lisp_eid_table_map_dump, "l2|l3")                                     \
 _(lisp_gpe_tunnel_dump, "")                                             \
 _(lisp_map_resolver_dump, "")                                           \
+_(lisp_adjacencies_get, "vni <vni>")                                    \
 _(show_lisp_status, "")                                                 \
 _(lisp_get_map_request_itr_rlocs, "")                                   \
 _(show_lisp_pitr, "")                                                   \
@@ -15900,8 +16405,12 @@ _(ipsec_gre_tunnel_dump, "[sw_if_index <nn>]")                          \
 _(delete_subif,"sub_sw_if_index <nn> sub_if_id <nn>")                   \
 _(l2_interface_pbb_tag_rewrite,                                         \
   "<intfc> | sw_if_index <nn> \n"                                       \
-  "[disable | push | pop | translate_pbb_stag <outer_tag>] \n" \
-  "dmac <mac> smac <mac> sid <nn> [vlanid <nn>]")
+  "[disable | push | pop | translate_pbb_stag <outer_tag>] \n"          \
+  "dmac <mac> smac <mac> sid <nn> [vlanid <nn>]")                       \
+_(punt, "protocol <l4-protocol> [ip <ver>] [port <l4-port>] [del]")     \
+_(flow_classify_set_interface,                                          \
+  "<intfc> | sw_if_index <nn> [ip4-table <nn>] [ip6-table <nn>] [del]") \
+_(flow_classify_dump, "type [ip4|ip6]")
 
 /* List of command functions, CLI names map directly to functions */
 #define foreach_cli_function                                    \