def nla_for_each_attr(head, len_, rem):
pos = head<EOL>rem.value = len_<EOL>while nla_ok(pos, rem):<EOL><INDENT>yield pos<EOL>pos = nla_next(pos, rem)<EOL><DEDENT>
Iterate over a stream of attributes.

    https://github.com/thom311/libnl/blob/libnl3_2_25/include/netlink/attr.h#L262

    Positional arguments:
    head -- first nlattr with more in its bytearray payload (nlattr class instance).
    len_ -- length of attribute stream (integer).
    rem -- initialized to len, holds bytes currently remaining in stream (c_int).

    Returns:
    Generator yielding nlattr instances.