Lines Matching refs:len
70 static int nla_validate_array(const struct nlattr *head, int len, int maxtype, in nla_validate_array() argument
78 nla_for_each_attr(entry, head, len, rem) { in nla_validate_array()
177 (pt->type == NLA_EXACT_LEN_WARN && attrlen != pt->len)) { in validate_nla()
204 if (attrlen != pt->len) in validate_nla()
232 if (pt->len) in validate_nla()
233 minlen = min_t(int, attrlen, pt->len + 1); in validate_nla()
247 if (pt->len) { in validate_nla()
253 if (attrlen > pt->len) in validate_nla()
259 if (pt->len && attrlen > pt->len) in validate_nla()
272 err = __nla_validate(nla_data(nla), nla_len(nla), pt->len, in validate_nla()
296 pt->len, pt->validation_data, in validate_nla()
316 if (attrlen < pt->len) in validate_nla()
321 if (pt->len) in validate_nla()
322 minlen = pt->len; in validate_nla()
357 static int __nla_validate_parse(const struct nlattr *head, int len, int maxtype, in __nla_validate_parse() argument
369 nla_for_each_attr(nla, head, len, rem) { in __nla_validate_parse()
419 int __nla_validate(const struct nlattr *head, int len, int maxtype, in __nla_validate() argument
423 return __nla_validate_parse(head, len, maxtype, policy, validate, in __nla_validate()
442 int i, len = 0; in nla_policy_len() local
445 if (p->len) in nla_policy_len()
446 len += nla_total_size(p->len); in nla_policy_len()
448 len += nla_total_size(nla_attr_len[p->type]); in nla_policy_len()
450 len += nla_total_size(nla_attr_minlen[p->type]); in nla_policy_len()
453 return len; in nla_policy_len()
474 const struct nlattr *head, int len, in __nla_parse() argument
478 return __nla_validate_parse(head, len, maxtype, policy, validate, in __nla_parse()
491 struct nlattr *nla_find(const struct nlattr *head, int len, int attrtype) in nla_find() argument
496 nla_for_each_attr(nla, head, len, rem) in nla_find()
525 size_t len = (srclen >= dstsize) ? dstsize - 1 : srclen; in nla_strlcpy() local
528 memcpy(dst, src, len); in nla_strlcpy()
607 int len = strlen(str); in nla_strcmp() local
615 d = attrlen - len; in nla_strcmp()
617 d = memcmp(nla_data(nla), str, len); in nla_strcmp()
728 size_t len; in nla_reserve_64bit() local
731 len = nla_total_size_64bit(attrlen); in nla_reserve_64bit()
733 len = nla_total_size(attrlen); in nla_reserve_64bit()
734 if (unlikely(skb_tailroom(skb) < len)) in nla_reserve_64bit()
853 size_t len; in nla_put_64bit() local
856 len = nla_total_size_64bit(attrlen); in nla_put_64bit()
858 len = nla_total_size(attrlen); in nla_put_64bit()
859 if (unlikely(skb_tailroom(skb) < len)) in nla_put_64bit()