def nl_send_simple(sk, type_, flags, buf=None, size=<NUM_LIT:0>):
msg = nlmsg_alloc_simple(type_, flags)<EOL>if buf is not None and size:<EOL><INDENT>err = nlmsg_append(msg, buf, size, NLMSG_ALIGNTO)<EOL>if err < <NUM_LIT:0>:<EOL><INDENT>return err<EOL><DEDENT><DEDENT>return nl_send_auto(sk, msg)<EOL>
Construct and transmit a Netlink message.

    https://github.com/thom311/libnl/blob/libnl3_2_25/lib/nl.c#L549

    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()`.

    Positional arguments:
    sk -- Netlink socket (nl_sock class instance).
    type_ -- Netlink message type (integer).
    flags -- Netlink message flags (integer).

    Keyword arguments:
    buf -- payload data.
    size -- size of `data` (integer).

    Returns:
    Number of characters sent on success or a negative error code.