rename nl_send_auto_complete() -> nl_send_auto(), nl_auto_complete -> nl_complete_msg()
Old symbols left to maintain backwards compatibility
This commit is contained in:
parent
063a2ebf53
commit
8a365dbd49
|
@ -52,8 +52,11 @@ extern int nl_sendmsg(struct nl_sock *, struct nl_msg *,
|
||||||
extern int nl_send(struct nl_sock *, struct nl_msg *);
|
extern int nl_send(struct nl_sock *, struct nl_msg *);
|
||||||
extern int nl_send_iovec(struct nl_sock *, struct nl_msg *,
|
extern int nl_send_iovec(struct nl_sock *, struct nl_msg *,
|
||||||
struct iovec *, unsigned);
|
struct iovec *, unsigned);
|
||||||
|
extern void nl_complete_msg(struct nl_sock *,
|
||||||
|
struct nl_msg *);
|
||||||
extern void nl_auto_complete(struct nl_sock *,
|
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 *,
|
extern int nl_send_auto_complete(struct nl_sock *,
|
||||||
struct nl_msg *);
|
struct nl_msg *);
|
||||||
extern int nl_send_simple(struct nl_sock *, int, int,
|
extern int nl_send_simple(struct nl_sock *, int, int,
|
||||||
|
|
|
@ -249,7 +249,7 @@ int nfnl_queue_msg_send_verdict_payload(struct nl_sock *nlh,
|
||||||
iov[2].iov_base = (void *) payload_data;
|
iov[2].iov_base = (void *) payload_data;
|
||||||
iov[2].iov_len = NLA_ALIGN(payload_len);
|
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);
|
err = nl_send_iovec(nlh, nlmsg, iov, 3);
|
||||||
|
|
||||||
nlmsg_free(nlmsg);
|
nlmsg_free(nlmsg);
|
||||||
|
|
21
lib/nl.c
21
lib/nl.c
|
@ -288,7 +288,7 @@ int nl_send(struct nl_sock *sk, struct nl_msg *msg)
|
||||||
return nl_send_iovec(sk, msg, &iov, 1);
|
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;
|
struct nlmsghdr *nlh;
|
||||||
|
|
||||||
|
@ -308,11 +308,19 @@ void nl_auto_complete(struct nl_sock *sk, struct nl_msg *msg)
|
||||||
nlh->nlmsg_flags |= NLM_F_ACK;
|
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 sk Netlink socket.
|
||||||
* @arg msg Netlink message to be sent.
|
* @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
|
* Checks the netlink message \c nlh for completness and extends it
|
||||||
* as required before sending it out. Checked fields include pid,
|
* as required before sending it out. Checked fields include pid,
|
||||||
* sequence nr, and flags.
|
* sequence nr, and flags.
|
||||||
|
@ -320,11 +328,11 @@ void nl_auto_complete(struct nl_sock *sk, struct nl_msg *msg)
|
||||||
* @see nl_send()
|
* @see nl_send()
|
||||||
* @return Number of characters sent or a negative error code.
|
* @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;
|
struct nl_cb *cb = sk->s_cb;
|
||||||
|
|
||||||
nl_auto_complete(sk, msg);
|
nl_complete_msg(sk, msg);
|
||||||
|
|
||||||
if (cb->cb_send_ow)
|
if (cb->cb_send_ow)
|
||||||
return cb->cb_send_ow(sk, msg);
|
return cb->cb_send_ow(sk, msg);
|
||||||
|
@ -332,6 +340,11 @@ int nl_send_auto_complete(struct nl_sock *sk, struct nl_msg *msg)
|
||||||
return nl_send(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()
|
* Send simple netlink message using nl_send_auto_complete()
|
||||||
* @arg sk Netlink socket.
|
* @arg sk Netlink socket.
|
||||||
|
|
Reference in New Issue