31 #define vl_msg_id(n,h) n, 34 #include <gtpu/gtpu.api.h> 42 #include <gtpu/gtpu.api.h> 47 #include <gtpu/gtpu.api.h> 51 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 53 #include <gtpu/gtpu.api.h> 57 #define vl_api_version(n,v) static u32 api_version=(v); 58 #include <gtpu/gtpu.api.h> 61 #define vl_msg_name_crc_list 62 #include <gtpu/gtpu.api.h> 63 #undef vl_msg_name_crc_list 65 #define REPLY_MSG_ID_BASE gtm->msg_id_base 72 vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id + gtm->msg_id_base); 73 foreach_vl_msg_name_crc_gtpu;
77 #define foreach_gtpu_plugin_api_msg \ 78 _(SW_INTERFACE_SET_GTPU_BYPASS, sw_interface_set_gtpu_bypass) \ 79 _(GTPU_ADD_DEL_TUNNEL, gtpu_add_del_tunnel) \ 80 _(GTPU_TUNNEL_DUMP, gtpu_tunnel_dump) 96 REPLY_MACRO (VL_API_SW_INTERFACE_SET_GTPU_BYPASS_REPLY);
110 rv = VNET_API_ERROR_NO_SUCH_FIB;
118 .encap_fib_index = p[0],
120 .teid = ntohl (mp->
teid),
128 rv = VNET_API_ERROR_SAME_SRC_DST;
134 rv = VNET_API_ERROR_INVALID_SW_IF_INDEX;
161 rmp->_vl_msg_id = ntohs (VL_API_GTPU_TUNNEL_DETAILS + gtm->
msg_id_base);
198 if (~0 == sw_if_index)
203 send_gtpu_tunnel_details(t, reg, mp->context);
230 vl_msg_api_set_handlers((VL_API_##N + gtm->msg_id_base), \ 232 vl_api_##n##_t_handler, \ 234 vl_api_##n##_t_endian, \ 235 vl_api_##n##_t_print, \ 236 sizeof(vl_api_##n##_t), 1); static void setup_message_id_table(gtpu_main_t *gtm, api_main_t *am)
static void send_gtpu_tunnel_details(gtpu_tunnel_t *t, vl_api_registration_t *reg, u32 context)
u32 * tunnel_index_by_sw_if_index
#define REPLY_MACRO2(t, body)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
#define foreach_gtpu_plugin_api_msg
void * vl_msg_api_alloc(int nbytes)
#define ip46_address_cmp(ip46_1, ip46_2)
static void vl_api_sw_interface_set_gtpu_bypass_t_handler(vl_api_sw_interface_set_gtpu_bypass_t *mp)
static uword ip46_address_is_multicast(const ip46_address_t *a)
static clib_error_t * gtpu_api_hookup(vlib_main_t *vm)
static void vl_api_gtpu_add_del_tunnel_t_handler(vl_api_gtpu_add_del_tunnel_t *mp)
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
vl_api_interface_index_t sw_if_index
int vnet_gtpu_add_del_tunnel(vnet_gtpu_add_del_tunnel_args_t *a, u32 *sw_if_indexp)
reply for set or delete an GTPU tunnel
uword * fib_index_by_table_id
Hash table mapping table id to fib index.
Interface set gtpu-bypass request.
API main structure, used by both vpp and binary API clients.
#define ip46_address_is_ip4(ip46)
An API client registration, only in vpp/vlib.
#define BAD_SW_IF_INDEX_LABEL
static uword vnet_sw_if_index_is_api_valid(u32 sw_if_index)
u32 ft_table_id
Table ID (hash key) for this FIB.
Interface set gtpu-bypass response.
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
static void vl_api_gtpu_tunnel_dump_t_handler(vl_api_gtpu_tunnel_dump_t *mp)
static ip46_address_t to_ip46(u32 is_ipv6, u8 *buf)
VLIB_API_INIT_FUNCTION(gtpu_api_hookup)
void vnet_int_gtpu_bypass_mode(u32 sw_if_index, u8 is_ip6, u8 is_enable)
dump details of an GTPU tunnel
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
ip4_main_t ip4_main
Global ip4 main structure.
struct fib_table_t_ * fibs
Vector of FIBs.
Set or delete an GTPU tunnel.
struct fib_table_t_ * fibs
#define VALIDATE_SW_IF_INDEX(mp)
u16 vl_msg_api_get_msg_ids(const char *name, int n)