api: remove transport specific code from handlers

This does not update api client code. In other words, if the client
assumes the transport is shmem based, this patch does not change that.
Furthermore, code that checks queue size, for tail dropping, is not
updated.

Done for the following apis:
Plugins
- acl
- gtpu
- memif
- nat
- pppoe
VNET
- bfd
- bier
- tapv2
- vhost user
- dhcp
- flow
- geneve
- ip
- punt
- ipsec/ipsec-gre
- l2
- l2tp
- lisp-cp/one-cp
- lisp-gpe
- map
- mpls
- policer
- session
- span
- udp
- tap
- vxlan/vxlan-gpe
- interface
VPP
- api/api.c
OAM
- oam_api.c
Stats
- stats.c

Change-Id: I0e33ecefb2bdab0295698c0add948068a5a83345
Signed-off-by: Florin Coras <fcoras@cisco.com>
diff --git a/src/vnet/devices/virtio/vhost_user_api.c b/src/vnet/devices/virtio/vhost_user_api.c
index 9ddd338..442d914 100644
--- a/src/vnet/devices/virtio/vhost_user_api.c
+++ b/src/vnet/devices/virtio/vhost_user_api.c
@@ -53,7 +53,7 @@
  */
 static void
 send_sw_interface_event_deleted (vpe_api_main_t * am,
-				 svm_queue_t * q, u32 sw_if_index)
+				 vl_api_registration_t * reg, u32 sw_if_index)
 {
   vl_api_sw_interface_event_t *mp;
 
@@ -65,7 +65,7 @@
   mp->admin_up_down = 0;
   mp->link_up_down = 0;
   mp->deleted = 1;
-  vl_msg_api_send_shmem (q, (u8 *) & mp);
+  vl_api_send_msg (reg, (u8 *) mp);
 }
 
 static void
@@ -127,6 +127,7 @@
   vl_api_delete_vhost_user_if_reply_t *rmp;
   vpe_api_main_t *vam = &vpe_api_main;
   u32 sw_if_index = ntohl (mp->sw_if_index);
+  vl_api_registration_t *reg;
 
   vnet_main_t *vnm = vnet_get_main ();
   vlib_main_t *vm = vlib_get_main ();
@@ -136,18 +137,18 @@
   REPLY_MACRO (VL_API_DELETE_VHOST_USER_IF_REPLY);
   if (!rv)
     {
-      svm_queue_t *q = vl_api_client_index_to_input_queue (mp->client_index);
-      if (!q)
+      reg = vl_api_client_index_to_registration (mp->client_index);
+      if (!reg)
 	return;
 
       vnet_clear_sw_interface_tag (vnm, sw_if_index);
-      send_sw_interface_event_deleted (vam, q, sw_if_index);
+      send_sw_interface_event_deleted (vam, reg, sw_if_index);
     }
 }
 
 static void
 send_sw_interface_vhost_user_details (vpe_api_main_t * am,
-				      svm_queue_t * q,
+				      vl_api_registration_t * reg,
 				      vhost_user_intf_details_t * vui,
 				      u32 context)
 {
@@ -169,7 +170,7 @@
   strncpy ((char *) mp->interface_name,
 	   (char *) vui->if_name, ARRAY_LEN (mp->interface_name) - 1);
 
-  vl_msg_api_send_shmem (q, (u8 *) & mp);
+  vl_api_send_msg (reg, (u8 *) mp);
 }
 
 static void
@@ -182,10 +183,10 @@
   vlib_main_t *vm = vlib_get_main ();
   vhost_user_intf_details_t *ifaces = NULL;
   vhost_user_intf_details_t *vuid = NULL;
-  svm_queue_t *q;
+  vl_api_registration_t *reg;
 
-  q = vl_api_client_index_to_input_queue (mp->client_index);
-  if (q == 0)
+  reg = vl_api_client_index_to_registration (mp->client_index);
+  if (!reg)
     return;
 
   rv = vhost_user_dump_ifs (vnm, vm, &ifaces);
@@ -194,7 +195,7 @@
 
   vec_foreach (vuid, ifaces)
   {
-    send_sw_interface_vhost_user_details (am, q, vuid, mp->context);
+    send_sw_interface_vhost_user_details (am, reg, vuid, mp->context);
   }
   vec_free (ifaces);
 }