Lines Matching refs:hdr

528   coap_hash((const unsigned char *)&pdu->hdr->id, sizeof(unsigned short), h);  in coap_transaction_id()
541 if (request && request->hdr->type == COAP_MESSAGE_CON) { in coap_send_ack()
542 response = coap_pdu_init(COAP_MESSAGE_ACK, 0, request->hdr->id, in coap_send_ack()
567 COAP_RESPONSE_CLASS(pdu->hdr->code) > 2) { in coap_send_impl()
572 (unsigned char *)pdu->hdr, pdu->length); in coap_send_impl()
655 response = coap_pdu_init(type, 0, request->hdr->id, sizeof(coap_pdu_t)); in coap_send_message_type()
789 node->retransmit_cnt, ntohs(node->pdu->hdr->id)); in coap_retransmit()
805 if (node->pdu->hdr->code >= 64) { in coap_retransmit()
808 token.length = node->pdu->hdr->token_length; in coap_retransmit()
809 token.s = node->pdu->hdr->token; in coap_retransmit()
993 context->sendqueue->pdu->hdr->token, in coap_cancel_all_messages()
994 context->sendqueue->pdu->hdr->token_length)) { in coap_cancel_all_messages()
997 debug("**** removed transaction %d\n", ntohs(q->pdu->hdr->id)); in coap_cancel_all_messages()
1011 q->pdu->hdr->token, q->pdu->hdr->token_length)) { in coap_cancel_all_messages()
1013 debug("**** removed transaction %d\n", ntohs(q->pdu->hdr->id)); in coap_cancel_all_messages()
1036 size_t size = sizeof(coap_hdr_t) + request->hdr->token_length; in coap_new_error_response()
1052 type = request->hdr->type == COAP_MESSAGE_CON in coap_new_error_response()
1097 response = coap_pdu_init(type, code, request->hdr->id, size); in coap_new_error_response()
1100 if (!coap_add_token(response, request->hdr->token_length, in coap_new_error_response()
1101 request->hdr->token)) { in coap_new_error_response()
1158 resp = coap_pdu_init(request->hdr->type == COAP_MESSAGE_CON in coap_wellknown_response()
1162 request->hdr->id, COAP_MAX_PDU_SIZE); in coap_wellknown_response()
1168 if (!coap_add_token(resp, request->hdr->token_length, request->hdr->token)) { in coap_wellknown_response()
1180 resp->hdr->code = COAP_RESPONSE_CODE(400); in coap_wellknown_response()
1181 resp->length = sizeof(coap_hdr_t) + resp->hdr->token_length; in coap_wellknown_response()
1190 resp->hdr->code = COAP_RESPONSE_CODE(400); in coap_wellknown_response()
1248 resp->data = (unsigned char *)resp->hdr + resp->length; in coap_wellknown_response()
1265 resp->hdr->code = COAP_RESPONSE_CODE(503); in coap_wellknown_response()
1266 resp->length = sizeof(coap_hdr_t) + resp->hdr->token_length; in coap_wellknown_response()
1290 COAP_SET_STR(&token, sent->pdu->hdr->token_length, sent->pdu->hdr->token); in coap_cancel()
1347 return (COAP_RESPONSE_CLASS(response->hdr->code) > 0) in no_response()
1348 && (((1 << (COAP_RESPONSE_CLASS(response->hdr->code) - 1)) & val) > 0); in no_response()
1352 (((Pdu)->hdr->code == COAP_REQUEST_GET) && is_wkc(Key))
1373 switch(node->pdu->hdr->code) { in handle_request()
1409 if ((size_t)node->pdu->hdr->code - 1 < in handle_request()
1411 h = resource->handler[node->pdu->hdr->code - 1]; in handle_request()
1416 response = coap_pdu_init(node->pdu->hdr->type == COAP_MESSAGE_CON in handle_request()
1419 0, node->pdu->hdr->id, COAP_MAX_PDU_SIZE); in handle_request()
1423 if (coap_add_token(response, node->pdu->hdr->token_length, in handle_request()
1424 node->pdu->hdr->token)) { in handle_request()
1425 str token = { node->pdu->hdr->token_length, node->pdu->hdr->token }; in handle_request()
1455 if (observe && ((COAP_RESPONSE_CLASS(response->hdr->code) > 2) in handle_request()
1465 if ((response->hdr->type == COAP_MESSAGE_ACK) in handle_request()
1466 && (response->hdr->code == 0)) { in handle_request()
1468 response->hdr->token_length = 0; in handle_request()
1472 if (response->hdr->type != COAP_MESSAGE_NON || in handle_request()
1473 (response->hdr->code >= 64 in handle_request()
1478 debug("cannot send response for message %d\n", node->pdu->hdr->id); in handle_request()
1514 rcvd->pdu->hdr->token, in handle_response()
1515 rcvd->pdu->hdr->token_length); in handle_response()
1554 switch (rcvd->pdu->hdr->type) {
1559 if (rcvd->pdu->hdr->code == 0)
1565 if (sent && COAP_RESPONSE_CLASS(sent->pdu->hdr->code) == 2) {
1567 { sent->pdu->hdr->token_length, sent->pdu->hdr->token };
1578 coap_log(LOG_ALERT, "got RST for message %u\n", ntohs(rcvd->pdu->hdr->id));
1580 coap_log(LOG_ALERT, "got RST for message %u\n", uip_ntohs(rcvd->pdu->hdr->id));
1621 if (COAP_MESSAGE_IS_REQUEST(rcvd->pdu->hdr))
1623 else if (COAP_MESSAGE_IS_RESPONSE(rcvd->pdu->hdr))
1627 COAP_RESPONSE_CLASS(rcvd->pdu->hdr->code),
1628 rcvd->pdu->hdr->code & 0x1f);