def nlmsg_append(n, data, len_, pad):
tmp = nlmsg_reserve(n, len_, pad)<EOL>if tmp is None:<EOL><INDENT>return -NLE_NOMEM<EOL><DEDENT>tmp[:len_] = data.bytearray[:len_]<EOL>_LOGGER.debug('<STR_LIT>', id(n), len_, pad)<EOL>return <NUM_LIT:0><EOL>
Append data to tail of a Netlink message.

    https://github.com/thom311/libnl/blob/libnl3_2_25/lib/msg.c#L442

    Extends the Netlink message as needed and appends the data of given length to the message.

    Positional arguments:
    n -- Netlink message (nl_msg class instance).
    data -- data to add.
    len_ -- length of data (integer).
    pad -- number of bytes to align data to (integer).

    Returns:
    0 on success or a negative error code.