35 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 42 #define foreach_punt_api_msg \ 44 _(PUNT_SOCKET_REGISTER, punt_socket_register) \ 45 _(PUNT_SOCKET_DEREGISTER, punt_socket_deregister) 50 vl_api_punt_reply_t *rmp;
89 rmp->_vl_msg_id = htons (VL_API_PUNT_SOCKET_REGISTER_REPLY);
101 vl_api_punt_socket_deregister_reply_t *rmp;
120 rmp->_vl_msg_id = htons (VL_API_PUNT_SOCKET_DEREGISTER_REPLY);
122 rmp->retval = htonl (rv);
126 #define vl_msg_name_crc_list 127 #include <vnet/ip/punt.api.h> 128 #undef vl_msg_name_crc_list 133 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 134 foreach_vl_msg_name_crc_punt;
144 vl_msg_api_set_handlers(VL_API_##N, #n, \ 145 vl_api_##n##_t_handler, \ 147 vl_api_##n##_t_endian, \ 148 vl_api_##n##_t_print, \ 149 sizeof(vl_api_##n##_t), 1);
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
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 setup_message_id_table(api_main_t *am)
static void vl_api_punt_socket_deregister_t_handler(vl_api_punt_socket_deregister_t *mp)
static void vl_api_punt_t_handler(vl_api_punt_t *mp)
API main structure, used by both vpp and binary API clients.
An API client registration, only in vpp/vlib.
clib_error_t * vnet_punt_socket_add(vlib_main_t *vm, u32 header_version, bool is_ip4, u8 protocol, u16 port, char *client_pathname)
Definitions for punt infrastructure.
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
char * vnet_punt_get_server_pathname(void)
VLIB_API_INIT_FUNCTION(punt_api_hookup)
static clib_error_t * punt_api_hookup(vlib_main_t *vm)
clib_error_t * vnet_punt_socket_del(vlib_main_t *vm, bool is_ip4, u8 l4_protocol, u16 port)
#define clib_error_report(e)
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_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 traffic to the host.