26 #define LIBMEMIF_VERSION "2.1" 28 #define MEMIF_DEFAULT_APP_NAME "libmemif-app" 31 #include <sys/timerfd.h> 89 #define MEMIF_FD_EVENT_READ (1 << 0) 90 #define MEMIF_FD_EVENT_WRITE (1 << 1) 92 #define MEMIF_FD_EVENT_ERROR (1 << 2) 94 #define MEMIF_FD_EVENT_DEL (1 << 3) 96 #define MEMIF_FD_EVENT_MOD (1 << 4) 188 int *fd,
void *private_ctx);
266 uint8_t interface_name[32];
290 #define MEMIF_BUFFER_FLAG_NEXT (1 << 0) 292 #define MEMIF_BUFFER_FLAG_RX (1 << 1) 320 #define MEMIF_QUEUE_FLAG_POLLING 1 437 char *buf, ssize_t buflen);
543 uint16_t * count_out);
557 uint16_t * count_out, uint16_t
size);
568 uint16_t
count, uint16_t headroom);
617 #define MEMIF_HAVE_CANCEL_POLL_EVENT 1
int on_disconnect(memif_conn_handle_t conn, void *private_ctx)
uint8_t * remote_inst_name
int() memif_control_fd_update_t(int fd, uint8_t events)
Memif control file descriptor update (callback function)
int memif_refill_queue(memif_conn_handle_t conn, uint16_t qid, uint16_t count, uint16_t headroom)
Memif refill ring.
int on_connect(memif_conn_handle_t conn, void *private_ctx)
int memif_get_details(memif_conn_handle_t conn, memif_details_t *md, char *buf, ssize_t buflen)
Memif get details.
memif_interface_mode_t mode
char * memif_strerror(int err_code)
Memif strerror.
uint8_t * socket_filename
int() memif_add_external_region_t(void **addr, uint32_t size, int *fd, void *private_ctx)
Add external region.
int memif_set_rx_mode(memif_conn_handle_t conn, memif_rx_mode_t rx_mode, uint16_t qid)
Memif set rx mode.
int() memif_del_external_region_t(void *addr, uint32_t size, int fd, void *private_ctx)
Delete external region.
int() memif_interrupt_t(memif_conn_handle_t conn, void *private_ctx, uint16_t qid)
Memif interrupt occured (callback function)
int memif_init(memif_control_fd_update_t *on_control_fd_update, char *app_name, memif_alloc_t *memif_alloc, memif_realloc_t *memif_realloc, memif_free_t *memif_free)
Memif initialization.
int() memif_connection_update_t(memif_conn_handle_t conn, void *private_ctx)
Memif connection status update (callback function)
int memif_get_queue_efd(memif_conn_handle_t conn, uint16_t qid, int *fd)
Memif get queue event file descriptor
int memif_buffer_enq_tx(memif_conn_handle_t conn, uint16_t qid, memif_buffer_t *bufs, uint16_t count, uint16_t *count_out)
Memif buffer enq tx.
int on_interrupt(memif_conn_handle_t conn, void *private_ctx, uint16_t qid)
int memif_tx_burst(memif_conn_handle_t conn, uint16_t qid, memif_buffer_t *bufs, uint16_t count, uint16_t *tx)
Memif transmit buffer burst.
void() memif_free_t(void *ptr)
Memif allocator free.
int memif_buffer_alloc(memif_conn_handle_t conn, uint16_t qid, memif_buffer_t *bufs, uint16_t count, uint16_t *count_out, uint16_t size)
Memif buffer alloc.
int memif_poll_event(int timeout)
Memif poll event.
memif_queue_details_t * rx_queues
void *() memif_realloc_t(void *ptr, size_t size)
Memif realloc.
int memif_cleanup()
Memif cleanup.
uint32_t() memif_get_external_buffer_offset_t(void *private_ctx)
Get external buffer offset (optional)
int memif_create(memif_conn_handle_t *conn, memif_conn_args_t *args, memif_connection_update_t *on_connect, memif_connection_update_t *on_disconnect, memif_interrupt_t *on_interrupt, void *private_ctx)
Memory interface create function.
void * memif_conn_handle_t
Memif connection handle pointer of type void, pointing to internal structure.
int memif_set_connection_request_timer(struct itimerspec timer)
Set connection request timer value.
int memif_control_fd_handler(int fd, uint8_t events)
Memif control file descriptor handler.
int memif_request_connection(memif_conn_handle_t conn)
Send connection request.
int memif_rx_burst(memif_conn_handle_t conn, uint16_t qid, memif_buffer_t *bufs, uint16_t count, uint16_t *rx)
Memif receive buffer burst.
void *() memif_alloc_t(size_t size)
Memif allocator alloc.
void *() memif_get_external_region_addr_t(uint32_t size, int fd, void *private_ctx)
Get external region address.
int memif_delete(memif_conn_handle_t *conn)
Memif delete.
memif_region_details_t * regions
int memif_cancel_poll_event()
memif_queue_details_t * tx_queues
uint16_t memif_get_version()
Memif get version.
Memif connection arguments.
void memif_register_external_region(memif_add_external_region_t *ar, memif_get_external_region_addr_t *gr, memif_del_external_region_t *dr, memif_get_external_buffer_offset_t *go)
Register external region.
uint8_t * socket_filename