Lines Matching refs:opt_len
288 uint8_t opt_len; in encode_option() local
294 len_size = encode_extended_option(len, &opt_len, &len_ext); in encode_option()
297 option_header_set_len(&opt, opt_len); in encode_option()
363 if (cpkt->opt_len) { in coap_packet_append_option()
367 r = encode_option(cpkt, code, value, len, cpkt->hdr_len + cpkt->opt_len); in coap_packet_append_option()
372 cpkt->opt_len += r; in coap_packet_append_option()
534 uint16_t max_len, uint16_t *opt_delta, uint16_t *opt_len, in parse_option() argument
554 *opt_len += 1U; in parse_option()
575 if (u16_add_overflow(*opt_len, hdr_len, opt_len)) { in parse_option()
588 if (u16_add_overflow(*opt_len, hdr_len, opt_len)) { in parse_option()
594 u16_add_overflow(*opt_len, len, opt_len)) { in parse_option()
647 cpkt->opt_len -= move_size; in remove_option_data()
662 uint16_t opt_len = 0; in remove_middle_option() local
665 r = parse_option(cpkt->data, offset, &offset, cpkt->hdr_len + cpkt->opt_len, in remove_middle_option()
666 &opt_delta, &opt_len, &option); in remove_middle_option()
680 cpkt->opt_len += r; in remove_middle_option()
688 uint16_t opt_len = 0; in coap_packet_remove_option() local
698 if (cpkt->opt_len == 0) { in coap_packet_remove_option()
710 while (offset < cpkt->hdr_len + cpkt->opt_len) { in coap_packet_remove_option()
711 r = parse_option(cpkt->data, offset, &offset, cpkt->hdr_len + cpkt->opt_len, in coap_packet_remove_option()
712 &opt_delta, &opt_len, &option); in coap_packet_remove_option()
730 if (cpkt->opt_len > opt_len) { in coap_packet_remove_option()
738 remove_option_data(cpkt, previous_offset, cpkt->hdr_len + cpkt->opt_len); in coap_packet_remove_option()
748 uint16_t opt_len; in coap_packet_parse() local
770 cpkt->opt_len = 0U; in coap_packet_parse()
790 opt_len = 0U; in coap_packet_parse()
799 &delta, &opt_len, option); in coap_packet_parse()
807 cpkt->opt_len = opt_len; in coap_packet_parse()
918 uint16_t opt_len; in coap_find_options() local
930 opt_len = 0U; in coap_find_options()
936 cpkt->max_len, &delta, &opt_len, in coap_find_options()
1077 payload_len = cpkt->offset - cpkt->hdr_len - cpkt->opt_len; in coap_packet_get_payload()
1085 cpkt->data + cpkt->hdr_len + cpkt->opt_len + 1; in coap_packet_get_payload()
1394 uint16_t opt_len = 0; in insert_option() local
1400 while (offset < cpkt->hdr_len + cpkt->opt_len) { in insert_option()
1401 r = parse_option(cpkt->data, offset, &offset, cpkt->hdr_len + cpkt->opt_len, in insert_option()
1402 &opt_delta, &opt_len, &option); in insert_option()
1418 cpkt->opt_len -= option_size; in insert_option()
1428 cpkt->opt_len += r; in insert_option()
1435 cpkt->opt_len += r; in insert_option()