Scroll to navigation

callback(3) Library Functions Manual callback(3)

NAME

callback - Callback helpers

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)

Detailed Description

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

This function is like mnl_cb_run2() but it does not allow you to set the control callback handlers.

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.

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, in that case, the parameter cb_ctl_array_len is not checked.

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 portID is not the expected, errno is set to ESRCH. If the sequence number is not the expected, errno is set to EPROTO. If the dump was interrupted, errno is set to EINTR and 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.

Version 1.0.5 libmnl