44 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 50 #define vl_api_version(n,v) static u32 api_version=(v); 56 #define foreach_vxlan_gpe_plugin_api_msg \ 57 _(VXLAN_GPE_IOAM_ENABLE, vxlan_gpe_ioam_enable) \ 58 _(VXLAN_GPE_IOAM_DISABLE, vxlan_gpe_ioam_disable) \ 59 _(VXLAN_GPE_IOAM_VNI_ENABLE, vxlan_gpe_ioam_vni_enable) \ 60 _(VXLAN_GPE_IOAM_VNI_DISABLE, vxlan_gpe_ioam_vni_disable) \ 61 _(VXLAN_GPE_IOAM_TRANSIT_ENABLE, vxlan_gpe_ioam_transit_enable) \ 62 _(VXLAN_GPE_IOAM_TRANSIT_DISABLE, vxlan_gpe_ioam_transit_disable) \ 69 vl_api_vxlan_gpe_ioam_enable_reply_t *rmp;
89 vl_api_vxlan_gpe_ioam_disable_reply_t *rmp;
108 vl_api_vxlan_gpe_ioam_vni_enable_reply_t *rmp;
110 vxlan4_gpe_tunnel_key_t key4;
122 vni = clib_net_to_host_u32 (mp->
vni);
123 key4.vni = clib_host_to_net_u32 (vni << 8);
149 REPLY_MACRO (VL_API_VXLAN_GPE_IOAM_VNI_ENABLE_REPLY);
157 vl_api_vxlan_gpe_ioam_vni_enable_reply_t *rmp;
159 vxlan4_gpe_tunnel_key_t key4;
170 vni = clib_net_to_host_u32 (mp->
vni);
171 key4.vni = clib_host_to_net_u32 (vni << 8);
196 REPLY_MACRO (VL_API_VXLAN_GPE_IOAM_VNI_DISABLE_REPLY);
203 vl_api_vxlan_gpe_ioam_transit_enable_reply_t *rmp;
205 ip46_address_t dst_addr;
207 clib_memset (&dst_addr.ip4, 0, sizeof (dst_addr.ip4));
218 REPLY_MACRO (VL_API_VXLAN_GPE_IOAM_TRANSIT_ENABLE_REPLY);
225 vl_api_vxlan_gpe_ioam_transit_disable_reply_t *rmp;
227 ip46_address_t dst_addr;
229 clib_memset (&dst_addr.ip4, 0, sizeof (dst_addr.ip4));
239 REPLY_MACRO (VL_API_VXLAN_GPE_IOAM_TRANSIT_DISABLE_REPLY);
248 vl_msg_api_set_handlers((VL_API_##N + sm->msg_id_base), \ 250 vl_api_##n##_t_handler, \ 252 vl_api_##n##_t_endian, \ 253 vl_api_##n##_t_print, \ 254 sizeof(vl_api_##n##_t), 1); 261 #define vl_msg_name_crc_list 263 #undef vl_msg_name_crc_list 268 #define _(id,n,crc) \ 269 vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id + sm->msg_id_base); 270 foreach_vl_msg_name_crc_ioam_vxlan_gpe;
291 name =
format (0,
"ioam_vxlan_gpe_%08x%c", api_version, 0);
307 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)
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.