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

struct nlattr* nla_find ( struct nlattr *  head,
int  len,
int  attrtype 
) [read]

Find a single attribute in a stream of attributes.

  • head Head of attributes stream.
  • len Length of attributes stream.
  • attrtype Attribute type to look for.
Iterates over the stream of attributes and compares each type with the type specified. Returns the first attribute which matches the type.

Returns:
Pointer to attribute found or NULL.

Definition at line 665 of file attr.c.

References nla_for_each_attr, and nla_type().

Referenced by nlmsg_find_attr().

{
      struct nlattr *nla;
      int rem;

      nla_for_each_attr(nla, head, len, rem)
            if (nla_type(nla) == attrtype)
                  return nla;

      return NULL;
}


Generated by  Doxygen 1.6.0   Back to index