package/libs/libnl-tiny/src/attr.c
/**
 * Validate a stream of attributes.
 * @arg head		Head of attributes stream.
 * @arg len		Length of attributes stream.
 * @arg maxtype		Maximum attribute type expected and accepted.
 * @arg policy		Validation policy.
 *
 * Iterates over the stream of attributes and validates each attribute
 * one by one using the specified policy. Attributes with a type greater
 * than the maximum type specified will be silently ignored in order to
 * maintain backwards compatibility.
 *
 * See \ref attr_datatypes for more details on what kind of validation
 * checks are performed on each attribute data type.
 *
 * @return 0 on success or a negative error code.
 */
Validate a stream of attributes.
@arg head            Head of attributes stream.
@arg len             Length of attributes stream.
@arg maxtype         Maximum attribute type expected and accepted.
@arg policy          Validation policy.

Iterates over the stream of attributes and validates each attribute
one by one using the specified policy. Attributes with a type greater
than the maximum type specified will be silently ignored in order to
maintain backwards compatibility.

See \ref attr_datatypes for more details on what kind of validation
checks are performed on each attribute data type.

@return 0 on success or a negative error code.
Validate a stream of attributes . @arg head Head of attributes stream . @arg len Length of attributes stream . @arg maxtype Maximum attribute type expected and accepted . @arg policy Validation policy . Iterates over the stream of attributes and validates each attribute one by one using the specified policy . Attributes with a type greater than the maximum type specified will be silently ignored in order to maintain backwards compatibility . See \ ref attr_datatypes for more details on what kind of validation checks are performed on each attribute data type . @return 0 on success or a negative error code .
int nla_validate(struct nlattr *head, int len, int maxtype,
		 struct nla_policy *policy)
{
	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;
errout:
	return err;
}
int nla_validate ( struct nlattr * head , int len , int maxtype , struct nla_policy * policy ) { 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 ; errout : return err ; }
Validate a stream of attributes.
Validate a stream of attributes .