Return next attribute in a stream of attributes.

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

    Calculates the offset to the next attribute based on the attribute given. The attribute provided is assumed to be
    accessible, the caller is responsible to use nla_ok() beforehand. The offset (length of specified attribute
    including padding) is then subtracted from the remaining bytes variable and a pointer to the next attribute is
    returned.

    nla_next() can be called as long as remaining is >0.

    Positional arguments:
    nla -- attribute of any kind (nlattr class instance).
    remaining -- number of bytes remaining in attribute stream (c_int).

    Returns:
    Next nlattr class instance.

def nla_next(nla, remaining):
    """Return next attribute in a stream of attributes.

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

    Calculates the offset to the next attribute based on the attribute given. The attribute provided is assumed to be
    accessible, the caller is responsible to use nla_ok() beforehand. The offset (length of specified attribute
    including padding) is then subtracted from the remaining bytes variable and a pointer to the next attribute is
    returned.

    nla_next() can be called as long as remaining is >0.

    Positional arguments:
    nla -- attribute of any kind (nlattr class instance).
    remaining -- number of bytes remaining in attribute stream (c_int).

    Returns:
    Next nlattr class instance.
    """
    totlen = int(NLA_ALIGN(nla.nla_len))
    remaining.value -= totlen
    return nlattr(bytearray_ptr(nla.bytearray, totlen))