extern int nl_send(struct nl_sock *, struct nl_msg *);
extern int nl_send_iovec(struct nl_sock *, struct nl_msg *,
struct iovec *, unsigned);
+extern void nl_complete_msg(struct nl_sock *,
+ struct nl_msg *);
extern void nl_auto_complete(struct nl_sock *,
- struct nl_msg *);
+ struct nl_msg *);
+extern int nl_send_auto(struct nl_sock *, struct nl_msg *);
extern int nl_send_auto_complete(struct nl_sock *,
struct nl_msg *);
extern int nl_send_simple(struct nl_sock *, int, int,
iov[2].iov_base = (void *) payload_data;
iov[2].iov_len = NLA_ALIGN(payload_len);
- nl_auto_complete(nlh, nlmsg);
+ nl_complete_msg(nlh, nlmsg);
err = nl_send_iovec(nlh, nlmsg, iov, 3);
nlmsg_free(nlmsg);
return nl_send_iovec(sk, msg, &iov, 1);
}
-void nl_auto_complete(struct nl_sock *sk, struct nl_msg *msg)
+void nl_complete_msg(struct nl_sock *sk, struct nl_msg *msg)
{
struct nlmsghdr *nlh;
nlh->nlmsg_flags |= NLM_F_ACK;
}
+void nl_auto_complete(struct nl_sock *sk, struct nl_msg *msg)
+{
+ nl_complete_msg(sk, msg);
+}
+
/**
- * Send netlink message and check & extend header values as needed.
+ * Automatically complete and send a netlink message
* @arg sk Netlink socket.
* @arg msg Netlink message to be sent.
*
+ * This function takes a netlink message and passes it on to
+ * nl_auto_complete() for completion.
+ *
* Checks the netlink message \c nlh for completness and extends it
* as required before sending it out. Checked fields include pid,
* sequence nr, and flags.
* @see nl_send()
* @return Number of characters sent or a negative error code.
*/
-int nl_send_auto_complete(struct nl_sock *sk, struct nl_msg *msg)
+int nl_send_auto(struct nl_sock *sk, struct nl_msg *msg)
{
struct nl_cb *cb = sk->s_cb;
- nl_auto_complete(sk, msg);
+ nl_complete_msg(sk, msg);
if (cb->cb_send_ow)
return cb->cb_send_ow(sk, msg);
return nl_send(sk, msg);
}
+int nl_send_auto_complete(struct nl_sock *sk, struct nl_msg *msg)
+{
+ return nl_send_auto(sk, msg);
+}
+
/**
* Send simple netlink message using nl_send_auto_complete()
* @arg sk Netlink socket.