Lines Matching defs:length
52 #define MAX_USER 128 /* Maximum length of a user name (i.e., PSK
54 #define MAX_KEY 64 /* Maximum length of a key (i.e., PSK) in bytes. */
169 if (!output_file.s || (output_file.length && output_file.s[0] == '-')) {
265 size_t length) {
281 if (the_token.length > COAP_TOKEN_DEFAULT_MAX) {
284 memcpy(&the_token.s[the_token.length - tokenlen], token, tokenlen);
286 coap_session_new_token(session, &the_token.length, the_token.s);
288 track_new_token(the_token.length, the_token.s);
289 if (!coap_add_token(pdu, the_token.length, the_token.s)) {
296 if (length) {
298 coap_add_data_large_request(session, pdu, length, data,
707 read_file_mem(const char *filename, size_t *length) {
712 *length = 0;
733 *length = (size_t)(statbuf.st_size + 1);
755 size_t length;
760 buf = read_file_mem(oscore_conf_file, &length);
766 file_mem.length = length;
825 if (!proxy_scheme_option && proxy.host.length) {
829 coap_log_err("Absolute URI length must be <= 1034 bytes for a proxy\n");
924 ((1ull << (block.szx + 4)) < payload.length);
949 proxy.path.length != 0 || proxy.query.length != 0) {
958 the_token.length = min(sizeof(_token_data), strlen(arg));
959 if (the_token.length > 0) {
960 memcpy((char *)the_token.s, arg, the_token.length);
992 * return The length of @p dst.
1065 * of size @p length to @p buf. The caller of this function must
1072 * @param length Length of @p seg.
1076 decode_segment(const uint8_t *seg, size_t length, unsigned char *buf) {
1078 while (length--) {
1084 length -= 2;
1097 * or the length of @p s when decoded.
1100 check_segment(const uint8_t *s, size_t length) {
1104 while (length) {
1106 if (length < 2 || !(isxdigit(s[1]) && isxdigit(s[2])))
1110 length -= 2;
1115 --length;
1133 buf->length = len;
1149 buf->length = 20000;
1150 buf->s = (unsigned char *)coap_malloc(buf->length);
1169 buf->length = statbuf.st_size;
1170 buf->s = (unsigned char *)coap_malloc(buf->length);
1177 len = fread(buf->s, 1, buf->length, inputfile);
1179 if (len < 0 || ((size_t)len < buf->length)) {
1183 buf->length = 0;
1187 buf->length = len;
1217 /* 0 length Identity is valid */
1301 snprintf(lhint, sizeof(lhint), "%.*s", (int)hint->length, hint->s);
1366 if ((uri.host.length == 3 && memcmp(uri.host.s, "::1", 3) != 0) ||
1367 (uri.host.length == 9 && memcmp(uri.host.s, "127.0.0.1", 9) != 0))
1368 memcpy(client_sni, uri.host.s, min(uri.host.length, sizeof(client_sni)-1));
1419 if (uri.host.length)
1421 min(uri.host.length, sizeof(client_sni) - 1));
1426 dtls_psk.psk_info.identity.length = identity_len;
1428 dtls_psk.psk_info.key.length = key_len;
1542 local.length = strlen(local_addr);
1636 payload.length = 0;
1640 payload.length = 0;
1675 output_file.length = strlen(optarg);
1676 output_file.s = (unsigned char *)coap_malloc(output_file.length + 1);
1683 memcpy(output_file.s, optarg, output_file.length + 1);
1798 if (proxy.host.length) {
1840 if (the_token.length > COAP_TOKEN_DEFAULT_MAX)
1841 coap_context_set_max_token_size(ctx, the_token.length);
1865 coap_session_init_token(session, the_token.length, the_token.s);
1868 if (coap_uri_into_options(&uri, !uri_host_option && !proxy.host.length ?
1881 if (payload.length) {
1883 data = coap_malloc(payload.length);
1886 memcpy(data, payload.s, payload.length);
1887 data_len = payload.length;
1969 if (payload.length) {
1971 data = coap_malloc(payload.length);
1974 memcpy(data, payload.s, payload.length);
1975 data_len = payload.length;