mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-08 10:32:53 +03:00
All this is handled by libcoap with coap-client having the ability to define an initial Hop Count value for testing. No other application support is required. Incoming requests are checked for the Hop Limit option - if found, the value is decremented in the PDU before passing it up to the application. If it decrements to 0, a 5.08 response is generated. coap_add_option() checks if this is a Proxy option for a request. If so, and Hop Limit option does not exist, then the Hop Limit option is inserted into the PDU with the default value (16). coap_send() checks if it is a 5.08 response and if so, prepends the diagnostic data with the IP address of the transmitting interface. If the IP address already exists, then the PDU is dropped as the return path for the 5.08 response is looping. An alternative method for return path looping check is also used by initially setting, then testing and then decrementing the Hop Limit value as response packets pass back through the proxies. If a proxy does not copy the Hop Limit options when returning the 5.08 response, then the IP address duplication is used. Makefile.am: Hide the coap_insert_option(), coap_update_option and coap_pdu_check_resize() function from applications. README.md: Add in RFC8768 is supported by libcoap. examples/client.c: Add in the -H hoplimit option. include/coap2/pdu.h: Add in the default Hop-Limit: option COAP_OPTION_HOP_LIMIT. Re-organize the COAP_OPTION_ descriptions to include the C, U, N, R, E, I and U flags. Expose the internal coap_pdu_check_resize() function so src/net.c can use it. Define the two new internal functions coap_insert_option() and coap_update_option() and expose them so that the test suites can use them. man/coap-client.txt.in: Document the new -H hoplimit option. man/coap.txt.in: Include the new RFC8768. man/coap_pdu_setup.txt.in: Update documentation for the CoAP options. src/coap_debug.c: Add in support for printing out COAP_OPTION_HOP_LIMIT. src/net.c: Make sure that COAP_OPTION_HOP_LIMIT is not returned in an error response. Decrement received Hop-limit in handle_request() and generate 5.08 response if appropriate. Update coap_send() to prepend IP in 5.08 response. Support COAP_OPTION_HOP_LIMIT being used in the 5.08 response message. src/pdu.c: Report on CoAP options that are repeated, but not defined as repeatable. Define new (5.08) Hop Limit Reached error response. Add in new internal coap_insert_option() function. This now means that callers of coap_add_option() no longer have to have the options in the correct order. Add in new internal coap_update_option() function that updates the value of an option. Make coap_pdu_check_resize() non-static. tests/test_pdu.c: Check that options are getting inserted in the correct order when using coap_insert_option(), even though they are provided in a random order. Test the coap_update_option() function.
This README documents the test cases supported for the 1st ETSI CoAP plugtest on March 24/25 in Paris, France. <http://www.etsi.org/plugtests/coap/coap.htm> Legend: [+] full support [o] partial support [-] no support [?] needs check [ ] has open issues Mandatory Tests [+] TD_COAP_CORE_01 Perform GET transaction (CON mode) [+] TD_COAP_CORE_02 Perform POST transaction (CON mode) [+] TD_COAP_CORE_03 Perform PUT transaction (CON mode) [+] TD_COAP_CORE_04 Perform DELETE transaction (CON mode) [+] TD_COAP_CORE_05 Perform GET transaction (NON mode) [+] TD_COAP_CORE_06 Perform POST transaction (NON mode) [+] TD_COAP_CORE_07 Perform PUT transaction (NON mode) [+] TD_COAP_CORE_08 Perform DELETE transaction (NON mode) [+] TD_COAP_CORE_09 Perform GET transaction with delayed response (CON mode, no piggyback) [+] TD_COAP_CORE_10 Handle request containing Token option [+] TD_COAP_CORE_11 Handle request not containing Token option [+] TD_COAP_CORE_12 Handle request containing several Uri-Path options [+] TD_COAP_CORE_13 Handle request containing several Uri-Query options [?] TD_COAP_CORE_14 Interoperate in lossy context (CON mode, piggybacked response) [?] TD_COAP_CORE_15 Interoperate in lossy context (CON mode, delayed response) Optional Tests [ ] TD_COAP_LINK_01 Access to well-known interface for resource discovery [-] TD_COAP_LINK_02 Use filtered requests for limiting discovery results [+] TD_COAP_BLOCK_01 Handle GET blockwise transfer for large resource (early negotiation) [+] TD_COAP_BLOCK_02 Handle GET blockwise transfer for large resource (late negotiation) [-] TD_COAP_BLOCK_03 Handle PUT blockwise transfer for large resource [-] TD_COAP_BLOCK_04 Handle POST blockwise transfer for large resource [-] TD_COAP_OBS_01 Handle resource observation [-] TD_COAP_OBS_02 Stop resource observation [-] TD_COAP_OBS_03 Client detection of deregistration (Max-Age) [-] TD_COAP_OBS_04 Server detection of deregistration (client OFF) [-] TD_COAP_OBS_05 Server detection of deregistration (explicit RST)