Home
last modified time | relevance | path

Searched refs:hdr (Results 1 – 24 of 24) sorted by relevance

/net-tools-2.7.6/libcoap/tests/
Dtest_error_response.c37 pdu->hdr->type = COAP_MESSAGE_CON; in t_error_response1()
38 pdu->hdr->id = htons(0x1234); in t_error_response1()
47 CU_ASSERT(response->hdr->version == 1); in t_error_response1()
48 CU_ASSERT(response->hdr->type == COAP_MESSAGE_ACK); in t_error_response1()
49 CU_ASSERT(response->hdr->token_length == 0); in t_error_response1()
50 CU_ASSERT(response->hdr->code == 0x80); in t_error_response1()
51 CU_ASSERT(pdu->hdr->id == htons(0x1234)); in t_error_response1()
53 CU_ASSERT(memcmp(response->hdr, teststr, sizeof(teststr)) == 0); in t_error_response1()
66 pdu->hdr->type = COAP_MESSAGE_NON; in t_error_response2()
67 pdu->hdr->id = htons(0x1234); in t_error_response2()
[all …]
Dtest_pdu.c34 CU_ASSERT(pdu->hdr->version == 1); in t_parse_pdu1()
35 CU_ASSERT(pdu->hdr->type == COAP_MESSAGE_CON); in t_parse_pdu1()
36 CU_ASSERT(pdu->hdr->token_length == 0); in t_parse_pdu1()
37 CU_ASSERT(pdu->hdr->code == COAP_REQUEST_GET); in t_parse_pdu1()
38 CU_ASSERT(memcmp(&pdu->hdr->id, teststr + 2, 2) == 0); in t_parse_pdu1()
51 CU_ASSERT(pdu->hdr->version == 1); in t_parse_pdu2()
52 CU_ASSERT(pdu->hdr->type == COAP_MESSAGE_NON); in t_parse_pdu2()
53 CU_ASSERT(pdu->hdr->token_length == 5); in t_parse_pdu2()
54 CU_ASSERT(pdu->hdr->code == 0x69); in t_parse_pdu2()
55 CU_ASSERT(memcmp(&pdu->hdr->id, teststr + 2, 2) == 0); in t_parse_pdu2()
[all …]
Dtest_wellknown.c174 == (unsigned char *)response->hdr + response->length - response->data); in t_wellknown4()
206 == (unsigned char *)response->hdr + response->length - response->data); in t_wellknown5()
221 pdu->hdr->type = COAP_MESSAGE_NON; in t_wellknown6()
222 pdu->hdr->code = COAP_REQUEST_GET; in t_wellknown6()
223 pdu->hdr->id = htons(0x1234); in t_wellknown6()
Dtest_options.c435 .hdr = (coap_hdr_t *)teststr, in t_iterate_option1()
460 .hdr = (coap_hdr_t *)teststr, in t_iterate_option2()
486 .hdr = (coap_hdr_t *)teststr, in t_iterate_option3()
528 .hdr = (coap_hdr_t *)teststr, in t_iterate_option4()
569 .hdr = (coap_hdr_t *)teststr, in t_iterate_option5()
601 .hdr = (coap_hdr_t *)teststr, in t_iterate_option6()
645 .hdr = (coap_hdr_t *)teststr, in t_iterate_option7()
691 .hdr = (coap_hdr_t *)teststr, in t_iterate_option8()
721 .hdr = (coap_hdr_t *)teststr, in t_iterate_option9()
751 .hdr = (coap_hdr_t *)teststr, in t_iterate_option10()
Dtest_uri.c330 .hdr = (coap_hdr_t *)teststr, in t_parse_uri13()
/net-tools-2.7.6/mbedtls-2.4.0/library/
Dmemory_buffer_alloc.c95 static void debug_header( memory_header *hdr ) in debug_header() argument
103 (size_t) hdr, (size_t) hdr->prev, (size_t) hdr->next, in debug_header()
104 hdr->alloc, hdr->size ); in debug_header()
106 (size_t) hdr->prev_free, (size_t) hdr->next_free ); in debug_header()
110 for( i = 0; i < hdr->trace_count; i++ ) in debug_header()
111 mbedtls_fprintf( stderr, "%s\n", hdr->trace[i] ); in debug_header()
138 static int verify_header( memory_header *hdr ) in verify_header() argument
140 if( hdr->magic1 != MAGIC1 ) in verify_header()
148 if( hdr->magic2 != MAGIC2 ) in verify_header()
156 if( hdr->alloc > 1 ) in verify_header()
[all …]
/net-tools-2.7.6/libcoap/src/
Dpdu.c35 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()
[all …]
Dnet.c528 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()
[all …]
Dasync.c41 request->hdr->token_length); in coap_register_async()
47 memset(s, 0, sizeof(coap_async_state_t) + request->hdr->token_length); in coap_register_async()
51 if (request->hdr->type == COAP_MESSAGE_CON) in coap_register_async()
58 if (request->hdr->token_length) { in coap_register_async()
59 s->tokenlen = request->hdr->token_length; in coap_register_async()
60 memcpy(s->token, request->hdr->token, request->hdr->token_length); in coap_register_async()
Doption.c27 if (pdu && pdu->hdr && in options_start()
28 (pdu->hdr->token + pdu->hdr->token_length in options_start()
29 < (unsigned char *)pdu->hdr + pdu->length)) { in options_start()
31 coap_opt_t *opt = pdu->hdr->token + pdu->hdr->token_length; in options_start()
123 assert(pdu->hdr); in coap_option_iterator_init()
128 oi->next_option = (unsigned char *)pdu->hdr + sizeof(coap_hdr_t) in coap_option_iterator_init()
129 + pdu->hdr->token_length; in coap_option_iterator_init()
130 if ((unsigned char *)pdu->hdr + pdu->length <= oi->next_option) { in coap_option_iterator_init()
135 assert((sizeof(coap_hdr_t) + pdu->hdr->token_length) <= pdu->length); in coap_option_iterator_init()
137 oi->length = pdu->length - (sizeof(coap_hdr_t) + pdu->hdr->token_length); in coap_option_iterator_init()
Ddebug.c386 pdu->hdr->version, msg_type_string(pdu->hdr->type), in coap_show_pdu()
387 msg_code_string(pdu->hdr->code), ntohs(pdu->hdr->id)); in coap_show_pdu()
389 for (i = 0; i < pdu->hdr->token_length; i++) { in coap_show_pdu()
390 fprintf(COAP_DEBUG_FD, "%02x", pdu->hdr->token[i]); in coap_show_pdu()
Dresource.c649 response->hdr->id = coap_new_message_id(context);
652 response->hdr->type = COAP_MESSAGE_NON;
654 response->hdr->type = COAP_MESSAGE_CON;
662 if (response->hdr->type == COAP_MESSAGE_CON) {
670 if (COAP_INVALID_TID == tid || response->hdr->type != COAP_MESSAGE_CON)
/net-tools-2.7.6/libcoap/examples/
Dclient.c143 pdu->hdr->type = msgtype; in coap_new_request()
144 pdu->hdr->id = coap_new_message_id(ctx); in coap_new_request()
145 pdu->hdr->code = m; in coap_new_request()
147 pdu->hdr->token_length = the_token.length; in coap_new_request()
242 if (pdu->hdr->type == COAP_MESSAGE_CON) in clear_obs()
250 } else if (pdu->hdr->type != COAP_MESSAGE_CON) in clear_obs()
305 ((Pdu)->hdr->code == COAP_RESPONSE_CODE(201) || \
306 (Pdu)->hdr->code == COAP_RESPONSE_CODE(204)))
310 return received->hdr->token_length == the_token.length && in check_token()
311 memcmp(received->hdr->token, the_token.s, the_token.length) == 0; in check_token()
[all …]
Detsi_iot_01.c134 response->hdr->code = COAP_RESPONSE_CODE(205); in hnd_get_index()
157 response->hdr->code = COAP_RESPONSE_CODE(500); in hnd_get_resource()
162 response->hdr->code = COAP_RESPONSE_CODE(205); in hnd_get_resource()
183 response->hdr->code = COAP_RESPONSE_CODE(400); in hnd_get_resource()
189 response->hdr->code = COAP_RESPONSE_CODE(500); in hnd_get_resource()
217 strlen(coap_response_phrase(response->hdr->code)), in hnd_get_resource()
218 (unsigned char *)coap_response_phrase(response->hdr->code)); in hnd_get_resource()
235 response->hdr->code = COAP_RESPONSE_CODE(202); in hnd_delete_resource()
263 response->hdr->code = COAP_RESPONSE_CODE(500); in hnd_post_test()
299 response->hdr->code = COAP_RESPONSE_CODE(201); in hnd_post_test()
[all …]
Dcoap-rd.c108 response->hdr->code = COAP_RESPONSE_CODE(205); in hnd_get_resource()
132 response->hdr->code = COAP_RESPONSE_CODE(501); in hnd_put_resource()
138 int type = (request->hdr->type == COAP_MESSAGE_CON) in hnd_put_resource()
183 response = coap_pdu_init(type, code, request->hdr->id, size); in hnd_put_resource()
186 debug("cannot create response for message %d\n", request->hdr->id); in hnd_put_resource()
190 if (request->hdr->token_length) in hnd_put_resource()
191 coap_add_token(response, request->hdr->token_length, request->hdr->token); in hnd_put_resource()
195 request->hdr->id); in hnd_put_resource()
220 response->hdr->code = COAP_RESPONSE_CODE(202); in hnd_delete_resource()
233 response->hdr->code = COAP_RESPONSE_CODE(205); in hnd_get_rd()
[all …]
Dtiny.c35 pdu->hdr->type = COAP_MESSAGE_NON; in make_pdu()
36 pdu->hdr->code = COAP_REQUEST_POST; in make_pdu()
37 pdu->hdr->id = htons(id++); in make_pdu()
Dcoap-server.c78 response->hdr->code = COAP_RESPONSE_CODE(205); in hnd_get_index()
110 response->hdr->code = in hnd_get_time()
176 response->hdr->code = in hnd_put_time()
223 if (async->id != request->hdr->id) { in hnd_get_async()
226 response->hdr->code = COAP_RESPONSE_CODE(503); in hnd_get_async()
270 response->hdr->id = coap_new_message_id(ctx); in check_async()
279 response->hdr->id); in check_async()
/net-tools-2.7.6/
Dmonitor_15_4.c125 struct pcap_file_header hdr; in monitor_pcap_create() local
137 memset(&hdr, 0, PCAP_FILE_HDR_SIZE); in monitor_pcap_create()
138 hdr.magic = 0xa1b2c3d4; in monitor_pcap_create()
139 hdr.version_major = 0x0002; in monitor_pcap_create()
140 hdr.version_minor = 0x0004; in monitor_pcap_create()
141 hdr.thiszone = 0; in monitor_pcap_create()
142 hdr.sigfigs = 0; in monitor_pcap_create()
143 hdr.snaplen = 0x0000ffff; in monitor_pcap_create()
148 hdr.linktype = 0x000000E6; in monitor_pcap_create()
150 len = write(pcap->fd, &hdr, PCAP_FILE_HDR_SIZE); in monitor_pcap_create()
Dcoap-client.c775 data[user_data->index].expected_mid = ntohs(pdu->hdr->id); in create_pdu()
810 if (pdu->hdr->type == COAP_MESSAGE_CON) in send_packets()
821 if (pdu->hdr->type != COAP_MESSAGE_CON || tid == COAP_INVALID_TID) in send_packets()
860 if (pdu->hdr->type == COAP_MESSAGE_CON) in try_send()
871 if (pdu->hdr->type != COAP_MESSAGE_CON || tid == COAP_INVALID_TID) in try_send()
1094 return received->hdr->token_length == the_token.length && in check_token()
1095 memcmp(received->hdr->token, the_token.s, in check_token()
1106 (received->hdr->type == COAP_MESSAGE_CON || in is_our_own()
1107 received->hdr->type == COAP_MESSAGE_NON)) in is_our_own()
1165 pdu->hdr->type = msgtype; in coap_new_request()
[all …]
Dnet-capture.py92 hdr = now.strftime("%Y%m%dZ%H:%M:%S") + "." + str(now.microsecond)
93 print('[%s] %s' % (hdr, packet.summary()))
Dthroughput-client.c493 struct header *hdr; in main() local
508 hdr = (struct header *)data[i].buf; in main()
509 hdr->type = TYPE_SEQ_NUM; in main()
510 hdr->len = sizeof(seq); in main()
511 memcpy(hdr->value, &seq, sizeof(seq)); in main()
/net-tools-2.7.6/libcoap/examples/contiki/
Dcoap-observer.c105 (received->hdr->code >> 5), received->hdr->code & 0x1F); in message_handler()
Dserver.c107 response->hdr->code = in hnd_get_time()
/net-tools-2.7.6/libcoap/include/coap/
Dpdu.h229 coap_hdr_t *hdr; /**< Address of the first byte of the CoAP message. member