44 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 50 #define vl_api_version(n,v) static u32 api_version=(v); 62 #define VXLAN_GPE_REPLY_MACRO(t) \ 65 vl_api_client_index_to_input_queue (mp->client_index); \ 69 rmp = vl_msg_api_alloc (sizeof (*rmp)); \ 70 rmp->_vl_msg_id = ntohs((t)+sm->msg_id_base); \ 71 rmp->context = mp->context; \ 72 rmp->retval = ntohl(rv); \ 74 vl_msg_api_send_shmem (q, (u8 *)&rmp); \ 78 #define VXLAN_GPE_REPLY_MACRO2(t, body) \ 81 rv = vl_msg_api_pd_handler (mp, rv); \ 82 q = vl_api_client_index_to_input_queue (mp->client_index); \ 86 rmp = vl_msg_api_alloc (sizeof (*rmp)); \ 87 rmp->_vl_msg_id = ntohs((t)); \ 88 rmp->context = mp->context; \ 89 rmp->retval = ntohl(rv); \ 90 do {body;} while (0); \ 91 vl_msg_api_send_shmem (q, (u8 *)&rmp); \ 97 #define foreach_vxlan_gpe_plugin_api_msg \ 98 _(VXLAN_GPE_IOAM_ENABLE, vxlan_gpe_ioam_enable) \ 99 _(VXLAN_GPE_IOAM_DISABLE, vxlan_gpe_ioam_disable) \ 100 _(VXLAN_GPE_IOAM_VNI_ENABLE, vxlan_gpe_ioam_vni_enable) \ 101 _(VXLAN_GPE_IOAM_VNI_DISABLE, vxlan_gpe_ioam_vni_disable) \ 102 _(VXLAN_GPE_IOAM_TRANSIT_ENABLE, vxlan_gpe_ioam_transit_enable) \ 103 _(VXLAN_GPE_IOAM_TRANSIT_DISABLE, vxlan_gpe_ioam_transit_disable) \ 110 vl_api_vxlan_gpe_ioam_enable_reply_t *rmp;
131 vl_api_vxlan_gpe_ioam_disable_reply_t *rmp;
151 vl_api_vxlan_gpe_ioam_vni_enable_reply_t *rmp;
154 vxlan4_gpe_tunnel_key_t key4;
166 vni = clib_net_to_host_u32 (mp->
vni);
167 key4.vni = clib_host_to_net_u32 (vni << 8);
201 vl_api_vxlan_gpe_ioam_vni_enable_reply_t *rmp;
204 vxlan4_gpe_tunnel_key_t key4;
215 vni = clib_net_to_host_u32 (mp->
vni);
216 key4.vni = clib_host_to_net_u32 (vni << 8);
248 vl_api_vxlan_gpe_ioam_transit_enable_reply_t *rmp;
250 ip46_address_t dst_addr;
252 clib_memset (&dst_addr.ip4, 0, sizeof (dst_addr.ip4));
270 vl_api_vxlan_gpe_ioam_transit_disable_reply_t *rmp;
272 ip46_address_t dst_addr;
274 clib_memset (&dst_addr.ip4, 0, sizeof (dst_addr.ip4));
293 vl_msg_api_set_handlers((VL_API_##N + sm->msg_id_base), \ 295 vl_api_##n##_t_handler, \ 297 vl_api_##n##_t_endian, \ 298 vl_api_##n##_t_print, \ 299 sizeof(vl_api_##n##_t), 1); 306 #define vl_msg_name_crc_list 308 #undef vl_msg_name_crc_list 313 #define _(id,n,crc) \ 314 vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id + sm->msg_id_base); 315 foreach_vl_msg_name_crc_ioam_vxlan_gpe;
336 name =
format (0,
"ioam_vxlan_gpe_%08x%c", api_version, 0);
352 vxlan_gpe_decap_node =
clib_error_t * vxlan_gpe_ioam_enable(int has_trace_option, int has_pot_option, int has_ppc_option)
static void vl_api_vxlan_gpe_ioam_transit_disable_t_handler(vl_api_vxlan_gpe_ioam_transit_disable_t *mp)
Disable iOAM for VXLAN-GPE transit.
vnet_main_t * vnet_get_main(void)
vlib_main_t * vlib_main
State convenience vlib_main_t.
vlib_node_registration_t vxlan_gpe_decap_ioam_v4_node
(constructor) VLIB_REGISTER_NODE (vxlan_gpe_decap_ioam_v4_node)
iOAM for VxLAN-GPE disable
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static f64 vlib_time_now(vlib_main_t *vm)
#define VXLAN_GPE_REPLY_MACRO(t)
int vxlan_gpe_enable_disable_ioam_for_dest(vlib_main_t *vm, ip46_address_t dst_addr, u32 outer_fib_index, u8 is_ipv4, u8 is_add)
vxlan_gpe_ioam_sw_interface_t * sw_interfaces
static void setup_message_id_table(vxlan_gpe_ioam_main_t *sm, api_main_t *am)
clib_error_t * vxlan_gpe_ioam_clear(vxlan_gpe_tunnel_t *t, int has_trace_option, int has_pot_option, int has_ppc_option, u8 ipv6_set)
void vxlan_gpe_ioam_interface_init(void)
static uword vlib_node_add_next(vlib_main_t *vm, uword node, uword next_node)
iOAM Over VxLAN-GPE - Set iOAM transport for VxLAN-GPE
vlib_node_registration_t vxlan_gpe_encap_ioam_v4_node
(constructor) VLIB_REGISTER_NODE (vxlan_gpe_encap_ioam_v4_node)
#define clib_memcpy(d, s, n)
clib_error_t * vxlan_gpe_ioam_disable(int has_trace_option, int has_pot_option, int has_ppc_option)
#define VLIB_INIT_FUNCTION(x)
#define vec_new(T, N)
Create new vector of given type and length (unspecified alignment, no header).
int vxlan_gpe_ioam_disable_for_dest(vlib_main_t *vm, ip46_address_t dst_addr, u32 outer_fib_index, u8 ipv4_set)
static void vl_api_vxlan_gpe_ioam_vni_disable_t_handler(vl_api_vxlan_gpe_ioam_vni_disable_t *mp)
vxlan_gpe_ioam_main_t vxlan_gpe_ioam_main
Aggregrate type for a prefix.
void vxlan_gpe_register_decap_protocol(u8 protocol_id, uword next_node_index)
Disable iOAM for a VNI (VXLAN-GPE)
Enable iOAM for a VXLAN-GPE transit.
#define hash_create_mem(elts, key_bytes, value_bytes)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static void vl_api_vxlan_gpe_ioam_enable_t_handler(vl_api_vxlan_gpe_ioam_enable_t *mp)
Struct for VXLAN GPE tunnel.
vxlan_gpe_main_t vxlan_gpe_main
static void vl_api_vxlan_gpe_ioam_disable_t_handler(vl_api_vxlan_gpe_ioam_disable_t *mp)
API main structure, used by both vpp and binary API clients.
clib_error_t * vxlan_gpe_ioam_set(vxlan_gpe_tunnel_t *t, int has_trace_option, int has_pot_option, int has_ppc_option, u8 ipv6_set)
#define vec_free(V)
Free vector's memory (no header).
#define foreach_vxlan_gpe_plugin_api_msg
vlib_node_t * vlib_get_node_by_name(vlib_main_t *vm, u8 *name)
Struct for VXLAN GPE node state.
#define clib_error_report(e)
vxlan_gpe_tunnel_t * tunnels
vector of encap tunnel instances
Enable iOAM for a VNI (VXLAN-GPE)
uword * vxlan4_gpe_tunnel_by_key
lookup IPv4 VXLAN GPE tunnel by key
#define clib_error_get_code(err)
static void vl_api_vxlan_gpe_ioam_vni_enable_t_handler(vl_api_vxlan_gpe_ioam_vni_enable_t *mp)
#define hash_get_mem(h, key)
static clib_error_t * vxlan_gpe_init(vlib_main_t *vm)
vlib_node_registration_t vxlan_gpe_encap_node
(constructor) VLIB_REGISTER_NODE (vxlan_gpe_encap_node)
static clib_error_t * vxlan_gpe_plugin_api_hookup(vlib_main_t *vm)
vnet_main_t * vnet_main
State convenience vnet_main_t.
static void vl_api_vxlan_gpe_ioam_transit_enable_t_handler(vl_api_vxlan_gpe_ioam_transit_enable_t *mp)
u16 vl_msg_api_get_msg_ids(const char *name, int n)
static uword pool_elts(void *v)
Number of active elements in a pool.