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) 72 vl_api_pg_capture_reply_t *rmp;
87 if (hw_if_index != ~0)
106 rv = VNET_API_ERROR_CANNOT_CREATE_PCAP_FILE;
117 vl_api_pg_enable_disable_reply_t *rmp;
121 u32 stream_index = ~0;
141 #define vl_msg_name_crc_list 142 #include <vnet/pg/pg.api.h> 143 #undef vl_msg_name_crc_list 148 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 149 foreach_vl_msg_name_crc_pg;
159 vl_msg_api_set_handlers(VL_API_##N, #n, \ 160 vl_api_##n##_t_handler, \ 162 vl_api_##n##_t_endian, \ 163 vl_api_##n##_t_print, \ 164 sizeof(vl_api_##n##_t), 1);
#define foreach_pg_api_msg
clib_error_t * pg_capture(pg_capture_args_t *a)
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)
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.
u32 pg_interface_add_or_get(pg_main_t *pg, uword stream_index, u8 gso_enabled, u32 gso_size)
static void vl_api_pg_enable_disable_t_handler(vl_api_pg_enable_disable_t *mp)
#define clib_memcpy(d, s, n)
u8 pcap_file_name[pcap_name_length]
PacketGenerator capture packets on given interface request.
#define vec_new(T, N)
Create new vector of given type and length (unspecified alignment, no header).
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.
u8 stream_name[stream_name_length]
API main structure, used by both vpp and binary API clients.
PacketGenerator create interface request.
#define vec_free(V)
Free vector's memory (no header).
static void setup_message_id_table(api_main_t *am)
void pg_enable_disable(u32 stream_index, int is_enable)
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)
pg_interface_t * interfaces