Lines Matching refs:length
83 if (!output_file.s || (output_file.length && output_file.s[0] == '-')) in append_to_output()
108 if (!output_file.s || (output_file.length && output_file.s[0] == '-')) in close_output()
136 size_t length) { in coap_new_request() argument
147 pdu->hdr->token_length = the_token.length; in coap_new_request()
148 if ( !coap_add_token(pdu, the_token.length, the_token.s)) { in coap_new_request()
167 if (length) { in coap_new_request()
169 coap_add_data(pdu, length, data); in coap_new_request()
171 coap_add_block(pdu, length, data, block.num, block.szx); in coap_new_request()
196 if (!coap_add_token(pdu, the_token.length, the_token.s)) { in clear_obs()
269 if (server->length) in resolve_address()
270 memcpy(addrstr, server->s, server->length); in resolve_address()
310 return received->hdr->token_length == the_token.length && in check_token()
311 memcmp(received->hdr->token, the_token.s, the_token.length) == 0; in check_token()
435 if (payload.length <= (block.num+1) * (1 << (block.szx + 4))) { in message_handler()
467 block.m = ((block.num+1) * (1 << (block.szx + 4)) < payload.length); in message_handler()
476 payload.length, in message_handler()
576 new_option_node(unsigned short key, unsigned int length, unsigned char *data) { in new_option_node() argument
579 node = coap_malloc(sizeof(coap_list_t) + sizeof(coap_option) + length); in new_option_node()
585 COAP_OPTION_LENGTH(*option) = length; in new_option_node()
586 memcpy(COAP_OPTION_DATA(*option), data, length); in new_option_node()
671 if (proxy.length) { /* create Proxy-Uri from argument */ in cmdline_uri()
698 if (uri.path.length) { in cmdline_uri()
700 res = coap_split_path(uri.path.s, uri.path.length, buf, &buflen); in cmdline_uri()
712 if (uri.query.length) { in cmdline_uri()
715 res = coap_split_query(uri.query.s, uri.query.length, buf, &buflen); in cmdline_uri()
763 ((1u << (block.szx + 4)) < payload.length); in set_blocksize()
801 proxy.length = strlen(arg); in cmdline_proxy()
802 if ( (proxy.s = coap_malloc(proxy.length + 1)) == NULL) { in cmdline_proxy()
803 proxy.length = 0; in cmdline_proxy()
807 memcpy(proxy.s, arg, proxy.length+1); in cmdline_proxy()
814 the_token.length = strlen(arg); in cmdline_token()
854 decode_segment(const unsigned char *seg, size_t length, unsigned char *buf) { in decode_segment() argument
856 while (length--) { in decode_segment()
861 seg += 2; length -= 2; in decode_segment()
876 check_segment(const unsigned char *s, size_t length) { in check_segment() argument
880 while (length) { in check_segment()
882 if (length < 2 || !(isxdigit(s[1]) && isxdigit(s[2]))) in check_segment()
886 length -= 2; in check_segment()
889 ++s; ++n; --length; in check_segment()
907 buf->length = len; in cmdline_input()
923 buf->length = 20000; in cmdline_input_from_file()
924 buf->s = (unsigned char *)coap_malloc(buf->length); in cmdline_input_from_file()
936 buf->length = statbuf.st_size; in cmdline_input_from_file()
937 buf->s = (unsigned char *)coap_malloc(buf->length); in cmdline_input_from_file()
949 len = fread(buf->s, 1, buf->length, inputfile); in cmdline_input_from_file()
951 if (len < 0 || ((size_t)len < buf->length)) { in cmdline_input_from_file()
955 buf->length = 0; in cmdline_input_from_file()
959 buf->length = len; in cmdline_input_from_file()
1057 payload.length = 0; in main()
1061 payload.length = 0; in main()
1077 output_file.length = strlen(optarg); in main()
1078 output_file.s = (unsigned char *)coap_malloc(output_file.length + 1); in main()
1085 memcpy(output_file.s, optarg, output_file.length + 1); in main()
1124 if (proxy.length) { in main()
1172 if (!proxy.length && addrptr in main()
1174 && (strlen(addr) != uri.host.length in main()
1175 || memcmp(addr, uri.host.s, uri.host.length) != 0)) { in main()
1180 uri.host.length, in main()
1188 if (! (pdu = coap_new_request(ctx, method, &optlist, payload.s, payload.length))) in main()