|
CNDP 22.08.0
|
#include <stdint.h>#include <stdlib.h>#include <fcntl.h>#include <unistd.h>#include <sys/types.h>#include <sys/socket.h>#include <sys/ioctl.h>#include <sys/queue.h>#include <errno.h>#include <bsd/string.h>#include <cne_common.h>Go to the source code of this file.
Data Structures | |
| struct | cne_ev_handle |
| struct | cne_ev_read_buffer |
Typedefs | |
| typedef void(*) | cne_ev_callback_fn(void *cb_arg) |
| typedef void(*) | cne_ev_unregister_callback_fn(struct cne_ev_handle *ev_handle, void *cb_arg) |
Functions | |
| CNDP_API int | cne_ev_callback_register (const struct cne_ev_handle *ev_handle, cne_ev_callback_fn cb_fn, void *cb_arg) |
| CNDP_API int | cne_ev_callback_unregister (const struct cne_ev_handle *ev_handle, cne_ev_callback_fn cb_fn, void *cb_arg) |
| CNDP_API int | cne_ev_callback_unregister_pending (const struct cne_ev_handle *ev_handle, cne_ev_callback_fn cb_fn, void *cb_arg, cne_ev_unregister_callback_fn ucb_fn) |
Event monitoring Helpers in CNE
Definition in file cne_event.h.
| typedef void(*) cne_ev_callback_fn(void *cb_arg) |
Function to be registered for the specific interrupt
| cb_arg | address of parameter for callback. |
Definition at line 45 of file cne_event.h.
| typedef void(*) cne_ev_unregister_callback_fn(struct cne_ev_handle *ev_handle, void *cb_arg) |
Function to call after a callback is unregistered. Can be used to close fd and free cb_arg.
| ev_handle | Pointer to the event handle. |
| cb_arg | address of parameter for callback. |
Definition at line 56 of file cne_event.h.
| CNDP_API int cne_ev_callback_register | ( | const struct cne_ev_handle * | ev_handle, |
| cne_ev_callback_fn | cb_fn, | ||
| void * | cb_arg ) |
It registers the callback for the specific event. Multiple callbacks can be registered at the same time.
| ev_handle | Pointer to the event handle. |
| cb_fn | callback address. |
| cb_arg | address of parameter for callback. |
| CNDP_API int cne_ev_callback_unregister | ( | const struct cne_ev_handle * | ev_handle, |
| cne_ev_callback_fn | cb_fn, | ||
| void * | cb_arg ) |
It unregisters the callback for the specific event. Multiple callbacks can be registered at the same time.
| ev_handle | Pointer to the event handle. |
| cb_fn | callback address. |
| cb_arg | address of parameter for callback. |
| CNDP_API int cne_ev_callback_unregister_pending | ( | const struct cne_ev_handle * | ev_handle, |
| cne_ev_callback_fn | cb_fn, | ||
| void * | cb_arg, | ||
| cne_ev_unregister_callback_fn | ucb_fn ) |
Unregister the callback according to the specified event handle, after it's no longer active. Fail if source is not active.
| ev_handle | pointer to the event handle. |
| cb_fn | callback address. |
| cb_arg | address of parameter for callback, (void *)-1 means to remove all registered which has the same callback address. |
| ucb_fn | callback to call before cb is unregistered (optional). can be used to close fd and free cb_arg. |