Logo Search packages:      
Sourcecode: libnl2 version File versions  Download package

struct nlattr* nla_next ( const struct nlattr *  nla,
int *  remaining 
) [read]

Return next attribute in a stream of attributes.

  • nla Attribute of any kind.
  • remaining Variable to count remaining bytes in stream.
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 remainig is >0.

Pointer to next attribute.

Definition at line 511 of file attr.c.

      int totlen = NLA_ALIGN(nla->nla_len);

      *remaining -= totlen;
      return (struct nlattr *) ((char *) nla + totlen);

Generated by  Doxygen 1.6.0   Back to index