Lines Matching refs:len
166 * @len: Length of the text to convert in bytes (of buf); hex will be double
170 int hexstr2bin(const char *hex, u8 *buf, size_t len)
177 for (i = 0; i < len; i++) {
188 int hwaddr_mask_txt(char *buf, size_t len, const u8 *addr, const u8 *mask)
202 res = os_snprintf(buf, len, MACSTR "/" MACSTR,
205 res = os_snprintf(buf, len, MACSTR, MAC2STR(addr));
206 if (os_snprintf_error(len, res))
215 * @len: Length of the counter in bytes
221 void inc_byte_array(u8 *counter, size_t len)
223 int pos = len - 1;
282 int wpa_snprintf_hex_sep(char *buf, size_t buf_size, const u8 *data, size_t len,
292 for (i = 0; i < len; i++) {
307 size_t len, int uppercase)
314 for (i = 0; i < len; i++) {
330 * @buf_size: Maximum buffer size in bytes (should be at least 2 * len + 1)
332 * @len: Length of data in bytes
335 int wpa_snprintf_hex(char *buf, size_t buf_size, const u8 *data, size_t len)
337 return _wpa_snprintf_hex(buf, buf_size, data, len, 0);
344 * @buf_size: Maximum buffer size in bytes (should be at least 2 * len + 1)
346 * @len: Length of data in bytes
350 size_t len)
352 return _wpa_snprintf_hex(buf, buf_size, data, len, 1);
466 void printf_encode(char *txt, size_t maxlen, const u8 *data, size_t len)
471 for (i = 0; i < len; i++) {
518 size_t len = 0;
522 if (len + 1 >= maxlen)
529 buf[len++] = '\\';
533 buf[len++] = '"';
537 buf[len++] = '\n';
541 buf[len++] = '\r';
545 buf[len++] = '\t';
549 buf[len++] = '\033';
559 buf[len++] = val;
562 buf[len++] = val;
579 buf[len++] = val;
586 buf[len++] = *pos++;
590 if (maxlen > len)
591 buf[len] = '\0';
593 return len;
631 char * wpa_config_parse_string(const char *value, size_t *len)
640 *len = pos - value;
641 str = dup_binstr(value, *len);
664 *len = printf_decode((u8 *) str, tlen + 1, tstr);
682 *len = tlen;
688 int is_hex(const u8 *data, size_t len)
692 for (i = 0; i < len; i++) {
704 size_t len = 0;
715 len += src1_len;
719 if (len + src2_len >= res_len) {
720 os_memcpy(res + len, src2, res_len - len);
724 os_memcpy(res + len, src2, src2_len);
725 len += src2_len;
728 return len;
732 char * dup_binstr(const void *src, size_t len)
738 res = os_malloc(len + 1);
741 os_memcpy(res, src, len);
742 res[len] = '\0';
939 size_t len = os_strlen(str);
940 os_memset(str, 0, len);
946 void bin_clear_free(void *bin, size_t len)
949 os_memset(bin, 0, len);