33 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 41 #define foreach_udp_api_msg \ 42 _(UDP_ENCAP_ADD_DEL, udp_encap_add_del) \ 43 _(UDP_ENCAP_DUMP, udp_encap_dump) 53 memset (mp, 0,
sizeof (*mp));
54 mp->_vl_msg_id = ntohs (VL_API_UDP_ENCAP_DETAILS);
104 vl_api_udp_encap_add_del_reply_t *rmp;
105 ip46_address_t src_ip, dst_ip;
106 u32 fib_index, table_id, ue_id;
110 ue_id = ntohl (mp->
id);
118 rv = VNET_API_ERROR_NO_SUCH_TABLE;
149 #define vl_msg_name_crc_list 150 #include <vnet/udp/udp.api.h> 151 #undef vl_msg_name_crc_list 156 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 157 foreach_vl_msg_name_crc_udp;
167 vl_msg_api_set_handlers(VL_API_##N, #n, \ 168 vl_api_##n##_t_handler, \ 170 vl_api_##n##_t_endian, \ 171 vl_api_##n##_t_print, \ 172 sizeof(vl_api_##n##_t), 1); fib_protocol_t ue_ip_proto
the protocol of the IP header imposed
#define foreach_udp_api_msg
The UDP encap represenation.
udp_encap_t * udp_encap_pool
Pool of encaps.
static clib_error_t * udp_api_hookup(vlib_main_t *vm)
VLIB_API_INIT_FUNCTION(udp_api_hookup)
static void vl_api_udp_encap_dump_t_handler(vl_api_udp_encap_dump_t *mp, vlib_main_t *vm)
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
void * vl_msg_api_alloc(int nbytes)
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
u32 ue_id
The ID given by the user/client.
static void send_udp_encap_details(const udp_encap_t *ue, vl_api_registration_t *reg, u32 context)
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
struct udp_encap_t_::@335::@336 ip4
u32 fib_table_find(fib_protocol_t proto, u32 table_id)
Get the index of the FIB for a Table-ID.
void udp_encap_unlock(u32 id)
index_t udp_encap_add_and_lock(u32 id, fib_protocol_t proto, index_t fib_index, const ip46_address_t *src_ip, const ip46_address_t *dst_ip, u16 src_port, u16 dst_port, udp_encap_fixup_flags_t flags)
API main structure, used by both vpp and binary API clients.
An API client registration, only in vpp/vlib.
index_t ue_fib_index
The FIB index in which the encap destination resides.
u32 ft_table_id
Table ID (hash key) for this FIB.
#define clib_memcpy(a, b, c)
struct udp_encap_t_::@335::@337 ip6
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
static void setup_message_id_table(api_main_t *am)
Add / del table request A table can be added multiple times, but need be deleted only once...
static void vl_api_udp_encap_add_del_t_handler(vl_api_udp_encap_add_del_t *mp, vlib_main_t *vm)
fib_table_t * fib_table_get(fib_node_index_t index, fib_protocol_t proto)
Get a pointer to a FIB table.
A protocol Independent FIB table.
union udp_encap_t_::@335 ue_hdrs
The headers to paint, in packet painting order.