35 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 42 #define foreach_punt_api_msg \ 43 _(SET_PUNT, set_punt) \ 44 _(PUNT_SOCKET_REGISTER, punt_socket_register) \ 45 _(PUNT_SOCKET_DEREGISTER, punt_socket_deregister) \ 46 _(PUNT_DUMP, punt_dump) \ 47 _(PUNT_SOCKET_DUMP, punt_socket_dump) 52 vl_api_set_punt_reply_t *rmp;
98 rmp->_vl_msg_id = htons (VL_API_PUNT_SOCKET_REGISTER_REPLY);
118 mp->_vl_msg_id = ntohs (VL_API_PUNT_SOCKET_DETAILS);
133 int rv __attribute__ ((unused)) = 0;
152 vl_api_punt_socket_deregister_reply_t *rmp;
171 rmp->_vl_msg_id = htons (VL_API_PUNT_SOCKET_DEREGISTER_REPLY);
173 rmp->retval = htonl (rv);
177 #define vl_msg_name_crc_list 178 #include <vnet/ip/punt.api.h> 179 #undef vl_msg_name_crc_list 184 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 185 foreach_vl_msg_name_crc_punt;
195 vl_msg_api_set_handlers(VL_API_##N, #n, \ 196 vl_api_##n##_t_handler, \ 198 vl_api_##n##_t_endian, \ 199 vl_api_##n##_t_print, \ 200 sizeof(vl_api_##n##_t), 1);
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
clib_error_t * vnet_punt_add_del(vlib_main_t *vm, u8 ipv, u8 protocol, u16 port, bool is_add)
Request IP traffic punt to the local TCP/IP stack.
punt_socket_detail_t * punt_socket_entries(u8 ipv)
static void vl_api_punt_socket_register_t_handler(vl_api_punt_socket_register_t *mp)
void * vl_msg_api_alloc(int nbytes)
static void vl_api_set_punt_t_handler(vl_api_set_punt_t *mp)
static void setup_message_id_table(api_main_t *am)
clib_error_t * vnet_punt_socket_del(vlib_main_t *vm, bool is_ip4, u8 l4_protocol, u16 port)
void send_punt_socket_details(vl_api_registration_t *reg, u32 context, punt_socket_detail_t *p)
static void vl_api_punt_socket_dump_t_handler(vl_api_punt_socket_dump_t *mp)
static void vl_api_punt_socket_deregister_t_handler(vl_api_punt_socket_deregister_t *mp)
API main structure, used by both vpp and binary API clients.
An API client registration, only in vpp/vlib.
#define vec_free(V)
Free vector's memory (no header).
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
static void vl_api_punt_dump_t_handler(vl_api_punt_dump_t *mp)
VLIB_API_INIT_FUNCTION(punt_api_hookup)
static clib_error_t * punt_api_hookup(vlib_main_t *vm)
#define clib_error_report(e)
Punt traffic to the host.
Punt traffic to the host via socket.
#define foreach_punt_api_msg
static vlib_main_t * vlib_get_main(void)
clib_error_t * vnet_punt_socket_add(vlib_main_t *vm, u32 header_version, bool is_ip4, u8 protocol, u16 port, char *client_pathname)
#define vec_foreach(var, vec)
Vector iterator.
char * vnet_punt_get_server_pathname(void)
Definitions for punt infrastructure.