code: def nla_put(msg, attrtype, datalen, data):
      
      nla = nla_reserve(msg, attrtype, datalen)
      if not nla:
          return -NLE_NOMEM
      if datalen <= 0:
          return 0
  
      nla_data(nla)[:datalen] = data[:datalen]
      _LOGGER.debug('msg 0x%x: attr <0x%x> %d: Wrote %d bytes at offset +%d', id(msg), id(nla), nla.nla_type, datalen,
                    nla.bytearray.slice.start - nlmsg_data(msg.nm_nlh).slice.start)
      return 0
docs: Add a unspecific attribute to Netlink message.
  
      https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L497
  
      Reserves room for an unspecific attribute and copies the provided data into the message as payload of the attribute.
      Returns an error if there is insufficient space for the attribute.
  
      Positional arguments:
      msg -- Netlink message (nl_msg class instance).
      attrtype -- attribute type (integer).
      datalen -- length of data to be used as payload (integer).
      data -- data to be used as attribute payload (bytearray).
  
      Returns:
      0 on success or a negative error code.