36 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 44 #define foreach_pg_api_msg \ 45 _(PG_CREATE_INTERFACE, pg_create_interface) \ 46 _(PG_CAPTURE, pg_capture) \ 47 _(PG_ENABLE_DISABLE, pg_enable_disable) \ 48 _(PG_INTERFACE_ENABLE_DISABLE_COALESCE, pg_interface_enable_disable_coalesce) 74 vl_api_pg_interface_enable_disable_coalesce_reply_t *rmp;
94 rv = VNET_API_ERROR_CANNOT_ENABLE_DISABLE_FEATURE;
98 rv = VNET_API_ERROR_NO_MATCHING_INTERFACE;
102 REPLY_MACRO (VL_API_PG_INTERFACE_ENABLE_DISABLE_COALESCE_REPLY);
108 vl_api_pg_capture_reply_t *rmp;
117 u32 hw_if_index = ~0;
123 if (hw_if_index != ~0)
126 char *pcap_file_name =
140 rv = VNET_API_ERROR_CANNOT_CREATE_PCAP_FILE;
151 vl_api_pg_enable_disable_reply_t *rmp;
155 u32 stream_index = ~0;
173 #define vl_msg_name_crc_list 174 #include <vnet/pg/pg.api.h> 175 #undef vl_msg_name_crc_list 180 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 181 foreach_vl_msg_name_crc_pg;
191 vl_msg_api_set_handlers(VL_API_##N, #n, \ 192 vl_api_##n##_t_handler, \ 194 vl_api_##n##_t_endian, \ 195 vl_api_##n##_t_print, \ 196 sizeof(vl_api_##n##_t), 1);
#define foreach_pg_api_msg
u32 pg_interface_add_or_get(pg_main_t *pg, uword stream_index, u8 gso_enabled, u32 gso_size, u8 coalesce_enabled)
vl_api_interface_index_t sw_if_index
void pg_interface_enable_disable_coalesce(pg_interface_t *pi, u8 enable, u32 tx_node_index)
vnet_main_t * vnet_get_main(void)
static vnet_hw_interface_t * vnet_get_sup_hw_interface(vnet_main_t *vnm, u32 sw_if_index)
vnet_interface_main_t interface_main
#define REPLY_MACRO2(t, body)
vl_api_interface_index_t sw_if_index
uword * stream_index_by_name
#define vec_terminate_c_string(V)
(If necessary) NULL terminate a vector containing a c-string.
VLIB_API_INIT_FUNCTION(pg_api_hookup)
Enable / disable packet generator request.
static void vl_api_pg_enable_disable_t_handler(vl_api_pg_enable_disable_t *mp)
PacketGenerator capture packets on given interface request.
description fragment has unexpected format
vl_api_interface_index_t interface_id
static clib_error_t * pg_api_hookup(vlib_main_t *vm)
uword * hw_interface_by_name
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
PacketGenerator interface enable/disable packet coalesce.
clib_error_t * pg_capture(pg_capture_args_t *a)
u32 vl_api_string_len(vl_api_string_t *astr)
vl_api_interface_index_t interface_id
API main structure, used by both vpp and binary API clients.
#define BAD_SW_IF_INDEX_LABEL
PacketGenerator create interface request.
bool is_enabled[default=true]
#define vec_free(V)
Free vector's memory (no header).
static vnet_hw_interface_t * vnet_get_sup_hw_interface_api_visible_or_null(vnet_main_t *vnm, u32 sw_if_index)
static void setup_message_id_table(api_main_t *am)
char * vl_api_from_api_to_new_c_string(vl_api_string_t *astr)
bool is_enabled[default=true]
static void vl_api_pg_create_interface_t_handler(vl_api_pg_create_interface_t *mp)
#define clib_error_report(e)
PacketGenerator create interface response.
static void vl_api_pg_capture_t_handler(vl_api_pg_capture_t *mp)
#define hash_get_mem(h, key)
static api_main_t * vlibapi_get_main(void)
void pg_enable_disable(u32 stream_index, int is_enable)
u8 * vl_api_from_api_to_new_vec(void *mp, vl_api_string_t *astr)
static void vl_api_pg_interface_enable_disable_coalesce_t_handler(vl_api_pg_interface_enable_disable_coalesce_t *mp)
pg_interface_t * interfaces
vl_api_interface_index_t sw_if_index
#define VALIDATE_SW_IF_INDEX(mp)