6#ifndef NETLINK_HANDLERS_H_
7#define NETLINK_HANDLERS_H_
12#include <netlink/netlink-compat.h>
13#include <netlink/netlink-kernel.h>
48 struct nlmsgerr *nlerr,
void *arg);
81#define NL_CB_KIND_MAX (__NL_CB_KIND_MAX - 1)
113#define NL_CB_TYPE_MAX (__NL_CB_TYPE_MAX - 1)
117extern struct nl_cb * nl_cb_get(
struct nl_cb *);
118extern void nl_cb_put(
struct nl_cb *);
128 int (*func)(
struct nl_sock *,
131 int (*func)(
struct nl_sock *,
132 struct sockaddr_nl *,
136 int (*func)(
struct nl_sock *,
void nl_cb_overwrite_send(struct nl_cb *, int(*func)(struct nl_sock *, struct nl_msg *))
Overwrite internal calls to nl_send()
nl_cb_action
Callback actions.
int(* nl_recvmsg_err_cb_t)(struct sockaddr_nl *nla, struct nlmsgerr *nlerr, void *arg)
nl_recvmsgs() callback for error message processing customization
void nl_cb_overwrite_recv(struct nl_cb *, int(*func)(struct nl_sock *, struct sockaddr_nl *, unsigned char **, struct ucred **))
Overwrite internal calls to nl_recv()
nl_cb_type
Callback types.
int(* nl_recvmsg_msg_cb_t)(struct nl_msg *msg, void *arg)
nl_recvmsgs() callback for message processing customization
nl_cb_kind
Callback kinds.
int nl_cb_set(struct nl_cb *, enum nl_cb_type, enum nl_cb_kind, nl_recvmsg_msg_cb_t, void *)
Set up a callback.
int nl_cb_set_all(struct nl_cb *, enum nl_cb_kind, nl_recvmsg_msg_cb_t, void *)
Set up a all callbacks.
struct nl_cb * nl_cb_clone(struct nl_cb *)
Clone an existing callback handle.
struct nl_cb * nl_cb_alloc(enum nl_cb_kind)
Allocate a new callback handle.
enum nl_cb_type nl_cb_active_type(struct nl_cb *cb)
Obtain type of current active callback.
void nl_cb_overwrite_recvmsgs(struct nl_cb *, int(*func)(struct nl_sock *, struct nl_cb *))
Overwrite internal calls to nl_recvmsgs()
int nl_cb_err(struct nl_cb *, enum nl_cb_kind, nl_recvmsg_err_cb_t, void *)
Set up an error callback.
@ NL_STOP
Stop parsing altogether and discard remaining messages.
@ NL_OK
Proceed with whatever would come next.
@ NL_SKIP
Skip this message.
@ NL_CB_SKIPPED
Message wants to be skipped.
@ NL_CB_FINISH
Last message in a series of multi part messages received.
@ NL_CB_MSG_OUT
Called for every message sent out except for nl_sendto()
@ NL_CB_DUMP_INTR
Flag NLM_F_DUMP_INTR is set in message.
@ NL_CB_MSG_IN
Called for every message received.
@ NL_CB_OVERRUN
Report received that data was lost.
@ NL_CB_VALID
Message is valid.
@ NL_CB_ACK
Message is an acknowledgement.
@ NL_CB_SEQ_CHECK
Called instead of internal sequence number checking.
@ NL_CB_SEND_ACK
Sending of an acknowledge message has been requested.
@ NL_CB_INVALID
Message is malformed and invalid.
@ NL_CB_DEFAULT
Default handlers (quiet)
@ NL_CB_CUSTOM
Customized handler specified by the user.
@ NL_CB_VERBOSE
Verbose default handlers (error messages printed)
@ NL_CB_DEBUG
Debug handlers for debugging.