Lines Matching refs:response
538 coap_pdu_t *response; in coap_send_ack() local
542 response = coap_pdu_init(COAP_MESSAGE_ACK, 0, request->hdr->id, in coap_send_ack()
544 if (response) { in coap_send_ack()
545 result = coap_send(context, local_interface, dst, response); in coap_send_ack()
546 coap_delete_pdu(response); in coap_send_ack()
630 coap_pdu_t *response; in coap_send_error() local
636 response = coap_new_error_response(request, code, opts); in coap_send_error()
637 if (response) { in coap_send_error()
638 result = coap_send(context, local_interface, dst, response); in coap_send_error()
639 coap_delete_pdu(response); in coap_send_error()
651 coap_pdu_t *response; in coap_send_message_type() local
655 response = coap_pdu_init(type, 0, request->hdr->id, sizeof(coap_pdu_t)); in coap_send_message_type()
656 if (response) { in coap_send_message_type()
657 result = coap_send(context, local_interface, dst, response); in coap_send_message_type()
658 coap_delete_pdu(response); in coap_send_message_type()
1035 coap_pdu_t *response; in coap_new_error_response() local
1097 response = coap_pdu_init(type, code, request->hdr->id, size); in coap_new_error_response()
1098 if (response) { in coap_new_error_response()
1100 if (!coap_add_token(response, request->hdr->token_length, in coap_new_error_response()
1103 coap_delete_pdu(response); in coap_new_error_response()
1110 coap_add_option(response, opt_iter.type, in coap_new_error_response()
1117 coap_add_data(response, strlen(phrase), (unsigned char *)phrase); in coap_new_error_response()
1121 return response; in coap_new_error_response()
1333 no_response(coap_pdu_t *request, coap_pdu_t *response) { in no_response() argument
1339 assert(response); in no_response()
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()
1357 coap_pdu_t *response = NULL; in handle_request() local
1378 response = coap_wellknown_response(context, node->pdu); in handle_request()
1384 response = in handle_request()
1395 response = coap_new_error_response(node->pdu, COAP_RESPONSE_CODE(405), in handle_request()
1399 if (response && !no_response(node->pdu, response) && coap_send(context, &node->local_if, in handle_request()
1400 &node->remote, response) == COAP_INVALID_TID) { in handle_request()
1403 coap_delete_pdu(response); in handle_request()
1416 response = coap_pdu_init(node->pdu->hdr->type == COAP_MESSAGE_CON in handle_request()
1423 if (coap_add_token(response, node->pdu->hdr->token_length, in handle_request()
1452 node->pdu, &token, response); in handle_request()
1454 if (!no_response(node->pdu, response)) { 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()
1469 response->length = sizeof(coap_hdr_t); in handle_request()
1472 if (response->hdr->type != COAP_MESSAGE_NON || in handle_request()
1473 (response->hdr->code >= 64 in handle_request()
1477 &node->remote, response) == COAP_INVALID_TID) { in handle_request()
1482 coap_delete_pdu(response); in handle_request()
1489 response = coap_wellknown_response(context, node->pdu); in handle_request()
1490 debug("have wellknown response %p\n", (void *)response); in handle_request()
1492 response = coap_new_error_response(node->pdu, COAP_RESPONSE_CODE(405), in handle_request()
1495 if (!response || (coap_send(context, &node->local_if, &node->remote, in handle_request()
1496 response) == COAP_INVALID_TID)) { in handle_request()
1499 coap_delete_pdu(response); in handle_request()
1539 coap_pdu_t *response; local
1600 response =
1603 if (!response)
1606 if (coap_send(context, &rcvd->local_if, &rcvd->remote, response)
1610 coap_delete_pdu(response);