API refactoring : ipsec-gre
[vpp.git] / vpp / vpp-api / api.c
index fc07550..4ac0afd 100644 (file)
@@ -49,7 +49,6 @@
 #include <vnet/vnet.h>
 #include <vnet/l2/l2_input.h>
 #include <vnet/l2/l2_bd.h>
-#include <vnet/l2tp/l2tp.h>
 #include <vnet/ip/ip.h>
 #include <vnet/ip/ip6.h>
 #include <vnet/ip/ip6_neighbor.h>
@@ -71,7 +70,6 @@
 #include <vnet/classify/flow_classify.h>
 #include <vnet/l2/l2_classify.h>
 #include <vnet/vxlan/vxlan.h>
-#include <vnet/gre/gre.h>
 #include <vnet/l2/l2_vtr.h>
 #include <vnet/vxlan-gpe/vxlan_gpe.h>
 #include <vnet/lisp-gpe/lisp_gpe.h>
@@ -84,7 +82,6 @@
 #include <vnet/ip/ip_source_and_port_range_check.h>
 #include <vnet/policer/policer.h>
 #include <vnet/flow/flow_report.h>
-#include <vnet/ipsec-gre/ipsec_gre.h>
 #include <vnet/flow/flow_report_classify.h>
 #include <vnet/ip/punt.h>
 #include <vnet/feature/feature.h>
 #include <vnet/devices/dpdk/dpdk.h>
 #endif
 
-#if IPSEC > 0
-#include <vnet/ipsec/ipsec.h>
-#include <vnet/ipsec/ikev2.h>
-#endif /* IPSEC */
-
 #include <stats/stats.h>
 #include <oam/oam.h>
-
 #include <vnet/ethernet/ethernet.h>
 #include <vnet/ethernet/arp_packet.h>
 #include <vnet/interface.h>
-
 #include <vnet/l2/l2_fib.h>
 #include <vnet/l2/l2_bd.h>
 #include <vpp-api/vpe_msg_enum.h>
 #include <vnet/span/span.h>
-
-#include <vnet/bfd/bfd_main.h>
-#include <vnet/bfd/bfd_api.h>
 #include <vnet/fib/ip6_fib.h>
 #include <vnet/fib/ip4_fib.h>
 #include <vnet/fib/fib_api.h>
 #include <vnet/dpo/lookup_dpo.h>
 #include <vnet/dpo/classify_dpo.h>
 #include <vnet/dpo/ip_null_dpo.h>
-
 #define vl_typedefs            /* define message structures */
 #include <vpp-api/vpe_all_api_h.h>
 #undef vl_typedefs
-
 #define vl_endianfun           /* define message structures */
 #include <vpp-api/vpe_all_api_h.h>
 #undef vl_endianfun
-
 /* instantiate all the print functions we know about */
 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__)
 #define vl_printfun
 #include <vpp-api/vpe_all_api_h.h>
 #undef vl_printfun
-
 #include <vlibapi/api_helper_macros.h>
-
 #define foreach_vpe_api_msg                                             \
 _(WANT_OAM_EVENTS, want_oam_events)                                     \
 _(OAM_ADD_DEL, oam_add_del)                                             \
@@ -185,15 +167,8 @@ _(CLASSIFY_SET_INTERFACE_IP_TABLE, classify_set_interface_ip_table)     \
 _(CLASSIFY_SET_INTERFACE_L2_TABLES, classify_set_interface_l2_tables)   \
 _(GET_NODE_INDEX, get_node_index)                                       \
 _(ADD_NODE_NEXT, add_node_next)                                                \
-_(L2TPV3_CREATE_TUNNEL, l2tpv3_create_tunnel)                           \
-_(L2TPV3_SET_TUNNEL_COOKIES, l2tpv3_set_tunnel_cookies)                 \
-_(L2TPV3_INTERFACE_ENABLE_DISABLE, l2tpv3_interface_enable_disable)     \
-_(L2TPV3_SET_LOOKUP_KEY, l2tpv3_set_lookup_key)                         \
-_(SW_IF_L2TPV3_TUNNEL_DUMP, sw_if_l2tpv3_tunnel_dump)                   \
 _(VXLAN_ADD_DEL_TUNNEL, vxlan_add_del_tunnel)                           \
 _(VXLAN_TUNNEL_DUMP, vxlan_tunnel_dump)                                 \
-_(GRE_ADD_DEL_TUNNEL, gre_add_del_tunnel)                               \
-_(GRE_TUNNEL_DUMP, gre_tunnel_dump)                                     \
 _(L2_FIB_CLEAR_TABLE, l2_fib_clear_table)                               \
 _(L2_INTERFACE_EFP_FILTER, l2_interface_efp_filter)                     \
 _(L2_INTERFACE_VLAN_TAG_REWRITE, l2_interface_vlan_tag_rewrite)         \
@@ -206,16 +181,6 @@ _(INTERFACE_NAME_RENUMBER, interface_name_renumber)                        \
 _(WANT_IP4_ARP_EVENTS, want_ip4_arp_events)                             \
 _(WANT_IP6_ND_EVENTS, want_ip6_nd_events)                               \
 _(INPUT_ACL_SET_INTERFACE, input_acl_set_interface)                     \
-_(IPSEC_SPD_ADD_DEL, ipsec_spd_add_del)                                 \
-_(IPSEC_INTERFACE_ADD_DEL_SPD, ipsec_interface_add_del_spd)             \
-_(IPSEC_SPD_ADD_DEL_ENTRY, ipsec_spd_add_del_entry)                     \
-_(IPSEC_SAD_ADD_DEL_ENTRY, ipsec_sad_add_del_entry)                     \
-_(IPSEC_SA_SET_KEY, ipsec_sa_set_key)                                   \
-_(IKEV2_PROFILE_ADD_DEL, ikev2_profile_add_del)                         \
-_(IKEV2_PROFILE_SET_AUTH, ikev2_profile_set_auth)                       \
-_(IKEV2_PROFILE_SET_ID, ikev2_profile_set_id)                           \
-_(IKEV2_PROFILE_SET_TS, ikev2_profile_set_ts)                           \
-_(IKEV2_SET_LOCAL_KEY, ikev2_set_local_key)                             \
 _(DELETE_LOOPBACK, delete_loopback)                                     \
 _(BD_IP_MAC_ADD_DEL, bd_ip_mac_add_del)                                 \
 _(COP_INTERFACE_ENABLE_DISABLE, cop_interface_enable_disable)          \
@@ -284,24 +249,15 @@ _(IP_SOURCE_AND_PORT_RANGE_CHECK_ADD_DEL,                               \
   ip_source_and_port_range_check_add_del)                               \
 _(IP_SOURCE_AND_PORT_RANGE_CHECK_INTERFACE_ADD_DEL,                     \
   ip_source_and_port_range_check_interface_add_del)                     \
-_(IPSEC_GRE_ADD_DEL_TUNNEL, ipsec_gre_add_del_tunnel)                   \
-_(IPSEC_GRE_TUNNEL_DUMP, ipsec_gre_tunnel_dump)                         \
 _(DELETE_SUBIF, delete_subif)                                           \
 _(L2_INTERFACE_PBB_TAG_REWRITE, l2_interface_pbb_tag_rewrite)           \
 _(PUNT, punt)                                                           \
 _(FLOW_CLASSIFY_SET_INTERFACE, flow_classify_set_interface)             \
 _(FLOW_CLASSIFY_DUMP, flow_classify_dump)                               \
-_(IPSEC_SPD_DUMP, ipsec_spd_dump)                                       \
-_(FEATURE_ENABLE_DISABLE, feature_enable_disable)                       \
-_(BFD_UDP_ADD, bfd_udp_add)                                             \
-_(BFD_UDP_DEL, bfd_udp_del)                                             \
-_(BFD_UDP_SESSION_DUMP, bfd_udp_session_dump)                           \
-_(BFD_SESSION_SET_FLAGS, bfd_session_set_flags)                         \
-_(WANT_BFD_EVENTS, want_bfd_events)
+_(FEATURE_ENABLE_DISABLE, feature_enable_disable)
 
 #define QUOTE_(x) #x
 #define QUOTE(x) QUOTE_(x)
-
 typedef enum
 {
   RESOLVE_IP4_ADD_DEL_ROUTE = 1,
@@ -338,7 +294,6 @@ vl_api_memclnt_delete_callback (u32 client_index)
 }
 
 pub_sub_handler (oam_events, OAM_EVENTS);
-pub_sub_handler (bfd_events, BFD_EVENTS);
 
 #define RESOLUTION_EVENT 1
 #define RESOLUTION_PENDING_EVENT 2
@@ -2555,63 +2510,6 @@ static void
   REPLY_MACRO (VL_API_L2_INTERFACE_VLAN_TAG_REWRITE_REPLY);
 }
 
-static void
-send_sw_if_l2tpv3_tunnel_details (vpe_api_main_t * am,
-                                 unix_shared_memory_queue_t * q,
-                                 l2t_session_t * s,
-                                 l2t_main_t * lm, u32 context)
-{
-  vl_api_sw_if_l2tpv3_tunnel_details_t *mp;
-  u8 *if_name = NULL;
-  vnet_sw_interface_t *si = NULL;
-
-  si = vnet_get_hw_sw_interface (lm->vnet_main, s->hw_if_index);
-
-  if_name = format (if_name, "%U",
-                   format_vnet_sw_interface_name, lm->vnet_main, si);
-
-  mp = vl_msg_api_alloc (sizeof (*mp));
-  memset (mp, 0, sizeof (*mp));
-  mp->_vl_msg_id = ntohs (VL_API_SW_IF_L2TPV3_TUNNEL_DETAILS);
-  strncpy ((char *) mp->interface_name,
-          (char *) if_name, ARRAY_LEN (mp->interface_name) - 1);
-  mp->sw_if_index = ntohl (si->sw_if_index);
-  mp->local_session_id = s->local_session_id;
-  mp->remote_session_id = s->remote_session_id;
-  mp->local_cookie[0] = s->local_cookie[0];
-  mp->local_cookie[1] = s->local_cookie[1];
-  mp->remote_cookie = s->remote_cookie;
-  clib_memcpy (mp->client_address, &s->client_address,
-              sizeof (s->client_address));
-  clib_memcpy (mp->our_address, &s->our_address, sizeof (s->our_address));
-  mp->l2_sublayer_present = s->l2_sublayer_present;
-  mp->context = context;
-
-  vl_msg_api_send_shmem (q, (u8 *) & mp);
-}
-
-
-static void
-vl_api_sw_if_l2tpv3_tunnel_dump_t_handler (vl_api_sw_if_l2tpv3_tunnel_dump_t *
-                                          mp)
-{
-  vpe_api_main_t *am = &vpe_api_main;
-  l2t_main_t *lm = &l2t_main;
-  unix_shared_memory_queue_t *q;
-  l2t_session_t *session;
-
-  q = vl_api_client_index_to_input_queue (mp->client_index);
-  if (q == 0)
-    return;
-
-  /* *INDENT-OFF* */
-  pool_foreach (session, lm->sessions,
-  ({
-    send_sw_if_l2tpv3_tunnel_details (am, q, session, lm, mp->context);
-  }));
-  /* *INDENT-ON* */
-}
-
 static void
 vl_api_l2_fib_table_entry_t_handler (vl_api_l2_fib_table_entry_t * mp)
 {
@@ -2815,114 +2713,6 @@ out:
   /* *INDENT-ON* */
 }
 
-static void vl_api_l2tpv3_create_tunnel_t_handler
-  (vl_api_l2tpv3_create_tunnel_t * mp)
-{
-  vl_api_l2tpv3_create_tunnel_reply_t *rmp;
-  l2t_main_t *lm = &l2t_main;
-  u32 sw_if_index = (u32) ~ 0;
-  int rv;
-
-  if (mp->is_ipv6 != 1)
-    {
-      rv = VNET_API_ERROR_UNIMPLEMENTED;
-      goto out;
-    }
-
-  u32 encap_fib_index;
-
-  if (mp->encap_vrf_id != ~0)
-    {
-      uword *p;
-      ip6_main_t *im = &ip6_main;
-      if (!
-         (p =
-          hash_get (im->fib_index_by_table_id, ntohl (mp->encap_vrf_id))))
-       {
-         rv = VNET_API_ERROR_NO_SUCH_FIB;
-         goto out;
-       }
-      encap_fib_index = p[0];
-    }
-  else
-    {
-      encap_fib_index = ~0;
-    }
-
-  rv = create_l2tpv3_ipv6_tunnel (lm,
-                                 (ip6_address_t *) mp->client_address,
-                                 (ip6_address_t *) mp->our_address,
-                                 ntohl (mp->local_session_id),
-                                 ntohl (mp->remote_session_id),
-                                 clib_net_to_host_u64 (mp->local_cookie),
-                                 clib_net_to_host_u64 (mp->remote_cookie),
-                                 mp->l2_sublayer_present,
-                                 encap_fib_index, &sw_if_index);
-
-out:
-  /* *INDENT-OFF* */
-  REPLY_MACRO2(VL_API_L2TPV3_CREATE_TUNNEL_REPLY,
-  ({
-    rmp->sw_if_index = ntohl (sw_if_index);
-  }));
-  /* *INDENT-ON* */
-}
-
-static void vl_api_l2tpv3_set_tunnel_cookies_t_handler
-  (vl_api_l2tpv3_set_tunnel_cookies_t * mp)
-{
-  vl_api_l2tpv3_set_tunnel_cookies_reply_t *rmp;
-  l2t_main_t *lm = &l2t_main;
-  int rv;
-
-  VALIDATE_SW_IF_INDEX (mp);
-
-  rv = l2tpv3_set_tunnel_cookies (lm, ntohl (mp->sw_if_index),
-                                 clib_net_to_host_u64 (mp->new_local_cookie),
-                                 clib_net_to_host_u64
-                                 (mp->new_remote_cookie));
-
-  BAD_SW_IF_INDEX_LABEL;
-
-  REPLY_MACRO (VL_API_L2TPV3_SET_TUNNEL_COOKIES_REPLY);
-}
-
-static void vl_api_l2tpv3_interface_enable_disable_t_handler
-  (vl_api_l2tpv3_interface_enable_disable_t * mp)
-{
-  int rv;
-  vnet_main_t *vnm = vnet_get_main ();
-  vl_api_l2tpv3_interface_enable_disable_reply_t *rmp;
-
-  VALIDATE_SW_IF_INDEX (mp);
-
-  rv = l2tpv3_interface_enable_disable
-    (vnm, ntohl (mp->sw_if_index), mp->enable_disable);
-
-  BAD_SW_IF_INDEX_LABEL;
-
-  REPLY_MACRO (VL_API_L2TPV3_INTERFACE_ENABLE_DISABLE_REPLY);
-}
-
-static void vl_api_l2tpv3_set_lookup_key_t_handler
-  (vl_api_l2tpv3_set_lookup_key_t * mp)
-{
-  int rv = 0;
-  l2t_main_t *lm = &l2t_main;
-  vl_api_l2tpv3_set_lookup_key_reply_t *rmp;
-
-  if (mp->key > L2T_LOOKUP_SESSION_ID)
-    {
-      rv = VNET_API_ERROR_INVALID_VALUE;
-      goto out;
-    }
-
-  lm->lookup_type = mp->key;
-
-out:
-  REPLY_MACRO (VL_API_L2TPV3_SET_LOOKUP_KEY_REPLY);
-}
-
 static void vl_api_vxlan_add_del_tunnel_t_handler
   (vl_api_vxlan_add_del_tunnel_t * mp)
 {
@@ -3049,109 +2839,6 @@ static void vl_api_vxlan_tunnel_dump_t_handler
     }
 }
 
-static void vl_api_gre_add_del_tunnel_t_handler
-  (vl_api_gre_add_del_tunnel_t * mp)
-{
-  vl_api_gre_add_del_tunnel_reply_t *rmp;
-  int rv = 0;
-  vnet_gre_add_del_tunnel_args_t _a, *a = &_a;
-  u32 outer_fib_id;
-  uword *p;
-  ip4_main_t *im = &ip4_main;
-  u32 sw_if_index = ~0;
-
-  p = hash_get (im->fib_index_by_table_id, ntohl (mp->outer_fib_id));
-  if (!p)
-    {
-      rv = VNET_API_ERROR_NO_SUCH_FIB;
-      goto out;
-    }
-  outer_fib_id = p[0];
-
-  /* Check src & dst are different */
-  if ((mp->is_ipv6 && memcmp (mp->src_address, mp->dst_address, 16) == 0) ||
-      (!mp->is_ipv6 && memcmp (mp->src_address, mp->dst_address, 4) == 0))
-    {
-      rv = VNET_API_ERROR_SAME_SRC_DST;
-      goto out;
-    }
-  memset (a, 0, sizeof (*a));
-
-  a->is_add = mp->is_add;
-  a->teb = mp->teb;
-
-  /* ip addresses sent in network byte order */
-  clib_memcpy (&(a->src), mp->src_address, 4);
-  clib_memcpy (&(a->dst), mp->dst_address, 4);
-
-  a->outer_fib_id = outer_fib_id;
-  rv = vnet_gre_add_del_tunnel (a, &sw_if_index);
-
-out:
-  /* *INDENT-OFF* */
-  REPLY_MACRO2(VL_API_GRE_ADD_DEL_TUNNEL_REPLY,
-  ({
-    rmp->sw_if_index = ntohl (sw_if_index);
-  }));
-  /* *INDENT-ON* */
-}
-
-static void send_gre_tunnel_details
-  (gre_tunnel_t * t, unix_shared_memory_queue_t * q, u32 context)
-{
-  vl_api_gre_tunnel_details_t *rmp;
-  ip4_main_t *im = &ip4_main;
-
-  rmp = vl_msg_api_alloc (sizeof (*rmp));
-  memset (rmp, 0, sizeof (*rmp));
-  rmp->_vl_msg_id = ntohs (VL_API_GRE_TUNNEL_DETAILS);
-  clib_memcpy (rmp->src_address, &(t->tunnel_src), 4);
-  clib_memcpy (rmp->dst_address, &(t->tunnel_dst), 4);
-  rmp->outer_fib_id = htonl (im->fibs[t->outer_fib_index].ft_table_id);
-  rmp->teb = (GRE_TUNNEL_TYPE_TEB == t->type);
-  rmp->sw_if_index = htonl (t->sw_if_index);
-  rmp->context = context;
-
-  vl_msg_api_send_shmem (q, (u8 *) & rmp);
-}
-
-static void
-vl_api_gre_tunnel_dump_t_handler (vl_api_gre_tunnel_dump_t * mp)
-{
-  unix_shared_memory_queue_t *q;
-  gre_main_t *gm = &gre_main;
-  gre_tunnel_t *t;
-  u32 sw_if_index;
-
-  q = vl_api_client_index_to_input_queue (mp->client_index);
-  if (q == 0)
-    {
-      return;
-    }
-
-  sw_if_index = ntohl (mp->sw_if_index);
-
-  if (~0 == sw_if_index)
-    {
-      /* *INDENT-OFF* */
-      pool_foreach (t, gm->tunnels,
-      ({
-        send_gre_tunnel_details(t, q, mp->context);
-      }));
-      /* *INDENT-ON* */
-    }
-  else
-    {
-      if ((sw_if_index >= vec_len (gm->tunnel_index_by_sw_if_index)) ||
-         (~0 == gm->tunnel_index_by_sw_if_index[sw_if_index]))
-       {
-         return;
-       }
-      t = &gm->tunnels[gm->tunnel_index_by_sw_if_index[sw_if_index]];
-      send_gre_tunnel_details (t, q, mp->context);
-    }
-}
-
 static void
 vl_api_l2_patch_add_del_t_handler (vl_api_l2_patch_add_del_t * mp)
 {
@@ -4830,430 +4517,82 @@ static void vl_api_input_acl_set_interface_t_handler
   REPLY_MACRO (VL_API_INPUT_ACL_SET_INTERFACE_REPLY);
 }
 
-static void vl_api_ipsec_spd_add_del_t_handler
-  (vl_api_ipsec_spd_add_del_t * mp)
+static void vl_api_cop_interface_enable_disable_t_handler
+  (vl_api_cop_interface_enable_disable_t * mp)
 {
-#if IPSEC == 0
-  clib_warning ("unimplemented");
-#else
-
-  vlib_main_t *vm __attribute__ ((unused)) = vlib_get_main ();
-  vl_api_ipsec_spd_add_del_reply_t *rmp;
+  vl_api_cop_interface_enable_disable_reply_t *rmp;
   int rv;
+  u32 sw_if_index = ntohl (mp->sw_if_index);
+  int enable_disable;
 
-#if DPDK > 0
-  rv = ipsec_add_del_spd (vm, ntohl (mp->spd_id), mp->is_add);
-#else
-  rv = VNET_API_ERROR_UNIMPLEMENTED;
-#endif
+  VALIDATE_SW_IF_INDEX (mp);
 
-  REPLY_MACRO (VL_API_IPSEC_SPD_ADD_DEL_REPLY);
-#endif
+  enable_disable = (int) mp->enable_disable;
+
+  rv = cop_interface_enable_disable (sw_if_index, enable_disable);
+
+  BAD_SW_IF_INDEX_LABEL;
+
+  REPLY_MACRO (VL_API_COP_INTERFACE_ENABLE_DISABLE_REPLY);
 }
 
-static void vl_api_ipsec_interface_add_del_spd_t_handler
-  (vl_api_ipsec_interface_add_del_spd_t * mp)
+static void vl_api_cop_whitelist_enable_disable_t_handler
+  (vl_api_cop_whitelist_enable_disable_t * mp)
 {
-  vlib_main_t *vm __attribute__ ((unused)) = vlib_get_main ();
-  vl_api_ipsec_interface_add_del_spd_reply_t *rmp;
+  vl_api_cop_whitelist_enable_disable_reply_t *rmp;
+  cop_whitelist_enable_disable_args_t _a, *a = &_a;
+  u32 sw_if_index = ntohl (mp->sw_if_index);
   int rv;
-  u32 sw_if_index __attribute__ ((unused));
-  u32 spd_id __attribute__ ((unused));
-
-  sw_if_index = ntohl (mp->sw_if_index);
-  spd_id = ntohl (mp->spd_id);
 
   VALIDATE_SW_IF_INDEX (mp);
 
-#if IPSEC > 0
-  rv = ipsec_set_interface_spd (vm, sw_if_index, spd_id, mp->is_add);
-#else
-  rv = VNET_API_ERROR_UNIMPLEMENTED;
-#endif
+  a->sw_if_index = sw_if_index;
+  a->ip4 = mp->ip4;
+  a->ip6 = mp->ip6;
+  a->default_cop = mp->default_cop;
+  a->fib_id = ntohl (mp->fib_id);
+
+  rv = cop_whitelist_enable_disable (a);
 
   BAD_SW_IF_INDEX_LABEL;
 
-  REPLY_MACRO (VL_API_IPSEC_INTERFACE_ADD_DEL_SPD_REPLY);
+  REPLY_MACRO (VL_API_COP_WHITELIST_ENABLE_DISABLE_REPLY);
 }
 
-static void vl_api_ipsec_spd_add_del_entry_t_handler
-  (vl_api_ipsec_spd_add_del_entry_t * mp)
+static void
+vl_api_get_node_graph_t_handler (vl_api_get_node_graph_t * mp)
 {
-  vlib_main_t *vm __attribute__ ((unused)) = vlib_get_main ();
-  vl_api_ipsec_spd_add_del_entry_reply_t *rmp;
-  int rv;
-
-#if IPSEC > 0
-  ipsec_policy_t p;
-
-  memset (&p, 0, sizeof (p));
+  int rv = 0;
+  u8 *vector = 0;
+  api_main_t *am = &api_main;
+  vlib_main_t *vm = vlib_get_main ();
+  void *oldheap;
+  vl_api_get_node_graph_reply_t *rmp;
 
-  p.id = ntohl (mp->spd_id);
-  p.priority = ntohl (mp->priority);
-  p.is_outbound = mp->is_outbound;
-  p.is_ipv6 = mp->is_ipv6;
+  pthread_mutex_lock (&am->vlib_rp->mutex);
+  oldheap = svm_push_data_heap (am->vlib_rp);
 
-  if (mp->is_ipv6 || mp->is_ip_any)
-    {
-      clib_memcpy (&p.raddr.start, mp->remote_address_start, 16);
-      clib_memcpy (&p.raddr.stop, mp->remote_address_stop, 16);
-      clib_memcpy (&p.laddr.start, mp->local_address_start, 16);
-      clib_memcpy (&p.laddr.stop, mp->local_address_stop, 16);
-    }
-  else
-    {
-      clib_memcpy (&p.raddr.start.ip4.data, mp->remote_address_start, 4);
-      clib_memcpy (&p.raddr.stop.ip4.data, mp->remote_address_stop, 4);
-      clib_memcpy (&p.laddr.start.ip4.data, mp->local_address_start, 4);
-      clib_memcpy (&p.laddr.stop.ip4.data, mp->local_address_stop, 4);
-    }
-  p.protocol = mp->protocol;
-  p.rport.start = ntohs (mp->remote_port_start);
-  p.rport.stop = ntohs (mp->remote_port_stop);
-  p.lport.start = ntohs (mp->local_port_start);
-  p.lport.stop = ntohs (mp->local_port_stop);
-  /* policy action resolve unsupported */
-  if (mp->policy == IPSEC_POLICY_ACTION_RESOLVE)
-    {
-      clib_warning ("unsupported action: 'resolve'");
-      rv = VNET_API_ERROR_UNIMPLEMENTED;
-      goto out;
-    }
-  p.policy = mp->policy;
-  p.sa_id = ntohl (mp->sa_id);
+  /*
+   * Keep the number of memcpy ops to a minimum (e.g. 1).
+   */
+  vec_validate (vector, 16384);
+  vec_reset_length (vector);
 
-  rv = ipsec_add_del_policy (vm, &p, mp->is_add);
-  if (rv)
-    goto out;
+  /* $$$$ FIXME */
+  vector = vlib_node_serialize (&vm->node_main, vector,
+                               (u32) ~ 0 /* all threads */ ,
+                               1 /* include nexts */ ,
+                               1 /* include stats */ );
 
-  if (mp->is_ip_any)
-    {
-      p.is_ipv6 = 1;
-      rv = ipsec_add_del_policy (vm, &p, mp->is_add);
-    }
-#else
-  rv = VNET_API_ERROR_UNIMPLEMENTED;
-  goto out;
-#endif
+  svm_pop_heap (oldheap);
+  pthread_mutex_unlock (&am->vlib_rp->mutex);
 
-out:
-  REPLY_MACRO (VL_API_IPSEC_SPD_ADD_DEL_ENTRY_REPLY);
-}
-
-static void vl_api_ipsec_sad_add_del_entry_t_handler
-  (vl_api_ipsec_sad_add_del_entry_t * mp)
-{
-  vlib_main_t *vm __attribute__ ((unused)) = vlib_get_main ();
-  vl_api_ipsec_sad_add_del_entry_reply_t *rmp;
-  int rv;
-#if IPSEC > 0
-  ipsec_sa_t sa;
-
-  memset (&sa, 0, sizeof (sa));
-
-  sa.id = ntohl (mp->sad_id);
-  sa.spi = ntohl (mp->spi);
-  /* security protocol AH unsupported */
-  if (mp->protocol == IPSEC_PROTOCOL_AH)
-    {
-      clib_warning ("unsupported security protocol 'AH'");
-      rv = VNET_API_ERROR_UNIMPLEMENTED;
-      goto out;
-    }
-  sa.protocol = mp->protocol;
-  /* check for unsupported crypto-alg */
-  if (mp->crypto_algorithm < IPSEC_CRYPTO_ALG_AES_CBC_128 ||
-      mp->crypto_algorithm >= IPSEC_CRYPTO_N_ALG)
-    {
-      clib_warning ("unsupported crypto-alg: '%U'", format_ipsec_crypto_alg,
-                   mp->crypto_algorithm);
-      rv = VNET_API_ERROR_UNIMPLEMENTED;
-      goto out;
-    }
-  sa.crypto_alg = mp->crypto_algorithm;
-  sa.crypto_key_len = mp->crypto_key_length;
-  clib_memcpy (&sa.crypto_key, mp->crypto_key, sizeof (sa.crypto_key));
-  /* check for unsupported integ-alg */
-#if DPDK_CRYPTO==1
-  if (mp->integrity_algorithm < IPSEC_INTEG_ALG_NONE ||
-#else
-  if (mp->integrity_algorithm < IPSEC_INTEG_ALG_SHA1_96 ||
-#endif
-      mp->integrity_algorithm >= IPSEC_INTEG_N_ALG)
-    {
-      clib_warning ("unsupported integ-alg: '%U'", format_ipsec_integ_alg,
-                   mp->integrity_algorithm);
-      rv = VNET_API_ERROR_UNIMPLEMENTED;
-      goto out;
-    }
-
-#if DPDK_CRYPTO==1
-  /*Special cases, aes-gcm-128 encryption */
-  if (mp->crypto_algorithm == IPSEC_CRYPTO_ALG_AES_GCM_128)
-    {
-      if (mp->integrity_algorithm != IPSEC_INTEG_ALG_NONE
-         && mp->integrity_algorithm != IPSEC_INTEG_ALG_AES_GCM_128)
-       {
-         clib_warning
-           ("unsupported: aes-gcm-128 crypto-alg needs none as integ-alg");
-         rv = VNET_API_ERROR_UNIMPLEMENTED;
-         goto out;
-       }
-      else                     /*set integ-alg internally to aes-gcm-128 */
-       mp->integrity_algorithm = IPSEC_INTEG_ALG_AES_GCM_128;
-    }
-  else if (mp->integrity_algorithm == IPSEC_INTEG_ALG_AES_GCM_128)
-    {
-      clib_warning ("unsupported integ-alg: aes-gcm-128");
-      rv = VNET_API_ERROR_UNIMPLEMENTED;
-      goto out;
-    }
-  else if (mp->integrity_algorithm == IPSEC_INTEG_ALG_NONE)
-    {
-      clib_warning ("unsupported integ-alg: none");
-      rv = VNET_API_ERROR_UNIMPLEMENTED;
-      goto out;
-    }
-#endif
-
-  sa.integ_alg = mp->integrity_algorithm;
-  sa.integ_key_len = mp->integrity_key_length;
-  clib_memcpy (&sa.integ_key, mp->integrity_key, sizeof (sa.integ_key));
-  sa.use_esn = mp->use_extended_sequence_number;
-  sa.is_tunnel = mp->is_tunnel;
-  sa.is_tunnel_ip6 = mp->is_tunnel_ipv6;
-  if (sa.is_tunnel_ip6)
-    {
-      clib_memcpy (&sa.tunnel_src_addr, mp->tunnel_src_address, 16);
-      clib_memcpy (&sa.tunnel_dst_addr, mp->tunnel_dst_address, 16);
-    }
-  else
-    {
-      clib_memcpy (&sa.tunnel_src_addr.ip4.data, mp->tunnel_src_address, 4);
-      clib_memcpy (&sa.tunnel_dst_addr.ip4.data, mp->tunnel_dst_address, 4);
-    }
-
-  rv = ipsec_add_del_sa (vm, &sa, mp->is_add);
-#else
-  rv = VNET_API_ERROR_UNIMPLEMENTED;
-  goto out;
-#endif
-
-out:
-  REPLY_MACRO (VL_API_IPSEC_SAD_ADD_DEL_ENTRY_REPLY);
-}
-
-static void
-vl_api_ikev2_profile_add_del_t_handler (vl_api_ikev2_profile_add_del_t * mp)
-{
-  vl_api_ikev2_profile_add_del_reply_t *rmp;
-  int rv = 0;
-
-#if IPSEC > 0
-  vlib_main_t *vm = vlib_get_main ();
-  clib_error_t *error;
-  u8 *tmp = format (0, "%s", mp->name);
-  error = ikev2_add_del_profile (vm, tmp, mp->is_add);
-  vec_free (tmp);
-  if (error)
-    rv = VNET_API_ERROR_UNSPECIFIED;
-#else
-  rv = VNET_API_ERROR_UNIMPLEMENTED;
-#endif
-
-  REPLY_MACRO (VL_API_IKEV2_PROFILE_ADD_DEL_REPLY);
-}
-
-static void
-  vl_api_ikev2_profile_set_auth_t_handler
-  (vl_api_ikev2_profile_set_auth_t * mp)
-{
-  vl_api_ikev2_profile_set_auth_reply_t *rmp;
-  int rv = 0;
-
-#if IPSEC > 0
-  vlib_main_t *vm = vlib_get_main ();
-  clib_error_t *error;
-  u8 *tmp = format (0, "%s", mp->name);
-  u8 *data = vec_new (u8, mp->data_len);
-  clib_memcpy (data, mp->data, mp->data_len);
-  error = ikev2_set_profile_auth (vm, tmp, mp->auth_method, data, mp->is_hex);
-  vec_free (tmp);
-  vec_free (data);
-  if (error)
-    rv = VNET_API_ERROR_UNSPECIFIED;
-#else
-  rv = VNET_API_ERROR_UNIMPLEMENTED;
-#endif
-
-  REPLY_MACRO (VL_API_IKEV2_PROFILE_SET_AUTH_REPLY);
-}
-
-static void
-vl_api_ikev2_profile_set_id_t_handler (vl_api_ikev2_profile_set_id_t * mp)
-{
-  vl_api_ikev2_profile_add_del_reply_t *rmp;
-  int rv = 0;
-
-#if IPSEC > 0
-  vlib_main_t *vm = vlib_get_main ();
-  clib_error_t *error;
-  u8 *tmp = format (0, "%s", mp->name);
-  u8 *data = vec_new (u8, mp->data_len);
-  clib_memcpy (data, mp->data, mp->data_len);
-  error = ikev2_set_profile_id (vm, tmp, mp->id_type, data, mp->is_local);
-  vec_free (tmp);
-  vec_free (data);
-  if (error)
-    rv = VNET_API_ERROR_UNSPECIFIED;
-#else
-  rv = VNET_API_ERROR_UNIMPLEMENTED;
-#endif
-
-  REPLY_MACRO (VL_API_IKEV2_PROFILE_SET_ID_REPLY);
-}
-
-static void
-vl_api_ikev2_profile_set_ts_t_handler (vl_api_ikev2_profile_set_ts_t * mp)
-{
-  vl_api_ikev2_profile_set_ts_reply_t *rmp;
-  int rv = 0;
-
-#if IPSEC > 0
-  vlib_main_t *vm = vlib_get_main ();
-  clib_error_t *error;
-  u8 *tmp = format (0, "%s", mp->name);
-  error = ikev2_set_profile_ts (vm, tmp, mp->proto, mp->start_port,
-                               mp->end_port, (ip4_address_t) mp->start_addr,
-                               (ip4_address_t) mp->end_addr, mp->is_local);
-  vec_free (tmp);
-  if (error)
-    rv = VNET_API_ERROR_UNSPECIFIED;
-#else
-  rv = VNET_API_ERROR_UNIMPLEMENTED;
-#endif
-
-  REPLY_MACRO (VL_API_IKEV2_PROFILE_SET_TS_REPLY);
-}
-
-static void
-vl_api_ikev2_set_local_key_t_handler (vl_api_ikev2_set_local_key_t * mp)
-{
-  vl_api_ikev2_profile_set_ts_reply_t *rmp;
-  int rv = 0;
-
-#if IPSEC > 0
-  vlib_main_t *vm = vlib_get_main ();
-  clib_error_t *error;
-
-  error = ikev2_set_local_key (vm, mp->key_file);
-  if (error)
-    rv = VNET_API_ERROR_UNSPECIFIED;
-#else
-  rv = VNET_API_ERROR_UNIMPLEMENTED;
-#endif
-
-  REPLY_MACRO (VL_API_IKEV2_SET_LOCAL_KEY_REPLY);
-}
-
-static void
-vl_api_ipsec_sa_set_key_t_handler (vl_api_ipsec_sa_set_key_t * mp)
-{
-  vlib_main_t *vm __attribute__ ((unused)) = vlib_get_main ();
-  vl_api_ipsec_sa_set_key_reply_t *rmp;
-  int rv;
-#if IPSEC > 0
-  ipsec_sa_t sa;
-  sa.id = ntohl (mp->sa_id);
-  sa.crypto_key_len = mp->crypto_key_length;
-  clib_memcpy (&sa.crypto_key, mp->crypto_key, sizeof (sa.crypto_key));
-  sa.integ_key_len = mp->integrity_key_length;
-  clib_memcpy (&sa.integ_key, mp->integrity_key, sizeof (sa.integ_key));
-
-  rv = ipsec_set_sa_key (vm, &sa);
-#else
-  rv = VNET_API_ERROR_UNIMPLEMENTED;
-#endif
-
-  REPLY_MACRO (VL_API_IPSEC_SA_SET_KEY_REPLY);
-}
-
-static void vl_api_cop_interface_enable_disable_t_handler
-  (vl_api_cop_interface_enable_disable_t * mp)
-{
-  vl_api_cop_interface_enable_disable_reply_t *rmp;
-  int rv;
-  u32 sw_if_index = ntohl (mp->sw_if_index);
-  int enable_disable;
-
-  VALIDATE_SW_IF_INDEX (mp);
-
-  enable_disable = (int) mp->enable_disable;
-
-  rv = cop_interface_enable_disable (sw_if_index, enable_disable);
-
-  BAD_SW_IF_INDEX_LABEL;
-
-  REPLY_MACRO (VL_API_COP_INTERFACE_ENABLE_DISABLE_REPLY);
-}
-
-static void vl_api_cop_whitelist_enable_disable_t_handler
-  (vl_api_cop_whitelist_enable_disable_t * mp)
-{
-  vl_api_cop_whitelist_enable_disable_reply_t *rmp;
-  cop_whitelist_enable_disable_args_t _a, *a = &_a;
-  u32 sw_if_index = ntohl (mp->sw_if_index);
-  int rv;
-
-  VALIDATE_SW_IF_INDEX (mp);
-
-  a->sw_if_index = sw_if_index;
-  a->ip4 = mp->ip4;
-  a->ip6 = mp->ip6;
-  a->default_cop = mp->default_cop;
-  a->fib_id = ntohl (mp->fib_id);
-
-  rv = cop_whitelist_enable_disable (a);
-
-  BAD_SW_IF_INDEX_LABEL;
-
-  REPLY_MACRO (VL_API_COP_WHITELIST_ENABLE_DISABLE_REPLY);
-}
-
-static void
-vl_api_get_node_graph_t_handler (vl_api_get_node_graph_t * mp)
-{
-  int rv = 0;
-  u8 *vector = 0;
-  api_main_t *am = &api_main;
-  vlib_main_t *vm = vlib_get_main ();
-  void *oldheap;
-  vl_api_get_node_graph_reply_t *rmp;
-
-  pthread_mutex_lock (&am->vlib_rp->mutex);
-  oldheap = svm_push_data_heap (am->vlib_rp);
-
-  /*
-   * Keep the number of memcpy ops to a minimum (e.g. 1).
-   */
-  vec_validate (vector, 16384);
-  vec_reset_length (vector);
-
-  /* $$$$ FIXME */
-  vector = vlib_node_serialize (&vm->node_main, vector,
-                               (u32) ~ 0 /* all threads */ ,
-                               1 /* include nexts */ ,
-                               1 /* include stats */ );
-
-  svm_pop_heap (oldheap);
-  pthread_mutex_unlock (&am->vlib_rp->mutex);
-
-  /* *INDENT-OFF* */
-  REPLY_MACRO2(VL_API_GET_NODE_GRAPH_REPLY,
-  ({
-    rmp->reply_in_shmem = (uword) vector;
-  }));
-  /* *INDENT-ON* */
+  /* *INDENT-OFF* */
+  REPLY_MACRO2(VL_API_GET_NODE_GRAPH_REPLY,
+  ({
+    rmp->reply_in_shmem = (uword) vector;
+  }));
+  /* *INDENT-ON* */
 }
 
 static void
@@ -6392,97 +5731,6 @@ reply:
   REPLY_MACRO (VL_API_IP_SOURCE_AND_PORT_RANGE_CHECK_INTERFACE_ADD_DEL_REPLY);
 }
 
-static void
-vl_api_ipsec_gre_add_del_tunnel_t_handler (vl_api_ipsec_gre_add_del_tunnel_t *
-                                          mp)
-{
-  vl_api_ipsec_gre_add_del_tunnel_reply_t *rmp;
-  int rv = 0;
-  vnet_ipsec_gre_add_del_tunnel_args_t _a, *a = &_a;
-  u32 sw_if_index = ~0;
-
-  /* Check src & dst are different */
-  if (memcmp (mp->src_address, mp->dst_address, 4) == 0)
-    {
-      rv = VNET_API_ERROR_SAME_SRC_DST;
-      goto out;
-    }
-
-  memset (a, 0, sizeof (*a));
-
-  /* ip addresses sent in network byte order */
-  clib_memcpy (&(a->src), mp->src_address, 4);
-  clib_memcpy (&(a->dst), mp->dst_address, 4);
-  a->is_add = mp->is_add;
-  a->lsa = ntohl (mp->local_sa_id);
-  a->rsa = ntohl (mp->remote_sa_id);
-
-  rv = vnet_ipsec_gre_add_del_tunnel (a, &sw_if_index);
-
-out:
-    /* *INDENT-OFF* */
-    REPLY_MACRO2(VL_API_GRE_ADD_DEL_TUNNEL_REPLY,
-    ({
-        rmp->sw_if_index = ntohl (sw_if_index);
-    }));
-    /* *INDENT-ON* */
-}
-
-static void send_ipsec_gre_tunnel_details
-  (ipsec_gre_tunnel_t * t, unix_shared_memory_queue_t * q, u32 context)
-{
-  vl_api_ipsec_gre_tunnel_details_t *rmp;
-
-  rmp = vl_msg_api_alloc (sizeof (*rmp));
-  memset (rmp, 0, sizeof (*rmp));
-  rmp->_vl_msg_id = ntohs (VL_API_IPSEC_GRE_TUNNEL_DETAILS);
-  clib_memcpy (rmp->src_address, &(t->tunnel_src), 4);
-  clib_memcpy (rmp->dst_address, &(t->tunnel_dst), 4);
-  rmp->sw_if_index = htonl (t->sw_if_index);
-  rmp->local_sa_id = htonl (t->local_sa_id);
-  rmp->remote_sa_id = htonl (t->remote_sa_id);
-  rmp->context = context;
-
-  vl_msg_api_send_shmem (q, (u8 *) & rmp);
-}
-
-static void vl_api_ipsec_gre_tunnel_dump_t_handler
-  (vl_api_ipsec_gre_tunnel_dump_t * mp)
-{
-  unix_shared_memory_queue_t *q;
-  ipsec_gre_main_t *igm = &ipsec_gre_main;
-  ipsec_gre_tunnel_t *t;
-  u32 sw_if_index;
-
-  q = vl_api_client_index_to_input_queue (mp->client_index);
-  if (q == 0)
-    {
-      return;
-    }
-
-  sw_if_index = ntohl (mp->sw_if_index);
-
-  if (~0 == sw_if_index)
-    {
-        /* *INDENT-OFF* */
-        pool_foreach (t, igm->tunnels,
-        ({
-            send_ipsec_gre_tunnel_details(t, q, mp->context);
-        }));
-        /* *INDENT-ON* */
-    }
-  else
-    {
-      if ((sw_if_index >= vec_len (igm->tunnel_index_by_sw_if_index)) ||
-         (~0 == igm->tunnel_index_by_sw_if_index[sw_if_index]))
-       {
-         return;
-       }
-      t = &igm->tunnels[igm->tunnel_index_by_sw_if_index[sw_if_index]];
-      send_ipsec_gre_tunnel_details (t, q, mp->context);
-    }
-}
-
 static void
 vl_api_delete_subif_t_handler (vl_api_delete_subif_t * mp)
 {
@@ -6531,162 +5779,6 @@ static void
 
 }
 
-static void
-vl_api_bfd_udp_add_t_handler (vl_api_bfd_udp_add_t * mp)
-{
-  vl_api_bfd_udp_add_reply_t *rmp;
-  int rv;
-
-  VALIDATE_SW_IF_INDEX (mp);
-
-  ip46_address_t local_addr;
-  memset (&local_addr, 0, sizeof (local_addr));
-  ip46_address_t peer_addr;
-  memset (&peer_addr, 0, sizeof (peer_addr));
-  if (mp->is_ipv6)
-    {
-      clib_memcpy (&local_addr.ip6, mp->local_addr, sizeof (local_addr.ip6));
-      clib_memcpy (&peer_addr.ip6, mp->peer_addr, sizeof (peer_addr.ip6));
-    }
-  else
-    {
-      clib_memcpy (&local_addr.ip4, mp->local_addr, sizeof (local_addr.ip4));
-      clib_memcpy (&peer_addr.ip4, mp->peer_addr, sizeof (peer_addr.ip4));
-    }
-
-  rv = bfd_udp_add_session (clib_net_to_host_u32 (mp->sw_if_index),
-                           clib_net_to_host_u32 (mp->desired_min_tx),
-                           clib_net_to_host_u32 (mp->required_min_rx),
-                           mp->detect_mult, &local_addr, &peer_addr);
-
-  BAD_SW_IF_INDEX_LABEL;
-  REPLY_MACRO (VL_API_BFD_UDP_ADD_REPLY);
-}
-
-static void
-vl_api_bfd_udp_del_t_handler (vl_api_bfd_udp_del_t * mp)
-{
-  vl_api_bfd_udp_del_reply_t *rmp;
-  int rv;
-
-  VALIDATE_SW_IF_INDEX (mp);
-
-  ip46_address_t local_addr;
-  memset (&local_addr, 0, sizeof (local_addr));
-  ip46_address_t peer_addr;
-  memset (&peer_addr, 0, sizeof (peer_addr));
-  if (mp->is_ipv6)
-    {
-      clib_memcpy (&local_addr.ip6, mp->local_addr, sizeof (local_addr.ip6));
-      clib_memcpy (&peer_addr.ip6, mp->peer_addr, sizeof (peer_addr.ip6));
-    }
-  else
-    {
-      clib_memcpy (&local_addr.ip4, mp->local_addr, sizeof (local_addr.ip4));
-      clib_memcpy (&peer_addr.ip4, mp->peer_addr, sizeof (peer_addr.ip4));
-    }
-
-  rv =
-    bfd_udp_del_session (clib_net_to_host_u32 (mp->sw_if_index), &local_addr,
-                        &peer_addr);
-
-  BAD_SW_IF_INDEX_LABEL;
-  REPLY_MACRO (VL_API_BFD_UDP_DEL_REPLY);
-}
-
-void
-send_bfd_udp_session_details (unix_shared_memory_queue_t * q, u32 context,
-                             bfd_session_t * bs)
-{
-  if (bs->transport != BFD_TRANSPORT_UDP4 &&
-      bs->transport != BFD_TRANSPORT_UDP6)
-    {
-      return;
-    }
-
-  vl_api_bfd_udp_session_details_t *mp = vl_msg_api_alloc (sizeof (*mp));
-  memset (mp, 0, sizeof (*mp));
-  mp->_vl_msg_id = ntohs (VL_API_BFD_UDP_SESSION_DETAILS);
-  mp->context = context;
-  mp->bs_index = clib_host_to_net_u32 (bs->bs_idx);
-  mp->state = bs->local_state;
-  bfd_udp_session_t *bus = &bs->udp;
-  bfd_udp_key_t *key = &bus->key;
-  mp->sw_if_index = clib_host_to_net_u32 (key->sw_if_index);
-  mp->is_ipv6 = !(ip46_address_is_ip4 (&key->local_addr));
-  if (mp->is_ipv6)
-    {
-      clib_memcpy (mp->local_addr, &key->local_addr,
-                  sizeof (key->local_addr));
-      clib_memcpy (mp->peer_addr, &key->peer_addr, sizeof (key->peer_addr));
-    }
-  else
-    {
-      clib_memcpy (mp->local_addr, key->local_addr.ip4.data,
-                  sizeof (key->local_addr.ip4.data));
-      clib_memcpy (mp->peer_addr, key->peer_addr.ip4.data,
-                  sizeof (key->peer_addr.ip4.data));
-    }
-
-  vl_msg_api_send_shmem (q, (u8 *) & mp);
-}
-
-void
-bfd_event (bfd_main_t * bm, bfd_session_t * bs)
-{
-  vpe_api_main_t *vam = &vpe_api_main;
-  vpe_client_registration_t *reg;
-  unix_shared_memory_queue_t *q;
-  /* *INDENT-OFF* */
-  pool_foreach (reg, vam->bfd_events_registrations, ({
-                  q = vl_api_client_index_to_input_queue (reg->client_index);
-                  if (q)
-                    {
-                      switch (bs->transport)
-                        {
-                        case BFD_TRANSPORT_UDP4:
-                        /* fallthrough */
-                        case BFD_TRANSPORT_UDP6:
-                          send_bfd_udp_session_details (q, 0, bs);
-                        }
-                    }
-                }));
-  /* *INDENT-ON* */
-}
-
-static void
-vl_api_bfd_udp_session_dump_t_handler (vl_api_bfd_udp_session_dump_t * mp)
-{
-  unix_shared_memory_queue_t *q;
-
-  q = vl_api_client_index_to_input_queue (mp->client_index);
-
-  if (q == 0)
-    return;
-
-  bfd_session_t *bs = NULL;
-  /* *INDENT-OFF* */
-  pool_foreach (bs, bfd_main.sessions, ({
-                  if (bs->transport == BFD_TRANSPORT_UDP4 ||
-                      bs->transport == BFD_TRANSPORT_UDP6)
-                    send_bfd_udp_session_details (q, mp->context, bs);
-                }));
-  /* *INDENT-ON* */
-}
-
-static void
-vl_api_bfd_session_set_flags_t_handler (vl_api_bfd_session_set_flags_t * mp)
-{
-  vl_api_bfd_session_set_flags_reply_t *rmp;
-  int rv;
-
-  rv =
-    bfd_session_set_flags (clib_net_to_host_u32 (mp->bs_index),
-                          mp->admin_up_down);
-
-  REPLY_MACRO (VL_API_BFD_SESSION_SET_FLAGS_REPLY);
-}
-
 static void
 vl_api_punt_t_handler (vl_api_punt_t * mp)
 {
@@ -6773,82 +5865,6 @@ vl_api_flow_classify_dump_t_handler (vl_api_flow_classify_dump_t * mp)
     }
 }
 
-static void
-send_ipsec_spd_details (ipsec_policy_t * p, unix_shared_memory_queue_t * q,
-                       u32 context)
-{
-  vl_api_ipsec_spd_details_t *mp;
-
-  mp = vl_msg_api_alloc (sizeof (*mp));
-  memset (mp, 0, sizeof (*mp));
-  mp->_vl_msg_id = ntohs (VL_API_IPSEC_SPD_DETAILS);
-  mp->context = context;
-
-  mp->spd_id = htonl (p->id);
-  mp->priority = htonl (p->priority);
-  mp->is_outbound = p->is_outbound;
-  mp->is_ipv6 = p->is_ipv6;
-  if (p->is_ipv6)
-    {
-      memcpy (mp->local_start_addr, &p->laddr.start.ip6, 16);
-      memcpy (mp->local_stop_addr, &p->laddr.stop.ip6, 16);
-      memcpy (mp->remote_start_addr, &p->raddr.start.ip6, 16);
-      memcpy (mp->remote_stop_addr, &p->raddr.stop.ip6, 16);
-    }
-  else
-    {
-      memcpy (mp->local_start_addr, &p->laddr.start.ip4, 4);
-      memcpy (mp->local_stop_addr, &p->laddr.stop.ip4, 4);
-      memcpy (mp->remote_start_addr, &p->raddr.start.ip4, 4);
-      memcpy (mp->remote_stop_addr, &p->raddr.stop.ip4, 4);
-    }
-  mp->local_start_port = htons (p->lport.start);
-  mp->local_stop_port = htons (p->lport.stop);
-  mp->remote_start_port = htons (p->rport.start);
-  mp->remote_stop_port = htons (p->rport.stop);
-  mp->protocol = p->protocol;
-  mp->policy = p->policy;
-  mp->sa_id = htonl (p->sa_id);
-  mp->bytes = clib_host_to_net_u64 (p->counter.bytes);
-  mp->packets = clib_host_to_net_u64 (p->counter.packets);
-
-  vl_msg_api_send_shmem (q, (u8 *) & mp);
-}
-
-static void
-vl_api_ipsec_spd_dump_t_handler (vl_api_ipsec_spd_dump_t * mp)
-{
-  unix_shared_memory_queue_t *q;
-  ipsec_main_t *im = &ipsec_main;
-  ipsec_policy_t *policy;
-  ipsec_spd_t *spd;
-  uword *p;
-  u32 spd_index;
-#if IPSEC > 0
-  q = vl_api_client_index_to_input_queue (mp->client_index);
-  if (q == 0)
-    return;
-
-  p = hash_get (im->spd_index_by_spd_id, ntohl (mp->spd_id));
-  if (!p)
-    return;
-
-  spd_index = p[0];
-  spd = pool_elt_at_index (im->spds, spd_index);
-
-  /* *INDENT-OFF* */
-  pool_foreach (policy, spd->policies,
-  ({
-    if (mp->sa_id == ~(0) || ntohl (mp->sa_id) == policy->sa_id)
-      send_ipsec_spd_details (policy, q,
-                              mp->context);}
-    ));
-  /* *INDENT-ON* */
-#else
-  clib_warning ("unimplemented");
-#endif
-}
-
 static void
 vl_api_feature_enable_disable_t_handler (vl_api_feature_enable_disable_t * mp)
 {