*------------------------------------------------------------------
* gtpu_api.c - gtpu api
*
- * Copyright (c) 2016 Cisco and/or its affiliates.
+ * Copyright (c) 2017 Intel 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:
#include <vppinfra/byte_order.h>
#include <vlibmemory/api.h>
-#include <vlibsocket/api.h>
#include <gtpu/gtpu.h>
}
static void send_gtpu_tunnel_details
- (gtpu_tunnel_t * t, unix_shared_memory_queue_t * q, u32 context)
+ (gtpu_tunnel_t * t, vl_api_registration_t * reg, u32 context)
{
vl_api_gtpu_tunnel_details_t *rmp;
ip4_main_t *im4 = &ip4_main;
u8 is_ipv6 = !ip46_address_is_ip4 (&t->dst);
rmp = vl_msg_api_alloc (sizeof (*rmp));
- memset (rmp, 0, sizeof (*rmp));
+ clib_memset (rmp, 0, sizeof (*rmp));
rmp->_vl_msg_id = ntohs (VL_API_GTPU_TUNNEL_DETAILS);
if (is_ipv6)
{
rmp->is_ipv6 = is_ipv6;
rmp->context = context;
- vl_msg_api_send_shmem (q, (u8 *) & rmp);
+ vl_api_send_msg (reg, (u8 *) rmp);
}
static void
vl_api_gtpu_tunnel_dump_t_handler (vl_api_gtpu_tunnel_dump_t * mp)
{
- unix_shared_memory_queue_t *q;
+ vl_api_registration_t *reg;
gtpu_main_t *gtm = >pu_main;
gtpu_tunnel_t *t;
u32 sw_if_index;
- q = vl_api_client_index_to_input_queue (mp->client_index);
- if (q == 0)
- {
- return;
- }
+ reg = vl_api_client_index_to_registration (mp->client_index);
+ if (!reg)
+ return;
sw_if_index = ntohl (mp->sw_if_index);
/* *INDENT-OFF* */
pool_foreach (t, gtm->tunnels,
({
- send_gtpu_tunnel_details(t, q, mp->context);
+ send_gtpu_tunnel_details(t, reg, mp->context);
}));
/* *INDENT-ON* */
}
return;
}
t = >m->tunnels[gtm->tunnel_index_by_sw_if_index[sw_if_index]];
- send_gtpu_tunnel_details (t, q, mp->context);
+ send_gtpu_tunnel_details (t, reg, mp->context);
}
}