Lines Matching refs:hdr

35   pdu->hdr = pdu->pbuf->payload;  in coap_pdu_clear()
40 memset(pdu->hdr, 0, size); in coap_pdu_clear()
42 pdu->hdr->version = COAP_DEFAULT_VERSION; in coap_pdu_clear()
67 result->hdr = pbuf->payload; in coap_pdu_from_pbuf()
91 pdu->hdr = coap_malloc_type(COAP_PDU_BUF, size); in coap_pdu_init()
92 if (pdu->hdr == NULL) { in coap_pdu_init()
111 pdu->hdr->id = id; in coap_pdu_init()
112 pdu->hdr->type = type; in coap_pdu_init()
113 pdu->hdr->code = code; in coap_pdu_init()
139 if (pdu->hdr != NULL) { in coap_delete_pdu()
140 coap_free_type(COAP_PDU_BUF, pdu->hdr); in coap_delete_pdu()
159 pdu->hdr->token_length = len; in coap_add_token()
161 memcpy(pdu->hdr->token, data, len); in coap_add_token()
183 opt = (unsigned char *)pdu->hdr + pdu->length; in coap_add_option()
215 opt = (unsigned char *)pdu->hdr + pdu->length; in coap_add_option_later()
247 pdu->data = (unsigned char *)pdu->hdr + pdu->length; in coap_add_data()
263 *len = (unsigned char *)pdu->hdr + pdu->length - pdu->data; in coap_get_data()
357 LWIP_ASSERT("coap_pdu_parse with unexpected addresses", data == pdu->hdr); in coap_pdu_parse()
361 pdu->hdr->version = data[0] >> 6; in coap_pdu_parse()
362 pdu->hdr->type = (data[0] >> 4) & 0x03; in coap_pdu_parse()
363 pdu->hdr->token_length = data[0] & 0x0f; in coap_pdu_parse()
364 pdu->hdr->code = data[1]; in coap_pdu_parse()
369 if (pdu->hdr->code == 0) { in coap_pdu_parse()
370 if (length != sizeof(coap_hdr_t) || pdu->hdr->token_length) { in coap_pdu_parse()
376 if (length < sizeof(coap_hdr_t) + pdu->hdr->token_length in coap_pdu_parse()
377 || pdu->hdr->token_length > 8) { in coap_pdu_parse()
385 memcpy(&pdu->hdr->id, data + 2, 2); in coap_pdu_parse()
388 memcpy(pdu->hdr + 1, data + sizeof(coap_hdr_t), length - sizeof(coap_hdr_t)); in coap_pdu_parse()
396 length -= (pdu->hdr->token_length + sizeof(coap_hdr_t)); in coap_pdu_parse()
397 opt = (unsigned char *)(pdu->hdr + 1) + pdu->hdr->token_length; in coap_pdu_parse()
417 (unsigned char *)pdu->hdr + pdu->length); in coap_pdu_parse()