Lines Matching refs:max_len
93 return (cpkt != NULL) && (cpkt->max_len - cpkt->offset >= bytes_to_add); in enough_space()
169 int coap_packet_init(struct coap_packet *cpkt, uint8_t *data, uint16_t max_len, in coap_packet_init() argument
176 if (!cpkt || !data || !max_len) { in coap_packet_init()
184 cpkt->max_len = max_len; in coap_packet_init()
220 uint8_t *data, uint16_t max_len, uint8_t code) in coap_ack_init() argument
231 return coap_packet_init(cpkt, data, max_len, ver, COAP_TYPE_ACK, tkl, in coap_ack_init()
236 uint8_t *data, uint16_t max_len) in coap_rst_init() argument
244 return coap_packet_init(cpkt, data, max_len, ver, COAP_TYPE_RESET, 0, in coap_rst_init()
457 uint16_t max_len, uint8_t *value) in read_u8() argument
459 if (max_len - offset < 1) { in read_u8()
466 return max_len - offset; in read_u8()
470 uint16_t max_len, uint16_t *value) in read_be16() argument
472 if (max_len - offset < 2) { in read_be16()
480 return max_len - offset; in read_be16()
484 uint16_t max_len, uint16_t len, uint8_t *value) in read() argument
486 if (max_len - offset < len) { in read()
494 return max_len - offset; in read()
497 static int decode_delta(uint8_t *data, uint16_t offset, uint16_t *pos, uint16_t max_len, in decode_delta() argument
507 ret = read_u8(data, offset, pos, max_len, &val); in decode_delta()
518 ret = read_be16(data, offset, pos, max_len, &val); in decode_delta()
534 uint16_t max_len, uint16_t *opt_delta, uint16_t *opt_len, in parse_option() argument
543 r = read_u8(data, offset, pos, max_len, &opt); in parse_option()
569 r = decode_delta(data, *pos, pos, max_len, in parse_option()
582 r = decode_delta(data, *pos, pos, max_len, in parse_option()
622 r = read(data, *pos, pos, max_len, len, &option->value[0]); in parse_option()
631 r = max_len - *pos; in parse_option()
769 cpkt->max_len = len; in coap_packet_parse()
798 ret = parse_option(cpkt->data, offset, &offset, cpkt->max_len, in coap_packet_parse()
925 if (cpkt->hdr_len == cpkt->max_len) { in coap_find_options()
936 cpkt->max_len, &delta, &opt_len, in coap_find_options()