]> git.ipfire.org Git - thirdparty/libnl.git/commitdiff
socket: introduce nl_socket_modify_err_cb
authorJiri Pirko <jpirko@redhat.com>
Tue, 30 Aug 2011 16:31:47 +0000 (18:31 +0200)
committerThomas Graf <tgraf@lsx.localdomain>
Wed, 31 Aug 2011 07:23:58 +0000 (09:23 +0200)
This function does the same as nl_socket_modify_cb except for error
callback

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
include/netlink/socket.h
lib/socket.c

index f0062b593348ba4205e969a668982424928d38c0..d0f5a6a5b6ad8581395551a5286168ac698c0b12 100644 (file)
@@ -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);
index 60120fb2a52c04cb1584ba355a24b9ca89f68959..565248f00eb51dd6e8a9422dd27ffc9dfa1974f2 100644 (file)
@@ -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);
+}
+
 /** @} */
 
 /**