38 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 45 #define foreach_vpe_api_msg \ 46 _(AF_PACKET_CREATE, af_packet_create) \ 47 _(AF_PACKET_DELETE, af_packet_delete) \ 48 _(AF_PACKET_SET_L4_CKSUM_OFFLOAD, af_packet_set_l4_cksum_offload) \ 49 _(AF_PACKET_DUMP, af_packet_dump) 57 u8 *host_if_name = NULL;
72 rmp->
sw_if_index = clib_host_to_net_u32(sw_if_index);
81 vl_api_af_packet_delete_reply_t *rmp;
83 u8 *host_if_name = NULL;
100 vl_api_af_packet_delete_reply_t *rmp;
104 REPLY_MACRO (VL_API_AF_PACKET_SET_L4_CKSUM_OFFLOAD_REPLY);
115 mp->_vl_msg_id = htons (VL_API_AF_PACKET_DETAILS);
158 #define vl_msg_name_crc_list 160 #undef vl_msg_name_crc_list 165 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 166 foreach_vl_msg_name_crc_af_packet;
176 vl_msg_api_set_handlers(VL_API_##N, #n, \ 177 vl_api_##n##_t_handler, \ 179 vl_api_##n##_t_endian, \ 180 vl_api_##n##_t_print, \ 181 sizeof(vl_api_##n##_t), 1);
static void vl_api_af_packet_create_t_handler(vl_api_af_packet_create_t *mp)
Set l4 offload ckecksum calculation.
int af_packet_set_l4_cksum_offload(vlib_main_t *vm, u32 sw_if_index, u8 set)
#define REPLY_MACRO2(t, body)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
Dump af_packet interfaces request.
int af_packet_dump_ifs(af_packet_if_detail_t **out_af_packet_ifs)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
void * vl_msg_api_alloc(int nbytes)
#define clib_memcpy(d, s, n)
#define foreach_vpe_api_msg
Create host-interface response.
vl_api_interface_index_t sw_if_index
Reply for af_packet dump request.
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)
VLIB_API_INIT_FUNCTION(af_packet_api_hookup)
static void af_packet_send_details(vpe_api_main_t *am, vl_api_registration_t *reg, af_packet_if_detail_t *af_packet_if, u32 context)
static void setup_message_id_table(api_main_t *am)
static vlib_main_t * vlib_get_main(void)
static void vl_api_af_packet_delete_t_handler(vl_api_af_packet_delete_t *mp)
static clib_error_t * af_packet_api_hookup(vlib_main_t *vm)
#define vec_foreach(var, vec)
Vector iterator.
int af_packet_create_if(vlib_main_t *vm, u8 *host_if_name, u8 *hw_addr_set, u32 *sw_if_index)
vpe_api_main_t vpe_api_main
static void vl_api_af_packet_set_l4_cksum_offload_t_handler(vl_api_af_packet_set_l4_cksum_offload_t *mp)
static void vl_api_af_packet_dump_t_handler(vl_api_af_packet_dump_t *mp)
int af_packet_delete_if(vlib_main_t *vm, u8 *host_if_name)