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) 73 vl_api_pg_capture_reply_t *rmp;
88 if (hw_if_index != ~0)
107 rv = VNET_API_ERROR_CANNOT_CREATE_PCAP_FILE;
118 vl_api_pg_enable_disable_reply_t *rmp;
122 u32 stream_index = ~0;
142 #define vl_msg_name_crc_list 143 #include <vnet/pg/pg.api.h> 144 #undef vl_msg_name_crc_list 149 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 150 foreach_vl_msg_name_crc_pg;
160 vl_msg_api_set_handlers(VL_API_##N, #n, \ 161 vl_api_##n##_t_handler, \ 163 vl_api_##n##_t_endian, \ 164 vl_api_##n##_t_print, \ 165 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.
static void vl_api_pg_enable_disable_t_handler(vl_api_pg_enable_disable_t *mp)
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]
u32 pg_interface_add_or_get(pg_main_t *pg, uword stream_index)
API main structure, used by both vpp and binary API clients.
PacketGenerator create interface request.
void stats_dslock_with_hint(int hint, int tag)
#define vec_free(V)
Free vector's memory (no header).
static void setup_message_id_table(api_main_t *am)
#define clib_memcpy(a, b, c)
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
void stats_dsunlock(void)