From 4a461f5221c963d6ca3669f1e2bccf374f9764ed Mon Sep 17 00:00:00 2001 From: Valerii Koval Date: Thu, 5 Jan 2023 12:42:19 +0200 Subject: [PATCH] Update examples --- examples/espidf-aws-iot/platformio.ini | 6 + .../components/CMakeLists.txt | 41 + .../espidf-coap-server/components/Kconfig | 109 + .../espidf-coap-server/components/LICENSE | 85 + .../espidf-coap-server/components/README.md | 89 + .../components/idf_component.yml | 5 + .../.github/ISSUE_TEMPLATE/bug_report.md | 112 + .../libcoap/.github/ISSUE_TEMPLATE/config.yml | 14 + .../.github/ISSUE_TEMPLATE/feature_request.md | 26 + .../libcoap/.github/workflows/main.yml | 196 + .../components/libcoap/.gitignore | 116 + .../components/libcoap/.gitmodules | 4 + .../components/libcoap/.travis.yml | 70 + .../components/libcoap/AUTHORS | 8 + .../components/libcoap/BUILDING | 157 + .../components/libcoap/CMakeLists.txt | 723 +++ .../components/libcoap/CONTRIBUTE | 218 + .../components/libcoap/COPYING | 6 + .../components/libcoap/ChangeLog | 332 ++ .../components/libcoap/Dockerfile | 7 + .../components/libcoap/HOWTO.dual.gnutls | 98 + .../components/libcoap/HOWTO.dual.openssl | 50 + .../components/libcoap/HOWTO.dual.softhsm2 | 90 + .../components/libcoap/HOWTO.pkcs11 | 129 + .../components/libcoap/LICENSE | 85 + .../components/libcoap/Makefile.am | 281 + .../components/libcoap/Makefile.libcoap | 7 + .../components/libcoap/NEWS | 0 .../components/libcoap/README | 89 + .../components/libcoap/README.md | 89 + .../components/libcoap/TODO | 27 + .../components/libcoap/autogen.sh | 142 + .../libcoap/build-env/.dockerignore | 5 + .../libcoap/build-env/Dockerfile.build-env | 7 + .../libcoap/build-env/Dockerfile.develop | 36 + .../components/libcoap/build-env/build.sh | 16 + .../components/libcoap/build-env/imagename | 2 + .../components/libcoap/cmake-format.yaml | 25 + .../libcoap/cmake/FindMbedTLS.cmake | 35 + .../libcoap/cmake/FindTinyDTLS.cmake | 88 + .../components/libcoap/cmake_coap_config.h.in | 177 + .../components/libcoap/coap_config.h.contiki | 215 + .../components/libcoap/coap_config.h.lwip | 42 + .../components/libcoap/coap_config.h.lwip.in | 42 + .../components/libcoap/coap_config.h.riot | 143 + .../components/libcoap/coap_config.h.riot.in | 143 + .../components/libcoap/coap_config.h.windows | 118 + .../libcoap/coap_config.h.windows.in | 118 + .../components/libcoap/configure.ac | 1106 ++++ .../components/libcoap/doc/Doxyfile.in | 2612 +++++++++ .../components/libcoap/doc/Makefile.am | 288 + .../components/libcoap/doc/docbook.local.css | 47 + .../components/libcoap/doc/main.md | 69 + .../components/libcoap/doc/module_api_wrap.h | 21 + .../libcoap/doc/upgrade_4.2.1_4.3.0.txt | 431 ++ .../libcoap/doc/upgrade_4.3.0_4.3.1.txt | 6 + .../components/libcoap/examples/Makefile.am | 129 + .../libcoap/examples/README.etsi_iot | 43 + .../components/libcoap/examples/coap-client.c | 1944 +++++++ .../components/libcoap/examples/coap-rd.c | 879 +++ .../components/libcoap/examples/coap-server.c | 2980 ++++++++++ .../components/libcoap/examples/coap_list.c | 67 + .../components/libcoap/examples/coap_list.h | 52 + .../libcoap/examples/contiki/.gitignore | 7 + .../libcoap/examples/contiki/Makefile.contiki | 33 + .../libcoap/examples/contiki/README | 30 + .../libcoap/examples/contiki/coap-observer.c | 186 + .../examples/contiki/radvd.conf.sample | 14 + .../libcoap/examples/contiki/server.c | 222 + .../libcoap/examples/etsi_coaptest.sh | 210 + .../components/libcoap/examples/etsi_iot_01.c | 633 +++ .../examples/etsi_iot_01_largedata.txt | 7 + .../libcoap/examples/etsi_testcases.sh | 765 +++ .../components/libcoap/examples/getopt.c | 66 + .../libcoap/examples/lwip/.gitignore | 7 + .../components/libcoap/examples/lwip/README | 30 + .../libcoap/examples/lwip/lwipopts.h | 37 + .../libcoap/examples/lwip/server-coap.c | 147 + .../libcoap/examples/lwip/server-coap.h | 17 + .../components/libcoap/examples/lwip/server.c | 91 + .../examples/share.libcoap.examples.Makefile | 43 + .../examples/share.libcoap.examples.README | 9 + .../components/libcoap/examples/tiny.c | 183 + .../components/libcoap/ext/tinydtls/ABOUT.md | 60 + .../libcoap/ext/tinydtls/AutoConf.cmake | 101 + .../libcoap/ext/tinydtls/CMakeLists.txt | 85 + .../libcoap/ext/tinydtls/CONTRIBUTING.md | 144 + .../components/libcoap/ext/tinydtls/LICENSE | 12 + .../libcoap/ext/tinydtls/Makefile.riot | 7 + .../libcoap/ext/tinydtls/Makefile.tinydtls | 9 + .../components/libcoap/ext/tinydtls/README.md | 81 + .../libcoap/ext/tinydtls/aes/Makefile.riot | 5 + .../libcoap/ext/tinydtls/aes/rijndael.c | 1231 +++++ .../libcoap/ext/tinydtls/aes/rijndael.h | 69 + .../libcoap/ext/tinydtls/aes/rijndael_wrap.c | 69 + .../components/libcoap/ext/tinydtls/alert.h | 85 + .../libcoap/ext/tinydtls/autogen.sh | 21 + .../components/libcoap/ext/tinydtls/ccm.c | 303 ++ .../components/libcoap/ext/tinydtls/ccm.h | 61 + .../libcoap/ext/tinydtls/configure.ac | 153 + .../components/libcoap/ext/tinydtls/crypto.c | 641 +++ .../components/libcoap/ext/tinydtls/crypto.h | 434 ++ .../libcoap/ext/tinydtls/doc/Doxyfile.in | 1551 ++++++ .../ext/tinydtls/doc/DoxygenLayout.xml | 184 + .../components/libcoap/ext/tinydtls/dtls.c | 4780 +++++++++++++++++ .../components/libcoap/ext/tinydtls/dtls.h | 755 +++ .../ext/tinydtls/dtls_config.h.cmake.in | 162 + .../libcoap/ext/tinydtls/dtls_debug.c | 460 ++ .../libcoap/ext/tinydtls/dtls_debug.h | 123 + .../libcoap/ext/tinydtls/dtls_mutex.h | 68 + .../libcoap/ext/tinydtls/dtls_prng.c | 39 + .../libcoap/ext/tinydtls/dtls_prng.h | 56 + .../libcoap/ext/tinydtls/dtls_time.c | 98 + .../libcoap/ext/tinydtls/dtls_time.h | 96 + .../libcoap/ext/tinydtls/ecc/Makefile.contiki | 7 + .../libcoap/ext/tinydtls/ecc/Makefile.ecc | 3 + .../libcoap/ext/tinydtls/ecc/Makefile.riot | 5 + .../components/libcoap/ext/tinydtls/ecc/ecc.c | 727 +++ .../components/libcoap/ext/tinydtls/ecc/ecc.h | 86 + .../libcoap/ext/tinydtls/ecc/test_helper.c | 79 + .../libcoap/ext/tinydtls/ecc/test_helper.h | 51 + .../libcoap/ext/tinydtls/ecc/testecc.c | 234 + .../libcoap/ext/tinydtls/ecc/testfield.c | 303 ++ .../components/libcoap/ext/tinydtls/global.h | 143 + .../components/libcoap/ext/tinydtls/hmac.c | 107 + .../components/libcoap/ext/tinydtls/hmac.h | 151 + .../components/libcoap/ext/tinydtls/netq.c | 176 + .../components/libcoap/ext/tinydtls/netq.h | 122 + .../components/libcoap/ext/tinydtls/numeric.h | 134 + .../components/libcoap/ext/tinydtls/peer.c | 107 + .../components/libcoap/ext/tinydtls/peer.h | 168 + .../platform-specific/dtls_prng_contiki.c | 60 + .../platform-specific/dtls_prng_espidf.c | 42 + .../platform-specific/dtls_prng_posix.c | 73 + .../platform-specific/dtls_prng_riot.c | 35 + .../platform-specific/dtls_prng_zephyr.c | 35 + .../ext/tinydtls/platform-specific/platform.h | 90 + .../tinydtls/platform-specific/riot_boards.h | 152 + .../components/libcoap/ext/tinydtls/session.c | 152 + .../components/libcoap/ext/tinydtls/session.h | 129 + .../libcoap/ext/tinydtls/sha2/README | 272 + .../libcoap/ext/tinydtls/sha2/sha2.c | 1106 ++++ .../libcoap/ext/tinydtls/sha2/sha2.h | 216 + .../libcoap/ext/tinydtls/sha2/sha2prog.c | 134 + .../libcoap/ext/tinydtls/sha2/sha2speed.c | 176 + .../libcoap/ext/tinydtls/sha2/sha2test.pl | 358 ++ .../tinydtls/sha2/testvectors/vector001.dat | 1 + .../tinydtls/sha2/testvectors/vector001.info | 21 + .../tinydtls/sha2/testvectors/vector002.dat | 1 + .../tinydtls/sha2/testvectors/vector002.info | 21 + .../tinydtls/sha2/testvectors/vector003.dat | 1 + .../tinydtls/sha2/testvectors/vector003.info | 22 + .../tinydtls/sha2/testvectors/vector004.dat | 1 + .../tinydtls/sha2/testvectors/vector004.info | 22 + .../tinydtls/sha2/testvectors/vector005.dat | 0 .../tinydtls/sha2/testvectors/vector005.info | 23 + .../tinydtls/sha2/testvectors/vector006.dat | 1 + .../tinydtls/sha2/testvectors/vector006.info | 22 + .../tinydtls/sha2/testvectors/vector007.dat | 1 + .../tinydtls/sha2/testvectors/vector007.info | 22 + .../tinydtls/sha2/testvectors/vector008.dat | 1 + .../tinydtls/sha2/testvectors/vector008.info | 22 + .../tinydtls/sha2/testvectors/vector009.dat | 1 + .../tinydtls/sha2/testvectors/vector009.info | 22 + .../tinydtls/sha2/testvectors/vector010.dat | Bin 0 -> 320 bytes .../tinydtls/sha2/testvectors/vector010.info | 22 + .../tinydtls/sha2/testvectors/vector011.dat | Bin 0 -> 447 bytes .../tinydtls/sha2/testvectors/vector011.info | 22 + .../tinydtls/sha2/testvectors/vector012.dat | Bin 0 -> 640 bytes .../tinydtls/sha2/testvectors/vector012.info | 22 + .../tinydtls/sha2/testvectors/vector013.dat | Bin 0 -> 2175 bytes .../tinydtls/sha2/testvectors/vector013.info | 22 + .../tinydtls/sha2/testvectors/vector014.dat | Bin 0 -> 16384 bytes .../tinydtls/sha2/testvectors/vector014.info | 22 + .../tinydtls/sha2/testvectors/vector015.dat | 1 + .../tinydtls/sha2/testvectors/vector015.info | 21 + .../tinydtls/sha2/testvectors/vector016.dat | 1 + .../tinydtls/sha2/testvectors/vector016.info | 23 + .../tinydtls/sha2/testvectors/vector017.dat | Bin 0 -> 12271 bytes .../tinydtls/sha2/testvectors/vector017.info | 32 + .../tinydtls/sha2/testvectors/vector018.dat | Bin 0 -> 1079 bytes .../tinydtls/sha2/testvectors/vector018.info | 26 + .../components/libcoap/ext/tinydtls/state.h | 60 + .../libcoap/ext/tinydtls/tests/CMakeLists.txt | 37 + .../ext/tinydtls/tests/cbc_aes128-test.c | 60 + .../ext/tinydtls/tests/cbc_aes128-testdata.c | 66 + .../libcoap/ext/tinydtls/tests/ccm-test.c | 90 + .../libcoap/ext/tinydtls/tests/ccm-testdata.c | 449 ++ .../libcoap/ext/tinydtls/tests/dsrv-test.c | 110 + .../libcoap/ext/tinydtls/tests/dtls-client.c | 554 ++ .../libcoap/ext/tinydtls/tests/dtls-server.c | 402 ++ .../libcoap/ext/tinydtls/tests/netq-test.c | 123 + .../libcoap/ext/tinydtls/tests/pcap.c | 478 ++ .../ext/tinydtls/tests/unit-tests/test_ccm.c | 215 + .../ext/tinydtls/tests/unit-tests/test_ccm.h | 15 + .../ext/tinydtls/tests/unit-tests/test_ecc.c | 242 + .../ext/tinydtls/tests/unit-tests/test_ecc.h | 15 + .../ext/tinydtls/tests/unit-tests/test_prf.c | 287 + .../ext/tinydtls/tests/unit-tests/test_prf.h | 15 + .../tinydtls/tests/unit-tests/testdriver.c | 30 + .../libcoap/ext/tinydtls/tinydtls.h | 51 + .../libcoap/ext/tinydtls/tinydtls.pc.in | 26 + .../components/libcoap/ext/tinydtls/uthash.h | 1210 +++++ .../components/libcoap/ext/tinydtls/utlist.h | 1073 ++++ .../ext/tinydtls/zephyr/CMakeLists.txt | 43 + .../libcoap/ext/tinydtls/zephyr/Kconfig | 47 + .../components/libcoap/include/coap3/block.h | 431 ++ .../libcoap/include/coap3/coap.h.in | 65 + .../libcoap/include/coap3/coap.h.windows | 65 + .../libcoap/include/coap3/coap.h.windows.in | 65 + .../libcoap/include/coap3/coap_address.h | 213 + .../include/coap3/coap_asn1_internal.h | 90 + .../libcoap/include/coap3/coap_async.h | 128 + .../include/coap3/coap_async_internal.h | 69 + .../include/coap3/coap_block_internal.h | 231 + .../libcoap/include/coap3/coap_cache.h | 234 + .../include/coap3/coap_cache_internal.h | 115 + .../libcoap/include/coap3/coap_debug.h | 260 + .../libcoap/include/coap3/coap_dtls.h | 491 ++ .../include/coap3/coap_dtls_internal.h | 408 ++ .../libcoap/include/coap3/coap_event.h | 146 + .../include/coap3/coap_forward_decls.h | 107 + .../libcoap/include/coap3/coap_hashkey.h | 61 + .../libcoap/include/coap3/coap_internal.h | 80 + .../libcoap/include/coap3/coap_io.h | 77 + .../libcoap/include/coap3/coap_io_internal.h | 186 + .../libcoap/include/coap3/coap_mutex.h | 82 + .../libcoap/include/coap3/coap_net_internal.h | 386 ++ .../libcoap/include/coap3/coap_option.h | 440 ++ .../libcoap/include/coap3/coap_pdu_internal.h | 318 ++ .../libcoap/include/coap3/coap_prng.h | 114 + .../include/coap3/coap_resource_internal.h | 145 + .../libcoap/include/coap3/coap_riot.h | 39 + .../libcoap/include/coap3/coap_session.h | 624 +++ .../include/coap3/coap_session_internal.h | 436 ++ .../libcoap/include/coap3/coap_subscribe.h | 69 + .../include/coap3/coap_subscribe_internal.h | 162 + .../libcoap/include/coap3/coap_tcp_internal.h | 112 + .../libcoap/include/coap3/coap_time.h | 204 + .../components/libcoap/include/coap3/encode.h | 128 + .../libcoap/include/coap3/libcoap.h | 68 + .../libcoap/include/coap3/lwippools.h | 117 + .../components/libcoap/include/coap3/mem.h | 144 + .../components/libcoap/include/coap3/net.h | 825 +++ .../components/libcoap/include/coap3/pdu.h | 603 +++ .../libcoap/include/coap3/resource.h | 499 ++ .../components/libcoap/include/coap3/str.h | 210 + .../components/libcoap/include/coap3/uri.h | 182 + .../components/libcoap/include/coap3/uthash.h | 1136 ++++ .../components/libcoap/include/coap3/utlist.h | 1073 ++++ .../components/libcoap/libcoap-3.map | 252 + .../components/libcoap/libcoap-3.pc.in | 12 + .../components/libcoap/libcoap-3.sym | 247 + .../libcoap/m4/ac_check_cryptolibs.m4 | 84 + .../libcoap/m4/ax_check_a2x_to_man.m4 | 57 + .../libcoap/m4/ax_check_compile_flag.m4 | 74 + .../libcoap/m4/ax_check_link_flag.m4 | 74 + .../components/libcoap/man/Makefile.am | 162 + .../components/libcoap/man/coap-client.txt.in | 299 ++ .../components/libcoap/man/coap-rd.txt.in | 163 + .../components/libcoap/man/coap-server.txt.in | 268 + .../components/libcoap/man/coap.txt.in | 87 + .../components/libcoap/man/coap_async.txt.in | 203 + .../libcoap/man/coap_attribute.txt.in | 158 + .../components/libcoap/man/coap_block.txt.in | 534 ++ .../components/libcoap/man/coap_cache.txt.in | 390 ++ .../libcoap/man/coap_context.txt.in | 149 + .../libcoap/man/coap_encryption.txt.in | 1237 +++++ .../libcoap/man/coap_endpoint_client.txt.in | 421 ++ .../libcoap/man/coap_endpoint_server.txt.in | 584 ++ .../libcoap/man/coap_handler.txt.in | 348 ++ .../components/libcoap/man/coap_io.txt.in | 463 ++ .../libcoap/man/coap_keepalive.txt.in | 78 + .../libcoap/man/coap_logging.txt.in | 185 + .../libcoap/man/coap_observe.txt.in | 405 ++ .../libcoap/man/coap_pdu_access.txt.in | 393 ++ .../libcoap/man/coap_pdu_setup.txt.in | 721 +++ .../libcoap/man/coap_recovery.txt.in | 216 + .../libcoap/man/coap_resource.txt.in | 584 ++ .../libcoap/man/coap_session.txt.in | 238 + .../components/libcoap/man/coap_string.txt.in | 182 + .../libcoap/man/coap_tls_library.txt.in | 153 + .../libcoap/man/examples-code-check.c | 437 ++ .../libcoap/scripts/api-version-bump.sh | 60 + .../components/libcoap/scripts/build.sh | 86 + .../components/libcoap/scripts/dist.sh | 70 + .../components/libcoap/scripts/fix-cunit.sh | 15 + .../libcoap/scripts/format_cmake.sh | 23 + .../components/libcoap/scripts/github_dist.sh | 24 + .../libcoap/scripts/msbuild.sln.cmd | 16 + .../components/libcoap/src/block.c | 2451 +++++++++ .../components/libcoap/src/coap_address.c | 115 + .../components/libcoap/src/coap_asn1.c | 107 + .../components/libcoap/src/coap_async.c | 237 + .../components/libcoap/src/coap_cache.c | 281 + .../components/libcoap/src/coap_debug.c | 1052 ++++ .../components/libcoap/src/coap_event.c | 38 + .../components/libcoap/src/coap_gnutls.c | 2960 ++++++++++ .../components/libcoap/src/coap_hashkey.c | 33 + .../components/libcoap/src/coap_io.c | 1615 ++++++ .../components/libcoap/src/coap_io_lwip.c | 242 + .../components/libcoap/src/coap_io_riot.c | 286 + .../components/libcoap/src/coap_mbedtls.c | 2540 +++++++++ .../components/libcoap/src/coap_notls.c | 271 + .../components/libcoap/src/coap_openssl.c | 3527 ++++++++++++ .../components/libcoap/src/coap_option.c | 605 +++ .../components/libcoap/src/coap_prng.c | 113 + .../components/libcoap/src/coap_session.c | 1709 ++++++ .../components/libcoap/src/coap_subscribe.c | 25 + .../components/libcoap/src/coap_tcp.c | 324 ++ .../components/libcoap/src/coap_time.c | 141 + .../components/libcoap/src/coap_tinydtls.c | 1311 +++++ .../components/libcoap/src/encode.c | 93 + .../components/libcoap/src/mem.c | 477 ++ .../components/libcoap/src/net.c | 3885 ++++++++++++++ .../components/libcoap/src/pdu.c | 1301 +++++ .../components/libcoap/src/resource.c | 1170 ++++ .../components/libcoap/src/str.c | 112 + .../components/libcoap/src/uri.c | 679 +++ .../components/libcoap/tests/Makefile.am | 43 + .../libcoap/tests/oss-fuzz/Makefile.ci.in | 38 + .../libcoap/tests/oss-fuzz/Makefile.oss-fuzz | 15 + .../libcoap/tests/oss-fuzz/pdu_parse_target.c | 23 + .../libcoap/tests/oss-fuzz/split_uri_target.c | 8 + .../components/libcoap/tests/test_common.h.in | 12 + .../components/libcoap/tests/test_encode.c | 266 + .../components/libcoap/tests/test_encode.h | 13 + .../libcoap/tests/test_error_response.c | 366 ++ .../libcoap/tests/test_error_response.h | 13 + .../components/libcoap/tests/test_options.c | 1049 ++++ .../components/libcoap/tests/test_options.h | 19 + .../components/libcoap/tests/test_pdu.c | 1327 +++++ .../components/libcoap/tests/test_pdu.h | 13 + .../components/libcoap/tests/test_sendqueue.c | 367 ++ .../components/libcoap/tests/test_sendqueue.h | 13 + .../components/libcoap/tests/test_session.c | 226 + .../components/libcoap/tests/test_session.h | 13 + .../components/libcoap/tests/test_tls.c | 129 + .../components/libcoap/tests/test_tls.h | 13 + .../components/libcoap/tests/test_uri.c | 623 +++ .../components/libcoap/tests/test_uri.h | 13 + .../components/libcoap/tests/test_wellknown.c | 278 + .../components/libcoap/tests/test_wellknown.h | 13 + .../components/libcoap/tests/testdriver.c | 59 + .../libcoap/tests/valgrind_suppression | 12 + .../win32/coap-client/coap-client.vcxproj | 387 ++ .../coap-client/coap-client.vcxproj.filters | 22 + .../libcoap/win32/coap-rd/coap-rd.vcxproj | 377 ++ .../win32/coap-rd/coap-rd.vcxproj.filters | 22 + .../win32/coap-server/coap-server.vcxproj | 378 ++ .../coap-server/coap-server.vcxproj.filters | 22 + .../components/libcoap/win32/libcoap.props | 82 + .../components/libcoap/win32/libcoap.sln | 144 + .../components/libcoap/win32/libcoap.vcxproj | 629 +++ .../libcoap/win32/libcoap.vcxproj.filters | 204 + .../win32/testdriver/testdriver.vcxproj | 401 ++ .../testdriver/testdriver.vcxproj.filters | 72 + .../components/port/include/coap3/coap.h | 51 + .../components/port/include/coap_config.h | 59 + .../port/include/coap_config_posix.h | 61 + .../espidf-coap-server/sdkconfig.defaults | 1 + .../src/Kconfig.projbuild | 45 + .../components/esp_tinyusb/.gitattributes | 25 + .../components/esp_tinyusb/.gitignore | 30 + .../components/esp_tinyusb/.readthedocs.yaml | 18 + .../components/esp_tinyusb/CMakeLists.txt | 73 + .../esp_tinyusb/CODE_OF_CONDUCT.rst | 88 + .../components/esp_tinyusb/CONTRIBUTORS.rst | 192 + .../components/esp_tinyusb/Kconfig | 163 + .../components/esp_tinyusb/LICENSE | 21 + .../components/esp_tinyusb/README.rst | 145 + .../esp_tinyusb/additions/include/tinyusb.h | 64 + .../additions/include/tinyusb_types.h | 24 + .../additions/include/tusb_cdc_acm.h | 195 + .../additions/include/tusb_config.h | 103 + .../additions/include/tusb_console.h | 33 + .../additions/include/tusb_tasks.h | 38 + .../additions/include/vfs_tinyusb.h | 34 + .../additions/include_private/cdc.h | 82 + .../include_private/descriptors_control.h | 23 + .../include_private/usb_descriptors.h | 27 + .../esp_tinyusb/additions/src/cdc.c | 109 + .../additions/src/descriptors_control.c | 150 + .../esp_tinyusb/additions/src/tinyusb.c | 93 + .../esp_tinyusb/additions/src/tusb_cdc_acm.c | 415 ++ .../esp_tinyusb/additions/src/tusb_console.c | 115 + .../esp_tinyusb/additions/src/tusb_tasks.c | 46 + .../additions/src/usb_descriptors.c | 186 + .../esp_tinyusb/additions/src/vfs_tinyusb.c | 289 + .../esp_tinyusb/hw/bsp/ansi_escape.h | 97 + .../components/esp_tinyusb/hw/bsp/board.c | 149 + .../components/esp_tinyusb/hw/bsp/board.h | 147 + .../components/esp_tinyusb/hw/bsp/board_mcu.h | 157 + .../hw/bsp/esp32s2/boards/CMakeLists.txt | 12 + .../adafruit_feather_esp32s2/board.cmake | 17 + .../boards/adafruit_feather_esp32s2/board.h | 45 + .../boards/adafruit_magtag_29gray/board.cmake | 17 + .../boards/adafruit_magtag_29gray/board.h | 45 + .../boards/adafruit_metro_esp32s2/board.cmake | 17 + .../boards/adafruit_metro_esp32s2/board.h | 43 + .../hw/bsp/esp32s2/boards/esp32s2.c | 148 + .../boards/espressif_kaluga_1/board.cmake | 17 + .../esp32s2/boards/espressif_kaluga_1/board.h | 44 + .../boards/espressif_saola_1/board.cmake | 17 + .../esp32s2/boards/espressif_saola_1/board.h | 45 + .../components/led_strip/CMakeLists.txt | 8 + .../components/led_strip/include/led_strip.h | 126 + .../led_strip/src/led_strip_rmt_ws2812.c | 171 + .../esp_tinyusb/hw/bsp/esp32s2/family.cmake | 7 + .../esp_tinyusb/hw/bsp/esp32s2/family.mk | 23 + .../hw/bsp/esp32s3/boards/CMakeLists.txt | 14 + .../hw/bsp/esp32s3/boards/esp32s3.c | 148 + .../boards/espressif_addax_1/board.cmake | 7 + .../esp32s3/boards/espressif_addax_1/board.h | 44 + .../boards/espressif_s3_devkitc/board.cmake | 7 + .../boards/espressif_s3_devkitc/board.h | 43 + .../boards/espressif_s3_devkitm/board.cmake | 7 + .../boards/espressif_s3_devkitm/board.h | 43 + .../components/led_strip/CMakeLists.txt | 8 + .../components/led_strip/include/led_strip.h | 126 + .../led_strip/src/led_strip_rmt_ws2812.c | 171 + .../esp_tinyusb/hw/bsp/esp32s3/family.cmake | 7 + .../esp_tinyusb/hw/bsp/esp32s3/family.mk | 26 + .../esp_tinyusb/hw/bsp/family_support.cmake | 100 + .../components/esp_tinyusb/idf_component.yml | 8 + .../esp_tinyusb/lib/SEGGER_RTT/License.txt | 34 + .../esp_tinyusb/lib/SEGGER_RTT/README.txt | 20 + .../lib/SEGGER_RTT/RTT/SEGGER_RTT.c | 2005 +++++++ .../lib/SEGGER_RTT/RTT/SEGGER_RTT.h | 321 ++ .../SEGGER_RTT/RTT/SEGGER_RTT_ASM_ARMv7M.S | 235 + .../lib/SEGGER_RTT/RTT/SEGGER_RTT_Conf.h | 384 ++ .../lib/SEGGER_RTT/RTT/SEGGER_RTT_printf.c | 500 ++ .../Syscalls/SEGGER_RTT_Syscalls_GCC.c | 120 + .../Syscalls/SEGGER_RTT_Syscalls_IAR.c | 115 + .../Syscalls/SEGGER_RTT_Syscalls_KEIL.c | 386 ++ .../Syscalls/SEGGER_RTT_Syscalls_SES.c | 247 + .../esp_tinyusb/lib/fatfs/00readme.txt | 138 + .../components/esp_tinyusb/lib/fatfs/ccsbcs.c | 543 ++ .../components/esp_tinyusb/lib/fatfs/diskio.c | 193 + .../components/esp_tinyusb/lib/fatfs/diskio.h | 95 + .../components/esp_tinyusb/lib/fatfs/ff.c | 4330 +++++++++++++++ .../components/esp_tinyusb/lib/fatfs/ff.h | 342 ++ .../components/esp_tinyusb/lib/fatfs/ffconf.h | 193 + .../esp_tinyusb/lib/fatfs/integer.h | 36 + .../esp_tinyusb/lib/networking/dhserver.c | 348 ++ .../esp_tinyusb/lib/networking/dhserver.h | 62 + .../esp_tinyusb/lib/networking/dnserver.c | 200 + .../esp_tinyusb/lib/networking/dnserver.h | 47 + .../esp_tinyusb/lib/networking/ndis.h | 266 + .../lib/networking/rndis_protocol.h | 307 ++ .../lib/networking/rndis_reports.c | 303 ++ .../components/esp_tinyusb/pkg.yml | 14 + .../components/esp_tinyusb/repository.yml | 15 + .../components/esp_tinyusb/sdkconfig.rename | 22 + .../esp_tinyusb/src/class/audio/audio.h | 933 ++++ .../src/class/audio/audio_device.c | 2294 ++++++++ .../src/class/audio/audio_device.h | 637 +++ .../esp_tinyusb/src/class/bth/bth_device.c | 258 + .../esp_tinyusb/src/class/bth/bth_device.h | 109 + .../esp_tinyusb/src/class/cdc/cdc.h | 409 ++ .../esp_tinyusb/src/class/cdc/cdc_device.c | 486 ++ .../esp_tinyusb/src/class/cdc/cdc_device.h | 260 + .../esp_tinyusb/src/class/cdc/cdc_host.c | 249 + .../esp_tinyusb/src/class/cdc/cdc_host.h | 134 + .../esp_tinyusb/src/class/cdc/cdc_rndis.h | 301 ++ .../src/class/cdc/cdc_rndis_host.c | 279 + .../src/class/cdc/cdc_rndis_host.h | 63 + .../esp_tinyusb/src/class/dfu/dfu.h | 119 + .../esp_tinyusb/src/class/dfu/dfu_device.c | 458 ++ .../esp_tinyusb/src/class/dfu/dfu_device.h | 98 + .../esp_tinyusb/src/class/dfu/dfu_rt_device.c | 128 + .../esp_tinyusb/src/class/dfu/dfu_rt_device.h | 54 + .../esp_tinyusb/src/class/hid/hid.h | 1119 ++++ .../esp_tinyusb/src/class/hid/hid_device.c | 417 ++ .../esp_tinyusb/src/class/hid/hid_device.h | 393 ++ .../esp_tinyusb/src/class/hid/hid_host.c | 636 +++ .../esp_tinyusb/src/class/hid/hid_host.h | 152 + .../esp_tinyusb/src/class/midi/midi.h | 212 + .../esp_tinyusb/src/class/midi/midi_device.c | 545 ++ .../esp_tinyusb/src/class/midi/midi_device.h | 173 + .../esp_tinyusb/src/class/msc/msc.h | 382 ++ .../esp_tinyusb/src/class/msc/msc_device.c | 939 ++++ .../esp_tinyusb/src/class/msc/msc_device.h | 159 + .../esp_tinyusb/src/class/msc/msc_host.c | 491 ++ .../esp_tinyusb/src/class/msc/msc_host.h | 119 + .../src/class/net/ecm_rndis_device.c | 445 ++ .../esp_tinyusb/src/class/net/ncm.h | 69 + .../esp_tinyusb/src/class/net/ncm_device.c | 510 ++ .../esp_tinyusb/src/class/net/net_device.h | 118 + .../esp_tinyusb/src/class/usbtmc/usbtmc.h | 316 ++ .../src/class/usbtmc/usbtmc_device.c | 858 +++ .../src/class/usbtmc/usbtmc_device.h | 116 + .../src/class/vendor/vendor_device.c | 257 + .../src/class/vendor/vendor_device.h | 136 + .../src/class/vendor/vendor_host.c | 146 + .../src/class/vendor/vendor_host.h | 67 + .../esp_tinyusb/src/class/video/video.h | 480 ++ .../src/class/video/video_device.c | 1149 ++++ .../src/class/video/video_device.h | 97 + .../esp_tinyusb/src/common/tusb_common.h | 406 ++ .../esp_tinyusb/src/common/tusb_compiler.h | 258 + .../esp_tinyusb/src/common/tusb_error.h | 75 + .../esp_tinyusb/src/common/tusb_fifo.c | 1007 ++++ .../esp_tinyusb/src/common/tusb_fifo.h | 151 + .../esp_tinyusb/src/common/tusb_timeout.h | 80 + .../esp_tinyusb/src/common/tusb_types.h | 546 ++ .../esp_tinyusb/src/common/tusb_verify.h | 181 + .../components/esp_tinyusb/src/device/dcd.h | 193 + .../esp_tinyusb/src/device/dcd_attr.h | 221 + .../components/esp_tinyusb/src/device/usbd.c | 1419 +++++ .../components/esp_tinyusb/src/device/usbd.h | 853 +++ .../esp_tinyusb/src/device/usbd_control.c | 233 + .../esp_tinyusb/src/device/usbd_pvt.h | 115 + .../components/esp_tinyusb/src/host/hcd.h | 179 + .../esp_tinyusb/src/host/hcd_attr.h | 105 + .../components/esp_tinyusb/src/host/hub.c | 388 ++ .../components/esp_tinyusb/src/host/hub.h | 196 + .../components/esp_tinyusb/src/host/usbh.c | 1204 +++++ .../components/esp_tinyusb/src/host/usbh.h | 99 + .../esp_tinyusb/src/host/usbh_classdriver.h | 83 + .../esp_tinyusb/src/host/usbh_control.c | 138 + .../components/esp_tinyusb/src/osal/osal.h | 111 + .../esp_tinyusb/src/osal/osal_freertos.h | 172 + .../esp_tinyusb/src/osal/osal_mynewt.h | 174 + .../esp_tinyusb/src/osal/osal_none.h | 204 + .../esp_tinyusb/src/osal/osal_pico.h | 187 + .../esp_tinyusb/src/osal/osal_rtthread.h | 130 + .../portable/espressif/esp32sx/dcd_esp32sx.c | 854 +++ .../components/esp_tinyusb/src/tusb.c | 245 + .../components/esp_tinyusb/src/tusb.h | 140 + .../components/esp_tinyusb/src/tusb_option.h | 382 ++ .../esp_tinyusb/tools/build_board.py | 100 + .../esp_tinyusb/tools/build_esp32sx.py | 101 + .../esp_tinyusb/tools/build_family.py | 113 + .../esp_tinyusb/tools/build_utils.py | 61 + .../components/esp_tinyusb/tools/iar_gen.py | 51 + .../esp_tinyusb/tools/iar_template.ipcf | 145 + .../components/esp_tinyusb/tools/top.mk | 30 + .../tools/usb_drivers/tinyusb_win_usbser.inf | 108 + .../components/esp_tinyusb/version.yml | 3 + platform.json | 2 +- 541 files changed, 145063 insertions(+), 1 deletion(-) create mode 100644 examples/espidf-coap-server/components/CMakeLists.txt create mode 100644 examples/espidf-coap-server/components/Kconfig create mode 100644 examples/espidf-coap-server/components/LICENSE create mode 100644 examples/espidf-coap-server/components/README.md create mode 100644 examples/espidf-coap-server/components/idf_component.yml create mode 100644 examples/espidf-coap-server/components/libcoap/.github/ISSUE_TEMPLATE/bug_report.md create mode 100644 examples/espidf-coap-server/components/libcoap/.github/ISSUE_TEMPLATE/config.yml create mode 100644 examples/espidf-coap-server/components/libcoap/.github/ISSUE_TEMPLATE/feature_request.md create mode 100644 examples/espidf-coap-server/components/libcoap/.github/workflows/main.yml create mode 100644 examples/espidf-coap-server/components/libcoap/.gitignore create mode 100644 examples/espidf-coap-server/components/libcoap/.gitmodules create mode 100644 examples/espidf-coap-server/components/libcoap/.travis.yml create mode 100644 examples/espidf-coap-server/components/libcoap/AUTHORS create mode 100644 examples/espidf-coap-server/components/libcoap/BUILDING create mode 100644 examples/espidf-coap-server/components/libcoap/CMakeLists.txt create mode 100644 examples/espidf-coap-server/components/libcoap/CONTRIBUTE create mode 100644 examples/espidf-coap-server/components/libcoap/COPYING create mode 100644 examples/espidf-coap-server/components/libcoap/ChangeLog create mode 100644 examples/espidf-coap-server/components/libcoap/Dockerfile create mode 100644 examples/espidf-coap-server/components/libcoap/HOWTO.dual.gnutls create mode 100644 examples/espidf-coap-server/components/libcoap/HOWTO.dual.openssl create mode 100644 examples/espidf-coap-server/components/libcoap/HOWTO.dual.softhsm2 create mode 100644 examples/espidf-coap-server/components/libcoap/HOWTO.pkcs11 create mode 100644 examples/espidf-coap-server/components/libcoap/LICENSE create mode 100644 examples/espidf-coap-server/components/libcoap/Makefile.am create mode 100644 examples/espidf-coap-server/components/libcoap/Makefile.libcoap create mode 100644 examples/espidf-coap-server/components/libcoap/NEWS create mode 100644 examples/espidf-coap-server/components/libcoap/README create mode 100644 examples/espidf-coap-server/components/libcoap/README.md create mode 100644 examples/espidf-coap-server/components/libcoap/TODO create mode 100644 examples/espidf-coap-server/components/libcoap/autogen.sh create mode 100644 examples/espidf-coap-server/components/libcoap/build-env/.dockerignore create mode 100644 examples/espidf-coap-server/components/libcoap/build-env/Dockerfile.build-env create mode 100644 examples/espidf-coap-server/components/libcoap/build-env/Dockerfile.develop create mode 100644 examples/espidf-coap-server/components/libcoap/build-env/build.sh create mode 100644 examples/espidf-coap-server/components/libcoap/build-env/imagename create mode 100644 examples/espidf-coap-server/components/libcoap/cmake-format.yaml create mode 100644 examples/espidf-coap-server/components/libcoap/cmake/FindMbedTLS.cmake create mode 100644 examples/espidf-coap-server/components/libcoap/cmake/FindTinyDTLS.cmake create mode 100644 examples/espidf-coap-server/components/libcoap/cmake_coap_config.h.in create mode 100644 examples/espidf-coap-server/components/libcoap/coap_config.h.contiki create mode 100644 examples/espidf-coap-server/components/libcoap/coap_config.h.lwip create mode 100644 examples/espidf-coap-server/components/libcoap/coap_config.h.lwip.in create mode 100644 examples/espidf-coap-server/components/libcoap/coap_config.h.riot create mode 100644 examples/espidf-coap-server/components/libcoap/coap_config.h.riot.in create mode 100644 examples/espidf-coap-server/components/libcoap/coap_config.h.windows create mode 100644 examples/espidf-coap-server/components/libcoap/coap_config.h.windows.in create mode 100644 examples/espidf-coap-server/components/libcoap/configure.ac create mode 100644 examples/espidf-coap-server/components/libcoap/doc/Doxyfile.in create mode 100644 examples/espidf-coap-server/components/libcoap/doc/Makefile.am create mode 100644 examples/espidf-coap-server/components/libcoap/doc/docbook.local.css create mode 100644 examples/espidf-coap-server/components/libcoap/doc/main.md create mode 100644 examples/espidf-coap-server/components/libcoap/doc/module_api_wrap.h create mode 100644 examples/espidf-coap-server/components/libcoap/doc/upgrade_4.2.1_4.3.0.txt create mode 100644 examples/espidf-coap-server/components/libcoap/doc/upgrade_4.3.0_4.3.1.txt create mode 100644 examples/espidf-coap-server/components/libcoap/examples/Makefile.am create mode 100644 examples/espidf-coap-server/components/libcoap/examples/README.etsi_iot create mode 100644 examples/espidf-coap-server/components/libcoap/examples/coap-client.c create mode 100644 examples/espidf-coap-server/components/libcoap/examples/coap-rd.c create mode 100644 examples/espidf-coap-server/components/libcoap/examples/coap-server.c create mode 100644 examples/espidf-coap-server/components/libcoap/examples/coap_list.c create mode 100644 examples/espidf-coap-server/components/libcoap/examples/coap_list.h create mode 100644 examples/espidf-coap-server/components/libcoap/examples/contiki/.gitignore create mode 100644 examples/espidf-coap-server/components/libcoap/examples/contiki/Makefile.contiki create mode 100644 examples/espidf-coap-server/components/libcoap/examples/contiki/README create mode 100644 examples/espidf-coap-server/components/libcoap/examples/contiki/coap-observer.c create mode 100644 examples/espidf-coap-server/components/libcoap/examples/contiki/radvd.conf.sample create mode 100644 examples/espidf-coap-server/components/libcoap/examples/contiki/server.c create mode 100644 examples/espidf-coap-server/components/libcoap/examples/etsi_coaptest.sh create mode 100644 examples/espidf-coap-server/components/libcoap/examples/etsi_iot_01.c create mode 100644 examples/espidf-coap-server/components/libcoap/examples/etsi_iot_01_largedata.txt create mode 100644 examples/espidf-coap-server/components/libcoap/examples/etsi_testcases.sh create mode 100644 examples/espidf-coap-server/components/libcoap/examples/getopt.c create mode 100644 examples/espidf-coap-server/components/libcoap/examples/lwip/.gitignore create mode 100644 examples/espidf-coap-server/components/libcoap/examples/lwip/README create mode 100644 examples/espidf-coap-server/components/libcoap/examples/lwip/lwipopts.h create mode 100644 examples/espidf-coap-server/components/libcoap/examples/lwip/server-coap.c create mode 100644 examples/espidf-coap-server/components/libcoap/examples/lwip/server-coap.h create mode 100644 examples/espidf-coap-server/components/libcoap/examples/lwip/server.c create mode 100644 examples/espidf-coap-server/components/libcoap/examples/share.libcoap.examples.Makefile create mode 100644 examples/espidf-coap-server/components/libcoap/examples/share.libcoap.examples.README create mode 100644 examples/espidf-coap-server/components/libcoap/examples/tiny.c create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/ABOUT.md create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/AutoConf.cmake create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/CMakeLists.txt create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/CONTRIBUTING.md create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/LICENSE create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/Makefile.riot create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/Makefile.tinydtls create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/README.md create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/aes/Makefile.riot create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/aes/rijndael.c create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/aes/rijndael.h create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/aes/rijndael_wrap.c create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/alert.h create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/autogen.sh create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/ccm.c create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/ccm.h create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/configure.ac create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/crypto.c create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/crypto.h create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/doc/Doxyfile.in create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/doc/DoxygenLayout.xml create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/dtls.c create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/dtls.h create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/dtls_config.h.cmake.in create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/dtls_debug.c create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/dtls_debug.h create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/dtls_mutex.h create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/dtls_prng.c create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/dtls_prng.h create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/dtls_time.c create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/dtls_time.h create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/ecc/Makefile.contiki create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/ecc/Makefile.ecc create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/ecc/Makefile.riot create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/ecc/ecc.c create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/ecc/ecc.h create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/ecc/test_helper.c create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/ecc/test_helper.h create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/ecc/testecc.c create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/ecc/testfield.c create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/global.h create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/hmac.c create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/hmac.h create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/netq.c create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/netq.h create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/numeric.h create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/peer.c create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/peer.h create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/platform-specific/dtls_prng_contiki.c create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/platform-specific/dtls_prng_espidf.c create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/platform-specific/dtls_prng_posix.c create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/platform-specific/dtls_prng_riot.c create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/platform-specific/dtls_prng_zephyr.c create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/platform-specific/platform.h create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/platform-specific/riot_boards.h create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/session.c create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/session.h create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/sha2/README create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/sha2/sha2.c create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/sha2/sha2.h create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/sha2/sha2prog.c create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/sha2/sha2speed.c create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/sha2/sha2test.pl create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/sha2/testvectors/vector001.dat create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/sha2/testvectors/vector001.info create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/sha2/testvectors/vector002.dat create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/sha2/testvectors/vector002.info create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/sha2/testvectors/vector003.dat create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/sha2/testvectors/vector003.info create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/sha2/testvectors/vector004.dat create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/sha2/testvectors/vector004.info create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/sha2/testvectors/vector005.dat create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/sha2/testvectors/vector005.info create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/sha2/testvectors/vector006.dat create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/sha2/testvectors/vector006.info create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/sha2/testvectors/vector007.dat create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/sha2/testvectors/vector007.info create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/sha2/testvectors/vector008.dat create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/sha2/testvectors/vector008.info create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/sha2/testvectors/vector009.dat create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/sha2/testvectors/vector009.info create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/sha2/testvectors/vector010.dat create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/sha2/testvectors/vector010.info create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/sha2/testvectors/vector011.dat create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/sha2/testvectors/vector011.info create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/sha2/testvectors/vector012.dat create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/sha2/testvectors/vector012.info create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/sha2/testvectors/vector013.dat create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/sha2/testvectors/vector013.info create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/sha2/testvectors/vector014.dat create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/sha2/testvectors/vector014.info create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/sha2/testvectors/vector015.dat create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/sha2/testvectors/vector015.info create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/sha2/testvectors/vector016.dat create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/sha2/testvectors/vector016.info create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/sha2/testvectors/vector017.dat create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/sha2/testvectors/vector017.info create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/sha2/testvectors/vector018.dat create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/sha2/testvectors/vector018.info create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/state.h create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/tests/CMakeLists.txt create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/tests/cbc_aes128-test.c create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/tests/cbc_aes128-testdata.c create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/tests/ccm-test.c create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/tests/ccm-testdata.c create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/tests/dsrv-test.c create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/tests/dtls-client.c create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/tests/dtls-server.c create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/tests/netq-test.c create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/tests/pcap.c create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/tests/unit-tests/test_ccm.c create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/tests/unit-tests/test_ccm.h create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/tests/unit-tests/test_ecc.c create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/tests/unit-tests/test_ecc.h create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/tests/unit-tests/test_prf.c create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/tests/unit-tests/test_prf.h create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/tests/unit-tests/testdriver.c create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/tinydtls.h create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/tinydtls.pc.in create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/uthash.h create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/utlist.h create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/zephyr/CMakeLists.txt create mode 100644 examples/espidf-coap-server/components/libcoap/ext/tinydtls/zephyr/Kconfig create mode 100644 examples/espidf-coap-server/components/libcoap/include/coap3/block.h create mode 100644 examples/espidf-coap-server/components/libcoap/include/coap3/coap.h.in create mode 100644 examples/espidf-coap-server/components/libcoap/include/coap3/coap.h.windows create mode 100644 examples/espidf-coap-server/components/libcoap/include/coap3/coap.h.windows.in create mode 100644 examples/espidf-coap-server/components/libcoap/include/coap3/coap_address.h create mode 100644 examples/espidf-coap-server/components/libcoap/include/coap3/coap_asn1_internal.h create mode 100644 examples/espidf-coap-server/components/libcoap/include/coap3/coap_async.h create mode 100644 examples/espidf-coap-server/components/libcoap/include/coap3/coap_async_internal.h create mode 100644 examples/espidf-coap-server/components/libcoap/include/coap3/coap_block_internal.h create mode 100644 examples/espidf-coap-server/components/libcoap/include/coap3/coap_cache.h create mode 100644 examples/espidf-coap-server/components/libcoap/include/coap3/coap_cache_internal.h create mode 100644 examples/espidf-coap-server/components/libcoap/include/coap3/coap_debug.h create mode 100644 examples/espidf-coap-server/components/libcoap/include/coap3/coap_dtls.h create mode 100644 examples/espidf-coap-server/components/libcoap/include/coap3/coap_dtls_internal.h create mode 100644 examples/espidf-coap-server/components/libcoap/include/coap3/coap_event.h create mode 100644 examples/espidf-coap-server/components/libcoap/include/coap3/coap_forward_decls.h create mode 100644 examples/espidf-coap-server/components/libcoap/include/coap3/coap_hashkey.h create mode 100644 examples/espidf-coap-server/components/libcoap/include/coap3/coap_internal.h create mode 100644 examples/espidf-coap-server/components/libcoap/include/coap3/coap_io.h create mode 100644 examples/espidf-coap-server/components/libcoap/include/coap3/coap_io_internal.h create mode 100644 examples/espidf-coap-server/components/libcoap/include/coap3/coap_mutex.h create mode 100644 examples/espidf-coap-server/components/libcoap/include/coap3/coap_net_internal.h create mode 100644 examples/espidf-coap-server/components/libcoap/include/coap3/coap_option.h create mode 100644 examples/espidf-coap-server/components/libcoap/include/coap3/coap_pdu_internal.h create mode 100644 examples/espidf-coap-server/components/libcoap/include/coap3/coap_prng.h create mode 100644 examples/espidf-coap-server/components/libcoap/include/coap3/coap_resource_internal.h create mode 100644 examples/espidf-coap-server/components/libcoap/include/coap3/coap_riot.h create mode 100644 examples/espidf-coap-server/components/libcoap/include/coap3/coap_session.h create mode 100644 examples/espidf-coap-server/components/libcoap/include/coap3/coap_session_internal.h create mode 100644 examples/espidf-coap-server/components/libcoap/include/coap3/coap_subscribe.h create mode 100644 examples/espidf-coap-server/components/libcoap/include/coap3/coap_subscribe_internal.h create mode 100644 examples/espidf-coap-server/components/libcoap/include/coap3/coap_tcp_internal.h create mode 100644 examples/espidf-coap-server/components/libcoap/include/coap3/coap_time.h create mode 100644 examples/espidf-coap-server/components/libcoap/include/coap3/encode.h create mode 100644 examples/espidf-coap-server/components/libcoap/include/coap3/libcoap.h create mode 100644 examples/espidf-coap-server/components/libcoap/include/coap3/lwippools.h create mode 100644 examples/espidf-coap-server/components/libcoap/include/coap3/mem.h create mode 100644 examples/espidf-coap-server/components/libcoap/include/coap3/net.h create mode 100644 examples/espidf-coap-server/components/libcoap/include/coap3/pdu.h create mode 100644 examples/espidf-coap-server/components/libcoap/include/coap3/resource.h create mode 100644 examples/espidf-coap-server/components/libcoap/include/coap3/str.h create mode 100644 examples/espidf-coap-server/components/libcoap/include/coap3/uri.h create mode 100644 examples/espidf-coap-server/components/libcoap/include/coap3/uthash.h create mode 100644 examples/espidf-coap-server/components/libcoap/include/coap3/utlist.h create mode 100644 examples/espidf-coap-server/components/libcoap/libcoap-3.map create mode 100644 examples/espidf-coap-server/components/libcoap/libcoap-3.pc.in create mode 100644 examples/espidf-coap-server/components/libcoap/libcoap-3.sym create mode 100644 examples/espidf-coap-server/components/libcoap/m4/ac_check_cryptolibs.m4 create mode 100644 examples/espidf-coap-server/components/libcoap/m4/ax_check_a2x_to_man.m4 create mode 100644 examples/espidf-coap-server/components/libcoap/m4/ax_check_compile_flag.m4 create mode 100644 examples/espidf-coap-server/components/libcoap/m4/ax_check_link_flag.m4 create mode 100644 examples/espidf-coap-server/components/libcoap/man/Makefile.am create mode 100644 examples/espidf-coap-server/components/libcoap/man/coap-client.txt.in create mode 100644 examples/espidf-coap-server/components/libcoap/man/coap-rd.txt.in create mode 100644 examples/espidf-coap-server/components/libcoap/man/coap-server.txt.in create mode 100644 examples/espidf-coap-server/components/libcoap/man/coap.txt.in create mode 100644 examples/espidf-coap-server/components/libcoap/man/coap_async.txt.in create mode 100644 examples/espidf-coap-server/components/libcoap/man/coap_attribute.txt.in create mode 100644 examples/espidf-coap-server/components/libcoap/man/coap_block.txt.in create mode 100644 examples/espidf-coap-server/components/libcoap/man/coap_cache.txt.in create mode 100644 examples/espidf-coap-server/components/libcoap/man/coap_context.txt.in create mode 100644 examples/espidf-coap-server/components/libcoap/man/coap_encryption.txt.in create mode 100644 examples/espidf-coap-server/components/libcoap/man/coap_endpoint_client.txt.in create mode 100644 examples/espidf-coap-server/components/libcoap/man/coap_endpoint_server.txt.in create mode 100644 examples/espidf-coap-server/components/libcoap/man/coap_handler.txt.in create mode 100644 examples/espidf-coap-server/components/libcoap/man/coap_io.txt.in create mode 100644 examples/espidf-coap-server/components/libcoap/man/coap_keepalive.txt.in create mode 100644 examples/espidf-coap-server/components/libcoap/man/coap_logging.txt.in create mode 100644 examples/espidf-coap-server/components/libcoap/man/coap_observe.txt.in create mode 100644 examples/espidf-coap-server/components/libcoap/man/coap_pdu_access.txt.in create mode 100644 examples/espidf-coap-server/components/libcoap/man/coap_pdu_setup.txt.in create mode 100644 examples/espidf-coap-server/components/libcoap/man/coap_recovery.txt.in create mode 100644 examples/espidf-coap-server/components/libcoap/man/coap_resource.txt.in create mode 100644 examples/espidf-coap-server/components/libcoap/man/coap_session.txt.in create mode 100644 examples/espidf-coap-server/components/libcoap/man/coap_string.txt.in create mode 100644 examples/espidf-coap-server/components/libcoap/man/coap_tls_library.txt.in create mode 100644 examples/espidf-coap-server/components/libcoap/man/examples-code-check.c create mode 100644 examples/espidf-coap-server/components/libcoap/scripts/api-version-bump.sh create mode 100644 examples/espidf-coap-server/components/libcoap/scripts/build.sh create mode 100644 examples/espidf-coap-server/components/libcoap/scripts/dist.sh create mode 100644 examples/espidf-coap-server/components/libcoap/scripts/fix-cunit.sh create mode 100644 examples/espidf-coap-server/components/libcoap/scripts/format_cmake.sh create mode 100644 examples/espidf-coap-server/components/libcoap/scripts/github_dist.sh create mode 100644 examples/espidf-coap-server/components/libcoap/scripts/msbuild.sln.cmd create mode 100644 examples/espidf-coap-server/components/libcoap/src/block.c create mode 100644 examples/espidf-coap-server/components/libcoap/src/coap_address.c create mode 100644 examples/espidf-coap-server/components/libcoap/src/coap_asn1.c create mode 100644 examples/espidf-coap-server/components/libcoap/src/coap_async.c create mode 100644 examples/espidf-coap-server/components/libcoap/src/coap_cache.c create mode 100644 examples/espidf-coap-server/components/libcoap/src/coap_debug.c create mode 100644 examples/espidf-coap-server/components/libcoap/src/coap_event.c create mode 100644 examples/espidf-coap-server/components/libcoap/src/coap_gnutls.c create mode 100644 examples/espidf-coap-server/components/libcoap/src/coap_hashkey.c create mode 100644 examples/espidf-coap-server/components/libcoap/src/coap_io.c create mode 100644 examples/espidf-coap-server/components/libcoap/src/coap_io_lwip.c create mode 100644 examples/espidf-coap-server/components/libcoap/src/coap_io_riot.c create mode 100644 examples/espidf-coap-server/components/libcoap/src/coap_mbedtls.c create mode 100644 examples/espidf-coap-server/components/libcoap/src/coap_notls.c create mode 100644 examples/espidf-coap-server/components/libcoap/src/coap_openssl.c create mode 100644 examples/espidf-coap-server/components/libcoap/src/coap_option.c create mode 100644 examples/espidf-coap-server/components/libcoap/src/coap_prng.c create mode 100644 examples/espidf-coap-server/components/libcoap/src/coap_session.c create mode 100644 examples/espidf-coap-server/components/libcoap/src/coap_subscribe.c create mode 100644 examples/espidf-coap-server/components/libcoap/src/coap_tcp.c create mode 100644 examples/espidf-coap-server/components/libcoap/src/coap_time.c create mode 100644 examples/espidf-coap-server/components/libcoap/src/coap_tinydtls.c create mode 100644 examples/espidf-coap-server/components/libcoap/src/encode.c create mode 100644 examples/espidf-coap-server/components/libcoap/src/mem.c create mode 100644 examples/espidf-coap-server/components/libcoap/src/net.c create mode 100644 examples/espidf-coap-server/components/libcoap/src/pdu.c create mode 100644 examples/espidf-coap-server/components/libcoap/src/resource.c create mode 100644 examples/espidf-coap-server/components/libcoap/src/str.c create mode 100644 examples/espidf-coap-server/components/libcoap/src/uri.c create mode 100644 examples/espidf-coap-server/components/libcoap/tests/Makefile.am create mode 100644 examples/espidf-coap-server/components/libcoap/tests/oss-fuzz/Makefile.ci.in create mode 100644 examples/espidf-coap-server/components/libcoap/tests/oss-fuzz/Makefile.oss-fuzz create mode 100644 examples/espidf-coap-server/components/libcoap/tests/oss-fuzz/pdu_parse_target.c create mode 100644 examples/espidf-coap-server/components/libcoap/tests/oss-fuzz/split_uri_target.c create mode 100644 examples/espidf-coap-server/components/libcoap/tests/test_common.h.in create mode 100644 examples/espidf-coap-server/components/libcoap/tests/test_encode.c create mode 100644 examples/espidf-coap-server/components/libcoap/tests/test_encode.h create mode 100644 examples/espidf-coap-server/components/libcoap/tests/test_error_response.c create mode 100644 examples/espidf-coap-server/components/libcoap/tests/test_error_response.h create mode 100644 examples/espidf-coap-server/components/libcoap/tests/test_options.c create mode 100644 examples/espidf-coap-server/components/libcoap/tests/test_options.h create mode 100644 examples/espidf-coap-server/components/libcoap/tests/test_pdu.c create mode 100644 examples/espidf-coap-server/components/libcoap/tests/test_pdu.h create mode 100644 examples/espidf-coap-server/components/libcoap/tests/test_sendqueue.c create mode 100644 examples/espidf-coap-server/components/libcoap/tests/test_sendqueue.h create mode 100644 examples/espidf-coap-server/components/libcoap/tests/test_session.c create mode 100644 examples/espidf-coap-server/components/libcoap/tests/test_session.h create mode 100644 examples/espidf-coap-server/components/libcoap/tests/test_tls.c create mode 100644 examples/espidf-coap-server/components/libcoap/tests/test_tls.h create mode 100644 examples/espidf-coap-server/components/libcoap/tests/test_uri.c create mode 100644 examples/espidf-coap-server/components/libcoap/tests/test_uri.h create mode 100644 examples/espidf-coap-server/components/libcoap/tests/test_wellknown.c create mode 100644 examples/espidf-coap-server/components/libcoap/tests/test_wellknown.h create mode 100644 examples/espidf-coap-server/components/libcoap/tests/testdriver.c create mode 100644 examples/espidf-coap-server/components/libcoap/tests/valgrind_suppression create mode 100644 examples/espidf-coap-server/components/libcoap/win32/coap-client/coap-client.vcxproj create mode 100644 examples/espidf-coap-server/components/libcoap/win32/coap-client/coap-client.vcxproj.filters create mode 100644 examples/espidf-coap-server/components/libcoap/win32/coap-rd/coap-rd.vcxproj create mode 100644 examples/espidf-coap-server/components/libcoap/win32/coap-rd/coap-rd.vcxproj.filters create mode 100644 examples/espidf-coap-server/components/libcoap/win32/coap-server/coap-server.vcxproj create mode 100644 examples/espidf-coap-server/components/libcoap/win32/coap-server/coap-server.vcxproj.filters create mode 100644 examples/espidf-coap-server/components/libcoap/win32/libcoap.props create mode 100644 examples/espidf-coap-server/components/libcoap/win32/libcoap.sln create mode 100644 examples/espidf-coap-server/components/libcoap/win32/libcoap.vcxproj create mode 100644 examples/espidf-coap-server/components/libcoap/win32/libcoap.vcxproj.filters create mode 100644 examples/espidf-coap-server/components/libcoap/win32/testdriver/testdriver.vcxproj create mode 100644 examples/espidf-coap-server/components/libcoap/win32/testdriver/testdriver.vcxproj.filters create mode 100644 examples/espidf-coap-server/components/port/include/coap3/coap.h create mode 100644 examples/espidf-coap-server/components/port/include/coap_config.h create mode 100644 examples/espidf-coap-server/components/port/include/coap_config_posix.h create mode 100644 examples/espidf-peripherals-uart/src/Kconfig.projbuild create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/.gitattributes create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/.gitignore create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/.readthedocs.yaml create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/CMakeLists.txt create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/CODE_OF_CONDUCT.rst create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/CONTRIBUTORS.rst create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/Kconfig create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/LICENSE create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/README.rst create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/additions/include/tinyusb.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/additions/include/tinyusb_types.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/additions/include/tusb_cdc_acm.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/additions/include/tusb_config.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/additions/include/tusb_console.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/additions/include/tusb_tasks.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/additions/include/vfs_tinyusb.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/additions/include_private/cdc.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/additions/include_private/descriptors_control.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/additions/include_private/usb_descriptors.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/additions/src/cdc.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/additions/src/descriptors_control.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/additions/src/tinyusb.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/additions/src/tusb_cdc_acm.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/additions/src/tusb_console.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/additions/src/tusb_tasks.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/additions/src/usb_descriptors.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/additions/src/vfs_tinyusb.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/hw/bsp/ansi_escape.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/hw/bsp/board.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/hw/bsp/board.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/hw/bsp/board_mcu.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/hw/bsp/esp32s2/boards/CMakeLists.txt create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/hw/bsp/esp32s2/boards/adafruit_feather_esp32s2/board.cmake create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/hw/bsp/esp32s2/boards/adafruit_feather_esp32s2/board.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/hw/bsp/esp32s2/boards/adafruit_magtag_29gray/board.cmake create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/hw/bsp/esp32s2/boards/adafruit_magtag_29gray/board.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/hw/bsp/esp32s2/boards/adafruit_metro_esp32s2/board.cmake create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/hw/bsp/esp32s2/boards/adafruit_metro_esp32s2/board.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/hw/bsp/esp32s2/boards/esp32s2.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/hw/bsp/esp32s2/boards/espressif_kaluga_1/board.cmake create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/hw/bsp/esp32s2/boards/espressif_kaluga_1/board.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/hw/bsp/esp32s2/boards/espressif_saola_1/board.cmake create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/hw/bsp/esp32s2/boards/espressif_saola_1/board.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/hw/bsp/esp32s2/components/led_strip/CMakeLists.txt create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/hw/bsp/esp32s2/components/led_strip/include/led_strip.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/hw/bsp/esp32s2/components/led_strip/src/led_strip_rmt_ws2812.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/hw/bsp/esp32s2/family.cmake create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/hw/bsp/esp32s2/family.mk create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/hw/bsp/esp32s3/boards/CMakeLists.txt create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/hw/bsp/esp32s3/boards/esp32s3.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/hw/bsp/esp32s3/boards/espressif_addax_1/board.cmake create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/hw/bsp/esp32s3/boards/espressif_addax_1/board.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/hw/bsp/esp32s3/boards/espressif_s3_devkitc/board.cmake create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/hw/bsp/esp32s3/boards/espressif_s3_devkitc/board.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/hw/bsp/esp32s3/boards/espressif_s3_devkitm/board.cmake create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/hw/bsp/esp32s3/boards/espressif_s3_devkitm/board.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/hw/bsp/esp32s3/components/led_strip/CMakeLists.txt create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/hw/bsp/esp32s3/components/led_strip/include/led_strip.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/hw/bsp/esp32s3/components/led_strip/src/led_strip_rmt_ws2812.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/hw/bsp/esp32s3/family.cmake create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/hw/bsp/esp32s3/family.mk create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/hw/bsp/family_support.cmake create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/idf_component.yml create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/lib/SEGGER_RTT/License.txt create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/lib/SEGGER_RTT/README.txt create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/lib/SEGGER_RTT/RTT/SEGGER_RTT.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/lib/SEGGER_RTT/RTT/SEGGER_RTT.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/lib/SEGGER_RTT/RTT/SEGGER_RTT_ASM_ARMv7M.S create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/lib/SEGGER_RTT/RTT/SEGGER_RTT_Conf.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/lib/SEGGER_RTT/RTT/SEGGER_RTT_printf.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/lib/SEGGER_RTT/Syscalls/SEGGER_RTT_Syscalls_GCC.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/lib/SEGGER_RTT/Syscalls/SEGGER_RTT_Syscalls_IAR.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/lib/SEGGER_RTT/Syscalls/SEGGER_RTT_Syscalls_KEIL.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/lib/SEGGER_RTT/Syscalls/SEGGER_RTT_Syscalls_SES.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/lib/fatfs/00readme.txt create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/lib/fatfs/ccsbcs.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/lib/fatfs/diskio.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/lib/fatfs/diskio.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/lib/fatfs/ff.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/lib/fatfs/ff.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/lib/fatfs/ffconf.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/lib/fatfs/integer.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/lib/networking/dhserver.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/lib/networking/dhserver.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/lib/networking/dnserver.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/lib/networking/dnserver.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/lib/networking/ndis.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/lib/networking/rndis_protocol.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/lib/networking/rndis_reports.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/pkg.yml create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/repository.yml create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/sdkconfig.rename create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/class/audio/audio.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/class/audio/audio_device.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/class/audio/audio_device.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/class/bth/bth_device.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/class/bth/bth_device.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/class/cdc/cdc.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/class/cdc/cdc_device.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/class/cdc/cdc_device.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/class/cdc/cdc_host.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/class/cdc/cdc_host.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/class/cdc/cdc_rndis.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/class/cdc/cdc_rndis_host.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/class/cdc/cdc_rndis_host.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/class/dfu/dfu.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/class/dfu/dfu_device.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/class/dfu/dfu_device.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/class/dfu/dfu_rt_device.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/class/dfu/dfu_rt_device.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/class/hid/hid.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/class/hid/hid_device.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/class/hid/hid_device.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/class/hid/hid_host.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/class/hid/hid_host.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/class/midi/midi.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/class/midi/midi_device.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/class/midi/midi_device.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/class/msc/msc.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/class/msc/msc_device.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/class/msc/msc_device.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/class/msc/msc_host.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/class/msc/msc_host.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/class/net/ecm_rndis_device.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/class/net/ncm.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/class/net/ncm_device.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/class/net/net_device.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/class/usbtmc/usbtmc.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/class/usbtmc/usbtmc_device.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/class/usbtmc/usbtmc_device.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/class/vendor/vendor_device.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/class/vendor/vendor_device.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/class/vendor/vendor_host.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/class/vendor/vendor_host.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/class/video/video.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/class/video/video_device.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/class/video/video_device.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/common/tusb_common.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/common/tusb_compiler.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/common/tusb_error.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/common/tusb_fifo.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/common/tusb_fifo.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/common/tusb_timeout.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/common/tusb_types.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/common/tusb_verify.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/device/dcd.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/device/dcd_attr.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/device/usbd.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/device/usbd.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/device/usbd_control.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/device/usbd_pvt.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/host/hcd.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/host/hcd_attr.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/host/hub.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/host/hub.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/host/usbh.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/host/usbh.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/host/usbh_classdriver.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/host/usbh_control.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/osal/osal.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/osal/osal_freertos.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/osal/osal_mynewt.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/osal/osal_none.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/osal/osal_pico.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/osal/osal_rtthread.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/portable/espressif/esp32sx/dcd_esp32sx.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/tusb.c create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/tusb.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/src/tusb_option.h create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/tools/build_board.py create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/tools/build_esp32sx.py create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/tools/build_family.py create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/tools/build_utils.py create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/tools/iar_gen.py create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/tools/iar_template.ipcf create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/tools/top.mk create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/tools/usb_drivers/tinyusb_win_usbser.inf create mode 100644 examples/espidf-peripherals-usb/components/esp_tinyusb/version.yml diff --git a/examples/espidf-aws-iot/platformio.ini b/examples/espidf-aws-iot/platformio.ini index 0738c34..5bf94f9 100644 --- a/examples/espidf-aws-iot/platformio.ini +++ b/examples/espidf-aws-iot/platformio.ini @@ -18,3 +18,9 @@ board_build.embed_txtfiles = src/certs/private.pem.key src/certs/certificate.pem.crt src/certs/aws-root-ca.pem + +# IDF v5 is not supported by ASW-IoT SDK +# https://github.com/espressif/esp-aws-iot/blob/bbaf03d7d1fbf8a3f91dc18489d7bd27d5b9e9df/README.md?plain=1#L21 +platform_packages = + framework-espidf @ ~3.40403.0 + toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5 diff --git a/examples/espidf-coap-server/components/CMakeLists.txt b/examples/espidf-coap-server/components/CMakeLists.txt new file mode 100644 index 0000000..f53f6b7 --- /dev/null +++ b/examples/espidf-coap-server/components/CMakeLists.txt @@ -0,0 +1,41 @@ +if(NOT CONFIG_LWIP_IPV6 AND NOT CMAKE_BUILD_EARLY_EXPANSION) + message(STATUS "IPV6 support is disabled so the coap component will not be built") + # note: the component is still included in the build so it can become visible again in config + # without needing to re-run CMake. However no source or header files are built. + idf_component_register() + return() +endif() + +set(include_dirs port/include port/include libcoap/include) + +set(srcs + "libcoap/src/block.c" + "libcoap/src/coap_address.c" + "libcoap/src/coap_asn1.c" + "libcoap/src/coap_async.c" + "libcoap/src/coap_cache.c" + "libcoap/src/coap_debug.c" + "libcoap/src/coap_event.c" + "libcoap/src/coap_hashkey.c" + "libcoap/src/coap_io.c" + "libcoap/src/coap_notls.c" + "libcoap/src/coap_option.c" + "libcoap/src/coap_prng.c" + "libcoap/src/coap_session.c" + "libcoap/src/coap_subscribe.c" + "libcoap/src/coap_tcp.c" + "libcoap/src/coap_time.c" + "libcoap/src/encode.c" + "libcoap/src/mem.c" + "libcoap/src/net.c" + "libcoap/src/pdu.c" + "libcoap/src/resource.c" + "libcoap/src/str.c" + "libcoap/src/uri.c" + "libcoap/src/coap_mbedtls.c") + +idf_component_register(SRCS "${srcs}" + INCLUDE_DIRS "${include_dirs}" + REQUIRES lwip mbedtls) +target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format") + diff --git a/examples/espidf-coap-server/components/Kconfig b/examples/espidf-coap-server/components/Kconfig new file mode 100644 index 0000000..9deb56a --- /dev/null +++ b/examples/espidf-coap-server/components/Kconfig @@ -0,0 +1,109 @@ +menu "CoAP Configuration" + visible if LWIP_IPV6 + + choice COAP_MBEDTLS_ENCRYPTION_MODE + prompt "CoAP Encryption method" + default COAP_MBEDTLS_PSK + help + If the CoAP information is to be encrypted, the encryption environment + can be set up in one of two ways (default being Pre-Shared key mode) + + - Encrypt using defined Pre-Shared Keys (PSK if uri includes coaps://) + - Encrypt using defined Public Key Infrastructure (PKI if uri includes coaps://) + + config COAP_MBEDTLS_PSK + bool "Pre-Shared Keys" + + config COAP_MBEDTLS_PKI + bool "PKI Certificates" + + endchoice #COAP_MBEDTLS_ENCRYPTION_MODE + + config COAP_MBEDTLS_DEBUG + bool "Enable CoAP debugging" + default n + help + Enable CoAP debugging functions at compile time for the example code. + + If this option is enabled, call coap_set_log_level() + at runtime in order to enable CoAP debug output via the ESP + log mechanism. + + Note: The Mbed TLS library logging is controlled by the mbedTLS + configuration, but logging level mbedTLS must be set for CoAP + to log it. + + choice COAP_MBEDTLS_DEBUG_LEVEL + bool "Set CoAP debugging level" + depends on COAP_MBEDTLS_DEBUG + default COAP_LOG_WARNING + help + Set CoAP debugging level + + config COAP_LOG_EMERG + bool "Emergency" + config COAP_LOG_ALERT + bool "Alert" + config COAP_LOG_CRIT + bool "Critical" + config COAP_LOG_ERROR + bool "Error" + config COAP_LOG_WARNING + bool "Warning" + config COAP_LOG_NOTICE + bool "Notice" + config COAP_LOG_INFO + bool "Info" + config COAP_LOG_DEBUG + bool "Debug" + config COAP_LOG_MBEDTLS + bool "mbedTLS" + endchoice + + config COAP_LOG_DEFAULT_LEVEL + int + default 0 if !COAP_MBEDTLS_DEBUG + default 0 if COAP_LOG_EMERG + default 1 if COAP_LOG_ALERT + default 2 if COAP_LOG_CRIT + default 3 if COAP_LOG_ERROR + default 4 if COAP_LOG_WARNING + default 5 if COAP_LOG_NOTICE + default 6 if COAP_LOG_INFO + default 7 if COAP_LOG_DEBUG + default 9 if COAP_LOG_MBEDTLS + + config COAP_TCP_SUPPORT + bool "Enable TCP within CoAP" + default y + help + Enable TCP functionality for CoAP. This is required if TLS sessions + are to be used. + + If this option is disabled, redundent CoAP TCP code is removed. + + config COAP_CLIENT_SUPPORT + bool "Enable Client functionality within CoAP" + default n + help + Enable client functionality (ability to make requests and receive + responses) for CoAP. If the server is going to act as a proxy, then + this needs to be enabled to support the ongoing session going to + the next hop. + + If this option is disabled, redundent CoAP client only code is removed. + If both this option and COAP_SERVER_SUPPORT are disabled, then both + are automatically enabled for backwards compatability. + + config COAP_SERVER_SUPPORT + bool "Enable Server functionality within CoAP" + default n + help + Enable server functionality (ability to receive requests and send + responses) for CoAP. + + If this option is disabled, redundent CoAP server only code is removed. + If both this option and COAP_CLIENT_SUPPORT are disabled, then both + are automatically enabled for backwards compatability. + +endmenu diff --git a/examples/espidf-coap-server/components/LICENSE b/examples/espidf-coap-server/components/LICENSE new file mode 100644 index 0000000..78d2c55 --- /dev/null +++ b/examples/espidf-coap-server/components/LICENSE @@ -0,0 +1,85 @@ +Copyright (c) 2010--2022, Olaf Bergmann and others +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + o Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + o Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +======================================================================== +getopt.c + +License information for getopt.c. This file is only used on Windows +builds of the executables in the examples folder: + +/* + * This file was copied from the following newsgroup posting: + * + * Newsgroups: mod.std.unix + * Subject: public domain AT&T getopt source + * Date: 3 Nov 85 19:34:15 GMT + * + * Here's something you've all been waiting for: the AT&T public domain + * source for getopt(3). It is the code which was given out at the 1985 + * UNIFORUM conference in Dallas. I obtained it by electronic mail + * directly from AT&T. The people there assure me that it is indeed + * in the public domain. + */ + +======================================================================== +uthash + +libcoap uses uthash.h and utlist.h from Troy D. Hanson +(https://troydhanson.github.io/uthash/). These files use the revised +BSD license (BSD-1-Clause license) as included in these two source +files. + +======================================================================== +OpenSSL + +Binaries that are linked against OpenSSL include software developed +by the OpenSSL Project for use in the OpenSSL Toolkit. +(http://www.openssl.org/). Please consult the OpenSSL license +(https://www.openssl.org/source/license.html) for licensing terms. + +======================================================================== +GnuTLS + +When compiled with GnuTLS support, this software includes components +that are licensed under the terms of the the GNU Lesser General Public +License, version 2.1 +(https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html). + +======================================================================== +tinyDTLS + +When compiled with tinyDTLS support, this software includes components +that are licensed under the terms of the Eclipse Distribution License 1.0 +(http://www.eclipse.org/org/documents/edl-v10.php). + +======================================================================== +Mbed TLS + +When compiled with Mbed TLS support, this software includes components +that are licensed under the terms of the Apache 2.0 license +(http://www.apache.org/licenses/LICENSE-2.0). + diff --git a/examples/espidf-coap-server/components/README.md b/examples/espidf-coap-server/components/README.md new file mode 100644 index 0000000..faab272 --- /dev/null +++ b/examples/espidf-coap-server/components/README.md @@ -0,0 +1,89 @@ +# libcoap: A C implementation of the Constrained Application Protocol (RFC 7252) + +[![Build Status: main](https://github.com/obgm/libcoap/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/obgm/libcoap/actions?query=branch:main) +[![Build Status: develop](https://github.com/obgm/libcoap/actions/workflows/main.yml/badge.svg?branch=develop)](https://github.com/obgm/libcoap/actions?query=branch:develop) +[![Static Analysis](https://scan.coverity.com/projects/10970/badge.svg?flat=1)](https://scan.coverity.com/projects/obgm-libcoap) +[![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/libcoap.svg)](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:libcoap) + +Copyright (C) 2010—2022 by Olaf Bergmann and others + +ABOUT LIBCOAP +============= + +libcoap is a C implementation of a lightweight application-protocol +for devices that are constrained their resources such as computing +power, RF range, memory, bandwidth, or network packet sizes. This +protocol, CoAP, is standardized by the IETF as RFC 7252. For further +information related to CoAP, see . + +You might want to check out +[libcoap-minimal](https://github.com/obgm/libcoap-minimal) for usage +examples. + +DOCUMENTATION +============= + +Documentation and further information can be found at +. + +PACKAGE CONTENTS +================ + +This package contains a protocol parser and basic networking +functions for platforms with support for malloc() and BSD-style +sockets. In addition, there is support for Contiki, LwIP and +Espressif/ESP-IDF hosted environments. + +The following RFCs are supported + +* RFC7252: The Constrained Application Protocol (CoAP) + +* RFC7390: Group Communication for the Constrained Application Protocol (CoAP) + +* RFC7641: Observing Resources in the Constrained Application Protocol (CoAP) + +* RFC7959: Block-Wise Transfers in the Constrained Application Protocol (CoAP) + +* RFC7967: Constrained Application Protocol (CoAP) Option for No Server Response + +* RFC8132: PATCH and FETCH Methods for the Constrained Application Protocol (CoAP) + +* RFC8323: CoAP (Constrained Application Protocol) over TCP, TLS, and WebSockets + [No WebSockets support] + +* RFC8516: "Too Many Requests" Response Code for the Constrained Application Protocol + +* RFC8768: Constrained Application Protocol (CoAP) Hop-Limit Option + +* RFC9175: CoAP: Echo, Request-Tag, and Token Processing + +There is (D)TLS support for the following libraries + +* OpenSSL (Minimum version 1.1.0) [PKI, PSK and PKCS11] + +* GnuTLS (Minimum version 3.3.0) [PKI, PSK, RPK(3.6.6+) and PKCS11] + +* Mbed TLS (Minimum version 2.7.10) [PKI and PSK] + +* TinyDTLS [PSK and RPK] [DTLS Only] + +The examples directory contain a CoAP client, CoAP Resource Directory server +and a CoAP server to demonstrate the use of this library. + +BUILDING +======== + +Further information can be found at +and [BUILDING](https://raw.githubusercontent.com/obgm/libcoap/develop/BUILDING). + +LICENSE INFORMATION +=================== + +This library is published as open-source software without any warranty +of any kind. Use is permitted under the terms of the simplified BSD +license. It includes public domain software. libcoap binaries may also +include open-source software with their respective licensing terms. +Please refer to +[LICENSE](https://raw.githubusercontent.com/obgm/libcoap/develop/LICENSE) +for further details. + diff --git a/examples/espidf-coap-server/components/idf_component.yml b/examples/espidf-coap-server/components/idf_component.yml new file mode 100644 index 0000000..177c3ec --- /dev/null +++ b/examples/espidf-coap-server/components/idf_component.yml @@ -0,0 +1,5 @@ +dependencies: + idf: '>=4.4' +description: Constrained Application Protocol (CoAP) C Library +url: https://github.com/espressif/idf-extra-components/tree/master/coap +version: 4.3.1~1 diff --git a/examples/espidf-coap-server/components/libcoap/.github/ISSUE_TEMPLATE/bug_report.md b/examples/espidf-coap-server/components/libcoap/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..7e8447a --- /dev/null +++ b/examples/espidf-coap-server/components/libcoap/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,112 @@ +--- +name: Bug report +about: libcoap crashes, produces incorrect output, or has incorrect behavior +title: '' +labels: '' +assignees: '' + +--- + +----------------------------- Delete Below ----------------------------- + +INSTRUCTIONS +============ + +Before submitting a new issue, please follow the checklist and try to find the +answer. + +- [ ] I have read the documentation [libcoap Modules Documentation](https://libcoap.net/doc/reference/develop/modules.html) +and the issue is not addressed there. +- [ ] I have read the documentation [libcoap Manual Pages](https://libcoap.net/doc/reference/develop/manpage.html) +and the issue is not addressed there. +- [ ] I have updated my libcoap branch (develop) to the latest version and +checked that the issue is present there. +- [ ] I have searched the [Issue Tracker](https://github.com/obgm/libcoap/issues) +(both open and closed - overwrite `is:issue is:open`) for a similar issue and +not found a similar issue. +- [ ] I have checked the [Wiki](https://github.com/obgm/libcoap/wiki) to see if +the issue is reported there. +- [ ] I have read the HOWTOs provided with the source. +- [ ] I have read the [BUILDING](https://raw.githubusercontent.com/obgm/libcoap/develop/BUILDING) +on how to build from source. + +If the issue cannot be solved after checking through the steps above, please +follow these instructions so we can get the needed information to help you in a +quick and effective fashion. + +1. Fill in all the fields under **Environment** marked with [ ] by picking the +correct option for you in each case and deleting the others. +2. Describe your problem. +3. Include any debug logs (running the application with verbose logging). +4. Providing as much information as possible under **Other items if possible** +will help us locate and fix the problem. +5. Use [Markdown](https://guides.github.com/features/mastering-markdown/) (see +formatting buttons above) and the Preview tab to check what the issue will look +like. +6. Delete these instructions from the `Delete Below` to the `Delete Above` +marker lines before submitting this issue. + +**IMPORTANT: If you do not follow these instructions and provide the necessary +details, it may not be possible to resolve your issue.** + +----------------------------- Delete Above ----------------------------- + +## Environment + +- libcoap version (run ``git describe --tags`` to find it): + + // v4.3.0-rc3-41-g25fe796 +- Build System: [Make|CMake] +- Operating System: [Windows|Linux|macOS|FreeBSD|Cygwin|Solaris|RIOT|Other (which?)] +- Operating System Version: [ ] +- Hosted Environment: [None|Contiki|LwIP|ESP-IDF|Other (which?)] + +## Problem Description + +// Detailed problem description goes here. + +### Expected Behavior + +// Describe what you are expecting. + +### Actual Behavior + +// Describe what you are seeing. + +### Steps to reproduce + +1. step1 +2. ... + + +### Code to reproduce this issue + +```cpp +// the code should be wrapped in the ```cpp tag so that it will be displayed +better. +#include "coap3/coap.h" + +void main() +{ + +} + +``` +// If your code is longer than 30 lines, upload it as an attachment. Do not +include code that is proprietary or sensitive for your project. Try to reduce +your code as much as possible so that it only demonstrates the issue. + +## Debug Logs + +``` +Debug verbose logs go here. +Please copy the plain text here for us to search the error log. Or attach the +complete logs but leave the main part here if the log is *too* long. +``` + +## Other items if possible + +- [ ] Does what you are trying to do work under any configuration. Detail what +works. +- [ ] Network configuration that is not straightforward. Detail any networking +that may have NAT or firewalls that might affect what is going on. diff --git a/examples/espidf-coap-server/components/libcoap/.github/ISSUE_TEMPLATE/config.yml b/examples/espidf-coap-server/components/libcoap/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..94f905f --- /dev/null +++ b/examples/espidf-coap-server/components/libcoap/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,14 @@ +blank_issues_enabled: false +contact_links: + - name: General libcoap Information + url: https://libcoap.net/ + about: General information about libcoap + - name: General libcoap Documentation + url: https://libcoap.net/documentation.html + about: Documentation information for libcoap + - name: Latest libcoap API Documentation + url: https://libcoap.net/doc/reference/develop/modules.html + about: Latest API information for libcoap + - name: Latest libcoap Manual Pages + url: https://libcoap.net/doc/reference/develop/manpage.html + about: Latest Manual Pages and Examples for libcoap diff --git a/examples/espidf-coap-server/components/libcoap/.github/ISSUE_TEMPLATE/feature_request.md b/examples/espidf-coap-server/components/libcoap/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..d96b521 --- /dev/null +++ b/examples/espidf-coap-server/components/libcoap/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,26 @@ +--- +name: Feature request +about: Suggest an idea for libcoap +title: '' +labels: 'Type: Feature Request' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** + +A clear and concise description of what the problem is. E.g. I'm always frustrated when [...] + +**Describe the solution you'd like** + +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** + +A clear and concise description of any alternative solutions or features you've considered. + +Please give as many details as you can. Include suggestions for useful APIs or interfaces if relevant. + +**Additional context** + +Add any other context or screenshots about the feature request here. diff --git a/examples/espidf-coap-server/components/libcoap/.github/workflows/main.yml b/examples/espidf-coap-server/components/libcoap/.github/workflows/main.yml new file mode 100644 index 0000000..0862f7c --- /dev/null +++ b/examples/espidf-coap-server/components/libcoap/.github/workflows/main.yml @@ -0,0 +1,196 @@ +name: Build Tests + +on: + push: + branches: + - main + - develop + - release-* + - gh-workflows + pull_request: + branches: + - main + - develop + +env: + PLATFORM: posix + TESTS: yes + OPENSSL_INSTALL_PATH: C:\Program Files\OpenSSL-Win64\ + +jobs: + build-linux: + runs-on: ubuntu-latest + strategy: + matrix: + CC: ["gcc", "clang"] + TLS: ["no", "openssl", "gnutls", "mbedtls"] + steps: + - uses: actions/checkout@v2 + - name: setup + run: | + sudo apt-get update && sudo apt-get install -y libcunit1-dev libmbedtls-dev libgnutls28-dev libtool libtool-bin exuberant-ctags valgrind + ./autogen.sh + - name: configure no-TLS + if: matrix.TLS == 'no' + run: | + mkdir build-${{matrix.TLS}}-${{matrix.CC}} + cd build-${{matrix.TLS}}-${{matrix.CC}} + $GITHUB_WORKSPACE/configure --disable-silent-rules --disable-documentation --enable-examples --enable-tests --disable-dtls CC=${{matrix.CC}} + - name: configure TLS + if: matrix.TLS != 'no' + run: | + mkdir build-${{matrix.TLS}}-${{matrix.CC}} + cd build-${{matrix.TLS}}-${{matrix.CC}} + "$GITHUB_WORKSPACE/configure" --disable-silent-rules --disable-documentation --enable-examples --enable-tests --with-${{matrix.TLS}} CC=${{matrix.CC}} + - name: compile + run: | + cd build-${{matrix.TLS}}-${{matrix.CC}} + make EXTRA_CFLAGS=-Werror && make check EXTRA_CFLAGS=-Werror + - name: test + run: | + cd build-${{matrix.TLS}}-${{matrix.CC}} + libtool --mode=execute valgrind --track-origins=yes --leak-check=yes --show-reachable=yes --error-exitcode=123 --quiet --suppressions=$GITHUB_WORKSPACE/tests/valgrind_suppression tests/testdriver + tinydtls-build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + - name: setup + run: | + sudo apt-get update && sudo apt-get install -y libcunit1-dev libtool libtool-bin exuberant-ctags valgrind + ./autogen.sh + - name: configure + run: | + $GITHUB_WORKSPACE/configure --disable-silent-rules --disable-documentation --enable-examples --enable-tests --with-tinydtls + - name: compile + run: | + make EXTRA_CFLAGS=-Werror && make check EXTRA_CFLAGS=-Werror + - name: test + run: | + LD_LIBRARY_PATH=ext/tinydtls libtool --mode=execute valgrind --track-origins=yes --leak-check=yes --show-reachable=yes --error-exitcode=123 --quiet --suppressions=$GITHUB_WORKSPACE/tests/valgrind_suppression tests/testdriver + cmake-build: + runs-on: ubuntu-latest + strategy: + matrix: + TLS: ["no", "openssl", "gnutls", "mbedtls", "tinydtls"] + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + - name: setup + run: | + sudo apt-get update && sudo apt-get install -y libcunit1-dev libmbedtls-dev libgnutls28-dev + cmake -E make_directory $GITHUB_WORKSPACE}/build-${{matrix.TLS}}-cmake + - name: configure no-TLS + if: matrix.TLS == 'no' + run: | + cd $GITHUB_WORKSPACE}/build-${{matrix.TLS}}-cmake + cmake $GITHUB_WORKSPACE -DENABLE_EXAMPLES=ON -DENABLE_TESTS=ON -DENABLE_DTLS=OFF -DENABLE_DOCS=OFF + - name: configure TLS + if: matrix.TLS != 'no' + run: | + cd $GITHUB_WORKSPACE}/build-${{matrix.TLS}}-cmake + cmake $GITHUB_WORKSPACE -DENABLE_EXAMPLES=ON -DENABLE_TESTS=ON -DENABLE_DTLS=ON -DENABLE_DOCS=OFF -DDTLS_BACKEND=${{matrix.TLS}} + - name: build + run: | + cd $GITHUB_WORKSPACE}/build-${{matrix.TLS}}-cmake + cmake --build . + other-build: + runs-on: ubuntu-latest + strategy: + matrix: + OS: ["contiki", "lwip"] + steps: + - uses: actions/checkout@v2 + - name: setup + run: | + ./autogen.sh + - name: configure + run: | + $GITHUB_WORKSPACE/configure --disable-documentation --disable-examples --disable-tests --disable-dtls + - name: compile + run: | + make -C examples/${{matrix.OS}} + ms-build: + runs-on: windows-latest + + steps: + - uses: actions/checkout@v2 + + - name: Add MSBuild to PATH + uses: microsoft/setup-msbuild@v1 + + - name: Install OpenSSL on Windows (choco) + run: | + choco install openssl + shell: cmd + + - name: Build sln + shell: cmd + run: call .\scripts\msbuild.sln.cmd + + additional-tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + - name: setup + run: | + sudo apt-get update && sudo apt-get install -y libgnutls28-dev libtool libtool-bin exuberant-ctags + ./autogen.sh + - name: configure + run: ./configure --disable-tests --disable-documentation + - name: build + run: | + make + make -C tests/oss-fuzz -f Makefile.ci check clean + documentation: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + - name: setup + run: | + sudo apt-get update && sudo apt-get install -y libtool libtool-bin exuberant-ctags graphviz doxygen libxml2-utils xsltproc docbook-xml docbook-xsl asciidoc + ./autogen.sh + - name: configure + run: ./configure --disable-tests --enable-documentation --prefix $GITHUB_WORKSPACE/test-install + - name: manuals check + run: | + make -C man + - name: manual page examples check + run: | + man/examples-code-check man + - name: doxygen check + run: | + make -C doc + - name: installation check + run: | + make install && ls -lR $GITHUB_WORKSPACE/test-install + distribution: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + - name: setup + run: | + sudo apt-get update && sudo apt-get install -y libcunit1-dev libtool libtool-bin exuberant-ctags graphviz doxygen libxml2-utils xsltproc docbook-xml docbook-xsl asciidoc + ./autogen.sh + - name: configure + run: | + mkdir build-dist + cd build-dist + $GITHUB_WORKSPACE/configure --enable-silent-rules --enable-documentation --enable-examples --disable-dtls + - name: build distribution + run: | + cd build-dist + make dist + - name: check distribution build + run: | + cd build-dist + $GITHUB_WORKSPACE/scripts/github_dist.sh + shell: bash diff --git a/examples/espidf-coap-server/components/libcoap/.gitignore b/examples/espidf-coap-server/components/libcoap/.gitignore new file mode 100644 index 0000000..65dde4b --- /dev/null +++ b/examples/espidf-coap-server/components/libcoap/.gitignore @@ -0,0 +1,116 @@ +# .gitignore for libcoap + +# autosave files +*~ +\#*# + +# ignoring autogenerated files and directories by autoreconf +INSTALL +Makefile +Makefile.in +aclocal.m4 +ar-lib +autom4te.cache/ +coap_config.h +coap_config.h.in +compile +config.* +!config.yml +configure +debian/ +depcomp +install-sh +libcoap-*.tar.bz2 +libtool +ltmain.sh +m4/libtool.m4 +m4/ltoptions.m4 +m4/ltsugar.m4 +m4/ltversion.m4 +m4/lt~obsolete.m4 +missing +stamp-h1 + +# ignoring more files generated by the configure script or the make actions +.libs/ +libcoap*.la +libcoap*.pc +src/**/.deps/ +src/**/.dirstamp +src/**/.libs/ +src/**/*.o +src/**/*.lo +src/*.lo +src/*.o +src/.deps/ +src/.dirstamp +src/.libs/ +build/ + +# the doc/ folder +doc/Doxyfile +doc/Makefile.in +doc/docbook-xsl.css +doc/doxyfile.stamp +doc/doxygen_sqlite3.db +doc/DoxygenLayout.xml +doc/upgrade_*.html +doc/html/ +doc/man_html/ +doc/man_tmp/ + +# the man/ folder +man/docbook-xsl.css +man/examples-code-check +man/examples-code-check.exe +man/examples-code-check.o +man/Makefile +man/Makefile.in +man/tmp +man/.deps/ +man/*.html +man/*.txt +man/*.xml +man/*.3 +man/*.5 +man/*.7 + +# the examples/ folder +examples/.deps/ +examples/*.o +examples/coap-client +examples/coap-client-* +examples/coap-etsi_iot_01 +examples/coap-rd +examples/coap-rd-* +examples/coap-server +examples/coap-server-* +examples/coap-tiny +examples/*.exe + +# the include/ folder +include/coap3/coap.h + +# the tests/ folder +tests/.deps +tests/oss-fuzz/Makefile.ci +tests/testdriver +tests/*.o +tests/test_common.h + +# ctags - Sublime plugin +tags +.tags* +TAGS + +# ignore gcov-generated files +**/*.gcda +**/*.gcno +**/*.gcov + +# IDE files +CMakeLists.txt.user +/.vs/ +/out/ +/.vscode/ +/_build/ diff --git a/examples/espidf-coap-server/components/libcoap/.gitmodules b/examples/espidf-coap-server/components/libcoap/.gitmodules new file mode 100644 index 0000000..fb96bfd --- /dev/null +++ b/examples/espidf-coap-server/components/libcoap/.gitmodules @@ -0,0 +1,4 @@ +[submodule "ext/tinydtls"] + path = ext/tinydtls + url = https://github.com/eclipse/tinydtls.git + ignore = dirty diff --git a/examples/espidf-coap-server/components/libcoap/.travis.yml b/examples/espidf-coap-server/components/libcoap/.travis.yml new file mode 100644 index 0000000..ec9e71d --- /dev/null +++ b/examples/espidf-coap-server/components/libcoap/.travis.yml @@ -0,0 +1,70 @@ +os: + - linux + +language: c + +compiler: + - gcc + - clang + +services: + - docker + +env: + - PLATFORM=posix TESTS=yes TLS=no + - PLATFORM=posix TESTS=yes TLS=gnutls SMALL_STACK=yes + - PLATFORM=posix TESTS=yes TLS=gnutls SMALL_STACK=no + - PLATFORM=posix TESTS=yes TLS=gnutls SMALL_STACK=yes EPOLL=no + - PLATFORM=posix TESTS=yes TLS=gnutls SMALL_STACK=no EPOLL=no + - PLATFORM=posix TESTS=yes TLS=openssl + - PLATFORM=posix TESTS=yes TLS=tinydtls + - PLATFORM=posix TESTS=yes TLS=mbedtls + +before_install: + - docker build -t obgm/libcoap:travis-env . + +branches: + only: + - main + - develop + - /^release-.*$/ + - travis-test + +stages: + - test + - other platforms + - dist + +jobs: + include: + - stage: other platforms + env: PLATFORM=contiki TLS=no + before_script: + script: + - docker run --privileged -e CC -e PLATFORM -e TLS obgm/libcoap:travis-env /bin/sh -c "scripts/build.sh" + - stage: other platforms + env: PLATFORM=lwip TLS=no + before_script: + script: + - docker run --privileged -e CC -e PLATFORM -e TLS obgm/libcoap:travis-env /bin/sh -c "scripts/build.sh" + - stage: dist + env: PLATFORM=posix TESTS=yes TLS=no DOCS=yes + before_script: + script: + - docker run --privileged -e CC -e PLATFORM -e TESTS -e DOCS -e TLS obgm/libcoap:travis-env /bin/sh -c "scripts/dist.sh" + +# Docker disables IPv6 in containers by default, so re-enable it. +before_script: + # `daemon.json` is normally missing, but let's log it in case that changes. + - sudo touch /etc/docker/daemon.json + - sudo cat /etc/docker/daemon.json + - sudo service docker stop + # This needs YAML quoting because of the curly braces. + - 'echo ''{"ipv6": true, "fixed-cidr-v6": "2001:db8:1::/64"}'' | sudo tee /etc/docker/daemon.json' + - sudo service docker start + # Fail early if docker failed on start -- add `- sudo dockerd` to debug. + - sudo docker info + # Paranoia log: what if our config got overwritten? + - sudo cat /etc/docker/daemon.json +script: + - docker run --privileged -e CC -e PLATFORM -e TESTS -e DOCS -e TLS -e EPOLL -e SMALL_STACK obgm/libcoap:travis-env /bin/sh -c "scripts/build.sh" diff --git a/examples/espidf-coap-server/components/libcoap/AUTHORS b/examples/espidf-coap-server/components/libcoap/AUTHORS new file mode 100644 index 0000000..d59fb86 --- /dev/null +++ b/examples/espidf-coap-server/components/libcoap/AUTHORS @@ -0,0 +1,8 @@ +Olaf Bergmann +Carsten Schönert +Jon Shallow +Jean-Claude Michelou +Christian Amsüss + +For additional contributors, see +https://github.com/obgm/libcoap/graphs/contributors \ No newline at end of file diff --git a/examples/espidf-coap-server/components/libcoap/BUILDING b/examples/espidf-coap-server/components/libcoap/BUILDING new file mode 100644 index 0000000..4a38182 --- /dev/null +++ b/examples/espidf-coap-server/components/libcoap/BUILDING @@ -0,0 +1,157 @@ +For Windows builds - see the Windows Section + +Obtaining the Libcoap Source +============================ + +To get the libcoap library source, you need to do either the following + +* Obtain the latest distribution package file from + https://github.com/obgm/libcoap/archive/develop.zip + [There is a stable version at + https://github.com/obgm/libcoap/archive/main.zip] +* Change to the directory that you want to install the libcoap sub-directory + into +* Unpack the distribution package file +* Change into the top level directory of the unpackaged files + +or alternatively, clone the libcoap git repository from github + +* Change to the directory that you want to install the libcoap sub-directory + into. +* Then clone the latest (develop) version of the code:- + git clone https://github.com/obgm/libcoap.git +* Change into the top level directory of the cloned files +* Optionally, change the branch from develop to the stable main branch:- + git checkout main + +Building Libcoap Libraries and Examples +======================================= + +Follow the appropriate sections below + + +TinyDTLS Only +============= + +It is possible that you may need to execute the following two commands once to +get the TinyDTLS code into your project, so the TinyDTLS library can be used. + + git submodule init + git submodule update + +General Building with cmake for linux/windows/macos/android (not for LwIP or Contiki - see below) +================ + + cmake -E remove_directory build + cmake -E make_directory build + cd build + cmake .. -DENABLE_TESTS=ON + cmake --build . + [sudo] cmake --build . -- install + cd .. + + Note: to see possible options (TLS lib, doc, tests, examples etc.): + cmake -LH build + + Note: For Windows, this is supported by Visual Studio Code with CMake extension + Note: You must use cmake version >=3.10. + + Note: you can use cmake's find package after installation: find_package(libcoap-2 REQUIRED), + and target_link_libraries(myTarget PRIVATE libcoap::coap-2) + + Note: Shared Library support is not currently available for Windows. + +General Building with autoconf (not for LwIP or Contiki - see below) +================ + + ./autogen.sh + ./configure + make + sudo make install + +./autogen.sh will fail if there is a required package for buildling libcoap +that is missing. Install the missing package and try ./autogen.sh again. + +It is possible that you may need to provide some options to ./configure +to customize your installation. + +In particular you may need to define which (D)TLS library to use as well as +disable some building of documentation. + +General configure instructions can be found in INSTALL, which is built +by ./autogen.sh + + ./configure --help +gives the specific options available to libcoap. + +Some examples are:- + +# No DTLS + ./configure --enable-tests --disable-documentation --enable-examples --disable-dtls --enable-shared + +# With TinyDTLS + ./configure --enable-tests --disable-documentation --enable-examples --with-tinydtls --enable-shared + +Note: FreeBSD requires gmake instead of make when building TinyDTLS - i.e. + gmake + sudo gmake install + +# With OpenSSL + ./configure --with-openssl --enable-tests --enable-shared + +# With GnuTLS + ./configure --with-gnutls --enable-tests --enable-shared + +Note: --disable-documentation disables the building of doxygen and man page +files. If you want to only disable one of them, use --disable-doxygen or +--disable-manpages. Doxygen requires the program doxygen and man pages require +the program a2x to build the appropriate files. + +If you need to rebuild the libcoap-*.{map,sym} files to update any exposed +function changes, run + + make update-map-file + +prior to running 'make'. + +LwIP +==== + + ./autogen.sh + ./configure --disable-tests --disable-documentation --disable-examples --disable-dtls + cd examples/lwip + make + +Executable is ./server. See examples/lwip/README for further information + +Contiki +======= + + ./autogen.sh + ./configure --disable-tests --disable-documentation --disable-examples --disable-dtls + cd examples/contiki + make + +Executable is ./server.minimal-net. See examples/contiki/README for further +information + +Windows +======= + +Install OpenSSL (minimum version 1.1.0) including the development libraries if +not already installed. + +Within Visual Studio, "Clone or check out code" using the repository +https://github.com/obgm/libcoap.git + +You may need to update the SDK version of the libcoap Windows Project files to +match that of the SDK version of the Visual Studio you are using. In Solution +Explorer with the view set to libcoap.sln, right click "Solution 'libcoap'" +and then "Retarget solution". + +You may need to edit win32\libcoap.props to update the OpenSSLRootDir and +OpenSSLRootDirDbg variables to point to the top level directory where OpenSSL +is installed so that the include, lib etc. directories are correctly set up. +Note: Make sure that you include a trailing \ in the variable definitions. + +Alternatively you can build everything in Visual Studio with CMake. diff --git a/examples/espidf-coap-server/components/libcoap/CMakeLists.txt b/examples/espidf-coap-server/components/libcoap/CMakeLists.txt new file mode 100644 index 0000000..606e1dd --- /dev/null +++ b/examples/espidf-coap-server/components/libcoap/CMakeLists.txt @@ -0,0 +1,723 @@ +# CMakeLists.txt for libcoap +# +# Copyright (C) 2020 Carlos Gomes Martinho +# Copyright (C) 2020-2022 Jon Shallow +# +# SPDX-License-Identifier: BSD-2-Clause +# +# This file is part of the CoAP library libcoap. Please see README for terms +# of use. + +cmake_minimum_required(VERSION 3.10) + +project( + libcoap + VERSION 4.3.1 + LANGUAGES CXX C) + +set(LIBCOAP_API_VERSION 3) +set(COAP_LIBRARY_NAME "coap-${LIBCOAP_API_VERSION}") + +option( + BUILD_SHARED_LIBS + "Build shared libs" + OFF) + +add_library(${COAP_LIBRARY_NAME}) + +# +# options to tweak the library +# + +option( + ENABLE_DTLS + "Enable building with DTLS support" + ON) +set(DTLS_BACKEND + "default" + CACHE + STRING + "\ +Name of the dtls backend, only relevant if `ENABLE_DTLS` is ON which is default. \ +Possible values: default, gnutls, openssl, tinydtls and mbedtls. \ +If specified then this library will be searched and if found also used. \ +If not found then the cmake configuration will stop with an error. \ +If not specified, then cmake will try to use the first one found in the following order: \ +gnutls, openssl, tinydtls, mbedtls \ + ") +set_property( + CACHE DTLS_BACKEND + PROPERTY STRINGS + default + openssl + gnutls + tinydtls + mbedtls) +option( + USE_VENDORED_TINYDTLS + "compile with the tinydtls project in the submodule if on, otherwise try to find the compiled lib with find_package" + ON) +option( + ENABLE_CLIENT_MODE + "compile with support for client mode code" + ON) +option( + ENABLE_SERVER_MODE + "compile with support for server mode code" + ON) +option( + WITH_EPOLL + "compile with epoll support" + ON) +option( + ENABLE_SMALL_STACK + "Define if the system has small stack size" + OFF) +option( + ENABLE_TCP + "Enable building with TCP support" + ON) +option( + ENABLE_TESTS + "build also tests" + OFF) +option( + ENABLE_EXAMPLES + "build also examples" + ON) +option( + ENABLE_DOCS + "build also doxygen documentation" + ON) + +if(NOT CMAKE_C_STANDARD) + set(CMAKE_C_STANDARD 11) +endif() + +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE Debug) +endif() + +if(MSVC) + add_definitions(-D_CRT_SECURE_NO_WARNINGS) +endif() + +if(APPLE) + add_definitions(-D__APPLE_USE_RFC_3542=1) +endif() + +list(APPEND CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR}) +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_BINARY_DIR}) +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) + +include(CheckCSourceCompiles) +include(CheckFunctionExists) +include(CheckIncludeFile) +include(CheckSymbolExists) +include(CheckTypeSize) +include(TestBigEndian) + +# check for headers +check_include_file(byteswap.h HAVE_BYTESWAP_H) +check_include_file(inttypes.h HAVE_INTTYPES_H) +check_include_file(limits.h HAVE_LIMITS_H) +check_include_file(memory.h HAVE_MEMORY_H) +check_include_file(strings.h HAVE_STRINGS_H) +check_include_file(string.h HAVE_STRING_H) +check_include_file(sys/sysctl.h HAVE_SYS_SYSCTL_H) +check_include_file(net/if.h HAVE_NET_IF_H) +check_include_file(netinet/in.h HAVE_NETINET_IN_H) +check_include_file(sys/epoll.h HAVE_EPOLL_H) +check_include_file(sys/timerfd.h HAVE_TIMERFD_H) +check_include_file(arpa/inet.h HAVE_ARPA_INET_H) +check_include_file(stdbool.h HAVE_STDBOOL_H) +check_include_file(netdb.h HAVE_NETDB_H) +check_include_file(pthread.h HAVE_PTHREAD_H) +check_include_file(stdlib.h HAVE_STDINT_H) +check_include_file(stdint.h HAVE_STDLIB_H) +check_include_file(syslog.h HAVE_SYSLOG_H) +check_include_file(sys/ioctl.h HAVE_SYS_IOCTL_H) +check_include_file(sys/socket.h HAVE_SYS_SOCKET_H) +check_include_file(sys/stat.h HAVE_SYS_STAT_H) +check_include_file(sys/time.h HAVE_SYS_TIME_H) +check_include_file(sys/types.h HAVE_SYS_TYPES_H) +check_include_file(sys/unistd.h HAVE_SYS_UNISTD_H) +check_include_file(time.h HAVE_TIME_H) +check_include_file(unistd.h HAVE_UNISTD_H) +check_include_file(float.h HAVE_FLOAT_H) +check_include_file(stddef.h HAVE_STDDEF_H) +check_include_file(winsock2.h HAVE_WINSOCK2_H) +check_include_file(ws2tcpip.h HAVE_WS2TCPIP_H) + +# check for functions +check_function_exists(malloc HAVE_MALLOC) +check_function_exists(memset HAVE_MEMSET) +check_function_exists(select HAVE_SELECT) +check_function_exists(socket HAVE_SOCKET) +check_function_exists(strcasecmp HAVE_STRCASECMP) +check_function_exists(pthread_mutex_lock HAVE_PTHREAD_MUTEX_LOCK) +check_function_exists(getaddrinfo HAVE_GETADDRINFO) +check_function_exists(strnlen HAVE_STRNLEN) +check_function_exists(strrchr HAVE_STRRCHR) +check_function_exists(getrandom HAVE_GETRANDOM) +check_function_exists(if_nametoindex HAVE_IF_NAMETOINDEX) + +# check for symbols +if(WIN32) + set(HAVE_STRUCT_CMSGHDR 1) +else() + check_symbol_exists( + CMSG_FIRSTHDR + sys/socket.h + HAVE_STRUCT_CMSGHDR) +endif() + +if(${ENABLE_CLIENT_MODE}) + set(COAP_CLIENT_SUPPORT "1") + message(STATUS "compiling with client support") +else() + message(STATUS "compiling without client support") +endif() + +if(${ENABLE_SERVER_MODE}) + set(COAP_SERVER_SUPPORT "1") + message(STATUS "compiling with server support") +else() + message(STATUS "compiling without server support") +endif() + +if(${WITH_EPOLL} + AND ${HAVE_EPOLL_H} + AND ${HAVE_TIMERFD_H}) + set(COAP_EPOLL_SUPPORT "1") + message(STATUS "compiling with epoll support") +else() + message(STATUS "compiling without epoll support") +endif() + +if(ENABLE_SMALL_STACK) + set(ENABLE_SMALL_STACK "${ENABLE_SMALL_STACK}") + message(STATUS "compiling with small stack support") +endif() + +set(WITH_GNUTLS OFF) +set(WITH_OPENSSL OFF) +set(WITH_TINYDTLS OFF) +set(WITH_MBEDTLS OFF) + +function(compile_tinydtls) + set(TINYDTLS_SOURCES_DIR ${CMAKE_CURRENT_LIST_DIR}/ext/tinydtls) + set(TINYDTLS_SOURCES_GENERATED ${TINYDTLS_SOURCES_DIR}/dtls_config.h) + + message(STATUS "compiling the tinydtls lib") + + include(ExternalProject) + + externalproject_add( + external_tinydtls + SOURCE_DIR "${TINYDTLS_SOURCES_DIR}" + BUILD_IN_SOURCE 1 + DOWNLOAD_COMMAND "" + UPDATE_COMMAND "" + CONFIGURE_COMMAND + ${TINYDTLS_SOURCES_DIR}/configure + --disable-manpages + --prefix=${CMAKE_BINARY_DIR} + BUILD_COMMAND make install + INSTALL_COMMAND "" + LOG_DOWNLOAD 1 + LOG_CONFIGURE 1) + + externalproject_add_step( + external_tinydtls autoreconf + COMMAND autoreconf --force --install + ALWAYS 1 + WORKING_DIRECTORY "${TINYDTLS_SOURCES_DIR}" + DEPENDERS configure + DEPENDEES download) + + # Let cmake know that it needs to execute the external_tinydtls target to generate those files. + add_custom_command( + OUTPUT ${TINYDTLS_SOURCES_GENERATED} + WORKING_DIRECTORY "${TINYDTLS_SOURCES_DIR}" + COMMAND "make install" + DEPENDS external_tinydtls) + + add_dependencies(${COAP_LIBRARY_NAME} external_tinydtls) + + if(BUILD_SHARED_LIBS) + set(LIBTINYDTLS_PATH "${CMAKE_CURRENT_BINARY_DIR}/lib/libtinydtls.so") + else() + set(LIBTINYDTLS_PATH "${CMAKE_CURRENT_BINARY_DIR}/lib/libtinydtls.a") + endif() + + add_library( + tinydtls + UNKNOWN + IMPORTED) + set_target_properties( + tinydtls + PROPERTIES INTERFACE_INCLUDE_DIRECTORIES + "${CMAKE_CURRENT_BINARY_DIR}/include" + IMPORTED_LINK_INTERFACE_LANGUAGES "C" + IMPORTED_LOCATION "${LIBTINYDTLS_PATH}") + +endfunction() + +if(ENABLE_DTLS) + message(STATUS "compiling with DTLS support") + message(STATUS "DTLS_BACKEND: ${DTLS_BACKEND}") + + if(DTLS_BACKEND + STREQUAL + "default") + # try to find a crypto lib and use it, use the first one found + + # libgnutls (e.g. debian libgnutls28-dev) + find_package(GnuTLS) + if(GnuTLS_FOUND) + set(WITH_GNUTLS ON) + message(STATUS "compiling with gnutls support") + set(HAVE_LIBGNUTLS 1) + else() + # gnutls not found + find_package(OpenSSL) + if(OpenSSL_FOUND) + set(WITH_OPENSSL ON) + message(STATUS "compiling with openssl support") + set(HAVE_OPENSSL 1) + else() + # openssl not found + # libmbedtls (e.g. debian libmbedtls-dev) + find_package(MbedTLS) + if(MbedTLS_FOUND) + set(WITH_MBEDTLS ON) + message(STATUS "compiling with mbedtls support") + set(HAVE_MBEDTLS 1) + else() + # mbedtls not found + if(USE_VENDORED_TINYDTLS) + compile_tinydtls() + else() + find_package(TinyDTLS) + if(TINYDTLS_FOUND) + + else() + # no cryto lib found + message( + FATAL_ERROR + "cannot find any cryto lib, either install one or compile without DTLS support" + ) + endif() + + endif() + + set(WITH_TINYDTLS ON) + message(STATUS "compiling with tinydtls support") + set(HAVE_LIBTINYDTLS 1) + + endif() + + endif() + + endif() + + else() + # DTLS_BACKEND variable is not empty, so set all to false and set the only right to true + set(WITH_GNUTLS OFF) + set(WITH_TINYDTLS OFF) + set(WITH_MBEDTLS OFF) + set(WITH_OPENSSL OFF) + + if(DTLS_BACKEND + STREQUAL + "gnutls") + # libgnutls (e.g. debian libgnutls28-dev) + find_package(GnuTLS REQUIRED) + set(WITH_GNUTLS ON) + message(STATUS "compiling with gnutls support") + set(HAVE_LIBGNUTLS 1) + endif() + + if(DTLS_BACKEND + STREQUAL + "openssl") + # libssl (e.g. debian libssl1.0-dev) + find_package(OpenSSL REQUIRED) + set(WITH_OPENSSL ON) + message(STATUS "compiling with openssl support") + set(HAVE_OPENSSL 1) + endif() + + if(DTLS_BACKEND + STREQUAL + "mbedtls") + # libmbedtls (e.g. debian libmbedtls-dev) + find_package(MbedTLS REQUIRED) + set(WITH_MBEDTLS ON) + message(STATUS "compiling with mbedtls support") + set(HAVE_MBEDTLS 1) + endif() + + if(DTLS_BACKEND + STREQUAL + "tinydtls") + + if(USE_VENDORED_TINYDTLS) + compile_tinydtls() + else(USE_VENDORED_TINYDTLS) + find_package(TinyDTLS REQUIRED) + endif(USE_VENDORED_TINYDTLS) + + message(STATUS "compiling with tinydtls support") + set(WITH_TINYDTLS ON) + set(HAVE_LIBTINYDTLS 1) + + endif() + + endif() + +endif() + +execute_process(COMMAND git describe --tags --dirty --always + RESULT_VARIABLE USING_GIT + OUTPUT_VARIABLE LIBCOAP_PACKAGE_BUILD + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_QUIET) +if(NOT ${USING_GIT} EQUAL 0) + set(LIBCOAP_PACKAGE_BUILD ${PROJECT_VERSION}) +else() + set(LIBCOAP_PACKAGE_BUILD "${LIBCOAP_PACKAGE_BUILD}") +endif() + +set(PACKAGE_URL "https://libcoap.net/") +set(PACKAGE_NAME "${PROJECT_NAME}") +set(PACKAGE_TARNAME "${PROJECT_NAME}") +set(PACKAGE_STRING "${PROJECT_NAME} ${PROJECT_VERSION}") +set(PACKAGE_VERSION "${PROJECT_VERSION}") +set(PACKAGE_BUGREPORT "libcoap-developers@lists.sourceforge.net") +set(LIBCOAP_PACKAGE_VERSION "${PACKAGE_VERSION}") +set(LIBCOAP_PACKAGE_URL "${PACKAGE_URL}") +set(LIBCOAP_PACKAGE_NAME "${PACKAGE_NAME}") +set(LIBCOAP_PACKAGE_STRING "${PACKAGE_STRING}") +set(LIBCOAP_PACKAGE_BUGREPORT "${PACKAGE_BUGREPORT}") + +message(STATUS "PACKAGE VERSION..................${PACKAGE_VERSION}") +message(STATUS "PACKAGE BUILD....................${LIBCOAP_PACKAGE_BUILD}") +message(STATUS "ENABLE_DTLS:.....................${ENABLE_DTLS}") +message(STATUS "ENABLE_TCP:......................${ENABLE_TCP}") +message(STATUS "ENABLE_CLIENT_MODE:..............${ENABLE_CLIENT_MODE}") +message(STATUS "ENABLE_SERVER_MODE:..............${ENABLE_SERVER_MODE}") +message(STATUS "ENABLE_DOCS:.....................${ENABLE_DOCS}") +message(STATUS "ENABLE_EXAMPLES:.................${ENABLE_EXAMPLES}") +message(STATUS "DTLS_BACKEND:....................${DTLS_BACKEND}") +message(STATUS "WITH_GNUTLS:.....................${WITH_GNUTLS}") +message(STATUS "WITH_TINYDTLS:...................${WITH_TINYDTLS}") +message(STATUS "WITH_OPENSSL:....................${WITH_OPENSSL}") +message(STATUS "WITH_MBEDTLS:....................${WITH_MBEDTLS}") +message(STATUS "HAVE_LIBTINYDTLS:................${HAVE_LIBTINYDTLS}") +message(STATUS "HAVE_LIBGNUTLS:..................${HAVE_LIBGNUTLS}") +message(STATUS "HAVE_OPENSSL:....................${HAVE_OPENSSL}") +message(STATUS "HAVE_MBEDTLS:....................${HAVE_MBEDTLS}") +message(STATUS "WITH_EPOLL:......................${WITH_EPOLL}") +message(STATUS "CMAKE_C_COMPILER:................${CMAKE_C_COMPILER}") +message(STATUS "BUILD_SHARED_LIBS:...............${BUILD_SHARED_LIBS}") +message(STATUS "CMAKE_BUILD_TYPE:................${CMAKE_BUILD_TYPE}") +message(STATUS "CMAKE_SYSTEM_PROCESSOR:..........${CMAKE_SYSTEM_PROCESSOR}") + +set(top_srcdir "${CMAKE_CURRENT_LIST_DIR}") +set(top_builddir "${CMAKE_CURRENT_BINARY_DIR}") +if(ENABLE_TCP) + set(COAP_DISABLE_TCP 0) +else(ENABLE_TCP) + set(COAP_DISABLE_TCP 1) +endif(ENABLE_TCP) + +# creates config header file in build directory +configure_file(${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/coap.h.in + ${CMAKE_CURRENT_BINARY_DIR}/include/coap${LIBCOAP_API_VERSION}/coap.h) + +configure_file(${CMAKE_CURRENT_LIST_DIR}/cmake_coap_config.h.in + ${CMAKE_CURRENT_BINARY_DIR}/coap_config.h) + +configure_file(${CMAKE_CURRENT_LIST_DIR}/tests/test_common.h.in + ${CMAKE_CURRENT_LIST_DIR}/tests/test_common.h) + +# +# sources +# + +target_sources( + ${COAP_LIBRARY_NAME} + PRIVATE ${CMAKE_CURRENT_LIST_DIR}/src/coap_address.c + ${CMAKE_CURRENT_LIST_DIR}/src/coap_asn1.c + ${CMAKE_CURRENT_LIST_DIR}/src/coap_async.c + ${CMAKE_CURRENT_LIST_DIR}/src/coap_cache.c + ${CMAKE_CURRENT_LIST_DIR}/src/coap_debug.c + ${CMAKE_CURRENT_LIST_DIR}/src/coap_event.c + ${CMAKE_CURRENT_LIST_DIR}/src/coap_hashkey.c + ${CMAKE_CURRENT_LIST_DIR}/src/coap_io.c + ${CMAKE_CURRENT_LIST_DIR}/src/coap_notls.c + ${CMAKE_CURRENT_LIST_DIR}/src/coap_option.c + ${CMAKE_CURRENT_LIST_DIR}/src/coap_prng.c + ${CMAKE_CURRENT_LIST_DIR}/src/coap_session.c + ${CMAKE_CURRENT_LIST_DIR}/src/coap_subscribe.c + ${CMAKE_CURRENT_LIST_DIR}/src/coap_tcp.c + ${CMAKE_CURRENT_LIST_DIR}/src/coap_time.c + ${CMAKE_CURRENT_LIST_DIR}/src/block.c + ${CMAKE_CURRENT_LIST_DIR}/src/encode.c + ${CMAKE_CURRENT_LIST_DIR}/src/mem.c + ${CMAKE_CURRENT_LIST_DIR}/src/net.c + ${CMAKE_CURRENT_LIST_DIR}/src/pdu.c + ${CMAKE_CURRENT_LIST_DIR}/src/resource.c + ${CMAKE_CURRENT_LIST_DIR}/src/str.c + ${CMAKE_CURRENT_LIST_DIR}/src/uri.c + # no need to parse those files if we do not need them + $<$:${CMAKE_CURRENT_LIST_DIR}/src/coap_openssl.c> + $<$:${CMAKE_CURRENT_LIST_DIR}/src/coap_tinydtls.c> + $<$:${CMAKE_CURRENT_LIST_DIR}/src/coap_gnutls.c> + $<$:${CMAKE_CURRENT_LIST_DIR}/src/coap_mbedtls.c> + # headers + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/coap.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/coap_address.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/coap_async.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/coap_cache.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/coap_debug.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/coap_dtls.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/coap_event.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/coap_hashkey.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/coap_io.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/coap_option.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/coap_prng.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/coap_session.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/coap_subscribe.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/coap_time.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/block.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/encode.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/libcoap.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/lwippools.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/mem.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/net.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/pdu.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/resource.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/str.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/uri.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/uthash.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/utlist.h) +target_include_directories( + ${COAP_LIBRARY_NAME} + PUBLIC # config headers are generated during configuration time + $ + $ + $ + $ + $<$,$>:${CMAKE_BINARY_DIR}/include/tinydtls> + $<$:${GNUTLS_INCLUDE_DIR}> + $<$:${MBEDTLS_INCLUDE_DIRS}>) +target_link_libraries( + ${COAP_LIBRARY_NAME} + PUBLIC $<$:OpenSSL::SSL> + $<$:OpenSSL::Crypto> + $<$:${GNUTLS_LIBRARIES}> + $<$:tinydtls> + $<$:${MBEDTLS_LIBRARY}> + $<$:${MBEDX509_LIBRARY}> + $<$:${MBEDCRYPTO_LIBRARY}>) + +target_compile_options( + ${COAP_LIBRARY_NAME} + PUBLIC -DLIBCOAP_PACKAGE_BUILD="${LIBCOAP_PACKAGE_BUILD}") + +add_library( + ${PROJECT_NAME}::${COAP_LIBRARY_NAME} + ALIAS + ${COAP_LIBRARY_NAME}) + +# +# compiler options +# + +add_compile_options( + $<$,$>:-pedantic> + $<$,$>:-Wall> + $<$,$>:-Wcast-qual> + $<$,$>:-Wextra> + $<$,$>:-Wformat-security> + $<$,$>:-Winline> + $<$,$>:-Wmissing-declarations> + $<$,$>:-Wmissing-prototypes> + $<$,$>:-Wnested-externs> + $<$,$>:-Wpointer-arith> + $<$,$>:-Wshadow> + $<$,$>:-Wstrict-prototypes> + $<$,$>:-Wswitch-default> + $<$,$>:-Wswitch-enum> + $<$,$>:-Wunused> + $<$,$>:-Wwrite-strings>) + +# +# tests +# + +if(ENABLE_TESTS) + add_executable( + testdriver + ${CMAKE_CURRENT_LIST_DIR}/tests/testdriver.c + ${CMAKE_CURRENT_LIST_DIR}/tests/test_common.h + ${CMAKE_CURRENT_LIST_DIR}/tests/test_encode.c + ${CMAKE_CURRENT_LIST_DIR}/tests/test_encode.h + ${CMAKE_CURRENT_LIST_DIR}/tests/test_error_response.c + ${CMAKE_CURRENT_LIST_DIR}/tests/test_error_response.h + ${CMAKE_CURRENT_LIST_DIR}/tests/test_options.c + ${CMAKE_CURRENT_LIST_DIR}/tests/test_options.h + ${CMAKE_CURRENT_LIST_DIR}/tests/test_pdu.c + ${CMAKE_CURRENT_LIST_DIR}/tests/test_pdu.h + ${CMAKE_CURRENT_LIST_DIR}/tests/test_sendqueue.c + ${CMAKE_CURRENT_LIST_DIR}/tests/test_sendqueue.h + ${CMAKE_CURRENT_LIST_DIR}/tests/test_session.c + ${CMAKE_CURRENT_LIST_DIR}/tests/test_session.h + ${CMAKE_CURRENT_LIST_DIR}/tests/test_tls.c + ${CMAKE_CURRENT_LIST_DIR}/tests/test_tls.h + ${CMAKE_CURRENT_LIST_DIR}/tests/test_uri.c + ${CMAKE_CURRENT_LIST_DIR}/tests/test_uri.h + ${CMAKE_CURRENT_LIST_DIR}/tests/test_wellknown.c + ${CMAKE_CURRENT_LIST_DIR}/tests/test_wellknown.h) + # tests require libcunit (e.g. debian libcunit1-dev) + target_link_libraries(testdriver PUBLIC ${PROJECT_NAME}::${COAP_LIBRARY_NAME} + -lcunit) +endif() + +# +# examples +# + +if(ENABLE_EXAMPLES) + add_executable(coap-client ${CMAKE_CURRENT_LIST_DIR}/examples/coap-client.c) + target_link_libraries(coap-client + PUBLIC ${PROJECT_NAME}::${COAP_LIBRARY_NAME}) + + add_executable(coap-rd ${CMAKE_CURRENT_LIST_DIR}/examples/coap-rd.c) + target_include_directories(coap-rd + PRIVATE + $) + target_link_libraries(coap-rd PUBLIC ${PROJECT_NAME}::${COAP_LIBRARY_NAME}) + + add_executable(coap-server ${CMAKE_CURRENT_LIST_DIR}/examples/coap-server.c) + target_link_libraries(coap-server + PUBLIC ${PROJECT_NAME}::${COAP_LIBRARY_NAME}) + + if(NOT WIN32) + add_executable(etsi_iot_01 ${CMAKE_CURRENT_LIST_DIR}/examples/etsi_iot_01.c) + target_link_libraries(etsi_iot_01 + PUBLIC ${PROJECT_NAME}::${COAP_LIBRARY_NAME}) + + add_executable(tiny ${CMAKE_CURRENT_LIST_DIR}/examples/tiny.c) + target_link_libraries(tiny PUBLIC ${PROJECT_NAME}::${COAP_LIBRARY_NAME}) + endif() +endif() + +# +# docs +# + +if(ENABLE_DOCS) + find_package(Doxygen) + + if(Doxygen_FOUND) + # set input and output files + set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile.in) + set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) + + # Make necessary temporary directories + file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/doc/man_tmp) + file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/doc/man_html) + + # request to configure the file + configure_file( + ${DOXYGEN_IN} + ${DOXYGEN_OUT} + @ONLY) + + # note the option ALL which allows to build the docs together with the + # application + add_custom_target( + doc_doxygen ALL + COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMENT "Generating API documentation with Doxygen" + VERBATIM) + + message(STATUS "Setup up the Doxygen documention build") + + else(Doxygen_FOUND) + message( + WARNING + "Doxygen need to be installed to generate the doxygen documentation") + endif(Doxygen_FOUND) + +endif() + +# +# install +# + +include(GNUInstallDirs) +include(CMakePackageConfigHelpers) + +set(LIBCOAP_CONFIG_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}) +install( + TARGETS ${COAP_LIBRARY_NAME} + EXPORT ${PROJECT_NAME}Targets + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT lib + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT lib) + +install( + EXPORT ${PROJECT_NAME}Targets + DESTINATION ${LIBCOAP_CONFIG_INSTALL_DIR} + NAMESPACE ${PROJECT_NAME}:: + COMPONENT dev) + +configure_package_config_file( + cmake/Config.cmake.in + ${PROJECT_NAME}Config.cmake + INSTALL_DESTINATION + ${LIBCOAP_CONFIG_INSTALL_DIR}) +write_basic_package_version_file( + ${PROJECT_NAME}ConfigVersion.cmake + COMPATIBILITY SameMajorVersion) +install( + FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake + ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake + DESTINATION ${LIBCOAP_CONFIG_INSTALL_DIR} + COMPONENT dev) + +install( + DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/include/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + COMPONENT dev + FILES_MATCHING + PATTERN "*.h" + PATTERN "coap.h" EXCLUDE + PATTERN "coap_riot.h" EXCLUDE + PATTERN "lwippools.h" EXCLUDE + PATTERN "utlist.h" EXCLUDE + PATTERN "uthash.h" EXCLUDE + PATTERN "*_internal.h" EXCLUDE) +install( + DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + COMPONENT dev + FILES_MATCHING + PATTERN "*.h") +if(ENABLE_EXAMPLES) + install( + TARGETS coap-server coap-client coap-rd + DESTINATION ${CMAKE_INSTALL_BINDIR} + COMPONENT dev) + if(NOT WIN32) + install( + TARGETS etsi_iot_01 tiny + DESTINATION ${CMAKE_INSTALL_BINDIR} + COMPONENT dev) + endif() +endif() diff --git a/examples/espidf-coap-server/components/libcoap/CONTRIBUTE b/examples/espidf-coap-server/components/libcoap/CONTRIBUTE new file mode 100644 index 0000000..d7319e9 --- /dev/null +++ b/examples/espidf-coap-server/components/libcoap/CONTRIBUTE @@ -0,0 +1,218 @@ + ####################################################### + # Developer information for contributing to libcoap # + ####################################################### + +1. The basics +~~~~~~~~~~~~~ +The libcoap project is a FOSS project that is dual licensed. The maintainer +for the libcoap is Olaf Bergmann . +Any contributions have to be made under the terms of the +license + + * BSD 2-Clause (The BSD 2-Clause License) + +Contributions made up to 2017-06-01 have been made under the dual +license model BSD 2-Clause and GPL v2+ (The GNU General Public License +2.0 or later). + +The used VCS for libcoap is Git, the main repository is living on GitHub. +You can clone (or fork directly on GitHub) on the repository site: + + https://github.com/obgm/libcoap + +Please refer also to the libcoap website for additional information + + https://libcoap.net/ + +The build environment is grounded on the classical autotools, the GNU GCC and +the LLVM C-compiler (CLang) are supported. The Windows systems are not +currently supported (until someone is creating support for it). + +Doxygen is used for creating a HTML based online documentation of the +libcoap library. + +2. Communications +~~~~~~~~~~~~~~~~~ +The main discussion and development platform for libcoap is the mailing list +on Sourceforge. +No matter if you just have a simple question, some specific problem or +want to discuss some patches, please write it to the mailing list. Please +avoid personal mailings to the maintainer (or some other contributor) if +your questions will probably be in the interest of other users too. +You can subscribe to the list here: + + https://lists.sourceforge.net/lists/listinfo/libcoap-developers + +The archive of the list can be found on: + + https://sourceforge.net/p/libcoap/mailman/libcoap-developers + +3. Starting contributing +~~~~~~~~~~~~~~~~~~~~~~~~ +As written above libcoap is maintained with the Git tools so you should be +familiar with the various git commands. +The libcoap project is using just two main branches, the 'main' branch is +holding the point releases, all the development process is going on in the +'develop' branch. +To start any contributing you first have to clone the git tree from the main +repository on GitHub: + + git clone https://github.com/obgm/libcoap.git + +4. Working on the source +~~~~~~~~~~~~~~~~~~~~~~~~ +As one golden rule you should work on improvements within *your* own local +development branch! To do so you have to first checkout the 'develop' branch +as local branch and then start on top on this branch your own branch. So +create (or better say checkout) the local 'develop' branch: + + cd libcoap + git checkout develop origin/develop + +Now you can simply start your own local branch (for example 'my-develop') +with the 'origin/develop' as parent so you can later create the patches +against the the upstream development branch: + + git checkout -b my-develop + +At this point you can now work as known with git, modify the source, commit +the changes, amend if needed and test your work. +At some point you will have to generate patches to post them on the mailing +list (and/or push your changes into your public Git tree). It's a good idea to +post your patch series on the mailing list so other contributors will see your +work and give further suggestions or discuss your work. + +To be able to send a patch series you will now create the series itself as +single patches, this will be going easy with the 'git format-patch' command +against the 'develop' branch, remind this is the upstream main development +branch. +To not mix up your series with probably unrelated patches let git place the +patches within a defined directory. Also, while create the patches, tell git to +create a cover letter patch so you can append some introducing words that will +hold probably explanations why you create the patches in the way you have done. + + git format-patch --cover-letter -o ../patches4libcoap + +This command will create a patch series in ../patches4libcoap where you find a +patch named '0000-cover-letter.patch'. Please modify this patch with some +useful information's for the mailing list. After finish this you now can send +your patches to libcoap-developers@lists.sourceforge.net + + git send-email ../patches4libcoap/* --to=libcoap-developers@lists.sourceforge.net + +5. Coding rules +~~~~~~~~~~~~~~~ +As every FOSS project the libcoap project needs also some rules for coding. +There are loss but the main of them are important! + +5.1 License and Copyright +------------------------- +Every new file must contain a license and the copyright holder(s). Please +take a look into existing files and adopt the needed changes to your new +file(s). + +5.2 Source Code Indentation +--------------------------- +* For better reading the indentation is set to 2 characters as spaces, this + is depended on the often used nested functions like 'if-else'. Don't use + TABs any there! Avoid trailing white spaces at the end of a line. + It's appropriate to set up a modline like this one at first line within + the source file: + +--8<---- +/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +--->8-- + +* Single lines within the source code should not be longer then 78 + characters. + +* If there a functions with a lot of parameters that do not fit into the above + rule split the declaration (in the *.h) and the implementation (in the *.c) + into single lines per parameter. For example like this (from src/block.c): + +--8<---- +int +coap_add_block(coap_pdu_t *pdu, + unsigned int len, + const unsigned char *data, + unsigned int block_num, + unsigned char block_szx); +--->8-- + +5.3 Source Code Documentation +----------------------------- +* A useful source code documentation is mandatory. Mostly to be done within the + source code files, but more complex description should be done in extra + README files. + +* Please set up/adjust the doxygen documentation if you create new functions or + change existing functions. The doxygen documentation has to be done in the + header files as they are the public part of the libcoap and only use the + @-syntax for doxygen commands (akin to javadoc). + +5.4 API Changes +--------------- +* Never break the API! + Don't remove old functions and if there some changes are needed in some kind + always provide a wrapper for the old call to let the library be backward + compatible and mark the old function as @deprecated in the doxygen comment. + Please discuss needed changes on the mailing list. + +5.5 Patches and Commits +----------------------- +* Git commits must be atomic and contain a declarative subject line (max 50 + characters if possible) and a body for a statement if needed. + Use the possibility to write a good explanation why your patch/commit is + handle the changes in the way you have done. Remind that other user can + read your code but not necessary understand why the code is written this + way. Don't use something to generic like "bugfix commit". + +* A patch/commit or a series of patches/commits have to ensure that the + whole project is able to build up every thing, in short: Do not break + any make target and test your work. + +* Every patch/commit should handle one single logical change. If more than + one patch/commit is needed for a change explain it, respect the point + above. If your subject line become much larger than 50 characters then + typically your patch is to big for one single commit. + +* Commit message should begin with a submodule or unit the commit is for. By + this your commit message helps to find thematic other changes. If you have + to search and find something with 'git log | grep [foo]' you will see why + this is useful. Examples: + + rd.c: Fixed type-specifier warning + Makefile.am: Added missing src/address.c + address.[hc]: make coap_address_equals() not inline on POSIX + +6. Where to start contributing? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +There are various things you could starting on to contribute, the best +is you simply pick up an issue you blindly see and just improve the +situation. Please take also a look into the file TODO and choose a point +from there or point the maintainer to add other things here too. + +* Documentation +We are always lacking on a better documentation on the source code, so +maybe you can improve the doxygen documentation. +Also a good documentation on the usage of the libcoap and the example +binaries is always improvable. So we appreciate any help on this. + +* Manual Pages +The source is providing some example binaries which originally just should show +how the libcoap can be used. Right now these binaries are fully usable and +quite more than simple examples on a system. There are man pages for these +binaries available, if you found there is a improvement needed please do so and +write to the mailing list explained in section 2. +Maybe you can write up some good HowTo's on the usage for these binaries. + +* HowTo's +The libcoap library has now a lot of functions you can use. +Unfortunately there is no good user guide on how to use the libcoap in +any external project. This means there is no HowTo or CheatSheet for a +programming person available. You want to write up something? + +* Missing functionality +There are some features that are still missing inside the libcoap. For +example some DTLS implementations and proxy functionality. + diff --git a/examples/espidf-coap-server/components/libcoap/COPYING b/examples/espidf-coap-server/components/libcoap/COPYING new file mode 100644 index 0000000..c64ad63 --- /dev/null +++ b/examples/espidf-coap-server/components/libcoap/COPYING @@ -0,0 +1,6 @@ +libcoap is published as open-source software without any warranty of any kind. + +Use is permitted under the terms of the simplified BSD 2-Clause license. +It includes public domain software. libcoap binaries may also +include open-source software with their respective licensing terms. +Please refer to LICENSE for further details. diff --git a/examples/espidf-coap-server/components/libcoap/ChangeLog b/examples/espidf-coap-server/components/libcoap/ChangeLog new file mode 100644 index 0000000..5ae73a5 --- /dev/null +++ b/examples/espidf-coap-server/components/libcoap/ChangeLog @@ -0,0 +1,332 @@ +2022-08-17 Olaf Bergmann + + Change summary for version 4.3.1: + + * Support for Server only and Client only libcoap builds. + * Add support for repeating requests in coap-client. + * Add in support for defining resources that support multicast. + * Add in more support for async delayed requests. + * Add in support for not closing down Observe when closing session. + * Support for RFC7390, RFC8516 and RFC9175. + * Warn when Tokens are re-used. + * Warn when Options are repeated that are not defined as being + repeatable. + * Support for TLS when using Mbed TLS library. + * support for Mbed TLS 3.1 + * Add in BERT support for block handling. + * More rigorous error handling for Block transfers. + * Support for using external or submodule TinyDTLS. + * Cmake - add in Apple build support. + * Source files renamed to be more consistent in naming. + * Update native Windows VC builds to use libcoap-3 instead of libcoap-2. + * Reported bugs fixed. + * Example applications Help report include build version. + * Documentation added and updated (Doxygen and man). + +2021-05-04 Olaf Bergmann + + Change summary for version 4.3.0: + + * Include directory updated from include/coap2 to include/coap3 as + this is a major version change. + * Other code references updated from coap2 to coap3. + * Examples now have the underlying (D)TLS library name as a suffix. + E.g. coap-server-openssl + * Examples and libraries can be installed with default names using + ./configure --enable-add-default-names + * Many call-back handlers have had their parameter lists changed, some + variables are made const and other ones removed as they can be easily + reconstructed if needed. + * Some functions have their parameters changed to const. + * Internal structures made opaque to applications, requiring the + applications to access the structure information via a new set of + functions. The new functions are of the form coap_X_get_Y() or + coap_X_set_Y() where X is the structure (e.g. session) and Y is + the variable. + * coap_async_state_t + * coap_attr_t + * coap_context_t + * coap_packet_t + * coap_pdu_t + * coap_resource_t + * coap_session_t + * coap_socket_t + * Header files are moved into libcoap space and so are accessed by coap + sub-directory - e.g. #include . + * RFC7959 (Block handling) moved into libcoap from application code + considerably simplifying application code. See coap_block(3) man page. + * CoAP Cache Key support. + * Support for cmake builds. + * Support for RIOT builds. + * Support for Cygwin builds. + * Proxy support for coap-server, enhanced coap-client capabilities + * Updated async support. + * Multicast requests now randomly delayed befor ethe response is + sent. + * Additional RFC support - RFC8768. + * Mbed TLS DTLS library support. + * (D)TLS support for RPK and PKCS11. + * Additional (D)TLS support for PSK (e.g. Identity Hints). + * PKI support consistent across all supported (D)TLS libraries. + * Support for disabling TCP for code reduction. + * More rigorous checking and appropriate rejection of inbound PDU + options. + * Additional unit tests. + * Reported bugs fixed. + * Example applications help reports on (D)TLS library capabilities + and versions. + * Documentation added and updated (Doxygen and man). + +2019-11-05 Olaf Bergmann + + Change summary for version 4.2.1: + + * Builds now support silent rules + * Support building with TinyDTLS as a shared library + * Added in EPOLL support + * Added in support for constrained stacks + * Server sessions hashed for performance lookup + * coap_endpoint_t and coap_subscription_t made opaque to applications + * Documentation updated + +2019-02-11 Olaf Bergmann + + Change summary for version 4.2.0: + + * DTLS support improvements (OpenSSL, GnuTLS, tinydtls) + * Pre-shared keys, X.509 certificates + * new session abstraction + * TCP and TLS support + * improved documentation; manual pages + * changes in internal PDU structure + * improved examples (DTLS usage, block-wise transfer) + * docker images for continuous integration + * support for Google OSS fuzzer + * MS Visual Studio project for Windows builds + +2017-07-10 Olaf Bergmann + + * DTLS support (OpenSSL, tinyDTLS) by Jean-Claude Michelou + * Win32 support by Jean-Claude Michelou + * New Session API by Jean-Claude Michelou + +2016-02-16 Olaf Bergmann + + * Fixed build for Contiki3 and LwIP + * .travis.yml: Enabled continuous integration for platforms + POSIX and Contiki + +2015-03-11 Olaf Bergmann + + * include/coap/resource.h: Replaced custom list structures by + utlist macros. + +2015-03-09 Olaf Bergmann + + * src/uri.c (coap_split_path): Fixed URI parser bug and + removed broken parse iterator. + +2015-03-05 Olaf Bergmann + + * src/coap_time.c (coap_ticks): Changed POSIX implementation + to fixed point arithmetic and removed clock_offset. + +2015-02-21 Olaf Bergmann + + * net.c (coap_send_confirmed): Use fixed point arithmetic + to calculate retransmission timeout. + +2015-02-20 Olaf Bergmann + + * coap_list.[hc]: Moved old list implementation into + sub-directory examples and replaced by linked lists + from utlist.h. As a result, the list must be sorted + explicitly with LL_SORT). + +2015-02-19 Olaf Bergmann + + * net.c (coap_send_confirmed): Fixed retransmission timeout + calculation and renamed transmission parameters according to + Section 4.8 of RFC 7252. + +2015-02-17 Olaf Bergmann + + * major rework to get Contiki and lwip running + * many fixed bugs and warnings + +2014-06-18 Olaf Bergmann + + * mem.c (coap_malloc_type): New functions for allocating memory. + On POSIX systems, coap_malloc_type() and coap_free_type() are just + wrapper functions for malloc() and free(), while on Contiki and + LWIP distinct arrays are used for each type. + +2014-03-09 Olaf Bergmann + + * net.c (coap_cancel): Removed 7.31 again and implemented new + method for cancelling observe relationships. + +2014-02-25 Olaf Bergmann + + * net.c (coap_cancel): Handling of 7.31 responses to cancel + notifications (see Section 4.6 of draft-ietf-core-observe-12) + +2014-02-04 Olaf Bergmann + + * resource.c (coap_print_link): This function now takes an offset + where printing starts. This is used for generating blocks on the + fly. + + * net.c (wellknown_response): Added support for Block2 options + when generating a response for .well-known/core. + + * block.h (coap_opt_block_num): Fixed handling of zero-length + options. COAP_OPT_BLOCK_LAST now returns NULL when the option + value's length is zero. + +2014-01-07 Olaf Bergmann + + * resource.c (coap_print_link): Output partial resource + descriptions. The function now provides a sliding window over the + textual representation of the resource. Output starts at the given + offset and ends at the buffer's upper bound. The meaning of the + return value has changed to allow distinguishing whether or not + the resource description has been truncated at the buffer's upper + bound. + (print_wellknown): Support for the new coap_print_link(). An + additional parameter now is used to provide the offset into the + resource description. The meaning of the return value has been + adjusted accordingly. + +2013-12-23 Olaf Bergmann + + * configure.in: merged with LWIP port from chrysn + . This + introduces new compiler flags WITH_POSIX and WITH_LWIP to + distinguish target platforms. + +2013-09-03 Olaf Bergmann + + * option.h (coap_option_setb): increased size of option type + argument + + * tests/test_error_response.c (t_init_error_response_tests): new + tests for error response generation + + * tests/test_pdu.c (t_encode_pdu5): fixed number for option Accept + + * net.c (coap_new_error_response): fixed option size calculation + +2013-07-04 Olaf Bergmann + + * net.c (coap_new_context): register critical Accept option + + * pdu.c: option codes for Accept and Size1 according to coap-18 + +2013-02-01 Olaf Bergmann + + * coap_time.h (coap_clock_init_impl): fix invalid preprocessor + directive. #warning is now only used for gcc only (close sf bug #15) + + * net.c (wellknown_response): applied patch from chrysn to + fix bug in generation of .well-known/core representation + +2013-01-21 Olaf Bergmann + + * option.h: renamed option field in coap_opt_iterator_t to + next_option to detect erroneous use in old code + +2013-01-18 Olaf Bergmann + + * configure.in: new option --with-tests to enable unit tests + + * tests/testdriver.c: unit tests for parser functions + + * pdu.c (coap_pdu_parse): new PDU parser for Klaus-encoding + according to coap-13 + + * net.c (coap_read): call coap_pdu_parse() to check PDU integrity + + * option.c: Klaus-encoding for coap-13, including new option + iterator interface + +2012-11-20 Olaf Bergmann + + * net.c (next_option_safe): made option parsing more robust in + presence of option jumps + + * pdu.h: new option codes from draft-ietf-core-coap-12 + + * option.c (coap_opt_setlength): new function to set option length + + * uri.c (make_decoded_option): use coap_opt_setlength() instead of + obsolete macro COAP_OPT_SETLENGTH. + +2012-11-19 Olaf Bergmann + + * uri.c (make_decoded_option): use coap_opt_encode() instead of writing + +2012-11-03 Olaf Bergmann + + * net.c (coap_read): read new option encoding + +2012-11-01 Olaf Bergmann + + * option.c (coap_opt_size, coap_opt_value, coap_opt_length): + several functions to access fields of options (possibly preceeded + by option jump) + +2012-10-25 Olaf Bergmann + + * option.c (coap_opt_encode): new function for option encoding + with option jumps + +2012-03-23 Olaf Bergmann + + * examples/client.c (clear_obs): clear observation relationship after + user-specified duration + +2012-03-21 Olaf Bergmann + + * resource.c (print_wellknown): filtering by attributes + +2012-03-19 Olaf Bergmann + + * pdu.c (coap_add_option): allow more than 15 options. + +2012-03-15 Olaf Bergmann + + * examples/client.c (cmdline_uri): split path and query here to + make it easier to include these options in subsequent requests for + block transfer. + +2012-03-14 Olaf Bergmann + + * examples/etsi_iot_01.c: Support for POST, PUT, DELETE on /test + +2012-03-13 Olaf Bergmann + + * encode.c (coap_encode_var_bytes): more efficient coding for 0 + +2012-03-11 Olaf Bergmann + + * examples/etsi_iot_01.c: Test cases for 1st ETSI CoAP Plugtest, + March 24/25, 2012 in Paris, France. + +2012-03-10 Olaf Bergmann + + * block.c: support for block transfer. + +2012-03-07 Olaf Bergmann + + * examples/client.c (usage): new command line options + -B to set timeout after which the main loop is left. + -e to specify a payload (incompatible with -f) + (message_handler): bugfixes + + * resource.h: (coap_method_handler_t): new API for method handlers. + + +Copyright 2012 Olaf Bergmann, TZI +Copying and distribution of this file, with or without modification, are +permitted provided the copyright notice and this notice are preserved. diff --git a/examples/espidf-coap-server/components/libcoap/Dockerfile b/examples/espidf-coap-server/components/libcoap/Dockerfile new file mode 100644 index 0000000..41b7fc8 --- /dev/null +++ b/examples/espidf-coap-server/components/libcoap/Dockerfile @@ -0,0 +1,7 @@ +FROM obgm/libcoap:build-env + +ENV libcoap_dir=/libcoap +ADD . $libcoap_dir +WORKDIR $libcoap_dir + +RUN ./autogen.sh --clean && ./autogen.sh diff --git a/examples/espidf-coap-server/components/libcoap/HOWTO.dual.gnutls b/examples/espidf-coap-server/components/libcoap/HOWTO.dual.gnutls new file mode 100644 index 0000000..e2fc0e1 --- /dev/null +++ b/examples/espidf-coap-server/components/libcoap/HOWTO.dual.gnutls @@ -0,0 +1,98 @@ +############################################################################ +# +# GnuTLS dual versions +# +# Works with CentOS 7 +# +############################################################################ +# +# Add in alternative GnuTLS support into /usr/local, and put all the +# libraries into /usr/local/lib. +# +# Need the latest of the following packages +# +# gmp (used 6.2.0) https://gmplib.org/#DOWNLOAD +# nettle (used 3.6) https://ftp.gnu.org/gnu/nettle/ +# gnutls (used 3.6.13) https://www.gnutls.org/download.html +# + +GMP_VER=6.2.0 +NETTLE_VER=3.6 +GNUTLS_VER=3.6.13 + +# +# gmp +# +tar xovf gmp-${GMP_VER}.tar.xz +cd gmp-${GMP_VER} +./configure +make +sudo make install +cd .. + +# +# nettle (by default wants to go into /usr/local/lib64 which gets messy) +# +tar zxovf nettle-${NETTLE_VER}.tar.gz +cd nettle-${NETTLE_VER} +PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure --libdir=/usr/local/lib \ + LDFLAGS="-L/usr/local/lib" +make +sudo make install +cd .. + +tar xovf gnutls-${GNUTLS_VER}.tar.xz +cd gnutls-${GNUTLS_VER} +# +# +# You may need to make the following change if you have an old version of +# p11-kit +# +# $ diff -Nau a/lib/pkcs11_privkey.c b/lib/pkcs11_privkey.c +# --- a/lib/pkcs11_privkey.c 2020-05-26 11:49:27.374385645 +0100 +# +++ b/lib/pkcs11_privkey.c 2020-05-26 11:58:24.300510455 +0100 +# @@ -265,13 +265,13 @@ +# # define CKG_MGF1_SHA384 0x00000003UL +# # define CKG_MGF1_SHA512 0x00000004UL +# +# +#endif +# struct ck_rsa_pkcs_pss_params { +# ck_mechanism_type_t hash_alg; +# /* ck_rsa_pkcs_mgf_type_t is not defined in old versions of p11-kit */ +# unsigned long mgf; +# unsigned long s_len; +# }; +# -#endif +# +# static const struct hash_mappings_st hash_mappings[] = +# { +# +# +PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure --with-included-unistring \ + --disable-hardware-acceleration --disable-tests --with-included-libtasn1 \ + --disable-doc LDFLAGS="-L/usr/local/lib" +make +sudo make install +cd .. + +############################################################################ +# +# libcoap build with updated GnuTLS +# +############################################################################ + +# Get the latest libcoap +git clone https://github.com/obgm/libcoap.git + +# Build code +cd libcoap +./autogen.sh +# Update --enable- / --disable- options as appropriate +# libcoap libraries are put into /usr/lib64 for ease of linking +PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure --libdir=/usr/lib64 \ + --with-gnutls --enable-tests --enable-examples --disable-doxygen \ + --enable-manpages +make +sudo make install +cd .. + diff --git a/examples/espidf-coap-server/components/libcoap/HOWTO.dual.openssl b/examples/espidf-coap-server/components/libcoap/HOWTO.dual.openssl new file mode 100644 index 0000000..6168c3e --- /dev/null +++ b/examples/espidf-coap-server/components/libcoap/HOWTO.dual.openssl @@ -0,0 +1,50 @@ +############################################################################ +# +# OpenSSL dual versions +# +# Works with CentOS 7 +# +############################################################################ +# +# Add in alternative OpenSSL support into /opt/openssl. /opt/openssl is +# chosen instead of the default of /usr/local so that existing utilities +# continue to use the original version of OpenSSL and so only specific +# applications that requires the newer version of OpenSSL will pick up the +# new code. +# +# Download latest stable version of openssl.X.Y.Z.tar.gz from +# https://www.openssl.org/source/ + +tar zxovf openssl.X.Y.Z.tar.gz +cd openssl.X.Y.X +./config --prefix=/opt/openssl --openssldir=/opt/openssl +make +sudo make install_sw + +# The following should not clash the existing OpenSSL lib*.so.1.0 usage unless +# the previous OpenSSL version is 1.1.0 or later. +# It just makes things for running executables a lot simpler. +sudo cp /opt/openssl/lib/lib*.so.1.1 /lib64 +cd .. + +############################################################################ +# +# libcoap build with updated OpenSSL +# +############################################################################ + +# Get the latest libcoap +git clone https://github.com/obgm/libcoap.git + +# Build code +cd libcoap +./autogen.sh +# Update --enable- / --disable- options as appropriate +# libcoap libraries are put into /usr/lib64 for ease of linking +PKG_CONFIG_PATH=/opt/openssl/lib/pkgconfig ./configure --libdir=/usr/lib64 \ + --with-openssl --enable-tests --enable-examples --disable-doxygen \ + --disable-manpages +make +sudo make install +cd .. + diff --git a/examples/espidf-coap-server/components/libcoap/HOWTO.dual.softhsm2 b/examples/espidf-coap-server/components/libcoap/HOWTO.dual.softhsm2 new file mode 100644 index 0000000..2eee889 --- /dev/null +++ b/examples/espidf-coap-server/components/libcoap/HOWTO.dual.softhsm2 @@ -0,0 +1,90 @@ +############################################################################ +# +# SoftHSMv2 dual versions +# +# Works with CentOS 7 +# +# The opensc package needs to be installed. +# +############################################################################ +# +# Install a software HSM module for doing the PKCS11 testing of libcoap. +# Real hardware can be used if you have the appropriate library module. +# +# It is assumed that the opensc package is installed. +# +# When installing SoftHSMv2 from your system's package manager, check that the +# OpenSSL version is at least 1.1.0. If not, then you will need to dual +# install SoftHSMv2 as below; otherwise you can use the existing SoftHSMv2. +# +# SoftHSMv2 is built using OpenSSL, but GnuTLS can use the PKCS11 interface. +# Note that if the default OpenSSL version is less than 1.1.0, you will need +# to install a dual stack version of OpenSSL as per HOWTO.dual.openssl. +# +# Creates module /usr/local/lib/softhsm/libsofthsm2.so +# + +# Add line below to /etc/security/limits.conf to support memory locking + +* - memlock unlimited + +# Get the latest SoftHSM +git clone https://github.com/opendnssec/SoftHSMv2.git + +# Build code +cd SoftHSMv2/ +sh autogen.sh +PKG_CONFIG_PATH=/opt/openssl/lib/pkgconfig ./configure --enable-silent-rules \ + --with-crypto-backend=openssl --disable-gost LDFLAGS=-L/opt/openssl/lib \ + CPPFLAGS=-I/opt/openssl/include --with-openssl=/opt/openssl +make +# You may need to comment out constexpr lines (fixes for gcc10) in +# src/lib/crypto/PublicKey.h src/lib/crypto/PrivateKey.h if you get +# compile errors. +sudo make install +cd .. + +# Make sure p11-kit softhsm modules have the correct module: fully qualified +# path where the entry is of the form (in particular for GnuTLS) :- +# /usr/share/p11-kit/modules/softhsm* +# +# module: /usr/local/lib/softhsm/libsofthsm2.so + +# The user you are running this as needs to be in the group defined for +# /var/lib/softhsm/tokens/. E.g. +# $ sudo ls -ld /var/lib/softhsm/tokens/ +# drwxrws--- 3 root softhsm 4096 May 3 09:52 /var/lib/softhsm/tokens/ +# which is softhsm in this case (It could be ods). To verify if you are in +# the correct group +# $ id +# To add user to this group +# $ sudo usermod -a -G softhsm +# and log out and back in again. +# + +############################################################################ +# +# libp11 (needed for OpenSSL as it provides the PKCS11 engine) +# +############################################################################ +# +# Install a pkcs11 library for OpenSSL to use as an engine. +# [GnuTLS has this built in] +# + +# Get the latest libp11 +git clone https://github.com/OpenSC/libp11.git + +# Build code +cd libp11 +./bootstrap +PKG_CONFIG_PATH=/opt/openssl/lib/pkgconfig ./configure \ + --with-pkcs11-module=/usr/local/lib/softhsm/libsofthsm2.so +make +sudo make install +cd .. + +# Verify that pkcs11 is available + +/opt/openssl/bin/openssl engine pkcs11 -t + diff --git a/examples/espidf-coap-server/components/libcoap/HOWTO.pkcs11 b/examples/espidf-coap-server/components/libcoap/HOWTO.pkcs11 new file mode 100644 index 0000000..64c01f9 --- /dev/null +++ b/examples/espidf-coap-server/components/libcoap/HOWTO.pkcs11 @@ -0,0 +1,129 @@ +# +# Using PKCS11 with libcoap. +# +# This HOWTO works for CentOS 7. +# +# As CentOS 7 uses OpenSSL prior to 1.1.0, dual OpenSSL support needs to be +# set up and used for libcoap. See HOWTO.dual.openssl for setting this up. +# +# It also is possible that you want to use GnuTLS - and want to use a later +# version. HOWTO.dual.gnutls for setting this up. +# +# OpenSSL and GnuTLS are currently supported +# + +############################################################################ +# +# Testing examples +# +############################################################################ +# +# Update PKCS11 token with certificates and keys +# +# Assumption is that you already have the following PEM files +# ca-cert.pem - The certificate of the CA that signed Server and Client +# server-cert.pem - Contains the server certificate in PEM format +# server-key.pem - Contains the server private key in PEM format +# client-cert.pem - Contains the server certificate in PEM format +# client-key.pem - Contains the server private key in PEM format +# +# Tokens will be stored under /var/lib/softhsm/tokens/ +# +# The user you are running this as needs to be in the group defined for +# /var/lib/softhsm/tokens/. E.g. +# $ sudo ls -ld /var/lib/softhsm/tokens/ +# drwxrws--- 3 root softhsm 4096 May 3 09:52 /var/lib/softhsm/tokens/ +# which is softhsm in this case (It could be ods). To verify if you are in +# the correct group +# $ id +# To add user to this group +# $ sudo usermod -a -G softhsm +# and log out and back in again. +# + +# Set libsofthsm2.so to use (may be /usr/lib/softhsm/libsofthsm2.so) +LIBSOFTHSM=/usr/local/lib/softhsm/libsofthsm2.so + +# Initialize Soft HSM token +# Note: slot 0 is re-allocated to slot XXX. This is presented as a decimal +# number, the hex equivalent (leading 0x) can be used for any slot options.. +# Set SO PIN to 4321, user PIN to 1234 +softhsm2-util --init-token --slot 0 --label "token-0" --pin 1234 --so-pin 4321 + +# CA Certificate (different id to Server/Client Public Certificate) +# (GnuTLS requires this to be trusted) +p11tool --so-login --load-certificate ca-cert.pem --write --label ca-cert \ + --set-so-pin 4321 --id cc00 --mark-trusted "pkcs11:token=token-0" + +# Server Private Key +openssl pkcs8 -topk8 -inform PEM -outform PEM -in server-key.pem \ + -out server-key.pk8 -nocrypt +softhsm2-util --import server-key.pk8 --label "server-key" --id aa00 \ + --pin 1234 --token "token-0" + +# Server Public Certificate +# (Use different id to private key, but not the same as CA/Client cert) +openssl x509 -in server-cert.pem -out server-cert.der -outform DER +pkcs11-tool --module $LIBSOFTHSM --pin 1234 \ + --write-object ./server-cert.der --type cert --id aa01 \ + --label "server-cert" --token-label "token-0" + +# Client Private Key +openssl pkcs8 -topk8 -inform PEM -outform PEM -in client-key.pem \ + -out client-key.pk8 -nocrypt +softhsm2-util --import client-key.pk8 --label "client-key" --id bb00 \ + --pin 1234 --token "token-0" + +# Client Public Certificate +# (Use different id to private key, but not the same as CA/Client cert) +openssl x509 -in client-cert.pem -out client-cert.der -outform DER +pkcs11-tool --module $LIBSOFTHSM --pin 1234 \ + --write-object ./client-cert.der --type cert --id bb01 \ + --label "client-cert" --token-label "token-0" + +# Verify token is correctly populated +pkcs11-tool --module=$LIBSOFTHSM -t +pkcs11-tool --module=$LIBSOFTHSM --list-objects \ + --pin 1234 --token-label "token-0" +p11tool --list-all pkcs11:model=SoftHSM%20v2 + +# +# Run coap-server using PKCS11 (-C option may need to be -C cert.der) +# +coap-server -C 'pkcs11:token=token-0;id=%cc%00?pin-value=1234' \ + -c 'pkcs11:token=token-0;id=%aa%01?pin-value=1234' \ + -j 'pkcs11:token=token-0;id=%aa%00?pin-value=1234' -v9 + +# or +coap-server -C 'pkcs11:token=token-0;id=%cc%00' \ + -c 'pkcs11:token=token-0;id=%aa%01' \ + -j 'pkcs11:token=token-0;id=%aa%00' -J 1234 -v9 + +# or +coap-server -C 'pkcs11:token=token-0;object=ca-cert' \ + -c 'pkcs11:token=token-0;object=server-cert' \ + -j 'pkcs11:token=token-0;object=server-key' -J 1234 -v9 + +# +# Run coap-client using PKCS11 (-C option may need to be -C cert.der) +# +coap-client -C 'pkcs11:token=token-0;id=%cc%00?pin-value=1234' \ + -c 'pkcs11:token=token-0;id=%bb%01?pin-value=1234' \ + -j 'pkcs11:token=token-0;id=%bb%00?pin-value=1234' -v9 coaps://[::1] + +# or +coap-client -C 'pkcs11:token=token-0;id=%cc%00' \ + -c 'pkcs11:token=token-0;id=%bb%01' \ + -j 'pkcs11:token=token-0;id=%bb%00' -J 1234 -v9 coaps://[::1] + +# or +coap-client -C 'pkcs11:token=token-0;object=ca-cert' \ + -c 'pkcs11:token=token-0;object=client-cert' \ + -j 'pkcs11:token=token-0;object=client-key' -J 1234 -v9 coaps://[::1] + +# +# Client and Server using RPK (GnuTLS only) +# +coap-server -M 'pkcs11:token=token-0;object=server-key' -J 1234 -v9 +# and +coap-client -M 'pkcs11:token=token-0;object=client-key' -J 1234 -v9 coaps://[::1] diff --git a/examples/espidf-coap-server/components/libcoap/LICENSE b/examples/espidf-coap-server/components/libcoap/LICENSE new file mode 100644 index 0000000..78d2c55 --- /dev/null +++ b/examples/espidf-coap-server/components/libcoap/LICENSE @@ -0,0 +1,85 @@ +Copyright (c) 2010--2022, Olaf Bergmann and others +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + o Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + o Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +======================================================================== +getopt.c + +License information for getopt.c. This file is only used on Windows +builds of the executables in the examples folder: + +/* + * This file was copied from the following newsgroup posting: + * + * Newsgroups: mod.std.unix + * Subject: public domain AT&T getopt source + * Date: 3 Nov 85 19:34:15 GMT + * + * Here's something you've all been waiting for: the AT&T public domain + * source for getopt(3). It is the code which was given out at the 1985 + * UNIFORUM conference in Dallas. I obtained it by electronic mail + * directly from AT&T. The people there assure me that it is indeed + * in the public domain. + */ + +======================================================================== +uthash + +libcoap uses uthash.h and utlist.h from Troy D. Hanson +(https://troydhanson.github.io/uthash/). These files use the revised +BSD license (BSD-1-Clause license) as included in these two source +files. + +======================================================================== +OpenSSL + +Binaries that are linked against OpenSSL include software developed +by the OpenSSL Project for use in the OpenSSL Toolkit. +(http://www.openssl.org/). Please consult the OpenSSL license +(https://www.openssl.org/source/license.html) for licensing terms. + +======================================================================== +GnuTLS + +When compiled with GnuTLS support, this software includes components +that are licensed under the terms of the the GNU Lesser General Public +License, version 2.1 +(https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html). + +======================================================================== +tinyDTLS + +When compiled with tinyDTLS support, this software includes components +that are licensed under the terms of the Eclipse Distribution License 1.0 +(http://www.eclipse.org/org/documents/edl-v10.php). + +======================================================================== +Mbed TLS + +When compiled with Mbed TLS support, this software includes components +that are licensed under the terms of the Apache 2.0 license +(http://www.apache.org/licenses/LICENSE-2.0). + diff --git a/examples/espidf-coap-server/components/libcoap/Makefile.am b/examples/espidf-coap-server/components/libcoap/Makefile.am new file mode 100644 index 0000000..dba0e61 --- /dev/null +++ b/examples/espidf-coap-server/components/libcoap/Makefile.am @@ -0,0 +1,281 @@ +# Makefile.am for libcoap +# +# Copyright (C) 2010-2022 Olaf Bergmann +# Copyright (C) 2015-2017 Carsten Schoenert +# Copyright (C) 2018-2022 Jon Shallow +# +# SPDX-License-Identifier: BSD-2-Clause +# +# This file is part of the CoAP C library libcoap. Please see README and +# COPYING for terms of use. + +## Place generated object files (.o) into the same directory as their source +## files, in order to avoid collisions when non-recursive make is used. +AUTOMAKE_OPTIONS = subdir-objects + +ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} -I m4 + +LIBCOAP_PACKAGE_BUILD = @DOLLAR_SIGN@(shell git describe --tags --dirty --always 2>/dev/null || echo @PACKAGE_VERSION@) + +## Additional files for the distribution archive +EXTRA_DIST = \ + BUILDING \ + CONTRIBUTE \ + TODO \ + LICENSE \ + CMakeLists.txt \ + cmake_coap_config.h.in \ + cmake/Config.cmake.in \ + cmake/FindMbedTLS.cmake \ + cmake/FindTinyDTLS.cmake \ + coap_config.h.lwip \ + coap_config.h.riot \ + coap_config.h.windows \ + libcoap-$(LIBCOAP_API_VERSION).pc.in \ + libcoap-$(LIBCOAP_API_VERSION).map \ + libcoap-$(LIBCOAP_API_VERSION).sym \ + examples/coap_list.h \ + examples/getopt.c \ + include/coap$(LIBCOAP_API_VERSION)/coap_internal.h \ + include/coap$(LIBCOAP_API_VERSION)/coap_riot.h \ + include/coap$(LIBCOAP_API_VERSION)/coap_asn1_internal.h \ + include/coap$(LIBCOAP_API_VERSION)/coap_async_internal.h \ + include/coap$(LIBCOAP_API_VERSION)/coap_block_internal.h \ + include/coap$(LIBCOAP_API_VERSION)/coap_cache_internal.h \ + include/coap$(LIBCOAP_API_VERSION)/coap_dtls_internal.h \ + include/coap$(LIBCOAP_API_VERSION)/coap_io_internal.h \ + include/coap$(LIBCOAP_API_VERSION)/coap_net_internal.h \ + include/coap$(LIBCOAP_API_VERSION)/coap_pdu_internal.h \ + include/coap$(LIBCOAP_API_VERSION)/coap_resource_internal.h \ + include/coap$(LIBCOAP_API_VERSION)/coap_session_internal.h \ + include/coap$(LIBCOAP_API_VERSION)/coap_subscribe_internal.h \ + include/coap$(LIBCOAP_API_VERSION)/coap_tcp_internal.h \ + include/coap$(LIBCOAP_API_VERSION)/coap.h.in \ + include/coap$(LIBCOAP_API_VERSION)/coap.h.windows \ + include/coap$(LIBCOAP_API_VERSION)/coap.h.windows.in \ + include/coap$(LIBCOAP_API_VERSION)/lwippools.h \ + include/coap$(LIBCOAP_API_VERSION)/uthash.h \ + include/coap$(LIBCOAP_API_VERSION)/utlist.h \ + src/coap_io_riot.c \ + tests/test_error_response.h \ + tests/test_encode.h \ + tests/test_options.h \ + tests/test_pdu.h \ + tests/test_sendqueue.h \ + tests/test_session.h \ + tests/test_tls.h \ + tests/test_uri.h \ + tests/test_wellknown.h \ + win32/coap-client/coap-client.vcxproj \ + win32/coap-client/coap-client.vcxproj.filters \ + win32/coap-rd/coap-rd.vcxproj \ + win32/coap-rd/coap-rd.vcxproj.filters \ + win32/coap-server/coap-server.vcxproj \ + win32/coap-server/coap-server.vcxproj.filters \ + win32/libcoap.sln \ + win32/libcoap.vcxproj \ + win32/libcoap.vcxproj.filters \ + win32/testdriver/testdriver.vcxproj \ + win32/testdriver/testdriver.vcxproj.filters \ + win32/testdriver/testdriver.vcxproj.user + +AM_CFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include $(WARNING_CFLAGS) \ + $(DTLS_CFLAGS) -std=c99 $(EXTRA_CFLAGS) \ + -DLIBCOAP_PACKAGE_BUILD='"$(LIBCOAP_PACKAGE_BUILD)"' + +SUBDIRS = $(subdirs) . man doc tests examples + +## Define a libtool archive target "libcoap-@LIBCOAP_NAME_SUFFIX@.la", with +## @LIBCOAP_NAME_SUFFIX@ substituted into the generated Makefile at configure +## time. +## The libtool archive file (.la) will be installed into the directory named +## by the predefined variable $(bindir), along with the actual shared library +## file (.so). +lib_LTLIBRARIES = libcoap-@LIBCOAP_NAME_SUFFIX@.la + +libcoap_@LIBCOAP_NAME_SUFFIX@_la_CFLAGS = \ + -fPIC \ + -fPIE \ + $(AM_CFLAGS) + +## Define the source file list for the "libcoap.la" target. +## Note that it is not necessary to list header files which are already listed +## elsewhere in a _HEADERS variable assignment. +libcoap_@LIBCOAP_NAME_SUFFIX@_la_SOURCES = \ + src/block.c \ + src/coap_address.c \ + src/coap_asn1.c \ + src/coap_async.c \ + src/coap_cache.c \ + src/coap_debug.c \ + src/coap_event.c \ + src/coap_hashkey.c \ + src/coap_gnutls.c \ + src/coap_io.c \ + src/coap_mbedtls.c \ + src/coap_notls.c \ + src/coap_openssl.c \ + src/coap_option.c \ + src/coap_prng.c \ + src/coap_session.c \ + src/coap_subscribe.c \ + src/coap_tcp.c \ + src/coap_time.c \ + src/coap_tinydtls.c \ + src/encode.c \ + src/mem.c \ + src/net.c \ + src/pdu.c \ + src/resource.c \ + src/str.c \ + src/uri.c + +## Define the list of public header files and their install location. +## The API version is appended to the install folder to being able to +## co-install various versions of libcoap. +libcoap_includedir = $(includedir)/coap$(LIBCOAP_API_VERSION)/ + +# If there is a API change to something $(LIBCOAP_API_VERSION) > 1 the install +# prefix for the header files has to change to not conflict the older version +# if the user want's to install both versions. There will be something used like +# libcoap_include_HEADERS = \ +# $(top_srcdir)/include/coap-$(LIBCOAP_API_VERSION)/* + +libcoap_include_HEADERS = \ + $(top_srcdir)/include/coap$(LIBCOAP_API_VERSION)/block.h \ + $(top_builddir)/include/coap$(LIBCOAP_API_VERSION)/coap.h \ + $(top_srcdir)/include/coap$(LIBCOAP_API_VERSION)/coap_address.h \ + $(top_srcdir)/include/coap$(LIBCOAP_API_VERSION)/coap_async.h \ + $(top_srcdir)/include/coap$(LIBCOAP_API_VERSION)/coap_cache.h \ + $(top_srcdir)/include/coap$(LIBCOAP_API_VERSION)/coap_debug.h \ + $(top_srcdir)/include/coap$(LIBCOAP_API_VERSION)/coap_dtls.h \ + $(top_srcdir)/include/coap$(LIBCOAP_API_VERSION)/coap_event.h \ + $(top_srcdir)/include/coap$(LIBCOAP_API_VERSION)/coap_forward_decls.h \ + $(top_srcdir)/include/coap$(LIBCOAP_API_VERSION)/coap_hashkey.h \ + $(top_srcdir)/include/coap$(LIBCOAP_API_VERSION)/coap_io.h \ + $(top_srcdir)/include/coap$(LIBCOAP_API_VERSION)/coap_mutex.h \ + $(top_srcdir)/include/coap$(LIBCOAP_API_VERSION)/coap_option.h \ + $(top_srcdir)/include/coap$(LIBCOAP_API_VERSION)/coap_session.h \ + $(top_srcdir)/include/coap$(LIBCOAP_API_VERSION)/coap_subscribe.h \ + $(top_srcdir)/include/coap$(LIBCOAP_API_VERSION)/coap_time.h \ + $(top_srcdir)/include/coap$(LIBCOAP_API_VERSION)/encode.h \ + $(top_srcdir)/include/coap$(LIBCOAP_API_VERSION)/libcoap.h \ + $(top_srcdir)/include/coap$(LIBCOAP_API_VERSION)/mem.h \ + $(top_srcdir)/include/coap$(LIBCOAP_API_VERSION)/net.h \ + $(top_srcdir)/include/coap$(LIBCOAP_API_VERSION)/pdu.h \ + $(top_srcdir)/include/coap$(LIBCOAP_API_VERSION)/coap_prng.h \ + $(top_srcdir)/include/coap$(LIBCOAP_API_VERSION)/resource.h \ + $(top_srcdir)/include/coap$(LIBCOAP_API_VERSION)/str.h \ + $(top_srcdir)/include/coap$(LIBCOAP_API_VERSION)/uri.h + +## Instruct libtool to include API version information in the generated shared +## library file (.so). The library ABI version will later defined in configure.ac, +## so that all version information is kept in one place. +libcoap_@LIBCOAP_NAME_SUFFIX@_la_LDFLAGS = \ + -version-info $(LT_LIBCOAP_CURRENT):$(LT_LIBCOAP_REVISION):$(LT_LIBCOAP_AGE) \ + @libcoap_SYMBOLS@ \ + $(DTLS_LIBS) \ + -pie + +## Collect symbols here we want to ignore while building the helper files +## libcoap-$(LIBCOAP_API_VERSION).{map,sym} for the linker. +CTAGS_IGNORE=-I " \ +coap_pdu_from_pbuf \ +" + +# This helper is called by libcoap-$(LIBCOAP_API_VERSION).{map,sym} to see if +# configure has detected a usable version of the ctags program and aborts if not. +check_ctags: + @if [ "$(CTAGS_PROG)" = "" ]; then \ + echo ;\ + echo "There was no ctags program found by the configure script!" ;\ + echo "ctags is needed for running this target! Please note the warning about the missed ctags program of the configure script." ;\ + echo ;\ + exit 1;\ + fi + +## Helper target to generate the symbol table needed by libtool. +## The .map format is used when ld supports linker scripts, otherwise +## it must fall back to a plain symbol file. +update-map-file: libcoap-$(LIBCOAP_API_VERSION).map libcoap-$(LIBCOAP_API_VERSION).sym + +libcoap-$(LIBCOAP_API_VERSION).map: check_ctags $(libcoap_include_HEADERS) + ( echo "VER_$(LIBCOAP_API_VERSION) {" ; \ + echo "global:" ; \ + $(CTAGS_PROG) $(CTAGS_IGNORE) -f - --c-kinds=p $(libcoap_include_HEADERS) | awk '/^coap_/ { print " " $$1 ";" }' | sort -u ; \ + echo "local:" ; \ + echo " *;" ; \ + echo "};" ) > $(top_builddir)/$@.new + mv $(top_builddir)/$@.new $(top_builddir)/$@ + +libcoap-$(LIBCOAP_API_VERSION).sym: check_ctags $(libcoap_include_HEADERS) + ( $(CTAGS_PROG) $(CTAGS_IGNORE) -f - --c-kinds=p $(libcoap_include_HEADERS) | awk '/^coap_/ { print $$1 }' | sort -u ) \ + > $(top_builddir)/$@.new + mv $(top_builddir)/$@.new $(top_builddir)/$@ + +## Install the generated pkg-config file (.pc) into the expected location for +## architecture-dependent package configuration information. Occasionally, +## pkg-config files are also used for architecture-independent data packages, +## in which case the correct install location would be $(datadir)/pkgconfig. +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libcoap-$(LIBCOAP_NAME_SUFFIX).pc + +## Define an independent executable script for inclusion in the distribution +## archive. However, it will not be installed on an end user's system due to +## the noinst_ prefix. +dist_noinst_SCRIPTS = autogen.sh + +## Set up a common library that causes linking against the common library +## to link with the actual library with (D)TLS support +if BUILD_ADD_DEFAULT_NAMES +install-exec-hook: + (cd $(DESTDIR)$(libdir) ; \ + if [ -f libcoap-$(LIBCOAP_NAME_SUFFIX).so ] ; then \ + rm -f libcoap-$(LIBCOAP_API_VERSION).so ; \ + $(LN_S) libcoap-$(LIBCOAP_NAME_SUFFIX).so libcoap-$(LIBCOAP_API_VERSION).so ; \ + fi ; \ + rm -f libcoap-$(LIBCOAP_API_VERSION).a ; \ + rm -f libcoap-$(LIBCOAP_API_VERSION).la ; \ + $(LN_S) libcoap-$(LIBCOAP_NAME_SUFFIX).a libcoap-$(LIBCOAP_API_VERSION).a ; \ + $(LN_S) libcoap-$(LIBCOAP_NAME_SUFFIX).la libcoap-$(LIBCOAP_API_VERSION).la ; \ + $(MKDIR_P) $(DESTDIR)$(pkgconfigdir) ; \ + cd $(DESTDIR)$(pkgconfigdir) ; \ + rm -f libcoap-$(LIBCOAP_API_VERSION).pc ; \ + $(LN_S) libcoap-$(LIBCOAP_NAME_SUFFIX).pc libcoap-$(LIBCOAP_API_VERSION).pc) + +uninstall-hook: + (cd $(DESTDIR)$(libdir) ; \ + rm -f libcoap-$(LIBCOAP_API_VERSION).a ; \ + rm -f libcoap-$(LIBCOAP_API_VERSION).la ; \ + rm -f libcoap-$(LIBCOAP_API_VERSION).so ; \ + cd $(DESTDIR)$(pkgconfigdir) ; \ + rm -f libcoap-$(LIBCOAP_API_VERSION).pc) +endif # BUILD_ADD_DEFAULT_NAMES + +## various *-local targets +## Remove the helper files for the linker and the pkg-config file if there +## is 'make distclean' called. NOTE: To re create the *.{map,sym} files you +## need to call the target update-map-file after the configure script was +## running! +clean-local: + -find \( -name '*.gcda' -o -name '*.gcno' -o -name '*.gcov' \) -delete + +distclean-local: + @rm -f src/*.o src/*.lo + rm -f libcoap-$(LIBCOAP_API_VERSION).map + rm -f libcoap-$(LIBCOAP_API_VERSION).sym + rm -f libcoap-$(LIBCOAP_NAME_SUFFIX).pc + @echo + @echo " ---> Please note the following important advice! <---" + @echo " The files libcoap-$(LIBCOAP_API_VERSION).{map,sym} are removed by the distclean target!" + @echo " To regenerate this two files you need to call 'make update-map-file' first before any" + @echo " other Make target. Otherwise the build of libcoap will fail!" + @echo + +## Ensure we have actual *.{map,sym} files if we create a release tarball. +dist-local: update-map-file + +## Finaly some phony targets, just to ensure those targets are always buildable +## no matter if the user has created same called files. +.PHONY: update-map-file check_ctags + diff --git a/examples/espidf-coap-server/components/libcoap/Makefile.libcoap b/examples/espidf-coap-server/components/libcoap/Makefile.libcoap new file mode 100644 index 0000000..88199d4 --- /dev/null +++ b/examples/espidf-coap-server/components/libcoap/Makefile.libcoap @@ -0,0 +1,7 @@ +libcoap_src = pdu.c net.c coap_cache.c coap_debug.c encode.c uri.c coap_subscribe.c resource.c str.c coap_option.c coap_async.c block.c mem.c coap_io.c coap_session.c coap_notls.c coap_hashkey.c coap_address.c coap_tcp.c + +libcoap_dir := $(filter %libcoap,$(APPDS)) +vpath %c $(libcoap_dir)/src + +# set include path for coap sources +CFLAGS += -I$(libcoap_dir)/include diff --git a/examples/espidf-coap-server/components/libcoap/NEWS b/examples/espidf-coap-server/components/libcoap/NEWS new file mode 100644 index 0000000..e69de29 diff --git a/examples/espidf-coap-server/components/libcoap/README b/examples/espidf-coap-server/components/libcoap/README new file mode 100644 index 0000000..faab272 --- /dev/null +++ b/examples/espidf-coap-server/components/libcoap/README @@ -0,0 +1,89 @@ +# libcoap: A C implementation of the Constrained Application Protocol (RFC 7252) + +[![Build Status: main](https://github.com/obgm/libcoap/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/obgm/libcoap/actions?query=branch:main) +[![Build Status: develop](https://github.com/obgm/libcoap/actions/workflows/main.yml/badge.svg?branch=develop)](https://github.com/obgm/libcoap/actions?query=branch:develop) +[![Static Analysis](https://scan.coverity.com/projects/10970/badge.svg?flat=1)](https://scan.coverity.com/projects/obgm-libcoap) +[![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/libcoap.svg)](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:libcoap) + +Copyright (C) 2010—2022 by Olaf Bergmann and others + +ABOUT LIBCOAP +============= + +libcoap is a C implementation of a lightweight application-protocol +for devices that are constrained their resources such as computing +power, RF range, memory, bandwidth, or network packet sizes. This +protocol, CoAP, is standardized by the IETF as RFC 7252. For further +information related to CoAP, see . + +You might want to check out +[libcoap-minimal](https://github.com/obgm/libcoap-minimal) for usage +examples. + +DOCUMENTATION +============= + +Documentation and further information can be found at +. + +PACKAGE CONTENTS +================ + +This package contains a protocol parser and basic networking +functions for platforms with support for malloc() and BSD-style +sockets. In addition, there is support for Contiki, LwIP and +Espressif/ESP-IDF hosted environments. + +The following RFCs are supported + +* RFC7252: The Constrained Application Protocol (CoAP) + +* RFC7390: Group Communication for the Constrained Application Protocol (CoAP) + +* RFC7641: Observing Resources in the Constrained Application Protocol (CoAP) + +* RFC7959: Block-Wise Transfers in the Constrained Application Protocol (CoAP) + +* RFC7967: Constrained Application Protocol (CoAP) Option for No Server Response + +* RFC8132: PATCH and FETCH Methods for the Constrained Application Protocol (CoAP) + +* RFC8323: CoAP (Constrained Application Protocol) over TCP, TLS, and WebSockets + [No WebSockets support] + +* RFC8516: "Too Many Requests" Response Code for the Constrained Application Protocol + +* RFC8768: Constrained Application Protocol (CoAP) Hop-Limit Option + +* RFC9175: CoAP: Echo, Request-Tag, and Token Processing + +There is (D)TLS support for the following libraries + +* OpenSSL (Minimum version 1.1.0) [PKI, PSK and PKCS11] + +* GnuTLS (Minimum version 3.3.0) [PKI, PSK, RPK(3.6.6+) and PKCS11] + +* Mbed TLS (Minimum version 2.7.10) [PKI and PSK] + +* TinyDTLS [PSK and RPK] [DTLS Only] + +The examples directory contain a CoAP client, CoAP Resource Directory server +and a CoAP server to demonstrate the use of this library. + +BUILDING +======== + +Further information can be found at +and [BUILDING](https://raw.githubusercontent.com/obgm/libcoap/develop/BUILDING). + +LICENSE INFORMATION +=================== + +This library is published as open-source software without any warranty +of any kind. Use is permitted under the terms of the simplified BSD +license. It includes public domain software. libcoap binaries may also +include open-source software with their respective licensing terms. +Please refer to +[LICENSE](https://raw.githubusercontent.com/obgm/libcoap/develop/LICENSE) +for further details. + diff --git a/examples/espidf-coap-server/components/libcoap/README.md b/examples/espidf-coap-server/components/libcoap/README.md new file mode 100644 index 0000000..faab272 --- /dev/null +++ b/examples/espidf-coap-server/components/libcoap/README.md @@ -0,0 +1,89 @@ +# libcoap: A C implementation of the Constrained Application Protocol (RFC 7252) + +[![Build Status: main](https://github.com/obgm/libcoap/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/obgm/libcoap/actions?query=branch:main) +[![Build Status: develop](https://github.com/obgm/libcoap/actions/workflows/main.yml/badge.svg?branch=develop)](https://github.com/obgm/libcoap/actions?query=branch:develop) +[![Static Analysis](https://scan.coverity.com/projects/10970/badge.svg?flat=1)](https://scan.coverity.com/projects/obgm-libcoap) +[![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/libcoap.svg)](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:libcoap) + +Copyright (C) 2010—2022 by Olaf Bergmann and others + +ABOUT LIBCOAP +============= + +libcoap is a C implementation of a lightweight application-protocol +for devices that are constrained their resources such as computing +power, RF range, memory, bandwidth, or network packet sizes. This +protocol, CoAP, is standardized by the IETF as RFC 7252. For further +information related to CoAP, see . + +You might want to check out +[libcoap-minimal](https://github.com/obgm/libcoap-minimal) for usage +examples. + +DOCUMENTATION +============= + +Documentation and further information can be found at +. + +PACKAGE CONTENTS +================ + +This package contains a protocol parser and basic networking +functions for platforms with support for malloc() and BSD-style +sockets. In addition, there is support for Contiki, LwIP and +Espressif/ESP-IDF hosted environments. + +The following RFCs are supported + +* RFC7252: The Constrained Application Protocol (CoAP) + +* RFC7390: Group Communication for the Constrained Application Protocol (CoAP) + +* RFC7641: Observing Resources in the Constrained Application Protocol (CoAP) + +* RFC7959: Block-Wise Transfers in the Constrained Application Protocol (CoAP) + +* RFC7967: Constrained Application Protocol (CoAP) Option for No Server Response + +* RFC8132: PATCH and FETCH Methods for the Constrained Application Protocol (CoAP) + +* RFC8323: CoAP (Constrained Application Protocol) over TCP, TLS, and WebSockets + [No WebSockets support] + +* RFC8516: "Too Many Requests" Response Code for the Constrained Application Protocol + +* RFC8768: Constrained Application Protocol (CoAP) Hop-Limit Option + +* RFC9175: CoAP: Echo, Request-Tag, and Token Processing + +There is (D)TLS support for the following libraries + +* OpenSSL (Minimum version 1.1.0) [PKI, PSK and PKCS11] + +* GnuTLS (Minimum version 3.3.0) [PKI, PSK, RPK(3.6.6+) and PKCS11] + +* Mbed TLS (Minimum version 2.7.10) [PKI and PSK] + +* TinyDTLS [PSK and RPK] [DTLS Only] + +The examples directory contain a CoAP client, CoAP Resource Directory server +and a CoAP server to demonstrate the use of this library. + +BUILDING +======== + +Further information can be found at +and [BUILDING](https://raw.githubusercontent.com/obgm/libcoap/develop/BUILDING). + +LICENSE INFORMATION +=================== + +This library is published as open-source software without any warranty +of any kind. Use is permitted under the terms of the simplified BSD +license. It includes public domain software. libcoap binaries may also +include open-source software with their respective licensing terms. +Please refer to +[LICENSE](https://raw.githubusercontent.com/obgm/libcoap/develop/LICENSE) +for further details. + diff --git a/examples/espidf-coap-server/components/libcoap/TODO b/examples/espidf-coap-server/components/libcoap/TODO new file mode 100644 index 0000000..52df83a --- /dev/null +++ b/examples/espidf-coap-server/components/libcoap/TODO @@ -0,0 +1,27 @@ +This is a simple file for all kinds of stuff related on development for +libcoap. Please append (and remove) any issue you think its worthy. + +Classification of issues: + Critical -> Break the library in some kind or a missing feature, maybe not + directly but later + Serious -> No regression on the user side, more likly on the libcoap + development + Minor -> Things that are nice to have, but they are not time critical + +================= +* CRITICAL ISSUES +================= + +================ +* SERIOUS ISSUES +================ +-> Create some development rules like: + --> How to submit patches? What about pull requests? + --> How to implement/change platform related code? +-> Further improve the API documentation + +============== +* MINOR ISSUES +============== +-> Adding a logo for libcoap + diff --git a/examples/espidf-coap-server/components/libcoap/autogen.sh b/examples/espidf-coap-server/components/libcoap/autogen.sh new file mode 100644 index 0000000..0b97905 --- /dev/null +++ b/examples/espidf-coap-server/components/libcoap/autogen.sh @@ -0,0 +1,142 @@ +#!/bin/sh -e + +# uncomment the set command for debugging +#set -x + +# function to check for needed helper tools +check_helper() { +#echo "Checking for $1 ..." +TOOL=`which "$1" || echo none` + +if [ "$TOOL" = "none" ]; then + echo + echo "Couldn't find '$1'!" + RET=1 +else + RET=0 +fi +} + +PROJECT="libcoap" + +AUTOGEN_FILES=" +INSTALL +aclocal.m4 ar-lib +coap_config.h coap_config.h.in* compile config.guess config.h* config.log config.status config.sub configure +depcomp +doc/Doxyfile doc/doxyfile.stamp doc/doxygen_sqlite3.db doc/Makefile doc/Makefile.in +examples/*.o examples/coap-client examples/coap-server examples/coap-rd +examples/Makefile examples/Makefile.in +include/coap3/coap.h +install-sh +libcoap-*.pc libtool ltmain.sh +man/coap*.[357] man/coap*.txt man/Makefile man/Makefile.in +missing +Makefile Makefile.in +stamp-h1 src/.dirstamp libcoap*.la* src/*.*o +tests/*.o tests/Makefile tests/Makefile.in tests/testdriver tests/test_common.h +tests/oss-fuzz/Makefile.ci +m4/libtool.m4 m4/lt~obsolete.m4 m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4 +" + +AUTOGEN_DIRS=" +.deps +.libs autom4te.cache/ +doc/html/ +examples/.deps/ examples/.libs +man/.deps +man/tmp +src/.deps/ src/.libs/ +tests/.deps/ +" + +# checking for cleaner argument +echo +if [ "$1" = "--clean" ]; then + echo "removing autogenerated files ..." + rm -rf $AUTOGEN_FILES $AUTOGEN_DIRS + echo "done" + exit +else + echo "[HINT] You can run 'autogen.sh --clean' to remove all generated files by the autotools." + echo +fi + +# checking for autoreconf +check_helper autoconf +if [ "$RET" = "1" ]; then + echo "You probably need to install the package 'autoconf'." + ERROR=1 +else + echo "Found 'autoconf'." +fi + +# checking for aclocal +check_helper aclocal +if [ "$RET" = "1" ]; then + echo "You probably need to install the package 'automake'." + ERROR=1 +else + echo "Found 'aclocal'." +fi + +# checking for pkg-config +check_helper pkg-config +if [ "$RET" = "1" ]; then + echo "You probably need to install the package 'pkg-config|pkgconf'." + ERROR=1 +else + echo "Found 'pkg-config'." +fi + +# checking for libtool +# The libtool helper maybe installed as 'libtoolize', checking for 'libtool' first. +check_helper libtool +if [ "$RET" = "1" ]; then + # O.k. libtool not found, searching for libtoolize. + check_helper libtoolize + if [ "$RET" = "1" ]; then + echo "You probably need to install the package 'libtool'." + # That's bad, we found nothing! + ERROR=1 + else + echo "Found 'libtoolize'." + break + fi +else + echo "Found 'libtool'." +fi + +# exit if one tool isn't available +if [ "$ERROR" = "1" ]; then + echo + echo "One or more needed tools are missing, exiting ..." + echo "Please install the needed software packages and restart 'autogen.sh' again." + echo + exit 1 +fi + +echo +echo " ---> Found all needed tools! That's fine." +echo + +# countinue otherwise +test -n "$srcdir" || srcdir=`dirname "$0"` +test -n "$srcdir" || srcdir=. + +# Creating the directory m4 before calling autoreconf to +# not struggle with old versions of aclocal. +mkdir -p $srcdir/m4 + +# create ar-lib if not present to avoid autoreconf throwing an error +# when the file is missing. As autoreconf is called with --force +# the file will get updated with the proper contents afterwards. +touch ar-lib + +echo "Generating needed autotools files for $PROJECT by running autoreconf ..." +autoreconf --force --install --verbose "$srcdir" + +echo +echo "You can now run './configure --help' to see possible configuration options." +echo "Otherwise process the configure script to create the makefiles and generated helper files." +echo diff --git a/examples/espidf-coap-server/components/libcoap/build-env/.dockerignore b/examples/espidf-coap-server/components/libcoap/build-env/.dockerignore new file mode 100644 index 0000000..73b67f9 --- /dev/null +++ b/examples/espidf-coap-server/components/libcoap/build-env/.dockerignore @@ -0,0 +1,5 @@ +imagename +build.sh +*~ +.*.swp +\#*# diff --git a/examples/espidf-coap-server/components/libcoap/build-env/Dockerfile.build-env b/examples/espidf-coap-server/components/libcoap/build-env/Dockerfile.build-env new file mode 100644 index 0000000..1cf6079 --- /dev/null +++ b/examples/espidf-coap-server/components/libcoap/build-env/Dockerfile.build-env @@ -0,0 +1,7 @@ +FROM debian:testing-slim + +RUN apt-get update && apt-get install -y autoconf automake gcc clang \ + libtool libtool-bin make pkg-config libcunit1-dev libssl-dev \ + libgnutls28-dev libmbedtls-dev exuberant-ctags git valgrind \ + graphviz doxygen libxml2-utils xsltproc docbook-xml docbook-xsl asciidoc +RUN apt-get clean diff --git a/examples/espidf-coap-server/components/libcoap/build-env/Dockerfile.develop b/examples/espidf-coap-server/components/libcoap/build-env/Dockerfile.develop new file mode 100644 index 0000000..3f83e0a --- /dev/null +++ b/examples/espidf-coap-server/components/libcoap/build-env/Dockerfile.develop @@ -0,0 +1,36 @@ +FROM obgm/libcoap:build-env + +RUN apt-get update && apt-get install -y cmake git g++ +RUN apt-get clean + +ENV libcoap_dir=/home/libcoap +ADD . $libcoap_dir +WORKDIR $libcoap_dir + +RUN ./autogen.sh --clean && ./autogen.sh +RUN ./configure --disable-documentation --enable-tests --enable-examples --with-openssl && make install clean + +WORKDIR /home +RUN git clone --depth 1 https://github.com/cabo/cn-cbor.git && cd cn-cbor && ./build.sh all doc install + +# The image for development with libcoap +FROM debian:testing-slim + +RUN apt-get update && apt-get install -y autoconf automake gcc g++ gdb libtool libtool-bin make \ + pkg-config libssl-dev libgnutls28-dev libmbedtls-dev +RUN apt-get install -y iproute2 lsof net-tools inetutils-ping netcat-openbsd less vim +RUN apt-get clean + +COPY --from=0 /usr/local/include/coap3 /usr/local/include/coap3 +COPY --from=0 /usr/local/lib /usr/local/lib +COPY --from=0 /usr/local/bin/coap-client /usr/local/bin/ +COPY --from=0 /usr/local/include/cn-cbor /usr/local/include/cn-cbor +RUN echo "/usr/local/lib" >>/etc/ld.so.conf.d/usr_local.conf && ldconfig /usr/local/lib + +ARG user=user +RUN adduser --disabled-password --gecos '' $user +RUN chown -R $user:$user /home/$user +WORKDIR /home/$user +USER $user + +EXPOSE 5683 5684 diff --git a/examples/espidf-coap-server/components/libcoap/build-env/build.sh b/examples/espidf-coap-server/components/libcoap/build-env/build.sh new file mode 100644 index 0000000..5cf4bc2 --- /dev/null +++ b/examples/espidf-coap-server/components/libcoap/build-env/build.sh @@ -0,0 +1,16 @@ +#! /usr/bin/env bash + +pushd $(dirname $0) +. ./imagename + +# see https://stackoverflow.com/a/2924755 for switching boldface on/off +bold=$(tput bold) +normal=$(tput sgr0) + +echo "${bold}**** Creating build-env image ****${normal}" +docker build -f Dockerfile.build-env -t $USER/$IMAGE:build-env . + +echo "${bold}**** Creating develop image ****${normal}" +docker build -f Dockerfile.develop -t $USER/$IMAGE:develop .. + +popd diff --git a/examples/espidf-coap-server/components/libcoap/build-env/imagename b/examples/espidf-coap-server/components/libcoap/build-env/imagename new file mode 100644 index 0000000..8d69844 --- /dev/null +++ b/examples/espidf-coap-server/components/libcoap/build-env/imagename @@ -0,0 +1,2 @@ +USER=obgm +IMAGE=libcoap diff --git a/examples/espidf-coap-server/components/libcoap/cmake-format.yaml b/examples/espidf-coap-server/components/libcoap/cmake-format.yaml new file mode 100644 index 0000000..3e25542 --- /dev/null +++ b/examples/espidf-coap-server/components/libcoap/cmake-format.yaml @@ -0,0 +1,25 @@ +# to format cmake files we use cmake-format: +# pip install cmake-format --upgrade +# information about the configuration here: +# https://github.com/cheshirekow/cmake_format + +# How wide to allow formatted cmake files +line_width: 80 + +# How many spaces to tab for indent +tab_size: 2 + +# Format command names consistently as 'lower' or 'upper' case +command_case: "lower" + +first_comment_is_literal: False + +# enable comment markup parsing and reflow +enable_markup: False + +# If arglists are longer than this, break them always +max_subargs_per_line: 1 + +max_subgroups_hwrap: 2 + +max_pargs_hwrap: 2 diff --git a/examples/espidf-coap-server/components/libcoap/cmake/FindMbedTLS.cmake b/examples/espidf-coap-server/components/libcoap/cmake/FindMbedTLS.cmake new file mode 100644 index 0000000..75d8598 --- /dev/null +++ b/examples/espidf-coap-server/components/libcoap/cmake/FindMbedTLS.cmake @@ -0,0 +1,35 @@ +find_path(MBEDTLS_INCLUDE_DIRS mbedtls/ssl.h) + +find_library(MBEDTLS_LIBRARY mbedtls) +find_library(MBEDX509_LIBRARY mbedx509) +find_library(MBEDCRYPTO_LIBRARY mbedcrypto) + +set(MBEDTLS_LIBRARIES + "${MBEDTLS_LIBRARY}" + "${MBEDX509_LIBRARY}" + "${MBEDCRYPTO_LIBRARY}") + +if(MBEDTLS_LIBRARY) + set(MbedTLS_FOUND TRUE) +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args( + MBEDTLS + DEFAULT_MSG + MBEDTLS_INCLUDE_DIRS + MBEDTLS_LIBRARY + MBEDX509_LIBRARY + MBEDCRYPTO_LIBRARY) + +mark_as_advanced( + MBEDTLS_INCLUDE_DIRS + MBEDTLS_LIBRARY + MBEDX509_LIBRARY + MBEDCRYPTO_LIBRARY) + +message(STATUS "MBEDTLS_INCLUDE_DIRS: ${MBEDTLS_INCLUDE_DIRS}") +message(STATUS "MBEDTLS_LIBRARY: ${MBEDTLS_LIBRARY}") +message(STATUS "MBEDX509_LIBRARY: ${MBEDX509_LIBRARY}") +message(STATUS "MBEDCRYPTO_LIBRARY: ${MBEDCRYPTO_LIBRARY}") +message(STATUS "MBEDTLS_LIBRARIES: ${MBEDTLS_LIBRARIES}") diff --git a/examples/espidf-coap-server/components/libcoap/cmake/FindTinyDTLS.cmake b/examples/espidf-coap-server/components/libcoap/cmake/FindTinyDTLS.cmake new file mode 100644 index 0000000..9955732 --- /dev/null +++ b/examples/espidf-coap-server/components/libcoap/cmake/FindTinyDTLS.cmake @@ -0,0 +1,88 @@ +# FindTinyDTLS +# ----------- +# +# Find the tinyDTLS encryption library. +# +# Imported Targets +# ^^^^^^^^^^^^^^^^ +# +# This module defines the following :prop_tgt:`IMPORTED` targets: +# +# ``tinydtls`` +# The tinyDTLS ``tinydtls`` library, if found. +# +# Result Variables +# ^^^^^^^^^^^^^^^^ +# +# This module will set the following variables in your project: +# +# ``TINYDTLS_FOUND`` +# System has the tinyDTLS library. +# ``TINYDTLS_INCLUDE_DIR`` +# The tinyDTLS include directory. +# ``TINYDTLS_LIBRARIES`` +# All tinyDTLS libraries. +# +# Hints +# ^^^^^ +# +# Set ``TINYDTLS_ROOT_DIR`` to the root directory of an tinyDTLS installation. + +if(TINYDTLS_ROOT_DIR) + set(_EXTRA_FIND_ARGS "NO_CMAKE_FIND_ROOT_PATH") +endif() + +find_path( + TINYDTLS_INCLUDE_DIR + NAMES tinydtls/dtls.h + PATH_SUFFIXES include + HINTS ${PROJECT_SOURCE_DIR} + ${CMAKE_CURRENT_BINARY_DIR} + ${TINYDTLS_ROOT_DIR} + ${_EXTRA_FIND_ARGS}) + +find_library( + TINYDTLS_LIBRARIES + NAMES tinydtls + PATH_SUFFIXES lib + HINTS ${PROJECT_SOURCE_DIR} + ${CMAKE_CURRENT_BINARY_DIR} + ${TINYDTLS_ROOT_DIR} + ${_EXTRA_FIND_ARGS}) + +if(TINYDTLS_LIBRARIES) + set(TINYDTLS_FOUND TRUE) +else() + set(TINYDTLS_FOUND FALSE) + if(TinyDTLS_FIND_REQUIRED) + message(FATAL_ERROR "Tinydtls could not be found") + endif() +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args( + tinyDTLS + FOUND_VAR + TINYDTLS_FOUND + REQUIRED_VARS + TINYDTLS_INCLUDE_DIR + TINYDTLS_LIBRARIES + VERSION_VAR) + +if(NOT + TARGET + tinydtls) + add_library( + tinydtls + UNKNOWN + IMPORTED) + set_target_properties( + tinydtls + PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${TINYDTLS_INCLUDE_DIR}" + IMPORTED_LINK_INTERFACE_LANGUAGES "C" + IMPORTED_LOCATION "${TINYDTLS_LIBRARIES}") +endif() + +message(STATUS "TINYDTLS_INCLUDE_DIR: ${TINYDTLS_INCLUDE_DIR}") +message(STATUS "TINYDTLS_LIBRARIES: ${TINYDTLS_LIBRARIES}") +message(STATUS "TINYDTLS_ROOT_DIR: ${TINYDTLS_ROOT_DIR}") diff --git a/examples/espidf-coap-server/components/libcoap/cmake_coap_config.h.in b/examples/espidf-coap-server/components/libcoap/cmake_coap_config.h.in new file mode 100644 index 0000000..d01ab53 --- /dev/null +++ b/examples/espidf-coap-server/components/libcoap/cmake_coap_config.h.in @@ -0,0 +1,177 @@ +/* + * cmake_coap_config.h -- cmake configuration for libcoap + * + * Copyright (C) 2020 Carlos Gomes Martinho + * Copyright (C) 2021-2022 Jon Shallow + * + * SPDX-License-Identifier: BSD-2-Clause + * + * This file is part of the CoAP library libcoap. Please see README for terms + * of use. + */ + +#ifndef COAP_CONFIG_H_ +#define COAP_CONFIG_H_ + +#if ! defined(_WIN32) +#define _GNU_SOURCE +#endif + +/* Define to 1 if you have header file. */ +#cmakedefine HAVE_WS2TCPIP_H @HAVE_WS2TCPIP_H@ + +/* Define if the system has small stack size */ +#cmakedefine COAP_CONSTRAINED_STACK @COAP_CONSTRAINED_STACK@ + +/* Define to 1 if you have header file. */ +#cmakedefine HAVE_WINSOCK2_H @HAVE_WINSOCK2_H@ + +/* Define if the library has client support */ +#cmakedefine COAP_CLIENT_SUPPORT @COAP_CLIENT_SUPPORT@ + +/* Define if the library has server support */ +#cmakedefine COAP_SERVER_SUPPORT @COAP_SERVER_SUPPORT@ + +/* Define if the system has epoll support */ +#cmakedefine COAP_EPOLL_SUPPORT @COAP_EPOLL_SUPPORT@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_ARPA_INET_H @HAVE_ARPA_INET_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_ASSERT_H @HAVE_ASSERT_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_DLFCN_H @HAVE_DLFCN_H@ + +/* Define to 1 if you have the `getaddrinfo' function. */ +#cmakedefine HAVE_GETADDRINFO @HAVE_GETADDRINFO@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_INTTYPES_H @HAVE_INTTYPES_H@ + +/* Define if the system has openssl */ +#cmakedefine HAVE_OPENSSL @HAVE_OPENSSL@ + +/* Define if the system has libgnutls28 */ +#cmakedefine HAVE_LIBGNUTLS @HAVE_LIBGNUTLS@ + +/* Define if the system has libtinydtls */ +#cmakedefine HAVE_LIBTINYDTLS @HAVE_LIBTINYDTLS@ + +/* Define if the system has libmbedtls */ +#cmakedefine HAVE_MBEDTLS @HAVE_MBEDTLS@ + +/* Define to 1 to build without TCP support. */ +#cmakedefine01 COAP_DISABLE_TCP + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_LIMITS_H @HAVE_LIMITS_H@ + +/* Define to 1 if you have the `malloc' function. */ +#cmakedefine HAVE_MALLOC @HAVE_MALLOC@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_MEMORY_H @HAVE_MEMORY_H@ + +/* Define to 1 if you have the `memset' function. */ +#cmakedefine HAVE_MEMSET @HAVE_MEMSET@ + +/* Define to 1 if you have the `if_nametoindex' function. */ +#cmakedefine HAVE_IF_NAMETOINDEX @HAVE_IF_NAMETOINDEX@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_NETDB_H @HAVE_NETDB_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_NET_IF_H @HAVE_NET_IF_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_NETINET_IN_H @HAVE_NETINET_IN_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_PTHREAD_H @HAVE_PTHREAD_H@ + +/* Define to 1 if you have the `pthread_mutex_lock' function. */ +#cmakedefine HAVE_PTHREAD_MUTEX_LOCK @HAVE_PTHREAD_MUTEX_LOCK@ + +/* Define to 1 if you have the `select' function. */ +#cmakedefine HAVE_SELECT @HAVE_SELECT@ + +/* Define to 1 if you have the `socket' function. */ +#cmakedefine HAVE_SOCKET @HAVE_SOCKET@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STDINT_H @HAVE_STDINT_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STDLIB_H @HAVE_STDLIB_H@ + +/* Define to 1 if you have the `strcasecmp' function. */ +#cmakedefine HAVE_STRCASECMP @HAVE_STRCASECMP@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STRINGS_H @HAVE_STRINGS_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STRING_H @HAVE_STRING_H@ + +/* Define to 1 if you have the `strnlen' function. */ +#cmakedefine HAVE_STRNLEN @HAVE_STRNLEN@ + +/* Define to 1 if you have the `strrchr' function. */ +#cmakedefine HAVE_STRRCHR @HAVE_STRRCHR@ + +/* Define to 1 if the system has the type `struct cmsghdr'. */ +#cmakedefine HAVE_STRUCT_CMSGHDR @HAVE_STRUCT_CMSGHDR@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYSLOG_H @HAVE_SYSLOG_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_IOCTL_H @HAVE_SYS_IOCTL_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_SOCKET_H @HAVE_SYS_SOCKET_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_STAT_H @HAVE_SYS_STAT_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_TIME_H @HAVE_SYS_TIME_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_TYPES_H @HAVE_SYS_TYPES_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_UNISTD_H @HAVE_SYS_UNISTD_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_TIME_H @HAVE_TIME_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_UNISTD_H @HAVE_UNISTD_H@ + +/* Define to the address where bug reports for this package should be sent. */ +#cmakedefine PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@" + +/* Define to the full name of this package. */ +#cmakedefine PACKAGE_NAME "@PACKAGE_NAME@" + +/* Define to the full name and version of this package. */ +#cmakedefine PACKAGE_STRING "@PACKAGE_STRING@" + +/* Define to the one symbol short name of this package. */ +#cmakedefine PACKAGE_TARNAME "@PACKAGE_TARNAME@" + +/* Define to the home page for this package. */ +#cmakedefine PACKAGE_URL "@PACKAGE_URL@" + +/* Define to the version of this package. */ +#cmakedefine PACKAGE_VERSION "@PACKAGE_VERSION@" + +#if defined(_MSC_VER) && (_MSC_VER < 1900) && !defined(snprintf) +#define snprintf _snprintf +#endif + +#endif /* COAP_CONFIG_H_ */ diff --git a/examples/espidf-coap-server/components/libcoap/coap_config.h.contiki b/examples/espidf-coap-server/components/libcoap/coap_config.h.contiki new file mode 100644 index 0000000..6e4f541 --- /dev/null +++ b/examples/espidf-coap-server/components/libcoap/coap_config.h.contiki @@ -0,0 +1,215 @@ +#ifndef COAP_CONFIG_H_ +#define COAP_CONFIG_H_ + +#include "contiki.h" +#include "contiki-lib.h" +#include "contiki-net.h" + +#define WITH_CONTIKI 1 + +#ifndef COAP_CONSTRAINED_STACK +#define COAP_CONSTRAINED_STACK 1 +#endif + +#ifndef COAP_DISABLE_TCP +#define COAP_DISABLE_TCP 1 +#endif + +#define PACKAGE_STRING "libcoap" +#define PACKAGE_NAME "libcoap" + +#ifndef COAP_DEFAULT_PDU_SIZE +#define COAP_DEFAULT_PDU_SIZE 64 +#endif /* COAP_DEFAULT_PDU_SIZE */ +#ifndef COAP_RXBUFFER_SIZE +#define COAP_RXBUFFER_SIZE 64 +#endif /* COAP_RXBUFFER_SIZE */ + +/** Number of resources that can be handled by a CoAP server in addition to + * @c /.well-known/core */ +#ifndef COAP_MAX_RESOURCES +#define COAP_MAX_RESOURCES 3 +#endif /* COAP_MAX_RESOURCES */ + +/** Number of attributes that can be handled (should be at least + * @c 2 * COAP_MAX_RESOURCES. to carry the content type and the + * resource type. */ +#ifndef COAP_MAX_ATTRIBUTES +#define COAP_MAX_ATTRIBUTES 4 +#endif /* COAP_MAX_ATTRIBUTES */ + +/** + * Number of PDUs that can be stored simultaneously. This number + * includes both, the PDUs stored for retransmission as well as the + * PDUs received. Beware that choosing a too small value can lead to + * many retransmissions to be dealt with. + */ +#ifndef COAP_PDU_MAXCNT +#define COAP_PDU_MAXCNT 4 +#endif /* COAP_PDU_MAXCNT */ + +/** + * Maximum number of sessions. + */ +#ifndef COAP_MAX_SESSIONS +#define COAP_MAX_SESSIONS 2 +#endif /* COAP_MAX_SESSIONS */ + +/** + * Maximum number of subscriptions. Every additional subscriber costs + * 36 B. + */ +#ifndef COAP_MAX_SUBSCRIBERS +#define COAP_MAX_SUBSCRIBERS 3 +#endif /* COAP_MAX_SUBSCRIBERS */ + +/** + * The maximum number of cache-key entries that allocate + * fixed-size memory blocks. + */ +#ifndef COAP_MAX_CACHE_KEYS +#define COAP_MAX_CACHE_KEYS (2U) +#endif /* COAP_MAX_CACHE_KEYS */ + +/** + * The maximum number of cache-entry entries that allocate + * fixed-size memory blocks. + */ +#ifndef COAP_MAX_CACHE_ENTRIES +#define COAP_MAX_CACHE_ENTRIES (2U) +#endif /* COAP_MAX_CACHE_ENTRIES */ + +/** + * Maximum number of large body transmissions. + */ +#ifndef COAP_MAX_LG_XMIT +#define COAP_MAX_LG_XMIT 2 +#endif /* COAP_MAX_LG_XMIT */ + +/** + * Maximum number of large body client receives. + */ +#ifndef COAP_MAX_LG_CRCV +#define COAP_MAX_LG_CRCV 2 +#endif /* COAP_MAX_LG_CRCV */ + +/** + * Maximum number of large body server receives. + */ +#ifndef COAP_MAX_LG_SRCV +#define COAP_MAX_LG_SRCV 2 +#endif /* COAP_MAX_LG_SRCV */ + +/** + * Number of notifications that may be sent non-confirmable before a confirmable + * message is sent to detect if observers are alive. The maximum allowed value + * here is @c 255. + */ +#ifndef COAP_OBS_MAX_NON +#define COAP_OBS_MAX_NON 5 +#endif /* COAP_OBS_MAX_NON */ +#if COAP_OBS_MAX_NON > 255 +#error COAP_OBS_MAX_NON is too large +#endif /* COAP_OBS_MAX_NON > 255 */ + +/** + * Number of different confirmable notifications that may fail (i.e. those + * that have hit MAX_RETRANSMIT multiple times) before an observer is removed. + * The maximum value for COAP_OBS_MAX_FAIL is @c 255. + */ +#ifndef COAP_OBS_MAX_FAIL +#define COAP_OBS_MAX_FAIL 1 +#endif /* COAP_OBS_MAX_FAIL */ +#if COAP_OBS_MAX_FAIL > 255 +#error COAP_OBS_MAX_FAIL is too large +#endif /* COAP_OBS_MAX_FAIL > 255 */ + +#ifndef DEBUG +# define DEBUG DEBUG_PRINT +#endif + +#define HAVE_STRNLEN 1 +#define HAVE_SNPRINTF 1 +#define HAVE_STRINGS_H 1 + +/* there is no file-oriented output */ +#define COAP_DEBUG_FD NULL +#define COAP_ERR_FD NULL + +#include "contiki-conf.h" + +#if (defined(PLATFORM) && PLATFORM == PLATFORM_MC1322X) || defined(CONTIKI_TARGET_ECONOTAG) +/* Redbee econotags get a special treatment here: endianness is set + * explicitly, and + */ + +#define BYTE_ORDER UIP_LITTLE_ENDIAN + +#define HAVE_ASSERT_H +#define HAVE_UNISTD_H +#define HAVE_SYS_TYPES_H +#define HAVE_LIMITS_H +#endif /* PLATFORM_MC1322X || CONTIKI_TARGET_ECONOTAG */ + +#if defined(TMOTE_SKY) || defined(CONTIKI_TARGET_SKY) || defined(CONTIKI_TARGET_WISMOTE) +/* Need to set the byte order for TMote Sky explicitely */ + +#define BYTE_ORDER UIP_LITTLE_ENDIAN +#undef COAP_DEFAULT_PDU_SIZE +#undef COAP_RXBUFFER_SIZE +#define COAP_DEFAULT_PDU_SIZE 100 +#define COAP_RXBUFFER_SIZE 100 + +#define COAP_MAX_BLOCK_SZX 2 + +typedef int ssize_t; +typedef void FILE; + +#define HAVE_LIMITS_H 1 +#undef HAVE_ASSERT_H +#define HAVE_VPRINTF 1 +#endif /* defined(TMOTE_SKY) */ + +#ifdef CONTIKI_TARGET_MINIMAL_NET +#undef COAP_DEFAULT_PDU_SIZE +#undef COAP_RXBUFFER_SIZE +#define COAP_DEFAULT_PDU_SIZE 1152 +#define COAP_RXBUFFER_SIZE 1472 +#define HAVE_ASSERT_H 1 +#define HAVE_VPRINTF 1 +#define HAVE_SYS_TYPES_H 1 +#endif /* CONTIKI_TARGET_MINIMAL_NET */ + +#ifdef CONTIKI_TARGET_CC2538DK +#define BYTE_ORDER UIP_LITTLE_ENDIAN +#undef COAP_DEFAULT_PDU_SIZE +#undef COAP_RXBUFFER_SIZE +#define COAP_DEFAULT_PDU_SIZE 100 +#define COAP_RXBUFFER_SIZE 100 + +#undef COAP_MAX_BLOCK_SZX +#define COAP_MAX_BLOCK_SZX 2 + +#define HAVE_LIMITS_H 1 +#endif /* CONTIKI_TARGET_CC2538DK */ + +#ifndef BYTE_ORDER +# ifdef UIP_CONF_BYTE_ORDER +# define BYTE_ORDER UIP_CONF_BYTE_ORDER +# else +# error "UIP_CONF_BYTE_ORDER not defined" +# endif /* UIP_CONF_BYTE_ORDER */ +#endif /* BYTE_ORDER */ + +/* Define assert() as empty directive unless HAVE_ASSERT_H is given. */ +#ifndef HAVE_ASSERT_H +# define assert(x) +#endif + +#define ntohs uip_ntohs + +#include +#define coap_log(fd, ...) printf(__VA_ARGS__) + +#endif /* COAP_CONFIG_H_ */ + diff --git a/examples/espidf-coap-server/components/libcoap/coap_config.h.lwip b/examples/espidf-coap-server/components/libcoap/coap_config.h.lwip new file mode 100644 index 0000000..265e892 --- /dev/null +++ b/examples/espidf-coap-server/components/libcoap/coap_config.h.lwip @@ -0,0 +1,42 @@ +/* + * coap_config.h.lwip -- LwIP configuration for libcoap + * + * Copyright (C) 2021-2022 Olaf Bergmann and others + * + * SPDX-License-Identifier: BSD-2-Clause + * + * This file is part of the CoAP library libcoap. Please see README for terms + * of use. + */ + +#ifndef COAP_CONFIG_H_ +#define COAP_CONFIG_H_ + +#include +#include +#include /* provide ntohs, htons */ + +#define WITH_LWIP 1 + +#ifndef COAP_CONSTRAINED_STACK +#define COAP_CONSTRAINED_STACK 1 +#endif + +#ifndef COAP_DISABLE_TCP +#define COAP_DISABLE_TCP 1 +#endif + +#define PACKAGE_NAME "libcoap" +#define PACKAGE_VERSION "4.3.1" +#define PACKAGE_STRING "libcoap 4.3.1" + +#define assert(x) LWIP_ASSERT("CoAP assert failed", x) + +/* it's just provided by libc. i hope we don't get too many of those, as + * actually we'd need autotools again to find out what environment we're + * building in */ +#define HAVE_STRNLEN 1 + +#define HAVE_LIMITS_H + +#endif /* COAP_CONFIG_H_ */ diff --git a/examples/espidf-coap-server/components/libcoap/coap_config.h.lwip.in b/examples/espidf-coap-server/components/libcoap/coap_config.h.lwip.in new file mode 100644 index 0000000..2fcf3cb --- /dev/null +++ b/examples/espidf-coap-server/components/libcoap/coap_config.h.lwip.in @@ -0,0 +1,42 @@ +/* + * coap_config.h.lwip -- LwIP configuration for libcoap + * + * Copyright (C) 2021-2022 Olaf Bergmann and others + * + * SPDX-License-Identifier: BSD-2-Clause + * + * This file is part of the CoAP library libcoap. Please see README for terms + * of use. + */ + +#ifndef COAP_CONFIG_H_ +#define COAP_CONFIG_H_ + +#include +#include +#include /* provide ntohs, htons */ + +#define WITH_LWIP 1 + +#ifndef COAP_CONSTRAINED_STACK +#define COAP_CONSTRAINED_STACK 1 +#endif + +#ifndef COAP_DISABLE_TCP +#define COAP_DISABLE_TCP 1 +#endif + +#define PACKAGE_NAME "@PACKAGE_NAME@" +#define PACKAGE_VERSION "@PACKAGE_VERSION@" +#define PACKAGE_STRING "@PACKAGE_STRING@" + +#define assert(x) LWIP_ASSERT("CoAP assert failed", x) + +/* it's just provided by libc. i hope we don't get too many of those, as + * actually we'd need autotools again to find out what environment we're + * building in */ +#define HAVE_STRNLEN 1 + +#define HAVE_LIMITS_H + +#endif /* COAP_CONFIG_H_ */ diff --git a/examples/espidf-coap-server/components/libcoap/coap_config.h.riot b/examples/espidf-coap-server/components/libcoap/coap_config.h.riot new file mode 100644 index 0000000..58f3f27 --- /dev/null +++ b/examples/espidf-coap-server/components/libcoap/coap_config.h.riot @@ -0,0 +1,143 @@ +/* + * coap_config.h.riot -- RIOT configuration for libcoap + * + * Copyright (C) 2021-2022 Olaf Bergmann and others + * + * SPDX-License-Identifier: BSD-2-Clause + * + * This file is part of the CoAP library libcoap. Please see README for terms + * of use. + */ + +#ifndef COAP_CONFIG_H_RIOT_ +#define COAP_CONFIG_H_RIOT_ + +#define WITH_POSIX 1 + +#ifndef COAP_CONSTRAINED_STACK +#define COAP_CONSTRAINED_STACK 1 +#endif + +#ifndef COAP_DISABLE_TCP +#define COAP_DISABLE_TCP 1 +#endif + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Define to 1 if you have the header file. */ +#define HAVE_ARPA_INET_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ASSERT_H 1 + +/* Define to 1 if you have the `getaddrinfo' function. */ +/* #undef HAVE_GETADDRINFO */ + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LIMITS_H */ + +/* Define to 1 if your system has a GNU libc compatible `malloc' function, and + to 0 otherwise. */ +#undef HAVE_MALLOC + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MEMORY_H */ + +/* Define to 1 if you have the `memset' function. */ +#define HAVE_MEMSET 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NETDB_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_NETINET_IN_H 1 + +/* Define to 1 if you have the `select' function. */ +/* #undef HAVE_SELECT */ + +/* Define to 1 if you have the `socket' function. */ +#define HAVE_SOCKET 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `strcasecmp' function. */ +#define HAVE_STRCASECMP 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strnlen' function. */ +/* #undef HAVE_STRNLEN */ + +/* Define to 1 if you have the `strrchr' function. */ +#define HAVE_STRRCHR 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_SOCKET_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_STAT_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_UNISTD_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_TIME_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "libcoap-developers@lists.sourceforge.net" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "libcoap" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "4.3.1" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "libcoap 4.3.1" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif + +/* Define to rpl_malloc if the replacement function should be used. */ +/* #undef malloc */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ + +/* Define to `int' if does not define. */ +/* #undef ssize_t */ + +#endif /* COAP_CONFIG_H_RIOT_ */ diff --git a/examples/espidf-coap-server/components/libcoap/coap_config.h.riot.in b/examples/espidf-coap-server/components/libcoap/coap_config.h.riot.in new file mode 100644 index 0000000..d0fecd6 --- /dev/null +++ b/examples/espidf-coap-server/components/libcoap/coap_config.h.riot.in @@ -0,0 +1,143 @@ +/* + * coap_config.h.riot -- RIOT configuration for libcoap + * + * Copyright (C) 2021-2022 Olaf Bergmann and others + * + * SPDX-License-Identifier: BSD-2-Clause + * + * This file is part of the CoAP library libcoap. Please see README for terms + * of use. + */ + +#ifndef COAP_CONFIG_H_RIOT_ +#define COAP_CONFIG_H_RIOT_ + +#define WITH_POSIX 1 + +#ifndef COAP_CONSTRAINED_STACK +#define COAP_CONSTRAINED_STACK 1 +#endif + +#ifndef COAP_DISABLE_TCP +#define COAP_DISABLE_TCP 1 +#endif + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Define to 1 if you have the header file. */ +#define HAVE_ARPA_INET_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ASSERT_H 1 + +/* Define to 1 if you have the `getaddrinfo' function. */ +/* #undef HAVE_GETADDRINFO */ + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LIMITS_H */ + +/* Define to 1 if your system has a GNU libc compatible `malloc' function, and + to 0 otherwise. */ +#undef HAVE_MALLOC + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MEMORY_H */ + +/* Define to 1 if you have the `memset' function. */ +#define HAVE_MEMSET 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NETDB_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_NETINET_IN_H 1 + +/* Define to 1 if you have the `select' function. */ +/* #undef HAVE_SELECT */ + +/* Define to 1 if you have the `socket' function. */ +#define HAVE_SOCKET 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `strcasecmp' function. */ +#define HAVE_STRCASECMP 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strnlen' function. */ +/* #undef HAVE_STRNLEN */ + +/* Define to 1 if you have the `strrchr' function. */ +#define HAVE_STRRCHR 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_SOCKET_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_STAT_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_UNISTD_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_TIME_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "@PACKAGE_NAME@" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "@PACKAGE_VERSION@" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "@PACKAGE_STRING@" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif + +/* Define to rpl_malloc if the replacement function should be used. */ +/* #undef malloc */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ + +/* Define to `int' if does not define. */ +/* #undef ssize_t */ + +#endif /* COAP_CONFIG_H_RIOT_ */ diff --git a/examples/espidf-coap-server/components/libcoap/coap_config.h.windows b/examples/espidf-coap-server/components/libcoap/coap_config.h.windows new file mode 100644 index 0000000..161fe18 --- /dev/null +++ b/examples/espidf-coap-server/components/libcoap/coap_config.h.windows @@ -0,0 +1,118 @@ +#ifndef COAP_CONFIG_H_ +#define COAP_CONFIG_H_ + +#if defined(_WIN32) + +/* Define to 1 if you have header file. */ +#define HAVE_WS2TCPIP_H 1 + +/* Define to 1 if you have header file. */ +#define HAVE_WINSOCK2_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ASSERT_H 1 + +/* Define to 1 if you have the `getaddrinfo' function. */ +#define HAVE_GETADDRINFO 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LIMITS_H 1 + +/* Define to 1 if you have the `malloc' function. */ +#define HAVE_MALLOC 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `memset' function. */ +#define HAVE_MEMSET 1 + +/* Define to 1 if you have the `select' function. */ +#define HAVE_SELECT 1 + +/* Define to 1 if you have the `socket' function. */ +#define HAVE_SOCKET 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strnlen' function. */ +#define HAVE_STRNLEN 1 + +/* Define to 1 if you have the `strrchr' function. */ +#define HAVE_STRRCHR 1 + +/* Define to 1 if the system has the type `struct cmsghdr'. */ +#define HAVE_STRUCT_CMSGHDR 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_TIME_H 1 + +#if defined(_MSC_VER) && (_MSC_VER < 1900) && !defined(snprintf) +#define snprintf _snprintf +#endif + +#ifndef COAP_DISABLE_TCP +#define COAP_DISABLE_TCP 0 +#endif + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "libcoap-developers@lists.sourceforge.net" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "libcoap" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "libcoap 4.3.1" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "libcoap" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "https://libcoap.net/" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "4.3.1" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif + +/* Define this to 1 for ancillary data on MacOS */ +/* #undef __APPLE_USE_RFC_3542 */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ + +/* Define to `int' if does not define. */ +/* #undef ssize_t */ + +#endif + +#endif /* COAP_CONFIG_H_ */ diff --git a/examples/espidf-coap-server/components/libcoap/coap_config.h.windows.in b/examples/espidf-coap-server/components/libcoap/coap_config.h.windows.in new file mode 100644 index 0000000..84ef458 --- /dev/null +++ b/examples/espidf-coap-server/components/libcoap/coap_config.h.windows.in @@ -0,0 +1,118 @@ +#ifndef COAP_CONFIG_H_ +#define COAP_CONFIG_H_ + +#if defined(_WIN32) + +/* Define to 1 if you have header file. */ +#define HAVE_WS2TCPIP_H 1 + +/* Define to 1 if you have header file. */ +#define HAVE_WINSOCK2_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ASSERT_H 1 + +/* Define to 1 if you have the `getaddrinfo' function. */ +#define HAVE_GETADDRINFO 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LIMITS_H 1 + +/* Define to 1 if you have the `malloc' function. */ +#define HAVE_MALLOC 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `memset' function. */ +#define HAVE_MEMSET 1 + +/* Define to 1 if you have the `select' function. */ +#define HAVE_SELECT 1 + +/* Define to 1 if you have the `socket' function. */ +#define HAVE_SOCKET 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strnlen' function. */ +#define HAVE_STRNLEN 1 + +/* Define to 1 if you have the `strrchr' function. */ +#define HAVE_STRRCHR 1 + +/* Define to 1 if the system has the type `struct cmsghdr'. */ +#define HAVE_STRUCT_CMSGHDR 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_TIME_H 1 + +#if defined(_MSC_VER) && (_MSC_VER < 1900) && !defined(snprintf) +#define snprintf _snprintf +#endif + +#ifndef COAP_DISABLE_TCP +#define COAP_DISABLE_TCP 0 +#endif + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "@PACKAGE_NAME@" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "@PACKAGE_STRING@" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "@PACKAGE_TARNAME@" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "@PACKAGE_URL@" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "@PACKAGE_VERSION@" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif + +/* Define this to 1 for ancillary data on MacOS */ +/* #undef __APPLE_USE_RFC_3542 */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ + +/* Define to `int' if does not define. */ +/* #undef ssize_t */ + +#endif + +#endif /* COAP_CONFIG_H_ */ diff --git a/examples/espidf-coap-server/components/libcoap/configure.ac b/examples/espidf-coap-server/components/libcoap/configure.ac new file mode 100644 index 0000000..5c46cc6 --- /dev/null +++ b/examples/espidf-coap-server/components/libcoap/configure.ac @@ -0,0 +1,1106 @@ +# configure.ac for the libcoap package +# +# Copyright (C) 2010-2022 Olaf Bergmann +# Copyright (C) 2015-2018 Carsten Schoenert +# Copyright (C) 2018-2022 Jon Shallow +# +# SPDX-License-Identifier: BSD-2-Clause +# +# This file is part of the CoAP library libcoap. Please see README for terms +# of use. +# +# Please run 'autogen.sh' to let autoconf produce a configure script. + +# Define the libcoap software version here. Note! The libtool versions are +# defined later. +m4_define([libcoap_major_version], [4]) +m4_define([libcoap_minor_version], [3]) +m4_define([libcoap_micro_version], [1]) + +# define an appending release state if needed, for example for pre-releases +# like 'alpha' or 'rc1', for a full release keep the value empty! +m4_define([libcoap_release_state], []) + +# concatenate the full libcoap version string +m4_define([libcoap_version], [m4_format([%s.%s.%s%s], libcoap_major_version, libcoap_minor_version, libcoap_micro_version, libcoap_release_state)]) + +AC_INIT([libcoap], [libcoap_version], [libcoap-developers@lists.sourceforge.net], [libcoap], [https://libcoap.net/]) +AC_PREREQ([2.64]) +AM_INIT_AUTOMAKE([1.10 -Wall no-define no-dist-gzip dist-bzip2]) +PKG_PROG_PKG_CONFIG([0.20]) +AM_SILENT_RULES([yes]) +AC_HEADER_ASSERT + +# Generate one configuration header file for building the library itself with +# an auto generated template. We need later a second one +# (include/coap$LIBCOAP_API_VERSION/libcoap.h) that will be installed alongside the library. +AC_CONFIG_HEADERS([coap_config.h]) + +AC_PROG_CC +AM_PROG_CC_C_O +AC_PROG_SED +AC_CONFIG_MACRO_DIR([m4]) +m4_pattern_allow([AM_PROG_AR]) +AM_PROG_AR +AC_PROG_LN_S +AC_PROG_MKDIR_P + +AC_C_BIGENDIAN + +# enable the automatically build of shared and static libraries +LT_INIT([shared static]) + +# Setting the libtool versioning +################################################################################### +# # +# To set the version of the library, libtool provides the -version-info # +# parameter, which accepts three numbers, separated by colons, that are called # +# respectively, current, revision and age. Both their name and their behavior, # +# nowadays, have to be considered fully arbitrary, as the explanation provided # +# in the official documentation is confusing to say the least, and can be, in # +# some cases, considered completely wrong. # +# https://autotools.io/libtool/version.html # +# # +################################################################################### +# +# How to work with the libtool versioning? +# +# Follow the following steps from top to bottom. This means always start at point 1 +# if you plan to make a release and change the values. +# Every new library starts with a version 'current' (short 'c') = 0 +# 'revision' (short 'r') = 0 +# 'age' (short 'a') = 0 +# +# Update the libtool versioning only after the release of a public release of libcoap. +# Go through the following checklist from top to bottom and check your needs, following +# the reminded changes if you can say "Yes" for specific check. +# +# 1. Only existing code has changed, no functional changes +# If the library source code has changed but *no* new symbols were added at all +# since the last update, then increment revision (c:r:a becomes c:r+1:a). +# This is usually happen if the existing source of a function was changed for +# bug fixing e.g. +# +# --> Increase the 'LT_LIBCOAP_REVISION' value with *every* new software release +# within one release cycle. +# +# 2. Interfaces were added, functions have changed or are removed +# If any interfaces [exported functions or data] have been added, got internal +# changes that implies a different behavior or removed and by this the visible +# symbols have changed since the last update, increment current, and set +# revision to 0 (c:r:a becomes c+1:r=0:a). +# +# --> Increase the 'LT_LIBCOAP_CURRENT' value whenever as an interface has been added +# or removed. This implies also a API change! You mostly have to change the +# 'libcoap_major_version' or at least 'libcoap_minor_version' then too! +# --> Set 'LT_LIBCOAP_REVISION' to 0. +# +# 3. Interfaces were added but none removed or changed +# If any interfaces have been added since the last public release and non of the +# existing interfaces were removed and existing interfaces have not changed internal +# functionality then the new library is backward compatible. Existing binaries can +# use the new library the same than as the existing old library without loosing +# existing functionality or breakage. +# Increase age by 1 (c:r:a becomes c:r:a+1). +# +# --> Increase the 'LT_LIBCOAP_AGE' value only if the changes made to the ABI are +# backward compatible. +# +# 4. Interfaces were removed or have functional changes +# If any interfaces within the library have been removed since the last public +# release or got some internal changes that let the interface act different than +# before, then set age to 0. The library isn't backwards compatible. +# +# --> Set 'LT_LIBCOAP_AGE' to 0. + +LT_LIBCOAP_CURRENT=3 +LT_LIBCOAP_REVISION=0 +LT_LIBCOAP_AGE=0 +LIBCOAP_SO_VERSION=$LT_LIBCOAP_CURRENT.$LT_LIBCOAP_REVISION.$LT_LIBCOAP_AGE + +# Announce the libtool version +AC_SUBST(LT_LIBCOAP_CURRENT) +AC_SUBST(LT_LIBCOAP_REVISION) +AC_SUBST(LT_LIBCOAP_AGE) +AC_SUBST(LIBCOAP_SO_VERSION) + +# Defining the API Version +LIBCOAP_API_VERSION=3 +AC_SUBST(LIBCOAP_API_VERSION) + +# Define a numeric version string +m4_define([version_number], + [m4_format([%u%03u%03u], + libcoap_major_version, + libcoap_minor_version, + libcoap_micro_version)]) +LIBCOAP_VERSION=version_number +AC_SUBST(LIBCOAP_VERSION) + +# Adding some default warning options for code QS +# see https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html +# and http://www.gnu.org/software/automake/manual/html_node/Flag-Variables-Ordering.html +WARNING_CFLAGS="\ +-pedantic \ +-Wall \ +-Wcast-qual \ +-Wextra \ +-Wformat-security \ +-Winline \ +-Wmissing-declarations \ +-Wmissing-prototypes \ +-Wnested-externs \ +-Wpointer-arith \ +-Wshadow \ +-Wstrict-prototypes \ +-Wswitch-default \ +-Wswitch-enum \ +-Wunused \ +-Wwrite-strings \ +" + +# check whether or not the compiler supports -Wlogical-op (clang does not...) +AX_CHECK_COMPILE_FLAG([-Wlogical-op], [WARNING_CFLAGS="$WARNING_CFLAGS -Wlogical-op"],,[-Werror]) +AX_CHECK_COMPILE_FLAG([-fdiagnostics-color], [CFLAGS="$CFLAGS -fdiagnostics-color"],,[-Werror]) +AX_CHECK_COMPILE_FLAG([-Wunused-result], [WARNING_CFLAGS="$WARNING_CFLAGS -Wunused-result"]) + +AC_SUBST([WARNING_CFLAGS]) + +AX_CHECK_LINK_FLAG([-Wl,--version-script=${srcdir}/libcoap-${LIBCOAP_API_VERSION}.map], + [libcoap_SYMBOLS="-Wl,--version-script=\$(srcdir)/libcoap-\$(LIBCOAP_API_VERSION).map"], + [libcoap_SYMBOLS="-export-symbols \$(top_builddir)/libcoap-\$(LIBCOAP_API_VERSION).sym"]) + +AC_SUBST(libcoap_SYMBOLS) + +# configure options +# __documentation__ + +AC_ARG_ENABLE([documentation], + [AS_HELP_STRING([--enable-documentation], + [Enable building all the documentation [default=yes]])], + [build_documentation="$enableval"], + [build_documentation="yes"]) + +AM_CONDITIONAL(BUILD_DOCUMENTATION, [test "x$build_documentation" = "xyes"]) + +doxygen_version_required=1.7.0 +dot_version_required=2.26.0 + +AC_ARG_ENABLE([doxygen], + [AS_HELP_STRING([--enable-doxygen], + [Enable building the doxygen documentation [default=yes]])], + [build_doxygen="$enableval"], + [build_doxygen="yes"]) + +if test -z "$enable_doxygen"; then + if test "x$enable_documentation" = "xno"; then + build_doxygen="no" + fi +fi + +if test "x$build_doxygen" = "xyes"; then + # Check for doxygen + AC_PATH_PROGS([DOXYGEN], [doxygen]) + if test -z "$DOXYGEN"; then + if test "x$build_doxygen" = "xyes"; then + AC_MSG_WARN([==> You want to build the doxygen documentation but doxygen was not found!]) + AC_MSG_ERROR([==> Install the package that contains doxygen or disable the doxygen documentation using '--disable-doxygen'.]) + fi + else + AC_MSG_CHECKING([for compatible doxygen version (>= $doxygen_version_required)]) + doxygen_version=`$DOXYGEN --version` + AS_VERSION_COMPARE([$doxygen_version], + [$doxygen_version_required], + [AC_MSG_RESULT([no]) + DOXYGEN=""], + [AC_MSG_RESULT([yes $doxygen_version])], + [AC_MSG_RESULT([yes $doxygen_version])]) + if test "x$DOXYGEN" = "x" -a "x$build_doxygen" = "xyes"; then + AC_MSG_WARN([==> Doxygen $doxygen_version too old. Doxygen >= $doxygen_version_required required for documentation build.]) + AC_MSG_ERROR([==> Install required doxygen version or disable the doxygen documentation using '--disable-doxygen'.]) + else + # we found doxygen and the version is valid + # now checking dot (needed for graphics) + AC_PATH_PROG([DOT], [dot]) + if test "x$DOT" = "x"; then + AC_MSG_WARN([==> dot not found - continuing without DOT support]) + AC_MSG_WARN([==> The libcoap html documentation will be build without DOT graphics!]) + HAVE_DOT="NO" + USE_CALL_GRAPH="NO" + else + AC_MSG_CHECKING([for compatible dot version (>= $dot_version_required)]) + case $host in + *-freebsd1*) + # csh and tcsh have a different output redirection than more recent shells + # cmd >& file # Redirect both stdout and stderr to file. + # cmd >>& file # Append both stdout and stderr to file. + # cmd1 | cmd2 # pipe stdout to cmd2 + # cmd1 |& cmd2 # pipe stdout and stderr to cmd2 + # Using an explicit call with the default always available C-shell on FreeBSD, + # the user may have installed another shell from a port which we don't know here + dot_version=`export DOT=$DOT && csh -c '$DOT -V |& cut -f5 -d" "'` + ;; + + *) + dot_version=`$DOT -V 2>&1 | cut -f5 -d" "` + ;; + + esac + AS_VERSION_COMPARE([$dot_version], + [$dot_version_required], + [AC_MSG_RESULT([no]) + DOT=""], + [AC_MSG_RESULT([yes $dot_version])], + [AC_MSG_RESULT([yes $dot_version])]) + if test "x$DOT" = "x" -a "x$build_doxygen" = "xyes"; then + AC_MSG_WARN([==> Graphviz dot $dot_version too old. Graphviz >= $dot_version_required required for doxygen build.]) + AC_MSG_ERROR([==> Install required graphviz version or disable the doxygen documentation using '--disable-doxygen'.]) + fi + # we found dot and the version is valid + HAVE_DOT="YES" + # let doxygen create caller graphics + # see http://www.stack.nl/~dimitri/doxygen/manual/config.html#cfg_call_graph + USE_CALL_GRAPH="YES" + # exporting the tests to doc/Doxygen(.in) + AC_SUBST(HAVE_DOT) + AC_SUBST(USE_CALL_GRAPH) + fi + fi + fi +fi +AM_CONDITIONAL(BUILD_DOXYGEN, [test "x$build_doxygen" = "xyes"]) + +AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"]) +AM_COND_IF([HAVE_DOXYGEN], [AC_CONFIG_FILES([doc/Doxyfile])]) + +# __manpages__ + +AC_ARG_ENABLE([manpages], + [AS_HELP_STRING([--enable-manpages], + [Enable building the manpages [default=yes]])], + [build_manpages="$enableval"], + [build_manpages="yes"]) + +if test -z "$enable_manpages"; then + if test "x$enable_documentation" = "xno"; then + build_manpages="no" + fi +fi + +if test "x$build_manpages" = "xyes"; then + AC_ARG_VAR([A2X], [a2x command]) + AC_PATH_PROG([A2X], [a2x]) + if test "x$A2X" = "x"; then + AC_MSG_WARN([==> You want to build the manpages, but a2x was not found!]) + AC_MSG_ERROR([==> Install the package that contains a2x (mostly asciidoc) or disable the build of the manpages using '--disable-manpages'.]) + build_manpages="no" + else + AX_CHECK_A2X_TO_MANPAGE([], [ + AC_MSG_RESULT([no]) + AC_MSG_WARN([==> You want to build the manpages with a2x, but manpage formatting does not work!]) + AC_MSG_ERROR([==> Install the packages that contains the docbook DTD and XSL stylesheets (presumably docbook, docbook-xml) or disable the build of the manpages using '--disable-manpages'.]) + build_manpages="no" + ]) + fi +fi +AM_CONDITIONAL(BUILD_MANPAGES, [test "x$build_manpages" = "xyes"]) + +# configure options +# __dtls__ +# The Datagram Transport Layer Security (DTLS) feature needs cryptography +# functions. +# We currently support the GnuTLS and OpenSSL library. The user can preselect +# the cryptography library that should be used by adding '--with-gnutls' or +# '--with-openssl'. +# If the user isn't using a selection we first search for GnuTLS and fallback +# to OpenSSL if the GnuTLS library couldn't be found. + +gnutls_version_required=3.3.0 +openssl_version_required=1.1.0 +mbedtls_version_required=2.7.10 +tinydtls_version_required=0.8.6 + +AC_ARG_ENABLE([dtls], + [AS_HELP_STRING([--enable-dtls], + [Enable building with DTLS support [default=yes]])], + [build_dtls="$enableval"], + [build_dtls="yes"]) + +AC_ARG_WITH([gnutls], + [AS_HELP_STRING([--with-gnutls], + [Use GnuTLS for DTLS functions])], + [with_gnutls="$withval"], + [with_gnutls="no"]) + +AC_ARG_WITH([openssl], + [AS_HELP_STRING([--with-openssl], + [Use OpenSSL for DTLS functions])], + [with_openssl="$withval"], + [with_openssl="no"]) + +AC_ARG_WITH([mbedtls], + [AS_HELP_STRING([--with-mbedtls], + [Use Mbed TLS for DTLS functions])], + [with_mbedtls="$withval"], + [with_mbedtls="no"]) + +AC_ARG_WITH([tinydtls], + [AS_HELP_STRING([--with-tinydtls], + [Use TinyDTLS for DTLS functions])], + [with_tinydtls="$withval"], + [with_tinydtls="no"]) + +AC_ARG_WITH([submodule-tinydtls], + [AS_HELP_STRING([--with-submodule-tinydtls], + [Use the TinyDTLS provided in the git submodule over the system-provided version [default=fallback to submodule if --with-tinydtls is explicitly set and no system-provided version was found])])], + [with_submodule_tinydtls="$withval"], + [with_submodule_tinydtls="explicit_fallback"]) + +if test "x$with_gnutls" = "xyes" -o "x$with_openssl" = "xyes" -o "x$with_mbedtls" = "xyes" -o "x$with_tinydtls" = "xyes"; then + if test "x$build_dtls" = "xno"; then + # Give an advice that '--with_gnutls', '--with_openssl', '--with-mbedtls' or '--with-tinydtls' was used but + # DTLS support isn't configured. + AC_MSG_WARN([==> Using the configure options '--with-gnutls', '--with-openssl', '--with-mbedtls' or '--with-tinydtls' without '--enable-dtls' is useless and will be ignored.]) + fi +fi +if test "x$with_submodule_tinydtls" = "xyes"; then + if test "x$with_tinydtls" = "xno"; then + # Give an advice that '--with-submodule-tinydtls' is useless if tinydtls is not also enabled. + AC_MSG_WARN([==> Using the configure option '--with-submodule-tinydtls' without '--with-tinydtls' is useless and it will be ignored.]) + fi +fi + +# O.K. the user hasn't de-selected DTLS +if test "x$build_dtls" = "xyes"; then + # The user can't select multiple crypto libraries. + TLSCOUNT=0 + if test "x$with_gnutls" = "xyes"; then + TLSCOUNT=`expr $TLSCOUNT + 1` + fi + if test "x$with_openssl" = "xyes"; then + TLSCOUNT=`expr $TLSCOUNT + 1` + fi + if test "x$with_mbedtls" = "xyes"; then + TLSCOUNT=`expr $TLSCOUNT + 1` + fi + if test "x$with_tinydtls" = "xyes"; then + TLSCOUNT=`expr $TLSCOUNT + 1` + fi + if test "$TLSCOUNT" -gt 1; then + AC_MSG_ERROR([==> You can't use more than 1 of the options '--with-gnutls', '--with-openssl', '--with-mbedtls' or '--with-tinydtls' at the same time while '--enable-dtls' is selected! + ==> Please note, the option '--enable-dtls' is turned on by default if not explicitly disabled!]) + fi + + # Check for all possible usable and supported SSL crypto libraries + # GnuTLS + PKG_CHECK_MODULES([GnuTLS], + [gnutls], + [have_gnutls="yes"], + [have_gnutls="no"]) + + # OpenSSL + PKG_CHECK_MODULES([OpenSSL], + [openssl], + [have_openssl="yes"], + [have_openssl="no"]) + + # Mbed TLS [does not have mbedtls.pc pkg-config file] + AC_CHECK_LIB(mbedtls, mbedtls_version_get_string, + [have_mbedtls="yes"; MbedTLS_CFLAGS="" ; MbedTLS_LIBS="-lmbedtls -lmbedcrypto -lmbedx509"], + [have_mbedtls="no"], -lmbedx509 -lmbedcrypto) + if test "x$have_mbedtls" = "xyes"; then + if test "x$cross_compiling" = "xyes" ; then + # Have no option but to do this + mbedtls_version=$mbedtls_version_required + else + # Get actual library version + AC_LANG_PUSH(C) + local_MbedTLS_save_LIBS=$LIBS + LIBS="$MbedTLS_LIBS $LIBS" + AC_LINK_IFELSE([dnl + AC_LANG_SOURCE( + [[#include + #include + int main () { + char str[20]; + mbedtls_version_get_string(str); + fprintf(stdout,"%s\n",str); + return 0; + }]])], + [mbedtls_version=$(./conftest$EXEEXT)], + [AC_MSG_WARN(Failed to determine Mbed TLS version) + have_mbedtls=no]) + LIBS=$local_MbedTLS_save_LIBS + AC_LANG_POP(C) + fi + fi + + if test "${TinyDTLS_CFLAGS+set}" = "set"; then + tinydtls_cflags_overridden="yes" + fi + if test "${TinyDTLS_LIBS+set}" = "set"; then + tinydtls_libs_overridden="yes" + fi + # TinyDTLS + PKG_CHECK_MODULES([TinyDTLS], + [tinydtls], + [have_tinydtls="yes"], + [have_tinydtls="no"]) + + # TBD ? + + # The user wants to use explicit GnuTLS if '--with-gnutls' was set. + if test "x$with_gnutls" = "xyes"; then + # Some more sanity checking. + if test "x$have_gnutls" != "xyes"; then + AC_MSG_ERROR([==> You want to build libcoap with DTLS support by the GnuTLS library but pkg-config file 'gnutls.pc' could not be found! + Install the package(s) that contains the development files for GnuTLS, + or select a different TLS library or disable the DTLS support using '--disable-dtls'.]) + fi + AC_MSG_NOTICE([The use of GnuTLS was explicitly requested with configure option '--with-gnutls'!]) + + # check for valid GnuTLS version + gnutls_version=`$PKG_CONFIG --modversion gnutls` + AX_CHECK_GNUTLS_VERSION + have_openssl="no" # don't confuse AC_MSG_RESULT at the end of the script + have_mbedtls="no" # don't confuse AC_MSG_RESULT at the end of the script + have_tinydtls="no" # don't confuse AC_MSG_RESULT at the end of the script + fi + + # The user wants to use explicit OpenSSL if '--with-openssl was set'. + if test "x$with_openssl" = "xyes"; then + # Some more sanity checking. + if test "x$have_openssl" != "xyes"; then + AC_MSG_ERROR([==> You want to build libcoap with DTLS support by the OpenSSL library but pkg-config file 'openssl.pc' could not be found! + Install the package(s) that contains the development files for OpenSSL, + or select a different TLS library or disable the DTLS support using '--disable-dtls'.]) + fi + AC_MSG_NOTICE([The use of OpenSSL was explicitly requested with configure option '--with-openssl'!]) + + # check for valid OpenSSL version + openssl_version=`$PKG_CONFIG --modversion openssl` + AX_CHECK_OPENSSL_VERSION + have_gnutls="no" # don't confuse AC_MSG_RESULT at the end of the script + have_mbedtls="no" # don't confuse AC_MSG_RESULT at the end of the script + have_tinydtls="no" # don't confuse AC_MSG_RESULT at the end of the script + fi + + # The user wants to use explicit Mbed TLS if '--with-mbedtls was set'. + if test "x$with_mbedtls" = "xyes"; then + # Some more sanity checking. + if test "x$have_mbedtls" != "xyes"; then + AC_MSG_ERROR([==> You want to build libcoap with DTLS support by the Mbed TLS library but library 'mbedtls' could not be found! + Install the package(s) that contains the development files for Mbed TLS, + or select a different TLS library or disable the DTLS support using '--disable-dtls'.]) + fi + AC_MSG_NOTICE([The use of Mbed TLS was explicitly requested with configure option '--with-mbedtls'!]) + + # check for valid Mbed TLS version (mbedtls.pc does not exist - hmm) + # mbedtls_version determined previously + AX_CHECK_MBEDTLS_VERSION + have_gnutls="no" # don't confuse AC_MSG_RESULT at the end of the script + have_openssl="no" # don't confuse AC_MSG_RESULT at the end of the script + have_tinydtls="no" # don't confuse AC_MSG_RESULT at the end of the script + fi + + # The user wants to use explicit TinyDTLS if '--with-tinydtls was set'. + if test "x$with_tinydtls" = "xyes" ; then + AC_MSG_NOTICE([The use of TinyDTLS was explicitly requested with configure option '--with-tinydtls'!]) + if [ test "x$have_tinydtls" = "xno" ] && [ test "x$with_submodule_tinydtls" = "xexplicit_fallback" ] || [ test "x$with_submodule_tinydtls" = "xyes" ]; then + AC_MSG_NOTICE([Using TinyDTLS submodule over system-provided version because either "--with-submodule-tinydtls" was set or no system-provided TinyDTLS was found.]) + if test -e "$srcdir/ext/tinydtls/dtls.h"; then + AC_CONFIG_SUBDIRS([ext/tinydtls]) + if test "x$enable_shared" = "xyes"; then + auto_TinyDTLS_LIBS="-L\$(top_builddir)/ext/tinydtls -ltinydtls" + else + # Needed as TinyDTLS compiling does not recognize --disable-shared + # and still builds libtinydtls.so which gets linked in otherwise + auto_TinyDTLS_LIBS="-L\$(top_builddir)/ext/tinydtls -l:libtinydtls.a" + fi + have_submodule_tinydtls="yes" + + auto_TinyDTLS_CFLAGS="-I \$(top_srcdir)/ext -I \$(top_srcdir)/ext/tinydtls" + + if test "x$tinydtls_cflags_overridden" != "xyes"; then + TinyDTLS_CFLAGS="$auto_TinyDTLS_CFLAGS" + fi + if test "x$tinydtls_libs_overridden" != "xyes"; then + TinyDTLS_LIBS="$auto_TinyDTLS_LIBS" + fi + else + AC_MSG_ERROR([==> You want to build libcoap with DTLS support using the TinyDTLS submodule library but no suitable version could be found! + Check whether you have updated the TinyDTLS git submodule, use the system-provided version if available (set '--with-submodule-tinydtls=no'), + select a different TLS library or disable the DTLS support using '--disable-dtls'.]) + have_tinydtls="no" # don't confuse AC_MSG_RESULT at the end of the script + have_submodule_tinydtls="no" # don't confuse AC_MSG_RESULT at the end of the script + fi + elif test "x$have_tinydtls" = "xyes"; then + AC_MSG_NOTICE([Using system-provided TinyDTLS]) + tinydtls_version=`$PKG_CONFIG --modversion tinydtls` + AX_CHECK_TINYDTLS_VERSION + have_gnutls="no" # don't confuse AC_MSG_RESULT at the end of the script + have_mbedtls="no" # don't confuse AC_MSG_RESULT at the end of the script + have_openssl="no" # don't confuse AC_MSG_RESULT at the end of the script + else + AC_MSG_ERROR([==> You want to build libcoap with DTLS support using the TinyDTLS library but no suitable version could be found! + Use the submodule TinyDTLS version (set '--with-submodule-tinydtls=yes' and update the git submodule), + ensure that you have a system-provided version of TinyDTLS that can be found using pkg-config (older versions can not), + select a different TLS library or disable the DTLS support using '--disable-dtls'.]) + have_tinydtls="no" # don't confuse AC_MSG_RESULT at the end of the script + fi + + have_gnutls="no" # don't confuse AC_MSG_RESULT at the end of the script + have_openssl="no" # don't confuse AC_MSG_RESULT at the end of the script + have_mbedtls="no" # don't confuse AC_MSG_RESULT at the end of the script + fi + + if test "$TLSCOUNT" -eq 0; then + # The user hasn't requested the use of a specific cryptography library + # we try first GnuTLS for usability ... + if test "x$have_gnutls" = "xyes"; then + gnutls_version=`$PKG_CONFIG --modversion gnutls` + AX_CHECK_GNUTLS_VERSION + AC_MSG_NOTICE([Using auto selected library GnuTLS for DTLS support!]) + with_gnutls_auto="yes" + have_openssl="no" # don't confuse AC_MSG_RESULT at the end of the script + have_mbedtls="no" # don't confuse AC_MSG_RESULT at the end of the script + have_tinydtls="no" # don't confuse AC_MSG_RESULT at the end of the script + + # ... and if not found check OpenSSL is suitable. + elif test "x$have_openssl" = "xyes"; then + openssl_version=`$PKG_CONFIG --modversion openssl` + AX_CHECK_OPENSSL_VERSION + AC_MSG_NOTICE([Using auto selected library OpenSSL for DTLS support!]) + with_openssl_auto="yes" + have_gnutls="no" # don't confuse AC_MSG_RESULT at the end of the script + have_mbedtls="no" # don't confuse AC_MSG_RESULT at the end of the script + have_tinydtls="no" # don't confuse AC_MSG_RESULT at the end of the script + + # ... and if not found check Mbed TLS is suitable. + elif test "x$have_mbedtls" = "xyes"; then + # Mbed TLS [does not have mbedtls.pc pkg-config file] + # mbedtls_version determined previously + AX_CHECK_MBEDTLS_VERSION + AC_MSG_NOTICE([Using auto selected library Mbed TLS for DTLS support!]) + with_mbedtls_auto="yes" + have_gnutls="no" # don't confuse AC_MSG_RESULT at the end of the script + have_openssl="no" # don't confuse AC_MSG_RESULT at the end of the script + have_tinydtls="no" # don't confuse AC_MSG_RESULT at the end of the script + + elif [ test "x$with_tinydtls" = "xyes" ] && [ test "x$have_tinydtls" = "xyes" ]; then + AC_MSG_NOTICE([Using auto selected library TinyDTLS for DTLS support!]) + tinydtls_version=`$PKG_CONFIG --modversion tinydtls` + AX_CHECK_TINYDTLS_VERSION + with_tinydtls_auto="yes" + have_gnutls="no" # don't confuse AC_MSG_RESULT at the end of the script + have_mbedtls="no" # don't confuse AC_MSG_RESULT at the end of the script + have_openssl="no" # don't confuse AC_MSG_RESULT at the end of the script + + + # Note that the TinyDTLS submodule is used only when explicitly requested. + # Giving out an error message if we haven't found at least one crypto library. + else + AC_MSG_ERROR([==> Option '--enable-dtls' is set but none of the needed cryptography libraries GnuTLS, OpenSSL, Mbed TLS or TinyDTLS could be found! + Install at least one of the package(s) that contains the development files for GnuTLS (>= $gnutls_version_required), OpenSSL(>= $openssl_version_required), Mbed TLS(>= $mbedtls_version_required), or TinyDTLS(>= $tinydtls_version_required) + or disable the DTLS support using '--disable-dtls'.]) + fi + fi + + # Saving the DTLS related Compiler flags. + if test "x$with_gnutls" = "xyes" -o "x$with_gnutls_auto" = "xyes"; then + DTLS_CFLAGS="$GnuTLS_CFLAGS" + DTLS_LIBS="$GnuTLS_LIBS" + AC_DEFINE(HAVE_LIBGNUTLS, [1], [Define if the system has libgnutls28]) + fi + if test "x$with_openssl" = "xyes" -o "x$with_openssl_auto" = "xyes"; then + DTLS_CFLAGS="$OpenSSL_CFLAGS" + DTLS_LIBS="$OpenSSL_LIBS" + AC_DEFINE(HAVE_OPENSSL, [1], [Define if the system has libssl1.1]) + fi + if test "x$with_mbedtls" = "xyes" -o "x$with_mbedtls_auto" = "xyes"; then + DTLS_CFLAGS="$MbedTLS_CFLAGS" + DTLS_LIBS="$MbedTLS_LIBS" + AC_DEFINE(HAVE_MBEDTLS, [1], [Define if the system has libmbedtls2.7.10]) + fi + if test "x$with_tinydtls" = "xyes" -o "x$with_tinydtls_auto" = "xyes"; then + DTLS_CFLAGS="$TinyDTLS_CFLAGS" + DTLS_LIBS="$TinyDTLS_LIBS" + AC_DEFINE(HAVE_LIBTINYDTLS, [1], [Define if the system has libtinydtls]) + fi + AC_SUBST(DTLS_CFLAGS) + AC_SUBST(DTLS_LIBS) +fi + +# Define the Library name extension for the TLS the library was linked against +if test "x$with_openssl" = "xyes" -o "x$with_openssl_auto" = "xyes"; then + LIBCOAP_DTLS_LIB_EXTENSION_NAME=-openssl +elif test "x$with_gnutls" = "xyes" -o "x$with_gnutls_auto" = "xyes"; then + LIBCOAP_DTLS_LIB_EXTENSION_NAME=-gnutls +elif test "x$with_mbedtls" = "xyes" -o "x$with_mbedtls_auto" = "xyes"; then + LIBCOAP_DTLS_LIB_EXTENSION_NAME=-mbedtls +elif test "x$with_tinydtls" = "xyes"; then + LIBCOAP_DTLS_LIB_EXTENSION_NAME=-tinydtls +else + LIBCOAP_DTLS_LIB_EXTENSION_NAME=-notls +fi + +LIBCOAP_NAME_SUFFIX="$LIBCOAP_API_VERSION$LIBCOAP_DTLS_LIB_EXTENSION_NAME" + +AC_SUBST(LIBCOAP_NAME_SUFFIX) +AC_SUBST(LIBCOAP_DTLS_LIB_EXTENSION_NAME) +AC_SUBST([DOLLAR_SIGN],[$]) + +# configure options +# __tests__ +AC_ARG_ENABLE([tests], + [AS_HELP_STRING([--enable-tests], + [Enable building the binary testsuite. Requires --enable-static [default=no]])], + [build_tests="$enableval"], + [build_tests="no"]) + +if test "x$build_tests" = "xyes"; then + PKG_CHECK_MODULES([CUNIT], + [cunit], + [have_cunit=yes + AC_DEFINE(HAVE_LIBCUNIT, [1], [Define if the system has libcunit])], + [have_cunit=no + AC_MSG_WARN([==> You want to build the testing binary but the pkg-config file cunit.pc could not be found or installed CUnit version is too old!]) + AC_MSG_ERROR([==> Install the package(s) that contains the development files for CUnit or disable the testing binary using '--disable-tests'.]) + ]) + if test "x$enable_static" = "xno"; then + enable_static=yes + AC_MSG_WARN([--enable-tests requires --enable-static which is now enabled.]) + fi +fi +AM_CONDITIONAL(HAVE_CUNIT, [test "x$CUNIT_LIBS" != "x"]) + +# configure options +# __examples__ +AC_ARG_ENABLE([examples], + [AS_HELP_STRING([--enable-examples], + [Enable building the example binaries [default=yes]])], + [build_examples="$enableval"], + [build_examples="yes"]) + +AM_CONDITIONAL(BUILD_EXAMPLES, [test "x$build_examples" = "xyes"]) + +# configure options +# __examples-source +AC_ARG_ENABLE([examples-source], + [AS_HELP_STRING([--enable-examples-source], + [Enable installing example source to DATAROOTDIR/libcoap/examples [default=yes]])], + [build_examples_source="$enableval"], + [build_examples_source="yes"]) + +AM_CONDITIONAL(BUILD_EXAMPLES_SOURCE, [test "x$build_examples_source" = "xyes"]) + +# configure options +# __gcov__ +AC_ARG_ENABLE([gcov], + [AS_HELP_STRING([--enable-gcov], + [Enable building with gcov test coverage support [default=no]])], + [build_gcov="$enableval"], + [build_gcov="no" + AC_MSG_WARN([gcov is disabled]) + ]) + +if test "x$build_gcov" = "xyes"; then + if test "x$GCC" != "xyes"; then + AC_MSG_ERROR([Currently, gcov is assumed to work with GCC-compatible compilers only.]) + else + AX_CHECK_COMPILE_FLAG([-fprofile-arcs], [CFLAGS="$CFLAGS -fprofile-arcs"]) + AX_CHECK_COMPILE_FLAG([-ftest-coverage], [CFLAGS="$CFLAGS -ftest-coverage"]) + # FIXME: clang complains about '--coverage' + AX_CHECK_COMPILE_FLAG([--coverage], [CFLAGS="$CFLAGS --coverage -O0" LDFLAGS="$LDFLAGS --coverage"]) + fi +fi + +# configure options +# __license-install__ +AC_ARG_ENABLE([license-install], + [AS_HELP_STRING([--enable-license-install], + [Enable installing LICENSE to DOCDIR [default=yes]])], + [build_license_install="$enableval"], + [build_license_install="yes"]) + +AM_CONDITIONAL(BUILD_LICENSE_INSTALL, [test "x$build_license_install" = "xyes"]) + +# configure options +# __tcp__ +AC_ARG_ENABLE([tcp], + [AS_HELP_STRING([--enable-tcp], + [Enable building with TCP support [default=yes]])], + [build_tcp="$enableval"], + [build_tcp="yes"]) + +AC_DEFINE(COAP_DISABLE_TCP, [0], [Define to 1 to build without TCP support.]) +AS_IF([test "x$build_tcp" != "xyes"], [AC_DEFINE(COAP_DISABLE_TCP, [1])]) +AC_SUBST(COAP_DISABLE_TCP) + +# configure options +# __async__ +AC_ARG_ENABLE([async], + [AS_HELP_STRING([--enable-async], + [Enable building with support for separate responses [default=yes]])], + [build_async="$enableval"], + [build_async="yes"]) + +AS_IF([test "x$build_async" != "xyes"], + [AC_DEFINE(WITHOUT_ASYNC, [1], [Define to build without support for separate responses.])]) + +# configure options +# __add_default_names__ +AC_ARG_ENABLE([add-default-names], + [AS_HELP_STRING([--enable-add-default-names], + [Enable adding libraries / examples with default names [default=yes]])], + [build_add_default_names="$enableval"], + [build_add_default_names="yes"]) + +AM_CONDITIONAL(BUILD_ADD_DEFAULT_NAMES, [test "x$build_add_default_names" = "xyes"]) + +# end configure options +####################### + +########################################### +# from configure options independent checks + +# Check for (ex)ctags binary +# The needed ctags binary name differs on FreeBSD and Linux, on Linux +# systems we search for 'ctags', on FreeBSD for 'exctags' +case $host in + # FreeBSD has exctags from the ctags port + *-freebsd1*) + AC_ARG_VAR([CTAGS_PROG],[the 'exctags' program to use for make target 'update-map-file']) + AC_PATH_PROG([CTAGS_PROG],[exctags]) + ;; + + *) + # Linux distributions have exuberant-ctags + AC_ARG_VAR([CTAGS_PROG],[the 'ctags' program to use for make target 'update-map-file']) + AC_PATH_PROG([CTAGS_PROG],[ctags]) + ;; + +esac + +if test "x$CTAGS_PROG" = "x"; then + AC_MSG_NOTICE([==> Note: '(ex)ctags' command not found!]) + AC_MSG_WARN([==> Without ctags you will be unable to run the target 'update-map-file'!]) + AC_MSG_WARN([==> This is no problem if you just want to build the library libcoap.]) +else + if test "`$CTAGS_PROG --help | grep '\---kinds'`" = ""; then + AC_MSG_NOTICE([==> Note: Your ctags binary does not support '--c-kinds'!]) + AC_MSG_NOTICE([==> Most likely, you are using the GNU Emacs ctag and not exuberant ctag.]) + AC_MSG_WARN([==> This option is required for the target 'update-map-file'.]) + AC_MSG_WARN([==> which is not a problem if you just want to build the library libcoap.]) + fi +fi + +# Checks for header files. +AC_CHECK_HEADERS([assert.h arpa/inet.h limits.h netdb.h netinet/in.h \ + pthread.h \ + stdlib.h string.h strings.h sys/socket.h sys/time.h \ + time.h unistd.h sys/unistd.h syslog.h sys/ioctl.h net/if.h]) + +# For epoll, need two headers (sys/epoll.h sys/timerfd.h), but set up one #define +AC_CHECK_HEADER([sys/epoll.h]) +AC_CHECK_HEADER([sys/timerfd.h]) +if test "x$ac_cv_header_sys_epoll_h" = "xyes" -a "x$ac_cv_header_sys_timerfd_h" = "xyes"; then + have_epoll="yes" + AC_ARG_WITH([epoll], + [AS_HELP_STRING([--with-epoll], + [Use epoll for I/O handling [if O/S supports it]])], + [with_epoll="$withval"], + [with_epoll="yes"]) +else + have_epoll="no" + if test "x$with_epoll" = "xyes"; then + AC_MSG_WARN([==> Underlying O/S does not support epoll - --with-epoll ignored.]) + with_epoll="no" + fi +fi + +if test "x$with_epoll" = "xyes"; then + AC_DEFINE(COAP_EPOLL_SUPPORT, 1, [Define if the system has epoll support]) +fi + +AC_ARG_ENABLE([small-stack], + [AS_HELP_STRING([--enable-small-stack], + [Use small-stack if the available stack space is restricted [default=no]])], + [enable_small_stack="$enableval"], + [enable_small_stack="no"]) + +if test "x$enable_small_stack" = "xyes"; then + AC_DEFINE(COAP_CONSTRAINED_STACK, 1, [Define if the system has small stack size]) +fi + +AC_ARG_ENABLE([server-mode], + [AS_HELP_STRING([--enable-server-mode], + [Enable CoAP server mode supporting code [default=yes]])], + [enable_server_mode="$enableval"], + [enable_server_mode="yes"]) + +if test "x$enable_server_mode" = "xyes"; then + AC_DEFINE(COAP_SERVER_SUPPORT, 1, [Define if libcoap supports server mode code]) +fi +AM_CONDITIONAL(HAVE_SERVER_SUPPORT, [test "x$enable_server_mode" = "xyes"]) + +AC_ARG_ENABLE([client-mode], + [AS_HELP_STRING([--enable-client-mode], + [Enable CoAP client mode supporting code [default=yes]])], + [enable_client_mode="$enableval"], + [enable_client_mode="yes"]) + +if test "x$enable_client_mode" = "xyes"; then + AC_DEFINE(COAP_CLIENT_SUPPORT, 1, [Define if libcoap supports client mode code]) +fi +AM_CONDITIONAL(HAVE_CLIENT_SUPPORT, [test "x$enable_client_mode" = "xyes"]) +if test "x$enable_server_mode" != "xyes" -a "x$enable_client_mode" != "xyes" ; then + AC_MSG_ERROR([==> One or both of '--enable-server-mode' and '--enable-client-mode' need to be set!]) +fi + +# Checks for typedefs, structures, and compiler characteristics. +AC_TYPE_SIZE_T +AC_TYPE_SSIZE_T + +# Checks for library functions. +AC_CHECK_FUNCS([memset select socket strcasecmp strrchr getaddrinfo \ + strnlen malloc pthread_mutex_lock getrandom if_nametoindex]) + +# Check if -lsocket -lnsl is required (specifically Solaris) +AC_SEARCH_LIBS([socket], [socket]) +AC_SEARCH_LIBS([inet_ntop], [nsl]) + +# Check if clock_gettime() requires librt, when available +AC_SEARCH_LIBS([clock_gettime], [rt]) + +#check for struct cmsghdr +AC_CHECK_TYPES([struct cmsghdr],,,[ +AC_INCLUDES_DEFAULT +#include ]) + +AC_MSG_CHECKING([operating system]) + +# Set up here some extra platform depended defines and variables. +# The "ADDITIONAL_CFLAGS" is need as this stand-alone definition +# for the doxygen part. +case $host in + *-linux* | *-uclinux*) + AC_MSG_RESULT([Linux]) + ADDITIONAL_CFLAGS="-D_GNU_SOURCE" + + # Not yet needed but if some code definitions have to depend on the platform. + #AC_DEFINE(OS_LINUX, 1, [Linux backend]) + #AC_SUBST(OS_LINUX) + ;; + + *-cygwin*) + AC_MSG_RESULT([Cygwin]) + ADDITIONAL_CFLAGS="-D_GNU_SOURCE -D_CYGWIN_ENV" + LDFLAGS="-no-undefined $LDFLAGS" + ;; + + *-solaris*) + AC_MSG_RESULT([Solaris]) + # set _XOPEN_SOURCE and _XOPEN_SOURCE_EXTENDED to enable XPG4v2 (POSIX 2004) + # set __EXTENSION__ to shut up feature test macros that restrict -std=c99 + # to only C99 (and nothing newer) + ADDITIONAL_CFLAGS="-D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=600 -D__EXTENSIONS__=1" + ;; + + *-darwin*) + AC_MSG_RESULT([Darwin]) + ADDITIONAL_CFLAGS="-D_GNU_SOURCE" + + AC_DEFINE(__APPLE_USE_RFC_3542, 1, [Define this to 1 for ancillary data on MacOS]) + + # Not yet needed but if some code definitions have to depend on the platform. + #AC_DEFINE(OS_MACOS, 1, [MacOS backend]) + #AC_SUBST(OS_MACOS) + ;; + + *-freebsd1*) + AC_MSG_RESULT([FreeBSD-1x]) + ADDITIONAL_CFLAGS="-D_GNU_SOURCE" + ;; + + *kfreebsd*) + AC_MSG_RESULT([kFreeBSD]) + ADDITIONAL_CFLAGS="-D_GNU_SOURCE" + ;; + + *) + AC_MSG_WARN([==> Currently unsupported operating system '${host}' !]) + AC_MSG_ERROR([==> If you can provide patches to support your operating system please write to 'libcoap-developers@lists.sourceforge.net'.]) +esac + +# Exporting the PREDEFINED_CFLAGS definition +PREDEFINED_CFLAGS=`echo $ADDITIONAL_CFLAGS | $SED -e 's/-D//g'` +AC_SUBST(PREDEFINED_CFLAGS) + +# And finally combining the CFLAGS together ... +CFLAGS="$CFLAGS $ADDITIONAL_CFLAGS" + +# Override the various template files, currently just makefiles and the +# pkgconfig *.pc file. +# Later if the API version is changing don't forget to change the +# libcoap-$LIBCOAP_API_VERSION.pc.in file too!! You will have to change +# the 'Cflags' variable to something like +# Cflags: -I${includedir}/coap-@LIBCOAP_API_VERSION@ +# +AC_CONFIG_FILES([ +Makefile +coap_config.h.lwip +coap_config.h.riot +coap_config.h.windows +doc/Makefile +examples/Makefile +include/coap$LIBCOAP_API_VERSION/coap.h +include/coap$LIBCOAP_API_VERSION/coap.h.windows +man/coap.txt +man/coap_async.txt +man/coap_attribute.txt +man/coap_block.txt +man/coap_cache.txt +man/coap_context.txt +man/coap_encryption.txt +man/coap_endpoint_client.txt +man/coap_endpoint_server.txt +man/coap_handler.txt +man/coap_io.txt +man/coap_keepalive.txt +man/coap_logging.txt +man/coap_observe.txt +man/coap_pdu_access.txt +man/coap_pdu_setup.txt +man/coap_recovery.txt +man/coap_resource.txt +man/coap_session.txt +man/coap_string.txt +man/coap_tls_library.txt +man/coap-client.txt +man/coap-server.txt +man/coap-rd.txt +man/Makefile +tests/test_common.h +tests/Makefile +tests/oss-fuzz/Makefile.ci +libcoap-$LIBCOAP_NAME_SUFFIX.pc:libcoap-$LIBCOAP_API_VERSION.pc.in +]) + +AC_OUTPUT + +AC_MSG_RESULT([ +libcoap configuration summary: + libcoap package version : "$PACKAGE_VERSION" + libcoap library version : "$LIBCOAP_SO_VERSION" + libcoap API version : "$LIBCOAP_API_VERSION" + libcoap DTLS lib extn : "$LIBCOAP_DTLS_LIB_EXTENSION_NAME" + host system : "$host"]); +if test "x$enable_server_mode" = "xyes"; then + AC_MSG_RESULT([ build with server support: "yes"]) +else + AC_MSG_RESULT([ build with server support: "no"]) +fi +if test "x$enable_client_mode" = "xyes"; then + AC_MSG_RESULT([ build with client support: "yes"]) +else + AC_MSG_RESULT([ build with client support: "no"]) +fi +if test "x$build_tcp" != "xno"; then + AC_MSG_RESULT([ build with TCP support : "yes"]) +else + AC_MSG_RESULT([ build with TCP support : "no"]) +fi +if test "x$with_gnutls" = "xyes" -o "x$with_gnutls_auto" = "xyes"; then + AC_MSG_RESULT([ build DTLS support : "yes"]) + AC_MSG_RESULT([ --> GnuTLS around : "yes" (found GnuTLS $gnutls_version)]) + AC_MSG_RESULT([ GNUTLS_CFLAGS : "$GnuTLS_CFLAGS"]) + AC_MSG_RESULT([ GNUTLS_LIBS : "$GnuTLS_LIBS"]) +fi +if test "x$with_openssl" = "xyes" -o "x$with_openssl_auto" = "xyes"; then + AC_MSG_RESULT([ build DTLS support : "yes"]) + AC_MSG_RESULT([ --> OpenSSL around : "yes" (found OpenSSL $openssl_version)]) + AC_MSG_RESULT([ OPENSSL_CFLAGS : "$OpenSSL_CFLAGS"]) + AC_MSG_RESULT([ OPENSSL_LIBS : "$OpenSSL_LIBS"]) +fi +if test "x$with_mbedtls" = "xyes" -o "x$with_mbedtls_auto" = "xyes"; then + AC_MSG_RESULT([ build DTLS support : "yes"]) + AC_MSG_RESULT([ --> Mbed TLS around : "yes" (found Mbed TLS $mbedtls_version)]) + AC_MSG_RESULT([ MBEDTLS_CFLAGS : "$MbedTLS_CFLAGS"]) + AC_MSG_RESULT([ MBEDTLS_LIBS : "$MbedTLS_LIBS"]) +fi +if test "x$with_tinydtls" = "xyes"; then + AC_MSG_RESULT([ build DTLS support : "yes"]) + if test "x$have_submodule_tinydtls" = "xyes"; then + AC_MSG_RESULT([ --> TinyDTLS around : "yes" (submodule)]) + else + AC_MSG_RESULT([ --> TinyDTLS around : "yes (found TinyDTLS $tinydtls_version)"]) + fi + AC_MSG_RESULT([ TinyDTLS_CFLAGS : "$DTLS_CFLAGS"]) + AC_MSG_RESULT([ TinyDTLS_LIBS : "$DTLS_LIBS"]) +fi +if test "x$build_dtls" != "xyes"; then + AC_MSG_RESULT([ build DTLS support : "no"]) +fi +if test "x$build_add_default_names" = "xyes"; then + AC_MSG_RESULT([ add default names : "yes"]) +else + AC_MSG_RESULT([ add default names : "no"]) +fi +if test "x$have_epoll" = "xyes"; then + AC_MSG_RESULT([ build using epoll : "$with_epoll"]) +fi +AC_MSG_RESULT([ enable small stack size : "$enable_small_stack"]) +if test "x$build_async" != "xno"; then + AC_MSG_RESULT([ enable separate responses: "yes"]) +else + AC_MSG_RESULT([ enable separate responses: "no"]) +fi +if test "x$build_doxygen" = "xyes"; then + AC_MSG_RESULT([ build doxygen pages : "yes"]) + AC_MSG_RESULT([ --> Doxygen around : "yes" ($DOXYGEN $doxygen_version)]) + if test "x$DOT" = "x"; then + AC_MSG_RESULT([ --> dot around : "no" (DOT not found!)]) + else + AC_MSG_RESULT([ --> dot around : "yes" ($DOT $dot_version)]) + fi +else + if test "x$build_doxygen" = "xno"; then + AC_MSG_RESULT([ build doxygen pages : "no"]) + fi +fi +if test "x$build_manpages" = "xyes"; then + AC_MSG_RESULT([ build man pages : "yes"]) +else + AC_MSG_RESULT([ build man pages : "no"]) +fi +if test "x$build_tests" = "xyes"; then + AC_MSG_RESULT([ build unit test binary : "yes"]) +else + AC_MSG_RESULT([ build unit test binary : "no"]) +fi +if test "x$build_examples" = "xyes"; then + AC_MSG_RESULT([ build examples : "yes"]) +else + AC_MSG_RESULT([ build examples : "no"]) +fi +if test "x$build_examples_source" = "xyes"; then + AC_MSG_RESULT([ install examples source : "yes"]) +else + AC_MSG_RESULT([ install examples source : "no"]) +fi +if test "x$build_gcov" = "xyes"; then + AC_MSG_RESULT([ build with gcov support : "yes"]) +else + AC_MSG_RESULT([ build with gcov support : "no"]) +fi +if test "x$enable_shared" = "xyes"; then + AC_MSG_RESULT([ build shared library : "yes"]) +else + AC_MSG_RESULT([ build shared library : "no"]) +fi +if test "x$enable_static" = "xyes"; then + AC_MSG_RESULT([ build static library : "yes"]) +else + AC_MSG_RESULT([ build static library : "no"]) +fi diff --git a/examples/espidf-coap-server/components/libcoap/doc/Doxyfile.in b/examples/espidf-coap-server/components/libcoap/doc/Doxyfile.in new file mode 100644 index 0000000..782410d --- /dev/null +++ b/examples/espidf-coap-server/components/libcoap/doc/Doxyfile.in @@ -0,0 +1,2612 @@ +# Doxyfile 1.9.1 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the configuration +# file that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# https://www.gnu.org/software/libiconv/ for the list of possible encodings. +# The default value is: UTF-8. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + +PROJECT_NAME = @PACKAGE_NAME@ + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. + +PROJECT_NUMBER = @PACKAGE_VERSION@ + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = + +# With the PROJECT_LOGO tag one can specify a logo or an icon that is included +# in the documentation. The maximum height of the logo should not exceed 55 +# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy +# the logo to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. + +OUTPUT_DIRECTORY = + +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- +# directories (in 2 levels) under the output directory of each output format and +# will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. +# The default value is: NO. + +CREATE_SUBDIRS = NO + +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, +# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), +# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, +# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, +# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, +# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, +# Ukrainian and Vietnamese. +# The default value is: English. + +OUTPUT_LANGUAGE = English + +# The OUTPUT_TEXT_DIRECTION tag is used to specify the direction in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all generated output in the proper direction. +# Possible values are: None, LTR, RTL and Context. +# The default value is: None. + +OUTPUT_TEXT_DIRECTION = None + +# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. +# The default value is: YES. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief +# description. +# The default value is: NO. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. +# The default value is: NO. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. + +FULL_PATH_NAMES = NO + +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. + +JAVADOC_AUTOBRIEF = YES + +# If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line +# such as +# /*************** +# as being the beginning of a Javadoc-style comment "banner". If set to NO, the +# Javadoc-style will behave just like regular comments and it will not be +# interpreted by doxygen. +# The default value is: NO. + +JAVADOC_BANNER = NO + +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. + +MULTILINE_CPP_IS_BRIEF = NO + +# By default Python docstrings are displayed as preformatted text and doxygen's +# special commands cannot be used. By setting PYTHON_DOCSTRING to NO the +# doxygen's special commands can be used and the contents of the docstring +# documentation blocks is shown as doxygen documentation. +# The default value is: YES. + +PYTHON_DOCSTRING = YES + +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new +# page for each member. If set to NO, the documentation of a member will be part +# of the file/class/namespace that contains it. +# The default value is: NO. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "sideeffect=@par Side Effects:\n" +# will allow you to put the command \sideeffect (or @sideeffect) in the +# documentation, which will result in a user-defined paragraph with heading +# "Side Effects:". You can put \n's in the value part of an alias to insert +# newlines (in the resulting output). You can put ^^ in the value part of an +# alias to insert a newline as if a physical newline was in the original file. +# When you need a literal { or } or , in the value part of an alias you have to +# escape them by means of a backslash (\), this can lead to conflicts with the +# commands \{ and \} for these it is advised to use the version @{ and @} or use +# a double escape (\\{ and \\}) + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice +# sources only. Doxygen will then generate output that is more tailored for that +# language. For instance, namespaces will be presented as modules, types will be +# separated into more groups, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_SLICE = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, JavaScript, +# Csharp (C#), C, C++, D, PHP, md (Markdown), Objective-C, Python, Slice, VHDL, +# Fortran (fixed format Fortran: FortranFixed, free formatted Fortran: +# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser +# tries to guess whether the code is fixed or free formatted code, this is the +# default for Fortran type files). For instance to make doxygen treat .inc files +# as Fortran files (default is PHP), and .f files as C (default is Fortran), +# use: inc=Fortran f=C. +# +# Note: For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. When specifying no_extension you should add +# * to the FILE_PATTERNS. +# +# Note see also the list of default file extension mappings. + +EXTENSION_MAPPING = + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See https://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. + +MARKDOWN_SUPPORT = YES + +# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up +# to that level are automatically included in the table of contents, even if +# they do not have an id attribute. +# Note: This feature currently applies only to Markdown headings. +# Minimum value: 0, maximum value: 99, default value: 5. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +TOC_INCLUDE_HEADINGS = 5 + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +# The default value is: NO. + +DISTRIBUTE_GROUP_DOC = NO + +# If one adds a struct or class to a group and this option is enabled, then also +# any nested class or struct is added to the same group. By default this option +# is disabled and one has to add nested compounds explicitly via \ingroup. +# The default value is: NO. + +GROUP_NESTED_COMPOUNDS = NO + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. + +TYPEDEF_HIDES_STRUCT = NO + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + +LOOKUP_CACHE_SIZE = 0 + +# The NUM_PROC_THREADS specifies the number threads doxygen is allowed to use +# during processing. When set to 0 doxygen will based this on the number of +# cores available in the system. You can set it explicitly to a value larger +# than 0 to get more control over the balance between CPU load and processing +# speed. At this moment only the input processing can be done using multiple +# threads. Since this is still an experimental feature the default is set to 1, +# which efficively disables parallel processing. Please report any issues you +# encounter. Generating dot graphs in parallel is controlled by the +# DOT_NUM_THREADS setting. +# Minimum value: 0, maximum value: 32, default value: 1. + +NUM_PROC_THREADS = 1 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will +# be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual +# methods of a class will be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIV_VIRTUAL = NO + +# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be +# included in the documentation. +# The default value is: NO. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO, +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. If set to YES, local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO, only methods in the interface are +# included. +# The default value is: NO. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + +EXTRACT_ANON_NSPACES = NO + +# If this flag is set to YES, the name of an unnamed parameter in a declaration +# will be determined by the corresponding definition. By default unnamed +# parameters remain unnamed in the output. +# The default value is: YES. + +RESOLVE_UNNAMED_PARAMS = YES + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO, these classes will be included in the various overviews. This option +# has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# declarations. If set to NO, these declarations will be included in the +# documentation. +# The default value is: NO. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO, these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. + +INTERNAL_DOCS = NO + +# With the correct setting of option CASE_SENSE_NAMES doxygen will better be +# able to match the capabilities of the underlying filesystem. In case the +# filesystem is case sensitive (i.e. it supports files in the same directory +# whose names only differ in casing), the option must be set to YES to properly +# deal with such files in case they appear in the input. For filesystems that +# are not case sensitive the option should be be set to NO to properly deal with +# output files written for symbols that only differ in casing, such as for two +# classes, one named CLASS and the other named Class, and to also support +# references to files without having to specify the exact matching casing. On +# Windows (including Cygwin) and MacOS, users should typically set this option +# to NO, whereas on Linux or other Unix flavors it should typically be set to +# YES. +# The default value is: system dependent. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES, the +# scope will be hidden. +# The default value is: NO. + +HIDE_SCOPE_NAMES = NO + +# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will +# append additional text to a page's title, such as Class Reference. If set to +# YES the compound reference will be hidden. +# The default value is: NO. + +HIDE_COMPOUND_REFERENCE= NO + +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. + +SHOW_INCLUDE_FILES = YES + +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + +SHOW_GROUPED_MEMB_INC = NO + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. +# The default value is: YES. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + +SORT_GROUP_NAMES = YES + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo +# list. This list is created by putting \todo commands in the documentation. +# The default value is: YES. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test +# list. This list is created by putting \test commands in the documentation. +# The default value is: YES. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. + +GENERATE_BUGLIST = NO + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if ... \endif and \cond +# ... \endcond blocks. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES, the +# list will mention the files that were used to generate the documentation. +# The default value is: YES. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files containing +# the reference definitions. This must be a list of .bib files. The .bib +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. See also \cite for info how to create references. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. + +QUIET = YES + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. + +WARNINGS = YES + +# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. + +WARN_IF_UNDOCUMENTED = YES + +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some parameters +# in a documented function, or documenting parameters that don't exist or using +# markup commands wrongly. +# The default value is: YES. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO, doxygen will only warn about wrong or incomplete +# parameter documentation, but not about the absence of documentation. If +# EXTRACT_ALL is set to YES then this flag will automatically be disabled. +# The default value is: NO. + +WARN_NO_PARAMDOC = NO + +# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when +# a warning is encountered. If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS +# then doxygen will continue running as if WARN_AS_ERROR tag is set to NO, but +# at the end of the doxygen process doxygen will return with a non-zero status. +# Possible values are: NO, YES and FAIL_ON_WARNINGS. +# The default value is: NO. + +WARN_AS_ERROR = YES + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# The default value is: $file:$line: $text. + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING +# Note: If this tag is empty the current directory is searched. + +INPUT = @top_srcdir@/doc/main.md \ + @top_srcdir@/doc/module_api_wrap.h \ + @top_srcdir@/src \ + @top_srcdir@/include/coap@LIBCOAP_API_VERSION@ \ + @top_builddir@/doc/man_tmp + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# libiconv (or the iconv built into libc) for the transcoding. See the libiconv +# documentation (see: +# https://www.gnu.org/software/libiconv/) for the list of possible encodings. +# The default value is: UTF-8. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# read by doxygen. +# +# Note the list of default checked file patterns might differ from the list of +# default file extension mappings. +# +# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, +# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, +# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, +# *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C comment), +# *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f18, *.f, *.for, *.vhd, *.vhdl, +# *.ucf, *.qsf and *.ice. + +FILE_PATTERNS = + +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. + +RECURSIVE = NO + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = @top_srcdir@/src/coap_io_lwip.c \ + @top_srcdir@/src/coap_io_riot.c \ + @top_srcdir@/include/coap@LIBCOAP_API_VERSION@/lwippools.h \ + @top_srcdir@/include/coap@LIBCOAP_API_VERSION@/uthash.h \ + @top_srcdir@/include/coap@LIBCOAP_API_VERSION@/utlist.h + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. +# The default value is: NO. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories use the pattern */test/* + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). + +EXAMPLE_PATH = @top_builddir@/doc/man_html + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command: +# +# +# +# where is the value of the INPUT_FILTER tag, and is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = + +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. + +SOURCE_BROWSER = YES + +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# classes and enums directly into the documentation. +# The default value is: NO. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# entity all documented functions referencing it will be listed. +# The default value is: NO. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. + +REFERENCES_LINK_SOURCE = YES + +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +SOURCE_TOOLTIPS = YES + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see https://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. +# The default value is: NO. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a +# verbatim copy of the header file for each class for which an include is +# specified. Set to NO to disable this. +# See also: Section \class. +# The default value is: YES. + +VERBATIM_HEADERS = YES + +# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the +# clang parser (see: +# http://clang.llvm.org/) for more accurate parsing at the cost of reduced +# performance. This can be particularly helpful with template rich C++ code for +# which doxygen's built-in parser lacks the necessary type information. +# Note: The availability of this option depends on whether or not doxygen was +# generated with the -Duse_libclang=ON option for CMake. +# The default value is: NO. + +CLANG_ASSISTED_PARSING = NO + +# If clang assisted parsing is enabled and the CLANG_ADD_INC_PATHS tag is set to +# YES then doxygen will add the directory of each input to the include path. +# The default value is: YES. + +CLANG_ADD_INC_PATHS = YES + +# If clang assisted parsing is enabled you can provide the compiler with command +# line options that you would normally use when invoking the compiler. Note that +# the include paths will already be set by doxygen for the files and directories +# specified with INPUT and INCLUDE_PATH. +# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. + +CLANG_OPTIONS = + +# If clang assisted parsing is enabled you can provide the clang parser with the +# path to the directory containing a file called compile_commands.json. This +# file is the compilation database (see: +# http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html) containing the +# options used when the source files were built. This is equivalent to +# specifying the -p option to a clang tool, such as clang-check. These options +# will then be passed to the parser. Any options specified with CLANG_OPTIONS +# will be added as well. +# Note: The availability of this option depends on whether or not doxygen was +# generated with the -Duse_libclang=ON option for CMake. + +CLANG_DATABASE_PATH = + +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all +# compounds will be generated. Enable this if the project contains a lot of +# classes, structs, unions or interfaces. +# The default value is: YES. + +ALPHABETICAL_INDEX = NO + +# In case all classes in a project start with a common prefix, all classes will +# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag +# can be used to specify a prefix (or a list of prefixes) that should be ignored +# while generating the index headers. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output +# The default value is: YES. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each +# generated HTML page (for example: .htm, .php, .asp). +# The default value is: .html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a user-defined HTML header file for +# each generated HTML page. If the tag is left blank doxygen will generate a +# standard header. +# +# To get valid HTML the header file that includes any scripts and style sheets +# that doxygen needs, which is dependent on the configuration options used (e.g. +# the setting GENERATE_TREEVIEW). It is highly recommended to start with a +# default header using +# doxygen -w html new_header.html new_footer.html new_stylesheet.css +# YourConfigFile +# and then modify the file new_header.html. See also section "Doxygen usage" +# for information on how to generate the default header that doxygen normally +# uses. +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. For a description +# of the possible markers and block names see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each +# generated HTML page. If the tag is left blank doxygen will generate a standard +# footer. See HTML_HEADER for more information on how to generate a default +# footer and what special commands can be used inside the footer. See also +# section "Doxygen usage" for information on how to generate the default footer +# that doxygen normally uses. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style +# sheet that is used by each HTML page. It can be used to fine-tune the look of +# the HTML output. If left blank doxygen will generate a default style sheet. +# See also section "Doxygen usage" for information on how to generate the style +# sheet that doxygen normally uses. +# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as +# it is more robust and this tag (HTML_STYLESHEET) will in the future become +# obsolete. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# cascading style sheets that are included after the standard style sheets +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefore more robust against future updates. +# Doxygen will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). For an example see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# files will be copied as-is; there are no commands or markers available. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen +# will adjust the colors in the style sheet and background images according to +# this color. Hue is specified as an angle on a colorwheel, see +# https://en.wikipedia.org/wiki/Hue for more information. For instance the value +# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 +# purple, and 360 is red again. +# Minimum value: 0, maximum value: 359, default value: 220. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors +# in the HTML output. For a value of 0 the output will use grayscales only. A +# value of 255 will produce the most vivid colors. +# Minimum value: 0, maximum value: 255, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the +# luminance component of the colors in the HTML output. Values below 100 +# gradually make the output lighter, whereas values above 100 make the output +# darker. The value divided by 100 is the actual gamma applied, so 80 represents +# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not +# change the gamma. +# Minimum value: 40, maximum value: 240, default value: 80. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting this +# to YES can help to show when doxygen was last run and thus if the +# documentation is up to date. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_TIMESTAMP = YES + +# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML +# documentation will contain a main index with vertical navigation menus that +# are dynamically created via JavaScript. If disabled, the navigation index will +# consists of multiple levels of tabs that are statically embedded in every HTML +# page. Disable this option to support browsers that do not have JavaScript, +# like the Qt help browser. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_MENUS = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_SECTIONS = YES + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries +# shown in the various tree structured indices initially; the user can expand +# and collapse entries dynamically later on. Doxygen will expand the tree to +# such a level that at most the specified number of entries are visible (unless +# a fully collapsed tree already exceeds this amount). So setting the number of +# entries 1 will produce a full collapsed tree by default. 0 is a special value +# representing an infinite number of entries and will result in a full expanded +# tree by default. +# Minimum value: 0, maximum value: 9999, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files will be +# generated that can be used as input for Apple's Xcode 3 integrated development +# environment (see: +# https://developer.apple.com/xcode/), introduced with OSX 10.5 (Leopard). To +# create a documentation set, doxygen will generate a Makefile in the HTML +# output directory. Running make will produce the docset in that directory and +# running make install will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at +# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy +# genXcode/_index.html for more information. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_DOCSET = NO + +# This tag determines the name of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# The default value is: Doxygen generated docs. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# This tag specifies a string that should uniquely identify the documentation +# set bundle. This should be a reverse domain-name style string, e.g. +# com.mycompany.MyDocSet. Doxygen will append .docset to the name. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. +# The default value is: org.doxygen.Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. +# The default value is: Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_NAME = "libcoap build system" + +# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three +# additional HTML index files: index.hhp, index.hhc, and index.hhk. The +# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop +# (see: +# https://www.microsoft.com/en-us/download/details.aspx?id=21138) on Windows. +# +# The HTML Help Workshop contains a compiler that can convert all HTML output +# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_HTMLHELP = NO + +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be +# written to the html output directory. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_FILE = + +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler (hhc.exe). If non-empty, +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +HHC_LOCATION = + +# The GENERATE_CHI flag controls if a separate .chi index file is generated +# (YES) or that it should be included in the main .chm file (NO). +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +GENERATE_CHI = NO + +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) +# and project file content. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_INDEX_ENCODING = + +# The BINARY_TOC flag controls whether a binary table of contents is generated +# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that +# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help +# (.qch) of the generated HTML documentation. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify +# the file name of the resulting .qch file. The path specified is relative to +# the HTML output folder. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help +# Project output. For more information please see Qt Help Project / Namespace +# (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace). +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt +# Help Project output. For more information please see Qt Help Project / Virtual +# Folders (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-folders). +# The default value is: doc. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_VIRTUAL_FOLDER = doc + +# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom +# filter to add. For more information please see Qt Help Project / Custom +# Filters (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see Qt Help Project / Custom +# Filters (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's filter section matches. Qt Help Project / Filter Attributes (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_SECT_FILTER_ATTRS = + +# The QHG_LOCATION tag can be used to specify the location (absolute path +# including file name) of Qt's qhelpgenerator. If non-empty doxygen will try to +# run qhelpgenerator on the generated .qhp file. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be +# generated, together with the HTML files, they form an Eclipse help plugin. To +# install this plugin and make it available under the help contents menu in +# Eclipse, the contents of the directory containing the HTML and XML files needs +# to be copied into the plugins directory of eclipse. The name of the directory +# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. +# After copying Eclipse needs to be restarted before the help appears. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the Eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have this +# name. Each documentation set should have its own identifier. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# to work a browser that supports JavaScript, DHTML, CSS and frames is required +# (i.e. any modern browser). Windows users are probably better off using the +# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can +# further fine-tune the look of the index. As an example, the default style +# sheet generated by doxygen has an example that shows how to put an image at +# the root of the tree instead of the PROJECT_NAME. Since the tree basically has +# the same information as the tab index, you could consider setting +# DISABLE_INDEX to YES when enabling this option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_TREEVIEW = YES + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. + +TREEVIEW_WIDTH = 250 + +# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +EXT_LINKS_IN_WINDOW = NO + +# If the HTML_FORMULA_FORMAT option is set to svg, doxygen will use the pdf2svg +# tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see +# https://inkscape.org) to generate formulas as SVG images instead of PNGs for +# the HTML output. These images will generally look nicer at scaled resolutions. +# Possible values are: png (the default) and svg (looks nicer but requires the +# pdf2svg or inkscape tool). +# The default value is: png. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FORMULA_FORMAT = png + +# Use this tag to change the font size of LaTeX formulas included as images in +# the HTML documentation. When you change the font size after a successful +# doxygen run you need to manually remove any form_*.png images from the HTML +# output directory to force them to be regenerated. +# Minimum value: 8, maximum value: 50, default value: 10. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANSPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are not +# supported properly for IE 6.0, but are supported on all modern browsers. +# +# Note that when changing this option you need to delete any form_*.png files in +# the HTML output directory before the changes have effect. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_TRANSPARENT = YES + +# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands +# to create new LaTeX commands to be used in formulas as building blocks. See +# the section "Including formulas" for details. + +FORMULA_MACROFILE = + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see +# https://www.mathjax.org) which uses client side JavaScript for the rendering +# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX +# installed or if you want to formulas look prettier in the HTML output. When +# enabled you may also need to install MathJax separately and configure the path +# to it using the MATHJAX_RELPATH option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +USE_MATHJAX = NO + +# When MathJax is enabled you can set the default output format to be used for +# the MathJax output. See the MathJax site (see: +# http://docs.mathjax.org/en/v2.7-latest/output.html) for more details. +# Possible values are: HTML-CSS (which is slower, but has the best +# compatibility), NativeMML (i.e. MathML) and SVG. +# The default value is: HTML-CSS. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the HTML +# output directory using the MATHJAX_RELPATH option. The destination directory +# should contain the MathJax.js script. For instance, if the mathjax directory +# is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax +# Content Delivery Network so you can quickly see the result without installing +# MathJax. However, it is strongly recommended to install a local copy of +# MathJax from https://www.mathjax.org before deployment. +# The default value is: https://cdn.jsdelivr.net/npm/mathjax@2. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest + +# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax +# extension names that should be enabled during MathJax rendering. For example +# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_EXTENSIONS = + +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces +# of code that will be used on startup of the MathJax code. See the MathJax site +# (see: +# http://docs.mathjax.org/en/v2.7-latest/output.html) for more details. For an +# example see the documentation. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_CODEFILE = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for +# the HTML output. The underlying search engine uses javascript and DHTML and +# should work on any modern browser. Note that when using HTML help +# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) +# there is already a search function so this one should typically be disabled. +# For large projects the javascript based search engine can be slow, then +# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to +# search using the keyboard; to jump to the search box use + S +# (what the is depends on the OS and browser, but it is typically +# , /