Reserve space for an attribute.

    https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L456

    Reserves room for an attribute in the specified Netlink message and fills in the attribute header (type, length).
    Returns None if there is insufficient space for the attribute.

    Any padding between payload and the start of the next attribute is zeroed out.

    Positional arguments:
    msg -- Netlink message (nl_msg class instance).
    attrtype -- attribute type (integer).
    attrlen -- length of payload (integer).

    Returns:
    nlattr class instance allocated to the new space or None on failure.

def nla_reserve(msg, attrtype, attrlen):
    """Reserve space for an attribute.

    https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L456

    Reserves room for an attribute in the specified Netlink message and fills in the attribute header (type, length).
    Returns None if there is insufficient space for the attribute.

    Any padding between payload and the start of the next attribute is zeroed out.

    Positional arguments:
    msg -- Netlink message (nl_msg class instance).
    attrtype -- attribute type (integer).
    attrlen -- length of payload (integer).

    Returns:
    nlattr class instance allocated to the new space or None on failure.
    """
    tlen = NLMSG_ALIGN(msg.nm_nlh.nlmsg_len) + nla_total_size(attrlen)
    if tlen > msg.nm_size:
        return None

    nla = nlattr(nlmsg_tail(msg.nm_nlh))
    nla.nla_type = attrtype
    nla.nla_len = nla_attr_size(attrlen)

    if attrlen:
        padlen = nla_padlen(attrlen)
        nla.bytearray[nla.nla_len:nla.nla_len + padlen] = bytearray(b'\0') * padlen
    msg.nm_nlh.nlmsg_len = tlen

    _LOGGER.debug('msg 0x%x: attr <0x%x> %d: Reserved %d (%d) bytes at offset +%d nlmsg_len=%d', id(msg), id(nla),
                  nla.nla_type, nla_total_size(attrlen), attrlen,
                  nla.bytearray.slice.start - nlmsg_data(msg.nm_nlh).slice.start, msg.nm_nlh.nlmsg_len)

    return nla