Home | History | Annotate | Download | only in utils

Lines Matching refs:len

30 static void wpabuf_overflow(const struct wpabuf *buf, size_t len)
39 wpa_printf(MSG_ERROR, "wpabuf %p (size=%lu used=%lu) overflow len=%lu",
41 (unsigned long) len);
110 * @len: Length for the allocated buffer
113 struct wpabuf * wpabuf_alloc(size_t len)
117 sizeof(struct wpabuf) + len);
124 struct wpabuf *buf = os_zalloc(sizeof(struct wpabuf) + len);
129 buf->size = len;
135 struct wpabuf * wpabuf_alloc_ext_data(u8 *data, size_t len)
151 buf->size = len;
152 buf->used = len;
160 struct wpabuf * wpabuf_alloc_copy(const void *data, size_t len)
162 struct wpabuf *buf = wpabuf_alloc(len);
164 wpabuf_put_data(buf, data, len);
217 void * wpabuf_put(struct wpabuf *buf, size_t len)
220 buf->used += len;
222 wpabuf_overflow(buf, len);
240 size_t len = 0;
246 len += wpabuf_len(a);
247 len += wpabuf_len(b);
249 n = wpabuf_alloc(len);
266 * @len: Length for the padded buffer
267 * Returns: wpabuf padded to len octets or %NULL on failure
269 * If buf is longer than len octets or of same size, it will be returned as-is.
275 struct wpabuf * wpabuf_zeropad(struct wpabuf *buf, size_t len)
284 if (blen >= len)
287 ret = wpabuf_alloc(len);
289 os_memset(wpabuf_put(ret, len - blen), 0, len - blen);
318 * The string len must be a multiple of two and contain only hexadecimal digits.
322 size_t len;
325 len = os_strlen(buf);
326 if (len & 0x01)
328 len /= 2;
330 ret = wpabuf_alloc(len);
334 if (hexstr2bin(buf, wpabuf_put(ret, len), len)) {