|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
34 #include <memif/memif.api_enum.h>
35 #include <memif/memif.api_types.h>
37 #define REPLY_MSG_ID_BASE mm->msg_id_base
53 vl_api_memif_socket_filename_add_del_reply_t *rmp;
60 socket_id = clib_net_to_host_u32 (mp->
socket_id);
61 if (socket_id == 0 || socket_id == ~0)
63 rv = VNET_API_ERROR_INVALID_ARGUMENT;
82 REPLY_MACRO (VL_API_MEMIF_SOCKET_FILENAME_ADD_DEL_REPLY);
98 static const u8 empty_hw_addr[6];
103 args.
id = clib_net_to_host_u32 (mp->
id);
110 if (strlen ((
char *) mp->
secret) > 0)
147 rv = VNET_API_ERROR_INVALID_ARGUMENT;
161 if (memcmp (&
mac, empty_hw_addr, 6) != 0)
190 vl_api_memif_delete_reply_t *rmp;
200 rv = VNET_API_ERROR_INVALID_SW_IF_INDEX;
227 mp->_vl_msg_id = htons (VL_API_MEMIF_DETAILS + mm->
msg_id_base);
239 mp->
id = clib_host_to_net_u32 (mif->
id);
287 if_name =
format (if_name,
"%U%c",
292 _vec_len (if_name) = 0;
310 mp->_vl_msg_id = htons (VL_API_MEMIF_SOCKET_FILENAME_DETAILS
314 mp->
socket_id = clib_host_to_net_u32 (socket_id);
341 memif_socket_file_t *msf;
344 msf = pool_elt_at_index(mm->socket_files, msf_idx);
345 filename = msf->filename;
346 send_memif_socket_filename_details(reg, sock_id, filename, mp->context);
352 #include <memif/memif.api.c>
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
memif_interface_mode_t mode
string socket_filename[108]
int memif_socket_filename_add_del(u8 is_add, u32 sock_id, u8 *sock_filename)
#define REPLY_MACRO2(t, body)
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
@ IF_STATUS_API_FLAG_LINK_UP
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
vnet_hw_interface_flags_t flags
memif_socket_file_t * socket_files
memif_log2_ring_size_t log2_ring_size
#define hash_foreach(key_var, value_var, h, body)
@ VNET_SW_INTERFACE_FLAG_ADMIN_UP
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
static vnet_sw_interface_t * vnet_get_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
@ VNET_HW_INTERFACE_FLAG_LINK_UP
Memory interface details structure.
vl_api_interface_index_t sw_if_index
void vl_api_memif_dump_t_handler(vl_api_memif_dump_t *mp)
Message handler for memif_dump API.
#define pool_foreach(VAR, POOL)
Iterate through pool.
struct memif_if_t::@729 run
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
memif_interface_mode_t mode
@ IF_STATUS_API_FLAG_ADMIN_UP
vnet_main_t * vnet_get_main(void)
vnet_device_class_t memif_device_class
An API client registration, only in vpp/vlib.
static void setup_message_id_table(api_main_t *am)
static vnet_hw_interface_t * vnet_get_sup_hw_interface_api_visible_or_null(vnet_main_t *vnm, u32 sw_if_index)
void vl_api_memif_create_t_handler(vl_api_memif_create_t *mp)
Message handler for memif_create API.
vl_api_interface_index_t sw_if_index
string socket_filename[108]
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
vl_api_mac_address_t hw_addr
vl_api_if_status_flags_t flags
static void send_memif_details(vl_api_registration_t *reg, memif_if_t *mif, vnet_sw_interface_t *swif, u8 *interface_name, u32 context)
#define MEMIF_DEFAULT_RX_QUEUES
uword * socket_file_index_by_sock_id
#define MEMIF_DEFAULT_BUFFER_SIZE
void vl_api_memif_socket_filename_dump_t_handler(vl_api_memif_socket_filename_dump_t *mp)
Message handler for memif_socket_filename_dump API.
void vl_api_memif_socket_filename_add_del_t_handler(vl_api_memif_socket_filename_add_del_t *mp)
Message handler for memif_socket_filename_add_del API.
#define vec_free(V)
Free vector's memory (no header).
#define MEMIF_DEFAULT_TX_QUEUES
clib_error_t * memif_plugin_api_hookup(vlib_main_t *vm)
void mac_address_encode(const mac_address_t *in, u8 *out)
description fragment has unexpected format
static vnet_hw_interface_t * vnet_get_sup_hw_interface(vnet_main_t *vnm, u32 sw_if_index)
Dump all memory interfaces.
static void send_memif_socket_filename_details(vl_api_registration_t *reg, u32 socket_id, u8 *socket_filename, u32 context)
void mac_address_decode(const u8 *in, mac_address_t *out)
Conversion functions to/from (decode/encode) API types to VPP internal types.
Create memory interface response.
vl_api_interface_index_t sw_if_index
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static vlib_main_t * vlib_get_main(void)
#define MEMIF_DEFAULT_RING_SIZE
vl_api_mac_address_t hw_addr
static uword min_log2(uword x)
void vl_api_memif_delete_t_handler(vl_api_memif_delete_t *mp)
Message handler for memif_delete API.
Create or remove named socket file for memif interfaces.
int memif_delete_if(vlib_main_t *vm, memif_if_t *mif)
static uword is_pow2(uword x)
memif_log2_ring_size_t log2_ring_size
u16 msg_id_base
API message ID base.
int memif_create_if(vlib_main_t *vm, memif_create_if_args_t *args)
Memory interface details structure.
Dump the table of socket ids and corresponding filenames.
format_function_t format_vnet_sw_interface_name
void * vl_msg_api_alloc(int nbytes)