[patch libnl] socket: introduce nl_socket_modify_err_cb
Jiri Pirko
jpirko at redhat.com
Tue Aug 30 12:31:47 EDT 2011
This function does the same as nl_socket_modify_cb except for error
callback
Signed-off-by: Jiri Pirko <jpirko at redhat.com>
---
include/netlink/socket.h | 2 ++
lib/socket.c | 15 +++++++++++++++
2 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/include/netlink/socket.h b/include/netlink/socket.h
index f0062b5..d0f5a6a 100644
--- a/include/netlink/socket.h
+++ b/include/netlink/socket.h
@@ -45,6 +45,8 @@ extern void nl_socket_set_cb(struct nl_sock *,
extern int nl_socket_modify_cb(struct nl_sock *, enum nl_cb_type,
enum nl_cb_kind,
nl_recvmsg_msg_cb_t, void *);
+extern int nl_socket_modify_err_cb(struct nl_sock *, enum nl_cb_kind,
+ nl_recvmsg_err_cb_t, void *);
extern int nl_socket_set_buffer_size(struct nl_sock *, int, int);
extern int nl_socket_set_passcred(struct nl_sock *, int);
diff --git a/lib/socket.c b/lib/socket.c
index 60120fb..565248f 100644
--- a/lib/socket.c
+++ b/lib/socket.c
@@ -511,6 +511,21 @@ int nl_socket_modify_cb(struct nl_sock *sk, enum nl_cb_type type,
return nl_cb_set(sk->s_cb, type, kind, func, arg);
}
+/**
+ * Modify the error callback handler associated with the socket
+ * @arg sk Netlink socket.
+ * @arg kind kind of callback
+ * @arg func callback function
+ * @arg arg argument to be passed to callback function
+ *
+ * @see nl_cb_err
+ */
+int nl_socket_modify_err_cb(struct nl_sock *sk, enum nl_cb_kind kind,
+ nl_recvmsg_err_cb_t func, void *arg)
+{
+ return nl_cb_err(sk->s_cb, kind, func, arg);
+}
+
/** @} */
/**
--
1.7.6
More information about the libnl
mailing list