callback(3)
callback(3) π
okay bestie, so this is a page from the Library Functions Manual β it's callback(3), the callback helpers situation, and it's literally all about running your netlink message callbacks. no cap, it's giving very "small file, big power" energy. let's get into it β¨
πΈ NAME πΈ
callback β Callback helpers π
like. the helpers. for your callbacks. that's the vibe. π¦
β¨ SYNOPSIS β¨
Functions π
int mnl_cb_run2 (const void *buf, size_t numbytes, unsigned int seq,
unsigned int portid, mnl_cb_t cb_data, void *data, const mnl_cb_t
*cb_ctl_array, unsigned int cb_ctl_array_len)
int mnl_cb_run (const void *buf, size_t numbytes, unsigned int seq,
unsigned int portid, mnl_cb_t cb_data, void *data)
two functions. two icons. they're sisters fr fr π
π Detailed Description π
(this part is just vibes, the real tea is below in the function docs π)
π Function Documentation π
int mnl_cb_run (const void * buf, size_t numbytes, unsigned int seq, unsigned int portid, mnl_cb_t cb_data, void * data) π«Ά
mnl_cb_run β callback runqueue for netlink messages (simplified version) πβ¨
Parameters
bufβ buffer that contains the netlink messages π¦numbytesβ number of bytes stored in the buffer π’seqβ sequence number that we expect to receive πportidβ Netlink PortID that we expect to receive π°οΈcb_dataβ callback handler for data messages πdataβ pointer to data that will be passed to the data callback handler π«΄
so this function is like mnl_cb_run2() but it does not let you set the control callback handlers. that's the whole difference bestie, it's the low-maintenance sibling π
Your callback may return three possible values:
MNL_CB_ERROR(<=-1): an error has occurred. Stop callback runqueue. πMNL_CB_STOP(=0): stop callback runqueue. βMNL_CB_OK(>=1): no problems has occurred. β
This function propagates the callback return value. like, it hands it right back to you, no editing, no notes π
Definition at line 159 of file callback.c. π
int mnl_cb_run2 (const void * buf, size_t numbytes, unsigned int seq, unsigned int portid, mnl_cb_t cb_data, void * data, const mnl_cb_t * cb_ctl_array, unsigned int cb_ctl_array_len) π§
mnl_cb_run2 β callback runqueue for netlink messages π₯
Parameters
bufβ buffer that contains the netlink messages π¦numbytesβ number of bytes stored in the buffer π’seqβ sequence number that we expect to receive πportidβ Netlink PortID that we expect to receive π°οΈcb_dataβ callback handler for data messages πdataβ pointer to data that will be passed to the data callback handler π«΄cb_ctl_arrayβ array of custom callback handlers from control messages ποΈcb_ctl_array_lenβ array length of custom control callback handlers π
You can set the cb_ctl_array to NULL if you want to use the default control callback handlers β and in that case, the parameter cb_ctl_array_len is not checked. so don't stress about it, it's literally not being read π
Your callback may return three possible values:
MNL_CB_ERROR(<=-1): an error has occurred. Stop callback runqueue. πMNL_CB_STOP(=0): stop callback runqueue. βMNL_CB_OK(>=1): no problem has occurred. β
This function propagates the callback return value. On error, it returns -1 and errno is explicitly set. π
- If the
portIDis not the expected,errnois set toESRCH. π - If the sequence number is not the expected,
errnois set toEPROTO. π - If the dump was interrupted,
errnois set toEINTRand you should request a new fresh dump again. πβ¨
Definition at line 130 of file callback.c. π
π Author π
Generated automatically by Doxygen for libmnl from the source code. π€β¨ (yes bestie, a robot wrote it, and it ate π )
and that's the whole page, periodt π this was libmnl, Version 1.0.5, callback(3) β mwah, take care of your callbacks and they'll take care of you π«ΆπΈ
π¦ where this page comes from
- debian trixie: libmnl-doc 1.0.5-3 Β· LGPL-2.1-only
- ubuntu noble: libmnl-doc 1.0.5-2build1 Β· LGPL-2.1-only
- ubuntu questing: libmnl-doc 1.0.5-3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms