def nlmsg_alloc(len_=default_msg_size):
len_ = max(libnl.linux_private.netlink.nlmsghdr.SIZEOF, len_)<EOL>nm = nl_msg()<EOL>nm.nm_refcnt = <NUM_LIT:1><EOL>nm.nm_nlh = libnl.linux_private.netlink.nlmsghdr(bytearray(b'<STR_LIT>') * len_)<EOL>nm.nm_protocol = -<NUM_LIT:1><EOL>nm.nm_size = len_<EOL>nm.nm_nlh.nlmsg_len = nlmsg_total_size(<NUM_LIT:0>)<EOL>_LOGGER.debug('<STR_LIT>', id(nm), len_)<EOL>return nm<EOL>
Allocate a new Netlink message with maximum payload size specified.

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

    Allocates a new Netlink message without any further payload. The maximum payload size defaults to
    resource.getpagesize() or as otherwise specified with nlmsg_set_default_size().

    Returns:
    Newly allocated Netlink message (nl_msg class instance).