|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
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 =
130 a->hw_if_index = hw_if_index;
131 a->dev_instance =
hi->dev_instance;
133 a->pcap_file_name = pcap_file_name;
134 a->count = ntohl (mp->
count);
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);
void pg_interface_enable_disable_coalesce(pg_interface_t *pi, u8 enable, u32 tx_node_index)
vnet_interface_main_t * im
#define VALIDATE_SW_IF_INDEX(mp)
VLIB_API_INIT_FUNCTION(pg_api_hookup)
bool is_enabled[default=true]
#define REPLY_MACRO2(t, body)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static void vl_api_pg_enable_disable_t_handler(vl_api_pg_enable_disable_t *mp)
#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)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
clib_error_t * pg_capture(pg_capture_args_t *a)
#define clib_error_report(e)
vl_api_interface_index_t sw_if_index
Enable / disable packet generator request.
PacketGenerator interface enable/disable packet coalesce.
bool is_enabled[default=true]
vnet_main_t * vnet_get_main(void)
vl_api_interface_index_t interface_id
static void setup_message_id_table(api_main_t *am)
vl_api_interface_index_t interface_id
static vnet_hw_interface_t * vnet_get_sup_hw_interface_api_visible_or_null(vnet_main_t *vnm, u32 sw_if_index)
PacketGenerator capture packets on given interface request.
static api_main_t * vlibapi_get_main(void)
PacketGenerator create interface request.
static clib_error_t * pg_api_hookup(vlib_main_t *vm)
u32 vl_api_string_len(vl_api_string_t *astr)
#define BAD_SW_IF_INDEX_LABEL
API main structure, used by both vpp and binary API clients.
#define vec_free(V)
Free vector's memory (no header).
pg_interface_t * interfaces
#define hash_get_mem(h, key)
uword * stream_index_by_name
description fragment has unexpected format
PacketGenerator create interface response.
void pg_enable_disable(u32 stream_index, int is_enable)
static vnet_hw_interface_t * vnet_get_sup_hw_interface(vnet_main_t *vnm, u32 sw_if_index)
static void vl_api_pg_create_interface_t_handler(vl_api_pg_create_interface_t *mp)
uword * hw_interface_by_name
u8 * vl_api_from_api_to_new_vec(void *mp, vl_api_string_t *astr)
#define vec_terminate_c_string(V)
(If necessary) NULL terminate a vector containing a c-string.
static void vl_api_pg_capture_t_handler(vl_api_pg_capture_t *mp)
static void vl_api_pg_interface_enable_disable_coalesce_t_handler(vl_api_pg_interface_enable_disable_coalesce_t *mp)
vl_api_interface_index_t sw_if_index
char * vl_api_from_api_to_new_c_string(vl_api_string_t *astr)
vnet_interface_main_t interface_main
vl_api_interface_index_t sw_if_index