Lines Matching refs:attrlen
163 int minlen = 0, attrlen = nla_len(nla), type = nla_type(nla); in validate_nla() local
176 if ((nla_attr_len[pt->type] && attrlen != nla_attr_len[pt->type]) || in validate_nla()
177 (pt->type == NLA_EXACT_LEN_WARN && attrlen != pt->len)) { in validate_nla()
204 if (attrlen != pt->len) in validate_nla()
218 if (attrlen > 0) in validate_nla()
223 if (attrlen != sizeof(struct nla_bitfield32)) in validate_nla()
233 minlen = min_t(int, attrlen, pt->len + 1); in validate_nla()
235 minlen = attrlen; in validate_nla()
244 if (attrlen < 1) in validate_nla()
250 if (buf[attrlen - 1] == '\0') in validate_nla()
251 attrlen--; in validate_nla()
253 if (attrlen > pt->len) in validate_nla()
259 if (pt->len && attrlen > pt->len) in validate_nla()
267 if (attrlen == 0) in validate_nla()
269 if (attrlen < NLA_HDRLEN) in validate_nla()
288 if (attrlen == 0) in validate_nla()
290 if (attrlen < NLA_HDRLEN) in validate_nla()
316 if (attrlen < pt->len) in validate_nla()
326 if (attrlen < minlen) in validate_nla()
609 int attrlen = nla_len(nla); in nla_strcmp() local
612 if (attrlen > 0 && buf[attrlen - 1] == '\0') in nla_strcmp()
613 attrlen--; in nla_strcmp()
615 d = attrlen - len; in nla_strcmp()
636 struct nlattr *__nla_reserve(struct sk_buff *skb, int attrtype, int attrlen) in __nla_reserve() argument
640 nla = skb_put(skb, nla_total_size(attrlen)); in __nla_reserve()
642 nla->nla_len = nla_attr_size(attrlen); in __nla_reserve()
644 memset((unsigned char *) nla + nla->nla_len, 0, nla_padlen(attrlen)); in __nla_reserve()
665 int attrlen, int padattr) in __nla_reserve_64bit() argument
670 return __nla_reserve(skb, attrtype, attrlen); in __nla_reserve_64bit()
684 void *__nla_reserve_nohdr(struct sk_buff *skb, int attrlen) in __nla_reserve_nohdr() argument
686 return skb_put_zero(skb, NLA_ALIGN(attrlen)); in __nla_reserve_nohdr()
702 struct nlattr *nla_reserve(struct sk_buff *skb, int attrtype, int attrlen) in nla_reserve() argument
704 if (unlikely(skb_tailroom(skb) < nla_total_size(attrlen))) in nla_reserve()
707 return __nla_reserve(skb, attrtype, attrlen); in nla_reserve()
725 struct nlattr *nla_reserve_64bit(struct sk_buff *skb, int attrtype, int attrlen, in nla_reserve_64bit() argument
731 len = nla_total_size_64bit(attrlen); in nla_reserve_64bit()
733 len = nla_total_size(attrlen); in nla_reserve_64bit()
737 return __nla_reserve_64bit(skb, attrtype, attrlen, padattr); in nla_reserve_64bit()
751 void *nla_reserve_nohdr(struct sk_buff *skb, int attrlen) in nla_reserve_nohdr() argument
753 if (unlikely(skb_tailroom(skb) < NLA_ALIGN(attrlen))) in nla_reserve_nohdr()
756 return __nla_reserve_nohdr(skb, attrlen); in nla_reserve_nohdr()
770 void __nla_put(struct sk_buff *skb, int attrtype, int attrlen, in __nla_put() argument
775 nla = __nla_reserve(skb, attrtype, attrlen); in __nla_put()
776 memcpy(nla_data(nla), data, attrlen); in __nla_put()
791 void __nla_put_64bit(struct sk_buff *skb, int attrtype, int attrlen, in __nla_put_64bit() argument
796 nla = __nla_reserve_64bit(skb, attrtype, attrlen, padattr); in __nla_put_64bit()
797 memcpy(nla_data(nla), data, attrlen); in __nla_put_64bit()
810 void __nla_put_nohdr(struct sk_buff *skb, int attrlen, const void *data) in __nla_put_nohdr() argument
814 start = __nla_reserve_nohdr(skb, attrlen); in __nla_put_nohdr()
815 memcpy(start, data, attrlen); in __nla_put_nohdr()
829 int nla_put(struct sk_buff *skb, int attrtype, int attrlen, const void *data) in nla_put() argument
831 if (unlikely(skb_tailroom(skb) < nla_total_size(attrlen))) in nla_put()
834 __nla_put(skb, attrtype, attrlen, data); in nla_put()
850 int nla_put_64bit(struct sk_buff *skb, int attrtype, int attrlen, in nla_put_64bit() argument
856 len = nla_total_size_64bit(attrlen); in nla_put_64bit()
858 len = nla_total_size(attrlen); in nla_put_64bit()
862 __nla_put_64bit(skb, attrtype, attrlen, data, padattr); in nla_put_64bit()
876 int nla_put_nohdr(struct sk_buff *skb, int attrlen, const void *data) in nla_put_nohdr() argument
878 if (unlikely(skb_tailroom(skb) < NLA_ALIGN(attrlen))) in nla_put_nohdr()
881 __nla_put_nohdr(skb, attrlen, data); in nla_put_nohdr()
895 int nla_append(struct sk_buff *skb, int attrlen, const void *data) in nla_append() argument
897 if (unlikely(skb_tailroom(skb) < NLA_ALIGN(attrlen))) in nla_append()
900 skb_put_data(skb, data, attrlen); in nla_append()