FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Callback multiplex scheme For a fully worked-out example, see .../src/vlib/main.[ch] and .../src/plugins/perfmon.c. More...
Go to the source code of this file.
Macros | |
#define | clib_callback_enable_disable(h, tmp, l, f, enable) |
Add or remove a callback to the specified callback set. More... | |
#define | clib_call_callbacks(h, ...) |
call the specified callback set More... | |
#define | clib_callback_is_set(h, l, f) |
predicate function says whether the specified function is enabled More... | |
Callback multiplex scheme For a fully worked-out example, see .../src/vlib/main.[ch] and .../src/plugins/perfmon.c.
Definition in file callback.h.
#define clib_call_callbacks | ( | h, | |
... | |||
) |
call the specified callback set
h | the callback set |
varargs | additional callback parameters |
Definition at line 67 of file callback.h.
Add or remove a callback to the specified callback set.
h | head of the callback vector |
tmp | vector to build result |
l | clib_spinlock_t lock to protect the vector, may be 0 |
f | function to add or remove |
enable | 1 adds f to the vector, 0 removes f from the vector |
Add or remove a callback from the indicated callback vector. Caller must provide locking to prevent > 1 concurrent writer Swaps the head of the callback vector and a tmp vector in one motion, after a write barrier to ensure that the write is atomic.
Definition at line 38 of file callback.h.
predicate function says whether the specified function is enabled
h | the callback set |
l | clib_spinlock_t lock to protect the vector, may be 0 |
f | the function to search for |
Definition at line 84 of file callback.h.