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

int nla_validate ( struct nlattr head,
int  len,
int  maxtype,
struct nla_policy policy 

Validate a stream of attributes

  • head head of attribute stream
  • len length of attribute stream
  • maxtype maximum attribute type to be expected
  • policy validation policy
Validates all attributes in the specified attribute stream against the specified policy. Attributes with a type exceeding maxtype will be ignored. See documenation of struct nla_policy for more details.

0 on success or a negative error code.

Definition at line 321 of file attr.c.

References nla_for_each_attr.

Referenced by nlmsg_validate().

      struct nlattr *nla;
      int rem, err;

      nla_for_each_attr(nla, head, len, rem) {
            err = validate_nla(nla, maxtype, policy);
            if (err < 0)
                  goto errout;

      err = 0;
      return err;

Generated by  Doxygen 1.6.0   Back to index