summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Graf <tgraf@redhat.com>2012-11-08 21:17:32 +0100
committerThomas Graf <tgraf@redhat.com>2012-11-08 21:17:32 +0100
commit665464cde54e9c31f0efa67799b3d4f254a072e2 (patch)
tree7262cd9ccd2117babcb3b51700e6af8ed18354ca
parentb28c25eb236c535017a0d17ceca02f277e20953f (diff)
downloadlibnl-665464cde54e9c31f0efa67799b3d4f254a072e2.tar.gz
nl: Improve API doc of nl_send_simple()
Signed-off-by: Thomas Graf <tgraf@redhat.com>
-rw-r--r--lib/nl.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/lib/nl.c b/lib/nl.c
index 4e8b992..ec1db01 100644
--- a/lib/nl.c
+++ b/lib/nl.c
@@ -479,18 +479,24 @@ int nl_send_sync(struct nl_sock *sk, struct nl_msg *msg)
}
/**
- * Send simple netlink message using nl_send_auto_complete()
- * @arg sk Netlink socket.
- * @arg type Netlink message type.
- * @arg flags Netlink message flags.
- * @arg buf Data buffer.
- * @arg size Size of data buffer.
+ * Construct and transmit a Netlink message
+ * @arg sk Netlink socket (required)
+ * @arg type Netlink message type (required)
+ * @arg flags Netlink message flags (optional)
+ * @arg buf Data buffer (optional)
+ * @arg size Size of data buffer (optional)
*
- * Builds a netlink message with the specified type and flags and
- * appends the specified data as payload to the message.
+ * Allocates a new Netlink message based on `type` and `flags`. If `buf`
+ * points to payload of length `size` that payload will be appended to the
+ * message.
+ *
+ * Sends out the message using `nl_send_auto()` and frees the message
+ * afterwards.
+ *
+ * @see nl_send_auto()
*
- * @see nl_send_auto_complete()
* @return Number of characters sent on success or a negative error code.
+ * @retval -NLE_NOMEM Unable to allocate Netlink message
*/
int nl_send_simple(struct nl_sock *sk, int type, int flags, void *buf,
size_t size)
@@ -507,9 +513,8 @@ int nl_send_simple(struct nl_sock *sk, int type, int flags, void *buf,
if (err < 0)
goto errout;
}
-
- err = nl_send_auto_complete(sk, msg);
+ err = nl_send_auto(sk, msg);
errout:
nlmsg_free(msg);