From b0e2e05964552572f14a1f101764c6ec809d5479 Mon Sep 17 00:00:00 2001 From: wanghan985406 Date: Thu, 21 Dec 2023 07:02:16 +0000 Subject: [PATCH] upload original libcoap release-4.3.4 Signed-off-by: wanghan985406 --- AUTHORS | 8 + BUILDING | 210 + CMakeLists.txt | 923 ++++ CONTRIBUTE | 263 + COPYING | 6 + ChangeLog | 383 ++ Dockerfile | 7 + HOWTO.dual.gnutls | 98 + HOWTO.dual.openssl | 50 + HOWTO.dual.softhsm2 | 90 + HOWTO.pkcs11 | 129 + LICENSE | 124 + Makefile.am | 367 ++ Makefile.libcoap | 5 + NEWS | 0 README | 1 + README.md | 97 + SECURITY.md | 33 + TODO | 27 + autogen.sh | 142 + build-env/.dockerignore | 5 + build-env/Dockerfile.build-env | 7 + build-env/Dockerfile.develop | 36 + build-env/build.sh | 16 + build-env/imagename | 2 + cmake-format.yaml | 25 + cmake/Config.cmake.in | 4 + cmake/FindMbedTLS.cmake | 35 + cmake/FindTinyDTLS.cmake | 88 + cmake_coap_config.h.in | 210 + coap_config.h.contiki | 105 + coap_config.h.riot | 345 ++ coap_config.h.riot.in | 345 ++ coap_config.h.windows | 185 + coap_config.h.windows.in | 185 + configure.ac | 1330 +++++ doc/Doxyfile.in | 2614 ++++++++++ doc/Makefile.am | 298 ++ doc/docbook.local.css | 47 + doc/main.md | 75 + doc/module_api_wrap.h | 21 + doc/upgrade_4.2.1_4.3.0.txt | 431 ++ doc/upgrade_4.3.0_4.3.1.txt | 6 + doc/upgrade_4.3.1_4.3.2.txt | 6 + doc/upgrade_4.3.2_4.3.3.txt | 5 + doc/upgrade_4.3.3_4.3.4.txt | 5 + examples/Makefile.am | 145 + examples/README.etsi_iot | 43 + examples/coap-client.c | 2035 ++++++++ examples/coap-rd.c | 879 ++++ examples/coap-server.c | 3111 ++++++++++++ examples/coap_list.c | 66 + examples/coap_list.h | 52 + examples/contiki/.gitignore | 2 + examples/contiki/Makefile | 33 + examples/contiki/Makefile.contiki | 12 + examples/contiki/README | 24 + examples/contiki/coap_config.h | 1 + examples/contiki/project-conf.h | 7 + examples/contiki/server.c | 192 + examples/etsi_coaptest.sh | 210 + examples/etsi_iot_01.c | 636 +++ examples/etsi_iot_01_largedata.txt | 7 + examples/etsi_testcases.sh | 765 +++ examples/getopt.c | 65 + examples/interop/a_client.conf | 8 + examples/interop/b_server.conf | 8 + examples/interop/c_client.conf | 9 + examples/interop/d_server.conf | 9 + examples/interop/e_client.conf | 8 + examples/interop/f_client.conf | 10 + examples/interop/g_client.conf | 10 + examples/lwip/.gitignore | 10 + examples/lwip/Makefile | 273 + examples/lwip/README | 79 + examples/lwip/client-coap.c | 240 + examples/lwip/client-coap.h | 29 + examples/lwip/client.c | 146 + examples/lwip/config/coap_config.h | 78 + examples/lwip/config/coap_config.h.in | 78 + examples/lwip/config/lwipopts.h | 51 + examples/lwip/config/lwippools.h | 175 + examples/lwip/server-coap.c | 223 + examples/lwip/server-coap.h | 24 + examples/lwip/server.c | 149 + examples/oscore-interop-server.c | 790 +++ examples/oscore_testcases.sh | 261 + examples/riot/.gitignore | 2 + examples/riot/Makefile | 51 + examples/riot/README | 48 + examples/riot/examples_libcoap_client/Kconfig | 19 + .../riot/examples_libcoap_client/Makefile | 67 + .../riot/examples_libcoap_client/Makefile.ci | 49 + .../riot/examples_libcoap_client/README.md | 24 + .../riot/examples_libcoap_client/app.config | 8 + .../examples_libcoap_client/client-coap.c | 253 + .../examples_libcoap_client/client-coap.h | 29 + examples/riot/examples_libcoap_client/main.c | 53 + examples/riot/examples_libcoap_server/Kconfig | 12 + .../riot/examples_libcoap_server/Makefile | 69 + .../riot/examples_libcoap_server/Makefile.ci | 49 + .../riot/examples_libcoap_server/README.md | 25 + .../riot/examples_libcoap_server/app.config | 6 + examples/riot/examples_libcoap_server/main.c | 53 + .../examples_libcoap_server/server-coap.c | 291 ++ .../examples_libcoap_server/server-coap.h | 29 + examples/riot/pkg_libcoap/Kconfig | 258 + examples/riot/pkg_libcoap/Makefile | 15 + examples/riot/pkg_libcoap/Makefile.dep | 10 + examples/riot/pkg_libcoap/Makefile.include | 2 + examples/riot/pkg_libcoap/Makefile.libcoap | 40 + examples/share.libcoap.examples.Makefile | 43 + examples/share.libcoap.examples.README | 9 + examples/tiny.c | 189 + include/coap3/coap.h.in | 72 + include/coap3/coap.h.riot | 67 + include/coap3/coap.h.riot.in | 67 + include/coap3/coap.h.windows | 67 + include/coap3/coap.h.windows.in | 67 + include/coap3/coap_address.h | 305 ++ include/coap3/coap_asn1_internal.h | 91 + include/coap3/coap_async.h | 124 + include/coap3/coap_async_internal.h | 68 + include/coap3/coap_block.h | 443 ++ include/coap3/coap_block_internal.h | 348 ++ include/coap3/coap_cache.h | 234 + include/coap3/coap_cache_internal.h | 116 + include/coap3/coap_crypto_internal.h | 157 + include/coap3/coap_debug.h | 389 ++ include/coap3/coap_debug_internal.h | 36 + include/coap3/coap_dtls.h | 501 ++ include/coap3/coap_dtls_internal.h | 446 ++ include/coap3/coap_encode.h | 127 + include/coap3/coap_event.h | 183 + include/coap3/coap_forward_decls.h | 116 + include/coap3/coap_hashkey_internal.h | 61 + include/coap3/coap_internal.h | 128 + include/coap3/coap_io.h | 81 + include/coap3/coap_io_internal.h | 219 + include/coap3/coap_layers_internal.h | 115 + include/coap3/coap_mem.h | 166 + include/coap3/coap_mutex_internal.h | 118 + include/coap3/coap_net.h | 872 ++++ include/coap3/coap_net_internal.h | 421 ++ include/coap3/coap_netif_internal.h | 207 + include/coap3/coap_option.h | 435 ++ include/coap3/coap_oscore.h | 198 + include/coap3/coap_oscore_internal.h | 147 + include/coap3/coap_pdu.h | 617 +++ include/coap3/coap_pdu_internal.h | 345 ++ include/coap3/coap_prng.h | 89 + include/coap3/coap_resource.h | 511 ++ include/coap3/coap_resource_internal.h | 153 + include/coap3/coap_riot.h | 39 + include/coap3/coap_session.h | 802 +++ include/coap3/coap_session_internal.h | 545 ++ include/coap3/coap_str.h | 210 + include/coap3/coap_subscribe.h | 263 + include/coap3/coap_subscribe_internal.h | 168 + include/coap3/coap_tcp_internal.h | 108 + include/coap3/coap_time.h | 223 + include/coap3/coap_uri.h | 253 + include/coap3/coap_uri_internal.h | 40 + include/coap3/coap_uthash_internal.h | 1136 +++++ include/coap3/coap_utlist_internal.h | 1073 ++++ include/coap3/coap_ws.h | 51 + include/coap3/coap_ws_internal.h | 155 + include/coap3/libcoap.h | 76 + include/oscore/oscore.h | 127 + include/oscore/oscore_cbor.h | 144 + include/oscore/oscore_context.h | 279 ++ include/oscore/oscore_cose.h | 270 + include/oscore/oscore_crypto.h | 143 + libcoap-3.map | 294 ++ libcoap-3.pc.in | 12 + libcoap-3.sym | 289 ++ m4/ac_check_cryptolibs.m4 | 84 + m4/ax_check_a2x_to_man.m4 | 57 + m4/ax_check_compile_flag.m4 | 74 + m4/ax_check_link_flag.m4 | 74 + man/Makefile.am | 215 + man/coap-client.txt.in | 333 ++ man/coap-oscore-conf.txt.in | 232 + man/coap-rd.txt.in | 175 + man/coap-server.txt.in | 305 ++ man/coap.txt.in | 93 + man/coap_address.txt.in | 307 ++ man/coap_async.txt.in | 229 + man/coap_attribute.txt.in | 188 + man/coap_block.txt.in | 577 +++ man/coap_cache.txt.in | 427 ++ man/coap_context.txt.in | 197 + man/coap_deprecated.txt.in | 194 + man/coap_encryption.txt.in | 1242 +++++ man/coap_endpoint_client.txt.in | 538 ++ man/coap_endpoint_server.txt.in | 591 +++ man/coap_handler.txt.in | 404 ++ man/coap_init.txt.in | 79 + man/coap_io.txt.in | 516 ++ man/coap_keepalive.txt.in | 89 + man/coap_logging.txt.in | 348 ++ man/coap_lwip.txt.in | 110 + man/coap_observe.txt.in | 436 ++ man/coap_oscore.txt.in | 394 ++ man/coap_pdu_access.txt.in | 444 ++ man/coap_pdu_setup.txt.in | 754 +++ man/coap_persist.txt.in | 423 ++ man/coap_recovery.txt.in | 356 ++ man/coap_resource.txt.in | 611 +++ man/coap_session.txt.in | 282 ++ man/coap_string.txt.in | 219 + man/coap_tls_library.txt.in | 212 + man/coap_uri.txt.in | 265 + man/coap_websockets.txt.in | 89 + man/examples-code-check.c | 795 +++ scripts/api-version-bump.sh | 60 + scripts/build.sh | 86 + scripts/dist.sh | 70 + scripts/fix-cunit.sh | 15 + scripts/format_cmake.sh | 23 + scripts/github_dist.sh | 36 + scripts/mingw-cmake.sh | 6 + scripts/msbuild.sln.cmd | 25 + scripts/msinstallopenssl.cmd | 5 + src/coap_address.c | 846 ++++ src/coap_asn1.c | 102 + src/coap_async.c | 236 + src/coap_block.c | 3903 +++++++++++++++ src/coap_cache.c | 279 ++ src/coap_debug.c | 1315 +++++ src/coap_dtls.c | 76 + src/coap_encode.c | 95 + src/coap_event.c | 38 + src/coap_gnutls.c | 3249 ++++++++++++ src/coap_hashkey.c | 32 + src/coap_io.c | 1773 +++++++ src/coap_io_contiki.c | 224 + src/coap_io_lwip.c | 508 ++ src/coap_io_riot.c | 80 + src/coap_layers.c | 124 + src/coap_mbedtls.c | 3053 ++++++++++++ src/coap_mem.c | 509 ++ src/coap_net.c | 4385 +++++++++++++++++ src/coap_netif.c | 268 + src/coap_notls.c | 402 ++ src/coap_openssl.c | 3949 +++++++++++++++ src/coap_option.c | 601 +++ src/coap_oscore.c | 2196 +++++++++ src/coap_pdu.c | 1529 ++++++ src/coap_prng.c | 148 + src/coap_resource.c | 1300 +++++ src/coap_session.c | 1937 ++++++++ src/coap_str.c | 122 + src/coap_subscribe.c | 1199 +++++ src/coap_tcp.c | 337 ++ src/coap_time.c | 147 + src/coap_tinydtls.c | 1715 +++++++ src/coap_uri.c | 836 ++++ src/coap_ws.c | 951 ++++ src/oscore/oscore.c | 457 ++ src/oscore/oscore_cbor.c | 429 ++ src/oscore/oscore_context.c | 778 +++ src/oscore/oscore_cose.c | 498 ++ src/oscore/oscore_crypto.c | 173 + tests/Makefile.am | 44 + tests/oss-fuzz/Makefile.ci.in | 38 + tests/oss-fuzz/Makefile.oss-fuzz | 15 + tests/oss-fuzz/pdu_parse_tcp_target.c | 23 + tests/oss-fuzz/pdu_parse_udp_target.c | 23 + tests/oss-fuzz/pdu_parse_ws_target.c | 23 + tests/oss-fuzz/split_uri_target.c | 8 + tests/test_common.h.in | 12 + tests/test_encode.c | 265 + tests/test_encode.h | 13 + tests/test_error_response.c | 365 ++ tests/test_error_response.h | 13 + tests/test_options.c | 1049 ++++ tests/test_options.h | 19 + tests/test_oscore.c | 1101 +++++ tests/test_oscore.h | 15 + tests/test_pdu.c | 1546 ++++++ tests/test_pdu.h | 13 + tests/test_sendqueue.c | 366 ++ tests/test_sendqueue.h | 13 + tests/test_session.c | 226 + tests/test_session.h | 13 + tests/test_tls.c | 128 + tests/test_tls.h | 13 + tests/test_uri.c | 628 +++ tests/test_uri.h | 13 + tests/test_wellknown.c | 277 ++ tests/test_wellknown.h | 13 + tests/testdriver.c | 65 + tests/valgrind_suppression | 12 + win32/coap-client/coap-client.vcxproj | 387 ++ win32/coap-client/coap-client.vcxproj.filters | 22 + win32/coap-rd/coap-rd.vcxproj | 377 ++ win32/coap-rd/coap-rd.vcxproj.filters | 22 + win32/coap-server/coap-server.vcxproj | 378 ++ win32/coap-server/coap-server.vcxproj.filters | 22 + win32/install/install.vcxproj | 296 ++ win32/install/install.vcxproj.filters | 17 + win32/libcoap.props | 83 + win32/libcoap.sln | 144 + win32/libcoap.vcxproj | 652 +++ win32/libcoap.vcxproj.filters | 272 + win32/testdriver/testdriver.vcxproj | 403 ++ win32/testdriver/testdriver.vcxproj.filters | 78 + win32/testdriver/testdriver.vcxproj.user | 43 + 309 files changed, 101288 insertions(+) create mode 100644 AUTHORS create mode 100644 BUILDING create mode 100644 CMakeLists.txt create mode 100644 CONTRIBUTE create mode 100644 COPYING create mode 100644 ChangeLog create mode 100644 Dockerfile create mode 100644 HOWTO.dual.gnutls create mode 100644 HOWTO.dual.openssl create mode 100644 HOWTO.dual.softhsm2 create mode 100644 HOWTO.pkcs11 create mode 100644 LICENSE create mode 100644 Makefile.am create mode 100644 Makefile.libcoap create mode 100644 NEWS create mode 120000 README create mode 100644 README.md create mode 100644 SECURITY.md create mode 100644 TODO create mode 100755 autogen.sh create mode 100644 build-env/.dockerignore create mode 100644 build-env/Dockerfile.build-env create mode 100644 build-env/Dockerfile.develop create mode 100755 build-env/build.sh create mode 100644 build-env/imagename create mode 100644 cmake-format.yaml create mode 100644 cmake/Config.cmake.in create mode 100644 cmake/FindMbedTLS.cmake create mode 100644 cmake/FindTinyDTLS.cmake create mode 100644 cmake_coap_config.h.in create mode 100644 coap_config.h.contiki create mode 100644 coap_config.h.riot create mode 100644 coap_config.h.riot.in create mode 100644 coap_config.h.windows create mode 100644 coap_config.h.windows.in create mode 100644 configure.ac create mode 100644 doc/Doxyfile.in create mode 100644 doc/Makefile.am create mode 100644 doc/docbook.local.css create mode 100644 doc/main.md create mode 100644 doc/module_api_wrap.h create mode 100644 doc/upgrade_4.2.1_4.3.0.txt create mode 100644 doc/upgrade_4.3.0_4.3.1.txt create mode 100644 doc/upgrade_4.3.1_4.3.2.txt create mode 100644 doc/upgrade_4.3.2_4.3.3.txt create mode 100644 doc/upgrade_4.3.3_4.3.4.txt create mode 100644 examples/Makefile.am create mode 100644 examples/README.etsi_iot create mode 100644 examples/coap-client.c create mode 100644 examples/coap-rd.c create mode 100644 examples/coap-server.c create mode 100644 examples/coap_list.c create mode 100644 examples/coap_list.h create mode 100644 examples/contiki/.gitignore create mode 100644 examples/contiki/Makefile create mode 100644 examples/contiki/Makefile.contiki create mode 100644 examples/contiki/README create mode 120000 examples/contiki/coap_config.h create mode 100644 examples/contiki/project-conf.h create mode 100644 examples/contiki/server.c create mode 100755 examples/etsi_coaptest.sh create mode 100644 examples/etsi_iot_01.c create mode 100644 examples/etsi_iot_01_largedata.txt create mode 100644 examples/etsi_testcases.sh create mode 100644 examples/getopt.c create mode 100644 examples/interop/a_client.conf create mode 100644 examples/interop/b_server.conf create mode 100644 examples/interop/c_client.conf create mode 100644 examples/interop/d_server.conf create mode 100644 examples/interop/e_client.conf create mode 100644 examples/interop/f_client.conf create mode 100644 examples/interop/g_client.conf create mode 100644 examples/lwip/.gitignore create mode 100644 examples/lwip/Makefile create mode 100644 examples/lwip/README create mode 100644 examples/lwip/client-coap.c create mode 100644 examples/lwip/client-coap.h create mode 100644 examples/lwip/client.c create mode 100644 examples/lwip/config/coap_config.h create mode 100644 examples/lwip/config/coap_config.h.in create mode 100644 examples/lwip/config/lwipopts.h create mode 100644 examples/lwip/config/lwippools.h create mode 100644 examples/lwip/server-coap.c create mode 100644 examples/lwip/server-coap.h create mode 100644 examples/lwip/server.c create mode 100644 examples/oscore-interop-server.c create mode 100755 examples/oscore_testcases.sh create mode 100644 examples/riot/.gitignore create mode 100644 examples/riot/Makefile create mode 100644 examples/riot/README create mode 100644 examples/riot/examples_libcoap_client/Kconfig create mode 100644 examples/riot/examples_libcoap_client/Makefile create mode 100644 examples/riot/examples_libcoap_client/Makefile.ci create mode 100644 examples/riot/examples_libcoap_client/README.md create mode 100644 examples/riot/examples_libcoap_client/app.config create mode 100644 examples/riot/examples_libcoap_client/client-coap.c create mode 100644 examples/riot/examples_libcoap_client/client-coap.h create mode 100644 examples/riot/examples_libcoap_client/main.c create mode 100644 examples/riot/examples_libcoap_server/Kconfig create mode 100644 examples/riot/examples_libcoap_server/Makefile create mode 100644 examples/riot/examples_libcoap_server/Makefile.ci create mode 100644 examples/riot/examples_libcoap_server/README.md create mode 100644 examples/riot/examples_libcoap_server/app.config create mode 100644 examples/riot/examples_libcoap_server/main.c create mode 100644 examples/riot/examples_libcoap_server/server-coap.c create mode 100644 examples/riot/examples_libcoap_server/server-coap.h create mode 100644 examples/riot/pkg_libcoap/Kconfig create mode 100644 examples/riot/pkg_libcoap/Makefile create mode 100644 examples/riot/pkg_libcoap/Makefile.dep create mode 100644 examples/riot/pkg_libcoap/Makefile.include create mode 100644 examples/riot/pkg_libcoap/Makefile.libcoap create mode 100644 examples/share.libcoap.examples.Makefile create mode 100644 examples/share.libcoap.examples.README create mode 100644 examples/tiny.c create mode 100644 include/coap3/coap.h.in create mode 100644 include/coap3/coap.h.riot create mode 100644 include/coap3/coap.h.riot.in create mode 100644 include/coap3/coap.h.windows create mode 100644 include/coap3/coap.h.windows.in create mode 100644 include/coap3/coap_address.h create mode 100644 include/coap3/coap_asn1_internal.h create mode 100644 include/coap3/coap_async.h create mode 100644 include/coap3/coap_async_internal.h create mode 100644 include/coap3/coap_block.h create mode 100644 include/coap3/coap_block_internal.h create mode 100644 include/coap3/coap_cache.h create mode 100644 include/coap3/coap_cache_internal.h create mode 100644 include/coap3/coap_crypto_internal.h create mode 100644 include/coap3/coap_debug.h create mode 100644 include/coap3/coap_debug_internal.h create mode 100644 include/coap3/coap_dtls.h create mode 100644 include/coap3/coap_dtls_internal.h create mode 100644 include/coap3/coap_encode.h create mode 100644 include/coap3/coap_event.h create mode 100644 include/coap3/coap_forward_decls.h create mode 100644 include/coap3/coap_hashkey_internal.h create mode 100644 include/coap3/coap_internal.h create mode 100644 include/coap3/coap_io.h create mode 100644 include/coap3/coap_io_internal.h create mode 100644 include/coap3/coap_layers_internal.h create mode 100644 include/coap3/coap_mem.h create mode 100644 include/coap3/coap_mutex_internal.h create mode 100644 include/coap3/coap_net.h create mode 100644 include/coap3/coap_net_internal.h create mode 100644 include/coap3/coap_netif_internal.h create mode 100644 include/coap3/coap_option.h create mode 100644 include/coap3/coap_oscore.h create mode 100644 include/coap3/coap_oscore_internal.h create mode 100644 include/coap3/coap_pdu.h create mode 100644 include/coap3/coap_pdu_internal.h create mode 100644 include/coap3/coap_prng.h create mode 100644 include/coap3/coap_resource.h create mode 100644 include/coap3/coap_resource_internal.h create mode 100644 include/coap3/coap_riot.h create mode 100644 include/coap3/coap_session.h create mode 100644 include/coap3/coap_session_internal.h create mode 100644 include/coap3/coap_str.h create mode 100644 include/coap3/coap_subscribe.h create mode 100644 include/coap3/coap_subscribe_internal.h create mode 100644 include/coap3/coap_tcp_internal.h create mode 100644 include/coap3/coap_time.h create mode 100644 include/coap3/coap_uri.h create mode 100644 include/coap3/coap_uri_internal.h create mode 100644 include/coap3/coap_uthash_internal.h create mode 100644 include/coap3/coap_utlist_internal.h create mode 100644 include/coap3/coap_ws.h create mode 100644 include/coap3/coap_ws_internal.h create mode 100644 include/coap3/libcoap.h create mode 100644 include/oscore/oscore.h create mode 100644 include/oscore/oscore_cbor.h create mode 100644 include/oscore/oscore_context.h create mode 100644 include/oscore/oscore_cose.h create mode 100644 include/oscore/oscore_crypto.h create mode 100644 libcoap-3.map create mode 100644 libcoap-3.pc.in create mode 100644 libcoap-3.sym create mode 100644 m4/ac_check_cryptolibs.m4 create mode 100644 m4/ax_check_a2x_to_man.m4 create mode 100644 m4/ax_check_compile_flag.m4 create mode 100644 m4/ax_check_link_flag.m4 create mode 100644 man/Makefile.am create mode 100644 man/coap-client.txt.in create mode 100644 man/coap-oscore-conf.txt.in create mode 100644 man/coap-rd.txt.in create mode 100644 man/coap-server.txt.in create mode 100644 man/coap.txt.in create mode 100644 man/coap_address.txt.in create mode 100644 man/coap_async.txt.in create mode 100644 man/coap_attribute.txt.in create mode 100644 man/coap_block.txt.in create mode 100644 man/coap_cache.txt.in create mode 100644 man/coap_context.txt.in create mode 100644 man/coap_deprecated.txt.in create mode 100644 man/coap_encryption.txt.in create mode 100644 man/coap_endpoint_client.txt.in create mode 100644 man/coap_endpoint_server.txt.in create mode 100644 man/coap_handler.txt.in create mode 100644 man/coap_init.txt.in create mode 100644 man/coap_io.txt.in create mode 100644 man/coap_keepalive.txt.in create mode 100644 man/coap_logging.txt.in create mode 100644 man/coap_lwip.txt.in create mode 100644 man/coap_observe.txt.in create mode 100644 man/coap_oscore.txt.in create mode 100644 man/coap_pdu_access.txt.in create mode 100644 man/coap_pdu_setup.txt.in create mode 100644 man/coap_persist.txt.in create mode 100644 man/coap_recovery.txt.in create mode 100644 man/coap_resource.txt.in create mode 100644 man/coap_session.txt.in create mode 100644 man/coap_string.txt.in create mode 100644 man/coap_tls_library.txt.in create mode 100644 man/coap_uri.txt.in create mode 100644 man/coap_websockets.txt.in create mode 100644 man/examples-code-check.c create mode 100755 scripts/api-version-bump.sh create mode 100755 scripts/build.sh create mode 100755 scripts/dist.sh create mode 100755 scripts/fix-cunit.sh create mode 100755 scripts/format_cmake.sh create mode 100755 scripts/github_dist.sh create mode 100755 scripts/mingw-cmake.sh create mode 100644 scripts/msbuild.sln.cmd create mode 100644 scripts/msinstallopenssl.cmd create mode 100644 src/coap_address.c create mode 100644 src/coap_asn1.c create mode 100644 src/coap_async.c create mode 100644 src/coap_block.c create mode 100644 src/coap_cache.c create mode 100644 src/coap_debug.c create mode 100644 src/coap_dtls.c create mode 100644 src/coap_encode.c create mode 100644 src/coap_event.c create mode 100644 src/coap_gnutls.c create mode 100644 src/coap_hashkey.c create mode 100644 src/coap_io.c create mode 100644 src/coap_io_contiki.c create mode 100644 src/coap_io_lwip.c create mode 100644 src/coap_io_riot.c create mode 100644 src/coap_layers.c create mode 100644 src/coap_mbedtls.c create mode 100644 src/coap_mem.c create mode 100644 src/coap_net.c create mode 100644 src/coap_netif.c create mode 100644 src/coap_notls.c create mode 100644 src/coap_openssl.c create mode 100644 src/coap_option.c create mode 100644 src/coap_oscore.c create mode 100644 src/coap_pdu.c create mode 100644 src/coap_prng.c create mode 100644 src/coap_resource.c create mode 100644 src/coap_session.c create mode 100644 src/coap_str.c create mode 100644 src/coap_subscribe.c create mode 100644 src/coap_tcp.c create mode 100644 src/coap_time.c create mode 100644 src/coap_tinydtls.c create mode 100644 src/coap_uri.c create mode 100644 src/coap_ws.c create mode 100644 src/oscore/oscore.c create mode 100644 src/oscore/oscore_cbor.c create mode 100644 src/oscore/oscore_context.c create mode 100644 src/oscore/oscore_cose.c create mode 100644 src/oscore/oscore_crypto.c create mode 100644 tests/Makefile.am create mode 100644 tests/oss-fuzz/Makefile.ci.in create mode 100644 tests/oss-fuzz/Makefile.oss-fuzz create mode 100644 tests/oss-fuzz/pdu_parse_tcp_target.c create mode 100644 tests/oss-fuzz/pdu_parse_udp_target.c create mode 100644 tests/oss-fuzz/pdu_parse_ws_target.c create mode 100644 tests/oss-fuzz/split_uri_target.c create mode 100644 tests/test_common.h.in create mode 100644 tests/test_encode.c create mode 100644 tests/test_encode.h create mode 100644 tests/test_error_response.c create mode 100644 tests/test_error_response.h create mode 100644 tests/test_options.c create mode 100644 tests/test_options.h create mode 100644 tests/test_oscore.c create mode 100644 tests/test_oscore.h create mode 100644 tests/test_pdu.c create mode 100644 tests/test_pdu.h create mode 100644 tests/test_sendqueue.c create mode 100644 tests/test_sendqueue.h create mode 100644 tests/test_session.c create mode 100644 tests/test_session.h create mode 100644 tests/test_tls.c create mode 100644 tests/test_tls.h create mode 100644 tests/test_uri.c create mode 100644 tests/test_uri.h create mode 100644 tests/test_wellknown.c create mode 100644 tests/test_wellknown.h create mode 100644 tests/testdriver.c create mode 100644 tests/valgrind_suppression create mode 100644 win32/coap-client/coap-client.vcxproj create mode 100644 win32/coap-client/coap-client.vcxproj.filters create mode 100644 win32/coap-rd/coap-rd.vcxproj create mode 100644 win32/coap-rd/coap-rd.vcxproj.filters create mode 100644 win32/coap-server/coap-server.vcxproj create mode 100644 win32/coap-server/coap-server.vcxproj.filters create mode 100644 win32/install/install.vcxproj create mode 100644 win32/install/install.vcxproj.filters create mode 100644 win32/libcoap.props create mode 100644 win32/libcoap.sln create mode 100644 win32/libcoap.vcxproj create mode 100644 win32/libcoap.vcxproj.filters create mode 100644 win32/testdriver/testdriver.vcxproj create mode 100644 win32/testdriver/testdriver.vcxproj.filters create mode 100644 win32/testdriver/testdriver.vcxproj.user diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..d59fb86 --- /dev/null +++ b/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/BUILDING b/BUILDING new file mode 100644 index 0000000..75f2a49 --- /dev/null +++ b/BUILDING @@ -0,0 +1,210 @@ +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 RIOT, LwIP or Contiki-NG - 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-3 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 RIOT, LwIP or Contiki-NG - 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'. + +RIOT +==== + + ./autogen.sh + ./configure --disable-tests --disable-documentation --disable-examples --disable-dtls + cd examples/riot + make + +See examples/riot/README for further information. + +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-NG +========== + + ./autogen.sh + ./configure --disable-tests --disable-documentation --disable-examples --disable-dtls + cd examples/contiki + make + +Executable is ./server.native. 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. + +MinGW +===== + +As there are many ways to install MinGW, depending on the different +installed packages, random failures can occur (usually because of conflicts +with cygwin based packages). Below is a way known to work with libcoap +on a Windows host. + +Remove any old copy of MSYS2 using Windows program remove. + +Download https://repo.msys2.org/distrib/x86_64/msys2-x86_64-20230318.exe and +run the executable, accepting the defaults. + +In a UCRT64 window, add in the following packages + + pacman -S git + pacman -S vim + pacman -S mingw-w64-ucrt-x86_64-cmake + pacman -S mingw-w64-ucrt-x86_64-gcc + pacman -S mingw-w64-ucrt-x86_64-openssl + +Alternatively, in a MINGW64 window, add in the following packages + + pacman -S git + pacman -S vim + pacman -S mingw-w64-x86_64-cmake + pacman -S mingw-w64-x86_64-gcc + pacman -S mingw-w64-x86_64-openssl + +Then clone a copy of the github libcoap repository in a UCRT64 or MINGW64 window + + git clone https://github.com/obgm/libcoap.git + cd libcoap + +Then build the libcoap library and example executables (which will be in the +build directory) + + cmake -E remove_directory build + cmake -E make_directory build + cd build + cmake .. -DENABLE_DOCS=OFF -DDTLS_BACKEND=openssl + cmake --build . diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..9325de3 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,923 @@ +# CMakeLists.txt for libcoap +# +# Copyright (C) 2020 Carlos Gomes Martinho +# Copyright (C) 2020-2023 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.4 + LANGUAGES CXX C) + +set(LIBCOAP_API_VERSION 3) +set(LIBCOAP_ABI_VERSION 3.1.1) + +set(COAP_LIBRARY_NAME "coap-${LIBCOAP_API_VERSION}") + +option( + BUILD_SHARED_LIBS + "Build shared libs" + OFF) + +# +# global compiler options +# (need to do it before add_library()) +# + +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>) + +if(MINGW) +add_compile_options( + $<$,$>:-Wno-format> + $<$,$>:-Wno-format-security>) +endif() + +if(${WARNING_TO_ERROR}) +add_compile_options( + $<$,$,$>:-Werror>) +endif() + +if(CMAKE_GENERATOR MATCHES "Visual Studio") + option(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS "Export all symbols when compiling to a .dll" ON) + # add_compile_options(/Wall /wd4100 /wd4820 /wd4668 /wd4061) + if(${WARNING_TO_ERROR}) + add_compile_options(/WX) + endif() +endif() + +# +# The libcoap library +# + +add_library(${COAP_LIBRARY_NAME}) +set_property(TARGET ${COAP_LIBRARY_NAME} PROPERTY C_STANDARD 99) +if(${CMAKE_VERSION} VERSION_GREATER "3.20.0") + cmake_policy(SET CMP0115 OLD) # Supresses libcoap configuration warning +endif() + +set_target_properties(${COAP_LIBRARY_NAME} PROPERTIES SOVERSION ${LIBCOAP_API_VERSION}) +set_target_properties(${COAP_LIBRARY_NAME} PROPERTIES VERSION ${LIBCOAP_ABI_VERSION}) + +# +# 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( + ENABLE_OSCORE + "compile with support for OSCORE" + ON) +option( + WITH_OBSERVE_PERSIST + "compile with observe persist support for server restarts" + ON) +option( + WITH_EPOLL + "compile with epoll support" + ON) +option( + ENABLE_SMALL_STACK + "enable if the system has small stack size" + OFF) +option( + ENABLE_TCP + "enable building with TCP support" + ON) +option( + ENABLE_IPV4 + "enable building with IPv4 support" + ON) +option( + ENABLE_IPV6 + "enable building with IPv6 support" + ON) +option( + ENABLE_AF_UNIX + "enable building with Unix socket support" + ON) +option( + ENABLE_WS + "enable building with WebSockets support" + ON) +option( + ENABLE_ASYNC + "enable building with async separate response support" + ON) +option( + ENABLE_Q_BLOCK + "enable building with Q-Block (RFC9177) support" + ON) +option( + ENABLE_TESTS + "build also tests" + OFF) +option( + ENABLE_EXAMPLES + "build also examples" + ON) +option( + ENABLE_DOCS + "build also doxygen documentation" + ON) +option( + WARNING_TO_ERROR + "force all compiler warnings to be errors" + OFF) +set(MAX_LOGGING_LEVEL + "8" + CACHE + STRING + "\ +Only build logging code up to and including the specified logging level (0 - 8)[default=8]] + ") +set_property( + CACHE DTLS_BACKEND + PROPERTY STRINGS + "0" + "1" + "2" + "3" + "4" + "5" + "6" + "7" + "8") + +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(assert.h HAVE_ASSERT_H) +check_include_file(string.h HAVE_STRING_H) +check_include_file(strings.h HAVE_STRINGS_H) +check_include_file(byteswap.h HAVE_BYTESWAP_H) +check_include_file(inttypes.h HAVE_INTTYPES_H) +check_include_file(errno.h HAVE_ERRNO_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(ifaddrs.h HAVE_IFADDRS_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(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(random HAVE_RANDOM) +check_function_exists(if_nametoindex HAVE_IF_NAMETOINDEX) + +# check for symbols +if(WIN32 AND NOT MINGW) + set(HAVE_STRUCT_CMSGHDR 1) + message(STATUS "setting HAVE_STRUCT_CMSGHDR") +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(${ENABLE_OSCORE}) + set(COAP_OSCORE_SUPPORT "1") + message(STATUS "compiling with OSCORE support") +else() + message(STATUS "compiling without OSCORE support") +endif() + +if(${ENABLE_WS} AND $(ENABLE_TCP)) + set(COAP_WS_SUPPORT "1") + message(STATUS "compiling with WebSockets support") +else() + if(${ENABLE_WS}) + set(ENABLE_WS OFF) + message(STATUS "WebSockets disabled as TCP not enabled") + endif() + message(STATUS "compiling without WebSockets support") +endif() + +if(${ENABLE_ASYNC}) + set(COAP_ASYNC_SUPPORT "1") + message(STATUS "compiling with async separate response support") +else() + message(STATUS "compiling without async separate response support") +endif() + +if(${ENABLE_IPV4}) + set(COAP_IPV4_SUPPORT "1") + message(STATUS "compiling with IPv4 support") +else() + message(STATUS "compiling without IPv4 support") +endif() + +if(${ENABLE_IPV6}) + set(COAP_IPV6_SUPPORT "1") + message(STATUS "compiling with IPv6 support") +else() + message(STATUS "compiling without IPv6 support") +endif() + +if(${ENABLE_AF_UNIX}) + set(COAP_AF_UNIX_SUPPORT "1") + message(STATUS "compiling with Unix socket support") +else() + message(STATUS "compiling without Unix socket support") +endif() + +if(${ENABLE_Q_BLOCK}) + set(COAP_Q_BLOCK_SUPPORT "1") + message(STATUS "compiling with Q-Block (RFC9177) support") +else() + message(STATUS "compiling without Q-Block (RFC9177) support") +endif() + + +if(${WITH_OBSERVE_PERSIST}) + set(COAP_WITH_OBSERVE_PERSIST "1") + message(STATUS "compiling with observe persistence support") +else() + message(STATUS "compiling without observe persistence 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() + if(${WITH_EPOLL}) + set(WITH_EPOLL OFF) + message(STATUS "epoll disabled as kernel support not available") + endif() + 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() + +if(${MAX_LOGGING_LEVEL} MATCHES "[0-7]") + set(COAP_MAX_LOGGING_LEVEL ${MAX_LOGGING_LEVEL}) + message(STATUS "compiling with max logging level set to ${MAX_LOGGING_LEVEL}") +else() + message(STATUS "compiling with max logging level set to none") +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 ./autogen.sh + 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(COAP_WITH_LIBGNUTLS 1) + else() + # gnutls not found + find_package(OpenSSL) + if(OpenSSL_FOUND) + set(WITH_OPENSSL ON) + message(STATUS "compiling with openssl support") + set(COAP_WITH_LIBOPENSSL 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(COAP_WITH_LIBMBEDTLS 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(COAP_WITH_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(COAP_WITH_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(COAP_WITH_LIBOPENSSL 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(COAP_WITH_LIBMBEDTLS 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(COAP_WITH_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 "") +message(STATUS "libcoap Configuration Summary:") +message(STATUS "") +message(STATUS "PACKAGE VERSION..................${PACKAGE_VERSION}") +message(STATUS "PACKAGE SOURCE...................${LIBCOAP_PACKAGE_BUILD}") +message(STATUS "LIBRARY API VERSION..............${LIBCOAP_API_VERSION}") +message(STATUS "LIBRARY ABI VERSION..............${LIBCOAP_ABI_VERSION}") +message(STATUS "ENABLE_DTLS:.....................${ENABLE_DTLS}") +message(STATUS "ENABLE_TCP:......................${ENABLE_TCP}") +message(STATUS "ENABLE_IPV4:.....................${ENABLE_IPV4}") +message(STATUS "ENABLE_IPV6:.....................${ENABLE_IPV6}") +message(STATUS "ENABLE_AF_UNIX:..................${ENABLE_AF_UNIX}") +message(STATUS "ENABLE_WEBSOCKETS:...............${ENABLE_WS}") +message(STATUS "ENABLE_Q_BLOCK:..................${ENABLE_Q_BLOCK}") +message(STATUS "ENABLE_CLIENT_MODE:..............${ENABLE_CLIENT_MODE}") +message(STATUS "ENABLE_SERVER_MODE:..............${ENABLE_SERVER_MODE}") +message(STATUS "ENABLE_OSCORE:...................${ENABLE_OSCORE}") +message(STATUS "ENABLE_ASYNC:....................${ENABLE_ASYNC}") +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:................${COAP_WITH_LIBTINYDTLS}") +message(STATUS "HAVE_LIBGNUTLS:..................${COAP_WITH_LIBGNUTLS}") +message(STATUS "HAVE_LIBOPENSSL:.................${COAP_WITH_LIBOPENSSL}") +message(STATUS "HAVE_LIBMBEDTLS:.................${COAP_WITH_LIBMBEDTLS}") +message(STATUS "WITH_EPOLL:......................${WITH_EPOLL}") +message(STATUS "WITH_OBSERVE_PERSIST:............${WITH_OBSERVE_PERSIST}") +message(STATUS "BUILD_SHARED_LIBS:...............${BUILD_SHARED_LIBS}") +message(STATUS "MAX_LOGGING_LEVEL:...............${MAX_LOGGING_LEVEL}") +message(STATUS "WARNING_TO_ERROR:................${WARNING_TO_ERROR}") +message(STATUS "CMAKE_C_COMPILER:................${CMAKE_C_COMPILER}") +message(STATUS "CMAKE_CXX_COMPILER_ID:...........${CMAKE_CXX_COMPILER_ID}") +message(STATUS "CMAKE_BUILD_TYPE:................${CMAKE_BUILD_TYPE}") +message(STATUS "CMAKE_SYSTEM_PROCESSOR:..........${CMAKE_SYSTEM_PROCESSOR}") +message(STATUS "CMAKE_HOST_SYSTEM_NAME:..........${CMAKE_HOST_SYSTEM_NAME}") +message(STATUS "CMAKE_GENERATOR:.................${CMAKE_GENERATOR}") +message(STATUS "") + +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_block.c + ${CMAKE_CURRENT_LIST_DIR}/src/coap_cache.c + ${CMAKE_CURRENT_LIST_DIR}/src/coap_debug.c + ${CMAKE_CURRENT_LIST_DIR}/src/coap_dtls.c + ${CMAKE_CURRENT_LIST_DIR}/src/coap_encode.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_layers.c + ${CMAKE_CURRENT_LIST_DIR}/src/coap_mem.c + ${CMAKE_CURRENT_LIST_DIR}/src/coap_net.c + ${CMAKE_CURRENT_LIST_DIR}/src/coap_netif.c + ${CMAKE_CURRENT_LIST_DIR}/src/coap_notls.c + ${CMAKE_CURRENT_LIST_DIR}/src/coap_option.c + ${CMAKE_CURRENT_LIST_DIR}/src/coap_oscore.c + ${CMAKE_CURRENT_LIST_DIR}/src/coap_pdu.c + ${CMAKE_CURRENT_LIST_DIR}/src/coap_prng.c + ${CMAKE_CURRENT_LIST_DIR}/src/coap_resource.c + ${CMAKE_CURRENT_LIST_DIR}/src/coap_session.c + ${CMAKE_CURRENT_LIST_DIR}/src/coap_str.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/coap_uri.c + ${CMAKE_CURRENT_LIST_DIR}/src/coap_ws.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> + # needed for OSCORE is enabled + $<$:${CMAKE_CURRENT_LIST_DIR}/src/oscore/oscore.c> + $<$:${CMAKE_CURRENT_LIST_DIR}/src/oscore/oscore_cbor.c> + $<$:${CMAKE_CURRENT_LIST_DIR}/src/oscore/oscore_context.c> + $<$:${CMAKE_CURRENT_LIST_DIR}/src/oscore/oscore_cose.c> + $<$:${CMAKE_CURRENT_LIST_DIR}/src/oscore/oscore_crypto.c> + # headers + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/coap.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/libcoap.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_block.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_encode.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/coap_event.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/coap_io.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/coap_mem.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/coap_net.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/coap_option.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/coap_pdu.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/coap_prng.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/coap_resource.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/coap_session.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/coap_str.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}/coap_uri.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/coap_ws.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}> + $<$:ws2_32>) + +target_compile_options( + ${COAP_LIBRARY_NAME} + PUBLIC -DLIBCOAP_PACKAGE_BUILD="${LIBCOAP_PACKAGE_BUILD}") + +add_library( + ${PROJECT_NAME}::${COAP_LIBRARY_NAME} + ALIAS + ${COAP_LIBRARY_NAME}) + +# +# 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_oscore.c + ${CMAKE_CURRENT_LIST_DIR}/tests/test_oscore.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 AND NOT MINGW) + 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}) + + add_executable(oscore-interop-server + ${CMAKE_CURRENT_LIST_DIR}/examples/oscore-interop-server.c) + target_link_libraries(oscore-interop-server + 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_CURRENT_BINARY_DIR}/doc/man_tmp) + file(MAKE_DIRECTORY ${CMAKE_CURRENT_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} -u > /dev/null 2>&1 + 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 "*_internal.h" EXCLUDE + PATTERN "oscore*" 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 AND NOT MINGW) + install( + TARGETS etsi_iot_01 tiny oscore-interop-server + DESTINATION ${CMAKE_INSTALL_BINDIR} + COMPONENT dev) + endif() +endif() diff --git a/CONTRIBUTE b/CONTRIBUTE new file mode 100644 index 0000000..d3a702e --- /dev/null +++ b/CONTRIBUTE @@ -0,0 +1,263 @@ + ####################################################### + # 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 or CMake, the +GNU GCC and the LLVM C-compiler (CLang) are supported. The Windows VS build +systems are supported. + +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 + +Alternatively, Issues can be raised at https://github.com/obgm/libcoap/issues + +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 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). Multiple commits +for your branch should be squash'ed into a single commit. This can be done +one of two ways. + +Way One: Push your changes to the github repository. + + git push origin my-develop + +Then go to https://github.com/obgm/libcoap/pulls and create your pull request +for others to review. If changes are needed, then commit and squash changes +and push the (forced) changes again. + + git push -f origin my-develop + +Way Two: 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, remember this is the upstream primary +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 lots but the main ones following are important! + +5.1 pre-commit +-------------- +pre-commit is used to check the the syntax of *.c and *.h files according to +the libcoap coding rules. The files are checked on github for every 'git push', +and can be locally checked if pre-commit is installed for every 'git commit'. + +$ cd libcoap +$ pip install pre-commit +$ pre-commit install --allow-missing-config + +5.2 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.3 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 where (apart from Makefile's indenting where TABs are mandatory)! + 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-- + +* For functions defined in *.h files, the function return type should be + defined on the same line as the function name declaration. For functions + defined in *.c files, the function return type should be defined on the + previous line (for both declarations and implementations). + +* Single lines within the source code should not be longer then 78 + characters. + +* If there are 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. Each parameter should be aligned with the + first defined parameter. For example like this (from src/coap_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.4 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.5 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.6 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 opportunity to write a good explanation why your patch/commit is to + handle the changes in the way you have done. Remember that other users 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. + Doing this in 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/coap_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 can easily 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 always need better documentation on the source code, as well as improving +the doxygen documentation in the header files. Updating the man pages for +missing functions helps. +Also updated documentation on the usage of the libcoap and the example +binaries is always useful. So we appreciate any help on this. + +* Manual Pages for example binaries +Manual pages are provided for the example binaries which have become more +complex over time with a variety of configuration options. It is possible +to work out how to use particular application functionality by reading the +examples source code. Improving documentation for usage would be useful. + +* Manual Pages for public API +As well as the doxygen documentation, manual pages are being written for the +public licoap API where functions are defined, what the parameters mean as +well as providing simple coding examples. These manual pages are also +embedded in the doxygen output, the latest copy of which can be seen at +https://libcoap.net/doc/reference/develop/ +Updating these manual pages for the missing functions, correcting errors +or providing simple examples of function usage would be helpful. + +* 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. Do 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/COPYING b/COPYING new file mode 100644 index 0000000..c64ad63 --- /dev/null +++ b/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/ChangeLog b/ChangeLog new file mode 100644 index 0000000..000fa5e --- /dev/null +++ b/ChangeLog @@ -0,0 +1,383 @@ +2023-09-18 Olaf Bergmann + + Change summary for version 4.3.4: + + * Clean up use of tags. + * Support for MacOS with Contiki-NG builds. + * Support for Windows with OpenSSL 3.x builds. + * Reported bugs fixed. + * Documentation updated. + +2023-09-12 Olaf Bergmann + + Change summary for version 4.3.3: + + * Fix ABI version. + +2023-07-13 Olaf Bergmann + + Change summary for version 4.3.2: + + * Source files reformatted according to pre-commit rules. + * Support for RFC8613 (OSCORE). + * Support for RFC8974 (Extended Tokens). + * Support for RFC9177 (Q-Block). + * Support for latest RIOT code and new examples. + * Support for MinGW builds. + * Support for AF_UNIX sockets. + * Support for WebSockets (RFC8323). + * Support for IPv4 only and IPv6 only libcoap builds. + * Support for defining maximum logging level. + * Support for maintaining Observer requests over server restarts. + * Support for Contiki-NG. + * Support for latest LwIP, including using TinyDTLS. + * libcoap now has protocol layered support, separating out the + logical layers. Stack now is:- + - Application + - libcoap - CoAP + - libcoap - CoAP-Session + - libcoap - (D)TLS I/F using external (D)TLS Library + - libcoap - Netif + - libcoap - Sockets + - Kernel Network Stack + * Fixes CVE-2023-30362 and CVE-2023-35862. + * Reported bugs fixed. + * Examples now support separate logging levels for libcoap and (D)TLS. + * syslog LOG_ logging levels replaced with COAP_LOG_ logging levels. + * New public API functions to aid / reduce application coding. + * Remove requirement for applications to have sockaddr knowledge. + * Support for clients sending IPv4 broadcast requests. + * Documentation added and updated (Doxygen and man). + +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 before the 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/Dockerfile b/Dockerfile new file mode 100644 index 0000000..41b7fc8 --- /dev/null +++ b/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/HOWTO.dual.gnutls b/HOWTO.dual.gnutls new file mode 100644 index 0000000..e2fc0e1 --- /dev/null +++ b/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/HOWTO.dual.openssl b/HOWTO.dual.openssl new file mode 100644 index 0000000..6168c3e --- /dev/null +++ b/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/HOWTO.dual.softhsm2 b/HOWTO.dual.softhsm2 new file mode 100644 index 0000000..2eee889 --- /dev/null +++ b/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/HOWTO.pkcs11 b/HOWTO.pkcs11 new file mode 100644 index 0000000..64c01f9 --- /dev/null +++ b/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/LICENSE b/LICENSE new file mode 100644 index 0000000..dee4568 --- /dev/null +++ b/LICENSE @@ -0,0 +1,124 @@ +Copyright (c) 2010--2023, 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. These files are named coap_uthash_internal.h and +coap_utlist_internal.h respectively to make sure the correct versions +are included. + +======================================================================== +oscore cose + +Copyright (c) 2018, SICS, RISE AB +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. 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. +3. Neither the name of the Institute nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE INSTITUTE 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 INSTITUTE 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. + +======================================================================== +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). + +======================================================================== +RIOT + +When compiled with RIOT support, this software includes components +that are licensed under the terms of the the GNU Lesser General Public +License, version 2.1 +(https://raw.githubusercontent.com/RIOT-OS/RIOT/master/LICENSE). diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..fa5f101 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,367 @@ +# Makefile.am for libcoap +# +# Copyright (C) 2010-2023 Olaf Bergmann +# Copyright (C) 2015-2017 Carsten Schoenert +# Copyright (C) 2018-2023 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@) + +## Source files specifically for OSCORE +libcoap_OSCORE_sources = \ + src/oscore/oscore.c \ + src/oscore/oscore_cbor.c \ + src/oscore/oscore_context.c \ + src/oscore/oscore_cose.c \ + src/oscore/oscore_crypto.c + +## 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.contiki \ + 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 \ + examples/contiki/coap_config.h \ + examples/contiki/Makefile \ + examples/contiki/Makefile.contiki \ + examples/contiki/project-conf.h \ + examples/contiki/README \ + examples/contiki/server.c \ + examples/lwip/client.c \ + examples/lwip/client-coap.c \ + examples/lwip/client-coap.h \ + examples/lwip/Makefile \ + examples/lwip/README \ + examples/lwip/server.c \ + examples/lwip/server-coap.c \ + examples/lwip/server-coap.h \ + examples/lwip/config/coap_config.h \ + examples/lwip/config/coap_config.h.in \ + examples/lwip/config/lwipopts.h \ + examples/lwip/config/lwippools.h \ + examples/riot/examples_libcoap_client/client-coap.c \ + examples/riot/examples_libcoap_client/client-coap.h \ + examples/riot/examples_libcoap_client/Kconfig \ + examples/riot/examples_libcoap_client/main.c \ + examples/riot/examples_libcoap_client/Makefile \ + examples/riot/examples_libcoap_client/Makefile.ci \ + examples/riot/examples_libcoap_client/README.md \ + examples/riot/examples_libcoap_server/main.c \ + examples/riot/examples_libcoap_server/Makefile \ + examples/riot/examples_libcoap_server/Makefile.ci \ + examples/riot/examples_libcoap_server/README.md \ + examples/riot/examples_libcoap_server/server-coap.c \ + examples/riot/examples_libcoap_server/server-coap.h \ + examples/riot/examples_libcoap_server/Kconfig \ + examples/riot/Makefile \ + examples/riot/pkg_libcoap/Kconfig \ + examples/riot/pkg_libcoap/Makefile \ + examples/riot/pkg_libcoap/Makefile.dep \ + examples/riot/pkg_libcoap/Makefile.include \ + examples/riot/pkg_libcoap/Makefile.libcoap \ + examples/riot/README \ + Makefile.libcoap \ + 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_crypto_internal.h \ + include/coap$(LIBCOAP_API_VERSION)/coap_debug_internal.h \ + include/coap$(LIBCOAP_API_VERSION)/coap_dtls_internal.h \ + include/coap$(LIBCOAP_API_VERSION)/coap_hashkey_internal.h \ + include/coap$(LIBCOAP_API_VERSION)/coap_io_internal.h \ + include/coap$(LIBCOAP_API_VERSION)/coap_layers_internal.h \ + include/coap$(LIBCOAP_API_VERSION)/coap_mutex_internal.h \ + include/coap$(LIBCOAP_API_VERSION)/coap_net_internal.h \ + include/coap$(LIBCOAP_API_VERSION)/coap_netif_internal.h \ + include/coap$(LIBCOAP_API_VERSION)/coap_oscore_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_uri_internal.h \ + include/coap$(LIBCOAP_API_VERSION)/coap_uthash_internal.h \ + include/coap$(LIBCOAP_API_VERSION)/coap_utlist_internal.h \ + include/coap$(LIBCOAP_API_VERSION)/coap_ws_internal.h \ + include/coap$(LIBCOAP_API_VERSION)/coap.h.in \ + include/coap$(LIBCOAP_API_VERSION)/coap.h.riot \ + include/coap$(LIBCOAP_API_VERSION)/coap.h.riot.in \ + include/coap$(LIBCOAP_API_VERSION)/coap.h.windows \ + include/coap$(LIBCOAP_API_VERSION)/coap.h.windows.in \ + include/oscore/oscore_cbor.h \ + include/oscore/oscore_context.h \ + include/oscore/oscore_cose.h \ + include/oscore/oscore_crypto.h \ + include/oscore/oscore.h \ + src/coap_io_contiki.c \ + src/coap_io_lwip.c \ + src/coap_io_riot.c \ + tests/test_error_response.h \ + tests/test_encode.h \ + tests/test_options.h \ + tests/test_oscore.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 + +# This is a mirror of files depending on COAP_OSCORE_SUPPORT included in src as per +# libcoap_@LIBCOAP_NAME_SUFFIX@_la_SOURCES +if !COAP_OSCORE_SUPPORT +EXTRA_DIST += $(libcoap_OSCORE_sources) + +endif # !COAP_OSCORE_SUPPORT + +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/coap_address.c \ + src/coap_asn1.c \ + src/coap_async.c \ + src/coap_block.c \ + src/coap_cache.c \ + src/coap_debug.c \ + src/coap_dtls.c \ + src/coap_encode.c \ + src/coap_event.c \ + src/coap_hashkey.c \ + src/coap_gnutls.c \ + src/coap_io.c \ + src/coap_layers.c \ + src/coap_mbedtls.c \ + src/coap_mem.c \ + src/coap_net.c \ + src/coap_netif.c \ + src/coap_notls.c \ + src/coap_openssl.c \ + src/coap_option.c \ + src/coap_oscore.c \ + src/coap_pdu.c \ + src/coap_prng.c \ + src/coap_resource.c \ + src/coap_session.c \ + src/coap_str.c \ + src/coap_subscribe.c \ + src/coap_tcp.c \ + src/coap_time.c \ + src/coap_tinydtls.c \ + src/coap_uri.c \ + src/coap_ws.c + +if COAP_OSCORE_SUPPORT +libcoap_@LIBCOAP_NAME_SUFFIX@_la_SOURCES += $(libcoap_OSCORE_sources) + +endif # COAP_OSCORE_SUPPORT + +## 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_builddir)/include/coap$(LIBCOAP_API_VERSION)/coap.h \ + $(top_srcdir)/include/coap$(LIBCOAP_API_VERSION)/libcoap.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_block.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_encode.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_io.h \ + $(top_srcdir)/include/coap$(LIBCOAP_API_VERSION)/coap_mem.h \ + $(top_srcdir)/include/coap$(LIBCOAP_API_VERSION)/coap_net.h \ + $(top_srcdir)/include/coap$(LIBCOAP_API_VERSION)/coap_option.h \ + $(top_srcdir)/include/coap$(LIBCOAP_API_VERSION)/coap_oscore.h \ + $(top_srcdir)/include/coap$(LIBCOAP_API_VERSION)/coap_pdu.h \ + $(top_srcdir)/include/coap$(LIBCOAP_API_VERSION)/coap_prng.h \ + $(top_srcdir)/include/coap$(LIBCOAP_API_VERSION)/coap_resource.h \ + $(top_srcdir)/include/coap$(LIBCOAP_API_VERSION)/coap_session.h \ + $(top_srcdir)/include/coap$(LIBCOAP_API_VERSION)/coap_str.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)/coap_uri.h \ + $(top_srcdir)/include/coap$(LIBCOAP_API_VERSION)/coap_ws.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 \ +coap_lwip_dump_memory_pools \ +coap_lwip_set_input_wait_handler \ +coap_print_contiki_prefix \ +" + +# 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 ";" }' | LC_ALL=C 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 }' | LC_ALL=C 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/Makefile.libcoap b/Makefile.libcoap new file mode 100644 index 0000000..c181ed2 --- /dev/null +++ b/Makefile.libcoap @@ -0,0 +1,5 @@ +LIBCOAP_DIR = os/net/app-layer/libcoap +MODULES += $(LIBCOAP_DIR)/src +MODULES += $(LIBCOAP_DIR)/include +MODULES_SOURCES_EXCLUDES += coap_io_riot.c +MODULES_SOURCES_EXCLUDES += coap_io_lwip.c diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..e69de29 diff --git a/README b/README new file mode 120000 index 0000000..42061c0 --- /dev/null +++ b/README @@ -0,0 +1 @@ +README.md \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..b8f91be --- /dev/null +++ b/README.md @@ -0,0 +1,97 @@ +# 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) +[![CIFuzz Status](https://github.com/obgm/libcoap/actions/workflows/cifuzz.yml/badge.svg?branch=develop)](https://github.com/obgm/libcoap/actions/workflows/cifuzz.yml) +[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit) + +Copyright (C) 2010—2023 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 or +[CoAP Wiki](https://en.wikipedia.org/wiki/Constrained_Application_Protocol). + +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-NG, +Espressif/ESP-IDF, LwIP and RIOT-OS hosted environments. + +The following RFCs are supported + +* [RFC7252: The Constrained Application Protocol (CoAP)](https://rfc-editor.org/rfc/rfc7252) + +* [RFC7390: Group Communication for the Constrained Application Protocol (CoAP)](https://rfc-editor.org/rfc/rfc7390) + +* [RFC7641: Observing Resources in the Constrained Application Protocol (CoAP)](https://rfc-editor.org/rfc/rfc7641) + +* [RFC7959: Block-Wise Transfers in the Constrained Application Protocol (CoAP)](https://rfc-editor.org/rfc/rfc7959) + +* [RFC7967: Constrained Application Protocol (CoAP) Option for No Server Response](https://rfc-editor.org/rfc/rfc7967) + +* [RFC8132: PATCH and FETCH Methods for the Constrained Application Protocol (CoAP)](https://rfc-editor.org/rfc/rfc8132) + +* [RFC8323: CoAP (Constrained Application Protocol) over TCP, TLS, and WebSockets](https://rfc-editor.org/rfc/rfc8323) + +* [RFC8516: "Too Many Requests" Response Code for the Constrained Application Protocol](https://rfc-editor.org/rfc/rfc8516) + +* [RFC8613: Object Security for Constrained RESTful Environments (OSCORE)](https://rfc-editor.org/rfc/rfc8613) + +* [RFC8768: Constrained Application Protocol (CoAP) Hop-Limit Option](https://rfc-editor.org/rfc/rfc8768) + +* [RFC8974: Extended Tokens and Stateless Clients in the Constrained Application Protocol (CoAP)](https://rfc-editor.org/rfc/rfc8974) + +* [RFC9175: CoAP: Echo, Request-Tag, and Token Processing](https://rfc-editor.org/rfc/rfc9175) + +* [RFC9177: Constrained Application Protocol (CoAP) Block-Wise Transfer Options Supporting Robust Transmission](https://rfc-editor.org/rfc/rfc9177) + +There is (D)TLS support for the following libraries + +* [OpenSSL](https://www.openssl.org) (Minimum version 1.1.0) [PKI, PSK and PKCS11] + +* [GnuTLS](https://www.gnutls.org) (Minimum version 3.3.0) [PKI, PSK, RPK(3.6.6+) and PKCS11] + +* [Mbed TLS](https://www.trustedfirmware.org/projects/mbed-tls/) (Minimum version 2.7.10) [PKI and PSK] + +* [TinyDTLS](https://github.com/eclipse/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/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..5118638 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,33 @@ +# Security Policy + +## No Warranty + +Per the terms of the BSD-2-Clause license, libcoap is offered "as is" and +without any guarantee or warranty pertaining to its operation. While every +reasonable effort is made by its maintainers to ensure the product remains +free of security vulnerabilities, users are ultimately responsible for +conducting their own evaluations of each software release. + +## Reporting a Suspected Vulnerability + +If you believe you've uncovered a security vulnerability and wish to report +it confidentially, you may do so via email. Please note that any reported +vulnerabilities **MUST** meet all the following conditions: + +* Affects the most recent stable release of libcoap, or a current beta release +* Is reproducible following a prescribed set of instructions + +Please note that we **DO NOT** accept reports generated by automated tooling +which merely suggest that a file or file(s) _may_ be vulnerable under certain +conditions, as these are most often innocuous. + +If you believe that you've found a vulnerability which meets all of these +conditions, please email a brief description of the suspected bug and +instructions for reproduction to **libcoap-security@tzi.org**. Please do NOT +create a public GitHub issue. + +### Bug Bounties + +As libcoap is provided as free open source software, we do not offer any monetary +compensation for vulnerability or bug reports, however your contributions are greatly +appreciated. diff --git a/TODO b/TODO new file mode 100644 index 0000000..52df83a --- /dev/null +++ b/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/autogen.sh b/autogen.sh new file mode 100755 index 0000000..0b97905 --- /dev/null +++ b/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/build-env/.dockerignore b/build-env/.dockerignore new file mode 100644 index 0000000..73b67f9 --- /dev/null +++ b/build-env/.dockerignore @@ -0,0 +1,5 @@ +imagename +build.sh +*~ +.*.swp +\#*# diff --git a/build-env/Dockerfile.build-env b/build-env/Dockerfile.build-env new file mode 100644 index 0000000..1cf6079 --- /dev/null +++ b/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/build-env/Dockerfile.develop b/build-env/Dockerfile.develop new file mode 100644 index 0000000..3f83e0a --- /dev/null +++ b/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/build-env/build.sh b/build-env/build.sh new file mode 100755 index 0000000..5cf4bc2 --- /dev/null +++ b/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/build-env/imagename b/build-env/imagename new file mode 100644 index 0000000..8d69844 --- /dev/null +++ b/build-env/imagename @@ -0,0 +1,2 @@ +USER=obgm +IMAGE=libcoap diff --git a/cmake-format.yaml b/cmake-format.yaml new file mode 100644 index 0000000..3e25542 --- /dev/null +++ b/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/cmake/Config.cmake.in b/cmake/Config.cmake.in new file mode 100644 index 0000000..9c15f36 --- /dev/null +++ b/cmake/Config.cmake.in @@ -0,0 +1,4 @@ +@PACKAGE_INIT@ + +include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") +check_required_components("@PROJECT_NAME@") diff --git a/cmake/FindMbedTLS.cmake b/cmake/FindMbedTLS.cmake new file mode 100644 index 0000000..75d8598 --- /dev/null +++ b/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/cmake/FindTinyDTLS.cmake b/cmake/FindTinyDTLS.cmake new file mode 100644 index 0000000..9955732 --- /dev/null +++ b/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/cmake_coap_config.h.in b/cmake_coap_config.h.in new file mode 100644 index 0000000..1876b98 --- /dev/null +++ b/cmake_coap_config.h.in @@ -0,0 +1,210 @@ +/* + * cmake_coap_config.h -- cmake configuration for libcoap + * + * Copyright (C) 2020 Carlos Gomes Martinho + * Copyright (C) 2021-2023 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 to 1 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 to 1 if the library has client support. */ +#cmakedefine COAP_CLIENT_SUPPORT @COAP_CLIENT_SUPPORT@ + +/* Define to 1 if the library has server support. */ +#cmakedefine COAP_SERVER_SUPPORT @COAP_SERVER_SUPPORT@ + +/* Define to 1 if the library is to have observe persistence. */ +#cmakedefine COAP_WITH_OBSERVE_PERSIST @COAP_WITH_OBSERVE_PERSIST@ + +/* Define to 1 if the system has epoll support. */ +#cmakedefine COAP_EPOLL_SUPPORT @COAP_EPOLL_SUPPORT@ + +/* Define to 1 if the library has OSCORE support. */ +#cmakedefine COAP_OSCORE_SUPPORT @COAP_OSCORE_SUPPORT@ + +/* Define to 1 if the library has WebSockets support. */ +#cmakedefine COAP_WS_SUPPORT @COAP_WS_SUPPORT@ + +/* Define to 1 if the library has async separate response support. */ +#cmakedefine COAP_ASYNC_SUPPORT @COAP_ASYNC_SUPPORT@ + +/* Define to 0-8 for maximum logging level. */ +#cmakedefine COAP_MAX_LOGGING_LEVEL @COAP_MAX_LOGGING_LEVEL@ + +/* Define to 1 to build without TCP support. */ +#cmakedefine01 COAP_DISABLE_TCP + +/* Define to 1 to build with IPv4 support. */ +#cmakedefine COAP_IPV4_SUPPORT @COAP_IPV4_SUPPORT@ + +/* Define to 1 to build with IPv6 support. */ +#cmakedefine COAP_IPV6_SUPPORT @COAP_IPV6_SUPPORT@ + +/* Define to 1 to build with Unix socket support. */ +#cmakedefine COAP_AF_UNIX_SUPPORT @COAP_AF_UNIX_SUPPORT@ + +/* Define to 1 to build with Q-Block (RFC 9177) support. */ +#cmakedefine COAP_Q_BLOCK_SUPPORT @COAP_Q_BLOCK_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 to 1 if you have the header file. */ +#cmakedefine HAVE_ERRNO_H @HAVE_ERRNO_H@ + +/* Define to 1 if the system has openssl */ +#cmakedefine COAP_WITH_LIBOPENSSL @COAP_WITH_LIBOPENSSL@ + +/* Define to 1 if the system has libgnutls28 */ +#cmakedefine COAP_WITH_LIBGNUTLS @COAP_WITH_LIBGNUTLS@ + +/* Define to 1 if the system has libtinydtls */ +#cmakedefine COAP_WITH_LIBTINYDTLS @COAP_WITH_LIBTINYDTLS@ + +/* Define to 1 if the system has libmbedtls */ +#cmakedefine COAP_WITH_LIBMBEDTLS @COAP_WITH_LIBMBEDTLS@ + +/* 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 you have the `getrandom' function. */ +#cmakedefine HAVE_GETRANDOM @HAVE_GETRANDOM@ + +/* Define to 1 if you have the `randon' function. */ +#cmakedefine HAVE_RANDOM @HAVE_RANDOM@ + +/* 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_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/coap_config.h.contiki b/coap_config.h.contiki new file mode 100644 index 0000000..b637bef --- /dev/null +++ b/coap_config.h.contiki @@ -0,0 +1,105 @@ +#ifndef COAP_CONFIG_H_ +#define COAP_CONFIG_H_ + +/* Define to 1 if libcoap supports client mode code. */ +#define COAP_CLIENT_SUPPORT 1 + +/* Define to 1 if libcoap supports server mode code. */ +#define COAP_SERVER_SUPPORT 1 + +/* Define to 1 if the system has small stack size. */ +#define COAP_CONSTRAINED_STACK 1 + +/* Define to 1 to build without TCP support. */ +#define COAP_DISABLE_TCP 1 + +/* Define to 1 to build support for IPv4 packets. */ +/* #undef COAP_IPV4_SUPPORT 1 */ + +/* Define to 1 to build support for IPv6 packets. */ +#define COAP_IPV6_SUPPORT 1 + +/* Define to 1 to build support for Unix socket packets. */ +/* #undef COAP_AF_UNIX_SUPPORT 1 */ + +/* Define to 1 to build with support for async separate responses. */ +#define COAP_ASYNC_SUPPORT 1 + +/* Define to 1 to build support for persisting observes. */ +/* #undef COAP_WITH_OBSERVE_PERSIST 1 */ + +/* Define to 1 to build with WebSockets support. */ +/* #undef COAP_WS_SUPPORT 1 */ + +/* Define to 1 to build with Q-Block (RFC9177) support. */ +/* #undef COAP_Q_BLOCK_SUPPORT 1 */ + +/* Define to 1 if you have the header file. */ +#define HAVE_ASSERT_H 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_ERRNO_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LIMITS_H 1 + +/* Define to 1 if you have the `memset' function. */ +#define HAVE_MEMSET 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDDEF_H 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. */ +#define HAVE_STRNLEN 1 + +/* Define to 1 if you have the `strrchr' function. */ +#define HAVE_STRRCHR 1 + +/* Define to 1 if you have the `snprintf' function. */ +#define HAVE_SNPRINTF 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 full name and version of this package. */ +#define PACKAGE_STRING "libcoap 4.3.4" + +/* 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.4" + +#define WITH_CONTIKI 1 + +#define HASH_NONFATAL_OOM 1 + +#ifndef HEAPMEM_CONF_ARENA_SIZE +#define HEAPMEM_CONF_ARENA_SIZE 6144 +#endif + +#endif /* COAP_CONFIG_H_ */ diff --git a/coap_config.h.riot b/coap_config.h.riot new file mode 100644 index 0000000..19a238d --- /dev/null +++ b/coap_config.h.riot @@ -0,0 +1,345 @@ +/* + * coap_config.h.riot -- RIOT configuration for libcoap + * + * Copyright (C) 2021-2023 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_ + +#define WITH_POSIX 1 + +#ifndef COAP_CONSTRAINED_STACK +#define COAP_CONSTRAINED_STACK 1 +#endif + +#ifdef CONFIG_LIBCOAP_MAX_LOGGING_LEVEL +#ifndef COAP_MAX_LOGGING_LEVEL +/* Define to 1 to build without TCP support. */ +#define COAP_MAX_LOGGING_LEVEL CONFIG_LIBCOAP_MAX_LOGGING_LEVEL +#endif /* COAP_MAX_LOGGING_LEVEL */ +#endif /* CONFIG_LIBCOAP_MAX_LOGGING_LEVEL */ + +#ifdef CONFIG_LIBCOAP_IPV4_SUPPORT +#ifndef COAP_IPV4_SUPPORT +/* Define to 1 to build with IPv4 support. */ +#define COAP_IPV4_SUPPORT 1 +#endif /* COAP_IPV4_SUPPORT */ +#endif /* CONFIG_LIBCOAP_IPV4_SUPPORT */ + +#ifdef CONFIG_LIBCOAP_IPV6_SUPPORT +#ifndef COAP_IPV6_SUPPORT +/* Define to 1 to build with IPv6 support. */ +#define COAP_IPV6_SUPPORT 1 +#endif /* COAP_IPV6_SUPPORT */ +#endif /* CONFIG_LIBCOAP_IPV6_SUPPORT */ + +#ifdef CONFIG_LIBCOAP_AF_UNIX_SUPPORT +#ifndef COAP_AF_UNIX_SUPPORT +/* Define to 1 to build with Unix socket support. */ +#define COAP_AF_UNIX_SUPPORT 1 +#endif /* COAP_AF_UNIX_SUPPORT */ +#endif /* CONFIG_LIBCOAP_AF_UNIX_SUPPORT */ + +#ifdef CONFIG_LIBCOAP_TCP_SUPPORT +#ifndef COAP_DISABLE_TCP +/* Define to 1 to build without TCP support. */ +#define COAP_DISABLE_TCP 0 +#endif /* COAP_DISABLE_TCP */ +#endif /* CONFIG_LIBCOAP_TCP_SUPPORT */ + +#ifdef CONFIG_LIBCOAP_OSCORE_SUPPORT +#ifndef COAP_OSCORE_SUPPORT +/* Define to 1 if the library has OSCORE support. */ +#define COAP_OSCORE_SUPPORT 1 +#endif /* COAP_OSCORE_SUPPORT */ +#endif /* CONFIG_LIBCOAP_OSCORE_SUPPORT */ + +#ifdef CONFIG_LIBCOAP_WITH_OBSERVE_PERSIST +#ifndef COAP_WITH_OBSERVE_PERSIST +/* Define to 1 if the library has Observe persist support. */ +#define COAP_WITH_OBSERVE_PERSIST 0 +#endif /* COAP_WITH_OBSERVE_PERSIST */ +#endif /* CONFIG_LIBCOAP_WITH_OBSERVE_PERSIST */ + +#ifdef CONFIG_LIBCOAP_WS_SUPPORT +#ifndef COAP_WS_SUPPORT +/* Define to 1 if the library has WebSockets support. */ +#define COAP_WS_SUPPORT 0 +#endif /* COAP_WS_SUPPORT */ +#endif /* CONFIG_LIBCOAP_WS_SUPPORT */ + +#ifdef CONFIG_LIBCOAP_Q_BLOCK_SUPPORT +#ifndef COAP_Q_BLOCK_SUPPORT +/* Define to 1 to build with Q-Block (RFC9177) support. */ +#define COAP_Q_BLOCK_SUPPORT 0 +#endif /* COAP_Q_BLOCK_SUPPORT */ +#endif /* CONFIG_LIBCOAP_Q_BLOCK_SUPPORT */ + +#ifdef CONFIG_LIBCOAP_CLIENT_SUPPORT +#ifndef COAP_CLIENT_SUPPORT +/* Define to 1 if the library has client support. */ +#define COAP_CLIENT_SUPPORT 1 +#endif /* COAP_CLIENT_SUPPORT */ +#endif /* CONFIG_LIBCOAP_CLIENT_SUPPORT */ + +#ifdef CONFIG_LIBCOAP_SERVER_SUPPORT +#ifndef COAP_SERVER_SUPPORT +/* Define to 1 if the library has server support. */ +#define COAP_SERVER_SUPPORT 1 +#endif /* COAP_SERVER_SUPPORT */ +#endif /* CONFIG_LIBCOAP_SERVER_SUPPORT */ + +#ifdef CONFIG_LIBCOAP_ASYNC_SUPPORT +#ifndef COAP_ASYNC_SUPPORT +/* Define to 1 to build with support for async separate responses. */ +#define COAP_ASYNC_SUPPORT 1 +#endif /* COAP_ASYNC_SUPPORT */ +#endif /* CONFIG_LIBCOAP_ASYNC_SUPPORT */ + +#ifdef CONFIG_LIBCOAP_MAX_STRING_SIZE +#ifndef COAP_MAX_STRING_SIZE +#define COAP_MAX_STRING_SIZE CONFIG_LIBCOAP_MAX_STRING_SIZE +#endif /* COAP_MAX_STRING_SIZE */ +#endif /* CONFIG_LIBCOAP_OSCORE_SUPPORT */ + +#ifdef CONFIG_LIBCOAP_MAX_ENDPOINTS +#ifndef COAP_MAX_ENDPOINTS +#define COAP_MAX_ENDPOINTS CONFIG_LIBCOAP_MAX_ENDPOINTS +#endif /* COAP_MAX_ENDPOINTS */ +#endif /* CONFIG_LIBCOAP_MAX_ENDPOINTS */ + +#ifdef CONFIG_LIBCOAP_MAX_RESOURCES +#ifndef COAP_MAX_RESOURCES +#define COAP_MAX_RESOURCES CONFIG_LIBCOAP_MAX_RESOURCES +#endif /* COAP_MAX_RESOURCES */ +#endif /* CONFIG_LIBCOAP_MAX_RESOURCES */ + +#ifdef CONFIG_LIBCOAP_MAX_ATTRIBUTE_SIZE +#ifndef COAP_MAX_ATTRIBUTE_SIZE +#define COAP_MAX_ATTRIBUTE_SIZE CONFIG_LIBCOAP_MAX_ATTRIBUTE_SIZE +#endif /* COAP_MAX_ATTRIBUTE_SIZE */ +#endif /* CONFIG_LIBCOAP_MAX_ATTRIBUTE_SIZE */ + +#ifdef CONFIG_LIBCOAP_MAX_ATTRIBUTES +#ifndef COAP_MAX_ATTRIBUTES +#define COAP_MAX_ATTRIBUTES CONFIG_LIBCOAP_MAX_ATTRIBUTES +#endif /* COAP_MAX_ATTRIBUTES */ +#endif /* CONFIG_LIBCOAP_MAX_ATTRIBUTES */ + +#ifdef CONFIG_LIBCOAP_MAX_PACKETS +#ifndef COAP_MAX_PACKETS +#define COAP_MAX_PACKETS CONFIG_LIBCOAP_MAX_PACKETS +#endif /* COAP_MAX_PACKETS */ +#endif /* CONFIG_LIBCOAP_MAX_PACKETS */ + +#ifdef CONFIG_LIBCOAP_MAX_NODES +#ifndef COAP_MAX_NODES +#define COAP_MAX_NODES CONFIG_LIBCOAP_MAX_NODES +#endif /* COAP_MAX_NODES */ +#endif /* CONFIG_LIBCOAP_MAX_NODES */ + +#ifdef CONFIG_LIBCOAP_MAX_CONTEXTS +#ifndef COAP_MAX_CONTEXTS +#define COAP_MAX_CONTEXTS CONFIG_LIBCOAP_MAX_CONTEXTS +#endif /* COAP_MAX_CONTEXTS */ +#endif /* CONFIG_LIBCOAP_MAX_CONTEXTS */ + +#ifdef CONFIG_LIBCOAP_MAX_PDUS +#ifndef COAP_MAX_PDUS +#define COAP_MAX_PDUS CONFIG_LIBCOAP_MAX_PDUS +#endif /* COAP_MAX_PDUS */ +#endif /* CONFIG_LIBCOAP_MAX_PDUS */ + +#ifdef CONFIG_LIBCOAP_MAX_DTLS_SESSIONS +#ifndef COAP_MAX_DTLS_SESSIONS +#define COAP_MAX_DTLS_SESSIONS CONFIG_LIBCOAP_MAX_DTLS_SESSIONS +#endif /* COAP_MAX_DTLS_SESSIONS */ +#endif /* CONFIG_LIBCOAP_MAX_DTLS_SESSIONS */ + +#ifdef CONFIG_LIBCOAP_MAX_SESSIONS +#ifndef COAP_MAX_SESSIONS +#define COAP_MAX_SESSIONS CONFIG_LIBCOAP_MAX_SESSIONS +#endif /* COAP_MAX_SESSIONS */ +#endif /* CONFIG_LIBCOAP_MAX_SESSIONS */ + +#ifdef CONFIG_LIBCOAP_MAX_OPTION_SIZE +#ifndef COAP_MAX_OPTION_SIZE +#define COAP_MAX_OPTION_SIZE CONFIG_LIBCOAP_MAX_OPTION_SIZE +#endif /* COAP_MAX_OPTION_SIZE */ +#endif /* CONFIG_LIBCOAP_MAX_OPTION_SIZE */ + +#ifdef CONFIG_LIBCOAP_MAX_OPTIONS +#ifndef COAP_MAX_OPTIONS +#define COAP_MAX_OPTIONS CONFIG_LIBCOAP_MAX_OPTIONS +#endif /* COAP_MAX_OPTIONS */ +#endif /* CONFIG_LIBCOAP_MAX_OPTIONS */ + +#ifdef CONFIG_LIBCOAP_MAX_CACHE_KEYS +#ifndef COAP_MAX_CACHE_KEYS +#define COAP_MAX_CACHE_KEYS CONFIG_LIBCOAP_MAX_CACHE_KEYS +#endif /* COAP_MAX_CACHE_KEYS */ +#endif /* CONFIG_LIBCOAP_MAX_CACHE_KEYS */ + +#ifdef CONFIG_LIBCOAP_MAX_CACHE_ENTRIES +#ifndef COAP_MAX_CACHE_ENTRIES +#define COAP_MAX_CACHE_ENTRIES CONFIG_LIBCOAP_MAX_CACHE_ENTRIES +#endif /* COAP_MAX_CACHE_ENTRIES */ +#endif /* CONFIG_LIBCOAP_MAX_CACHE_ENTRIES */ + +#ifdef CONFIG_LIBCOAP_MAX_LG_CRCVS +#ifndef COAP_MAX_LG_CRCVS +#define COAP_MAX_LG_CRCVS CONFIG_LIBCOAP_MAX_LG_CRCVS +#endif /* COAP_MAX_LG_CRCVS */ +#endif /* CONFIG_LIBCOAP_MAX_LG_CRCVS */ + +#ifdef CONFIG_LIBCOAP_MAX_LG_SRCVS +#ifndef COAP_MAX_LG_SRCVS +#define COAP_MAX_LG_SRCVS CONFIG_LIBCOAP_MAX_LG_SRCVS +#endif /* COAP_MAX_LG_SRCVS */ +#endif /* CONFIG_LIBCOAP_MAX_LG_SRCVS */ + +#ifdef CONFIG_LIBCOAP_MAX_LG_XMITS +#ifndef COAP_MAX_LG_XMITS +#define COAP_MAX_LG_XMITS CONFIG_LIBCOAP_MAX_LG_XMITS +#endif /* COAP_MAX_LG_XMITS */ +#endif /* CONFIG_LIBCOAP_MAX_LG_XMITS */ + +#ifndef COAP_DISABLE_TCP +#if MODULE_SOCK_TCP +#define COAP_DISABLE_TCP 0 +#else /* ! MODULE_SOCK_TCP */ +#define COAP_DISABLE_TCP 1 +#endif /* ! MODULE_SOCK_TCP */ +#endif /* COAP_DISABLE_TCP */ + +#ifdef MODULE_TINYDTLS +#ifndef COAP_WITH_LIBTINYDTLS +#define COAP_WITH_LIBTINYDTLS 1 +#endif /* ! COAP_WITH_LIBTINYDTLS */ +#endif /* MODULE_TINYDTLS */ + +/* 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. */ +#define HAVE_STRNLEN 1 + +/* 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.4" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "libcoap 4.3.4" + +/* 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_ */ diff --git a/coap_config.h.riot.in b/coap_config.h.riot.in new file mode 100644 index 0000000..2962008 --- /dev/null +++ b/coap_config.h.riot.in @@ -0,0 +1,345 @@ +/* + * coap_config.h.riot -- RIOT configuration for libcoap + * + * Copyright (C) 2021-2023 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_ + +#define WITH_POSIX 1 + +#ifndef COAP_CONSTRAINED_STACK +#define COAP_CONSTRAINED_STACK 1 +#endif + +#ifdef CONFIG_LIBCOAP_MAX_LOGGING_LEVEL +#ifndef COAP_MAX_LOGGING_LEVEL +/* Define to 1 to build without TCP support. */ +#define COAP_MAX_LOGGING_LEVEL CONFIG_LIBCOAP_MAX_LOGGING_LEVEL +#endif /* COAP_MAX_LOGGING_LEVEL */ +#endif /* CONFIG_LIBCOAP_MAX_LOGGING_LEVEL */ + +#ifdef CONFIG_LIBCOAP_IPV4_SUPPORT +#ifndef COAP_IPV4_SUPPORT +/* Define to 1 to build with IPv4 support. */ +#define COAP_IPV4_SUPPORT 1 +#endif /* COAP_IPV4_SUPPORT */ +#endif /* CONFIG_LIBCOAP_IPV4_SUPPORT */ + +#ifdef CONFIG_LIBCOAP_IPV6_SUPPORT +#ifndef COAP_IPV6_SUPPORT +/* Define to 1 to build with IPv6 support. */ +#define COAP_IPV6_SUPPORT 1 +#endif /* COAP_IPV6_SUPPORT */ +#endif /* CONFIG_LIBCOAP_IPV6_SUPPORT */ + +#ifdef CONFIG_LIBCOAP_AF_UNIX_SUPPORT +#ifndef COAP_AF_UNIX_SUPPORT +/* Define to 1 to build with Unix socket support. */ +#define COAP_AF_UNIX_SUPPORT 1 +#endif /* COAP_AF_UNIX_SUPPORT */ +#endif /* CONFIG_LIBCOAP_AF_UNIX_SUPPORT */ + +#ifdef CONFIG_LIBCOAP_TCP_SUPPORT +#ifndef COAP_DISABLE_TCP +/* Define to 1 to build without TCP support. */ +#define COAP_DISABLE_TCP 0 +#endif /* COAP_DISABLE_TCP */ +#endif /* CONFIG_LIBCOAP_TCP_SUPPORT */ + +#ifdef CONFIG_LIBCOAP_OSCORE_SUPPORT +#ifndef COAP_OSCORE_SUPPORT +/* Define to 1 if the library has OSCORE support. */ +#define COAP_OSCORE_SUPPORT 1 +#endif /* COAP_OSCORE_SUPPORT */ +#endif /* CONFIG_LIBCOAP_OSCORE_SUPPORT */ + +#ifdef CONFIG_LIBCOAP_WITH_OBSERVE_PERSIST +#ifndef COAP_WITH_OBSERVE_PERSIST +/* Define to 1 if the library has Observe persist support. */ +#define COAP_WITH_OBSERVE_PERSIST 0 +#endif /* COAP_WITH_OBSERVE_PERSIST */ +#endif /* CONFIG_LIBCOAP_WITH_OBSERVE_PERSIST */ + +#ifdef CONFIG_LIBCOAP_WS_SUPPORT +#ifndef COAP_WS_SUPPORT +/* Define to 1 if the library has WebSockets support. */ +#define COAP_WS_SUPPORT 0 +#endif /* COAP_WS_SUPPORT */ +#endif /* CONFIG_LIBCOAP_WS_SUPPORT */ + +#ifdef CONFIG_LIBCOAP_Q_BLOCK_SUPPORT +#ifndef COAP_Q_BLOCK_SUPPORT +/* Define to 1 to build with Q-Block (RFC9177) support. */ +#define COAP_Q_BLOCK_SUPPORT 0 +#endif /* COAP_Q_BLOCK_SUPPORT */ +#endif /* CONFIG_LIBCOAP_Q_BLOCK_SUPPORT */ + +#ifdef CONFIG_LIBCOAP_CLIENT_SUPPORT +#ifndef COAP_CLIENT_SUPPORT +/* Define to 1 if the library has client support. */ +#define COAP_CLIENT_SUPPORT 1 +#endif /* COAP_CLIENT_SUPPORT */ +#endif /* CONFIG_LIBCOAP_CLIENT_SUPPORT */ + +#ifdef CONFIG_LIBCOAP_SERVER_SUPPORT +#ifndef COAP_SERVER_SUPPORT +/* Define to 1 if the library has server support. */ +#define COAP_SERVER_SUPPORT 1 +#endif /* COAP_SERVER_SUPPORT */ +#endif /* CONFIG_LIBCOAP_SERVER_SUPPORT */ + +#ifdef CONFIG_LIBCOAP_ASYNC_SUPPORT +#ifndef COAP_ASYNC_SUPPORT +/* Define to 1 to build with support for async separate responses. */ +#define COAP_ASYNC_SUPPORT 1 +#endif /* COAP_ASYNC_SUPPORT */ +#endif /* CONFIG_LIBCOAP_ASYNC_SUPPORT */ + +#ifdef CONFIG_LIBCOAP_MAX_STRING_SIZE +#ifndef COAP_MAX_STRING_SIZE +#define COAP_MAX_STRING_SIZE CONFIG_LIBCOAP_MAX_STRING_SIZE +#endif /* COAP_MAX_STRING_SIZE */ +#endif /* CONFIG_LIBCOAP_OSCORE_SUPPORT */ + +#ifdef CONFIG_LIBCOAP_MAX_ENDPOINTS +#ifndef COAP_MAX_ENDPOINTS +#define COAP_MAX_ENDPOINTS CONFIG_LIBCOAP_MAX_ENDPOINTS +#endif /* COAP_MAX_ENDPOINTS */ +#endif /* CONFIG_LIBCOAP_MAX_ENDPOINTS */ + +#ifdef CONFIG_LIBCOAP_MAX_RESOURCES +#ifndef COAP_MAX_RESOURCES +#define COAP_MAX_RESOURCES CONFIG_LIBCOAP_MAX_RESOURCES +#endif /* COAP_MAX_RESOURCES */ +#endif /* CONFIG_LIBCOAP_MAX_RESOURCES */ + +#ifdef CONFIG_LIBCOAP_MAX_ATTRIBUTE_SIZE +#ifndef COAP_MAX_ATTRIBUTE_SIZE +#define COAP_MAX_ATTRIBUTE_SIZE CONFIG_LIBCOAP_MAX_ATTRIBUTE_SIZE +#endif /* COAP_MAX_ATTRIBUTE_SIZE */ +#endif /* CONFIG_LIBCOAP_MAX_ATTRIBUTE_SIZE */ + +#ifdef CONFIG_LIBCOAP_MAX_ATTRIBUTES +#ifndef COAP_MAX_ATTRIBUTES +#define COAP_MAX_ATTRIBUTES CONFIG_LIBCOAP_MAX_ATTRIBUTES +#endif /* COAP_MAX_ATTRIBUTES */ +#endif /* CONFIG_LIBCOAP_MAX_ATTRIBUTES */ + +#ifdef CONFIG_LIBCOAP_MAX_PACKETS +#ifndef COAP_MAX_PACKETS +#define COAP_MAX_PACKETS CONFIG_LIBCOAP_MAX_PACKETS +#endif /* COAP_MAX_PACKETS */ +#endif /* CONFIG_LIBCOAP_MAX_PACKETS */ + +#ifdef CONFIG_LIBCOAP_MAX_NODES +#ifndef COAP_MAX_NODES +#define COAP_MAX_NODES CONFIG_LIBCOAP_MAX_NODES +#endif /* COAP_MAX_NODES */ +#endif /* CONFIG_LIBCOAP_MAX_NODES */ + +#ifdef CONFIG_LIBCOAP_MAX_CONTEXTS +#ifndef COAP_MAX_CONTEXTS +#define COAP_MAX_CONTEXTS CONFIG_LIBCOAP_MAX_CONTEXTS +#endif /* COAP_MAX_CONTEXTS */ +#endif /* CONFIG_LIBCOAP_MAX_CONTEXTS */ + +#ifdef CONFIG_LIBCOAP_MAX_PDUS +#ifndef COAP_MAX_PDUS +#define COAP_MAX_PDUS CONFIG_LIBCOAP_MAX_PDUS +#endif /* COAP_MAX_PDUS */ +#endif /* CONFIG_LIBCOAP_MAX_PDUS */ + +#ifdef CONFIG_LIBCOAP_MAX_DTLS_SESSIONS +#ifndef COAP_MAX_DTLS_SESSIONS +#define COAP_MAX_DTLS_SESSIONS CONFIG_LIBCOAP_MAX_DTLS_SESSIONS +#endif /* COAP_MAX_DTLS_SESSIONS */ +#endif /* CONFIG_LIBCOAP_MAX_DTLS_SESSIONS */ + +#ifdef CONFIG_LIBCOAP_MAX_SESSIONS +#ifndef COAP_MAX_SESSIONS +#define COAP_MAX_SESSIONS CONFIG_LIBCOAP_MAX_SESSIONS +#endif /* COAP_MAX_SESSIONS */ +#endif /* CONFIG_LIBCOAP_MAX_SESSIONS */ + +#ifdef CONFIG_LIBCOAP_MAX_OPTION_SIZE +#ifndef COAP_MAX_OPTION_SIZE +#define COAP_MAX_OPTION_SIZE CONFIG_LIBCOAP_MAX_OPTION_SIZE +#endif /* COAP_MAX_OPTION_SIZE */ +#endif /* CONFIG_LIBCOAP_MAX_OPTION_SIZE */ + +#ifdef CONFIG_LIBCOAP_MAX_OPTIONS +#ifndef COAP_MAX_OPTIONS +#define COAP_MAX_OPTIONS CONFIG_LIBCOAP_MAX_OPTIONS +#endif /* COAP_MAX_OPTIONS */ +#endif /* CONFIG_LIBCOAP_MAX_OPTIONS */ + +#ifdef CONFIG_LIBCOAP_MAX_CACHE_KEYS +#ifndef COAP_MAX_CACHE_KEYS +#define COAP_MAX_CACHE_KEYS CONFIG_LIBCOAP_MAX_CACHE_KEYS +#endif /* COAP_MAX_CACHE_KEYS */ +#endif /* CONFIG_LIBCOAP_MAX_CACHE_KEYS */ + +#ifdef CONFIG_LIBCOAP_MAX_CACHE_ENTRIES +#ifndef COAP_MAX_CACHE_ENTRIES +#define COAP_MAX_CACHE_ENTRIES CONFIG_LIBCOAP_MAX_CACHE_ENTRIES +#endif /* COAP_MAX_CACHE_ENTRIES */ +#endif /* CONFIG_LIBCOAP_MAX_CACHE_ENTRIES */ + +#ifdef CONFIG_LIBCOAP_MAX_LG_CRCVS +#ifndef COAP_MAX_LG_CRCVS +#define COAP_MAX_LG_CRCVS CONFIG_LIBCOAP_MAX_LG_CRCVS +#endif /* COAP_MAX_LG_CRCVS */ +#endif /* CONFIG_LIBCOAP_MAX_LG_CRCVS */ + +#ifdef CONFIG_LIBCOAP_MAX_LG_SRCVS +#ifndef COAP_MAX_LG_SRCVS +#define COAP_MAX_LG_SRCVS CONFIG_LIBCOAP_MAX_LG_SRCVS +#endif /* COAP_MAX_LG_SRCVS */ +#endif /* CONFIG_LIBCOAP_MAX_LG_SRCVS */ + +#ifdef CONFIG_LIBCOAP_MAX_LG_XMITS +#ifndef COAP_MAX_LG_XMITS +#define COAP_MAX_LG_XMITS CONFIG_LIBCOAP_MAX_LG_XMITS +#endif /* COAP_MAX_LG_XMITS */ +#endif /* CONFIG_LIBCOAP_MAX_LG_XMITS */ + +#ifndef COAP_DISABLE_TCP +#if MODULE_SOCK_TCP +#define COAP_DISABLE_TCP 0 +#else /* ! MODULE_SOCK_TCP */ +#define COAP_DISABLE_TCP 1 +#endif /* ! MODULE_SOCK_TCP */ +#endif /* COAP_DISABLE_TCP */ + +#ifdef MODULE_TINYDTLS +#ifndef COAP_WITH_LIBTINYDTLS +#define COAP_WITH_LIBTINYDTLS 1 +#endif /* ! COAP_WITH_LIBTINYDTLS */ +#endif /* MODULE_TINYDTLS */ + +/* 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. */ +#define HAVE_STRNLEN 1 + +/* 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_ */ diff --git a/coap_config.h.windows b/coap_config.h.windows new file mode 100644 index 0000000..e648004 --- /dev/null +++ b/coap_config.h.windows @@ -0,0 +1,185 @@ +/* + * coap_config.h.windows -- Windows configuration for libcoap + * + * Copyright (C) 2017-2023 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_ + +#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 to 1 to build without TCP support. */ +#define COAP_DISABLE_TCP 0 +#endif + +#ifndef COAP_IPV4_SUPPORT +/* Define to 1 to build with IPv4 support. */ +#define COAP_IPV4_SUPPORT 1 +#endif + +#ifndef COAP_IPV6_SUPPORT +/* Define to 1 to build with IPv6 support. */ +#define COAP_IPV6_SUPPORT 1 +#endif + +#ifndef COAP_AF_UNIX_SUPPORT +/* Define to 1 to build with Unix socket support. */ +#define COAP_AF_UNIX_SUPPORT 0 +#endif + +#ifndef COAP_CLIENT_SUPPORT +/* Define if libcoap supports client mode code. */ +#define COAP_CLIENT_SUPPORT 1 +#endif + +#ifndef COAP_SERVER_SUPPORT +/* Define if libcoap supports server mode code. */ +#define COAP_SERVER_SUPPORT 1 +#endif + +#ifndef COAP_WITH_OBSERVE_PERSIST +/* Define to build support for persisting observes. */ +#define COAP_WITH_OBSERVE_PERSIST 0 +#endif + +#ifndef COAP_WS_SUPPORT +/* Define to 1 to build with WebSockets support. */ +#define COAP_WS_SUPPORT 0 +#endif + +#ifndef COAP_Q_BLOCK_SUPPORT +/* Define to 1 to build with Q-Block (RFC9177) support. */ +#define COAP_Q_BLOCK_SUPPORT 0 +#endif + +#ifndef COAP_MAX_LOGGING_LEVEL +/* Define to 0-8 for maximum logging level. */ +#define COAP_MAX_LOGGING_LEVEL 8 +#endif + +#ifndef COAP_OSCORE_SUPPORT +/* Define to 1 to build with OSCORE support. */ +#define COAP_OSCORE_SUPPORT 1 +#endif + +#ifndef COAP_ASYNC_SUPPORT +/* Define to 1 to build with support for async separate responses. */ +#define COAP_ASYNC_SUPPORT 1 +#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.4" + +/* 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.4" + +/* 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/coap_config.h.windows.in b/coap_config.h.windows.in new file mode 100644 index 0000000..4eb6a57 --- /dev/null +++ b/coap_config.h.windows.in @@ -0,0 +1,185 @@ +/* + * coap_config.h.windows -- Windows configuration for libcoap + * + * Copyright (C) 2017-2023 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_ + +#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 to 1 to build without TCP support. */ +#define COAP_DISABLE_TCP 0 +#endif + +#ifndef COAP_IPV4_SUPPORT +/* Define to 1 to build with IPv4 support. */ +#define COAP_IPV4_SUPPORT 1 +#endif + +#ifndef COAP_IPV6_SUPPORT +/* Define to 1 to build with IPv6 support. */ +#define COAP_IPV6_SUPPORT 1 +#endif + +#ifndef COAP_AF_UNIX_SUPPORT +/* Define to 1 to build with Unix socket support. */ +#define COAP_AF_UNIX_SUPPORT 0 +#endif + +#ifndef COAP_CLIENT_SUPPORT +/* Define if libcoap supports client mode code. */ +#define COAP_CLIENT_SUPPORT 1 +#endif + +#ifndef COAP_SERVER_SUPPORT +/* Define if libcoap supports server mode code. */ +#define COAP_SERVER_SUPPORT 1 +#endif + +#ifndef COAP_WITH_OBSERVE_PERSIST +/* Define to build support for persisting observes. */ +#define COAP_WITH_OBSERVE_PERSIST 0 +#endif + +#ifndef COAP_WS_SUPPORT +/* Define to 1 to build with WebSockets support. */ +#define COAP_WS_SUPPORT 0 +#endif + +#ifndef COAP_Q_BLOCK_SUPPORT +/* Define to 1 to build with Q-Block (RFC9177) support. */ +#define COAP_Q_BLOCK_SUPPORT 0 +#endif + +#ifndef COAP_MAX_LOGGING_LEVEL +/* Define to 0-8 for maximum logging level. */ +#define COAP_MAX_LOGGING_LEVEL 8 +#endif + +#ifndef COAP_OSCORE_SUPPORT +/* Define to 1 to build with OSCORE support. */ +#define COAP_OSCORE_SUPPORT 1 +#endif + +#ifndef COAP_ASYNC_SUPPORT +/* Define to 1 to build with support for async separate responses. */ +#define COAP_ASYNC_SUPPORT 1 +#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/configure.ac b/configure.ac new file mode 100644 index 0000000..4df0c6d --- /dev/null +++ b/configure.ac @@ -0,0 +1,1330 @@ +# configure.ac for the libcoap package +# +# Copyright (C) 2010-2023 Olaf Bergmann +# Copyright (C) 2015-2018 Carsten Schoenert +# Copyright (C) 2018-2023 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], [4]) + +# 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. + +# The following explanation may help to understand the above rules a bit better: +# consider that there are three possible kinds of reactions from users of your +# library to changes in a shared library: +# +# 1. Programs using the previous version may use the new version as drop-in +# replacement, and programs using the new version can also work with the +# previous one. In other words, no recompiling nor relinking is needed. In this +# case, bump 'LT_LIBCOAP_REVISION' only, don't touch 'LT_LIBCOAP_CURRENT' nor +# 'LT_LIBCOAP_AGE'. +# +# 2. Programs using the previous version may use the new version +# as drop-in replacement, but programs using the new version may use APIs not +# present in the previous one. In other words, a program linking against the new +# version may fail with 'unresolved symbols' if linking against the old version +# at runtime: set 'LT_LIBCOAP_REVISION' to 0, bump 'LT_LIBCOAP_CURRENT' and +# 'LT_LIBCOAP_AGE'. +# +# 3. Programs may need to be changed, recompiled, and relinked in +# order to use the new version. Bump 'LT_LIBCOAP_CURRENT', +# set 'LT_LIBCOAP_REVISION' and 'LT_LIBCOAP_AGE' to 0. + +# To add to the confusion, if LIBCOAP_SO_VERSION is set to 3:0:1 (c:r:a), then the +# .so version naming ends up as 2.1.0 (c-a:a:r) (as decided by libtool). + +# +# CAUTION +# +# You will need to manually update VERSION and LIBCOAP_ABI_VERSION in CMakeLists.txt +# if changes are made to libcoap_xx_version and LT_LIBCOAP_xx respectively. +# + +LT_LIBCOAP_CURRENT=4 +LT_LIBCOAP_REVISION=1 +LT_LIBCOAP_AGE=1 +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 + +# calculate the ABI version naming as calculated by libtool +m4_pattern_allow(LT_TEMP) +LT_TEMP=$LT_LIBCOAP_CURRENT +LT_TEMP=`expr $LT_TEMP - $LT_LIBCOAP_AGE` +if test "$LT_TEMP" != "$LIBCOAP_API_VERSION" ; then + AC_MSG_ERROR([==> API version ($LIBCOAP_API_VERSION) does not match base of ABI ($LT_TEMP.$LT_LIBCOAP_AGE.$LT_LIBCOAP_REVISION) version.]) +fi +LIBCOAP_ABI_VERSION=$LT_TEMP.$LT_LIBCOAP_AGE.$LT_LIBCOAP_REVISION +AC_SUBST(LIBCOAP_ABI_VERSION) +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"]) + +# clang 14+ generates dwarf-5, which is not currently supported by valgrind +if test "x$CC" = "xclang"; then + WARNING_CFLAGS="$WARNING_CFLAGS -gdwarf-4" +fi + +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 + # 'git submodule update' may be required + AC_DEFINE(HAVE_DTLS_SET_LOG_HANDLER, [1], [Define to 1 if TinyDTLS has dtls_set_log_handler.]) + 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 + AC_CHECK_LIB(tinydtls,dtls_set_log_handler,AC_DEFINE(HAVE_DTLS_SET_LOG_HANDLER, [1], [Define to 1 if TinyDTLS has dtls_set_log_handler.])) + 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(COAP_WITH_LIBGNUTLS, [1], [Define to 1 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(COAP_WITH_LIBOPENSSL, [1], [Define to 1 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(COAP_WITH_LIBMBEDTLS, [1], [Define to 1 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(COAP_WITH_LIBTINYDTLS, [1], [Define to 1 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 + AC_DEFINE(HAVE_NOTLS, [1], [Define to 1 if libcoap has no tls library support.]) +fi +AM_CONDITIONAL(HAVE_NOTLS, [test "x$LIBCOAP_DTLS_LIB_EXTENSION_NAME" = "x-notls"]) + +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 +# __OSCORE__ +# Support for Object Security according to RFC 8613. +AC_ARG_ENABLE([oscore], + [AS_HELP_STRING([--enable-oscore], + [Enable building with OSCORE support [default=yes]])], + [build_oscore="$enableval"], + [build_oscore="yes"]) + +if test "x$build_oscore" = "xyes"; then + if test "x$LIBCOAP_DTLS_LIB_EXTENSION_NAME" = "x-notls"; then + AC_MSG_WARN([==> --enable-oscore requires crypto support from TLS library or OS]) + fi +fi + +if test "x$build_oscore" = "xyes"; then + AC_DEFINE(COAP_OSCORE_SUPPORT, [1], [Define to 1 to build with OSCORE support.]) +fi +AM_CONDITIONAL(COAP_OSCORE_SUPPORT, [test "x$build_oscore" = "xyes"]) + +# 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 to 1 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 +# __ipv4__ +AC_ARG_ENABLE([ipv4], + [AS_HELP_STRING([--enable-ipv4-support], + [Enable building with support for IPv4 packets [default=yes]])], + [build_ipv4_support="$enableval"], + [build_ipv4_support="yes"]) + +AS_IF([test "x$build_ipv4_support" = "xyes"], + [AC_DEFINE(COAP_IPV4_SUPPORT, [1], [Define to build support for IPv4 packets.])]) + +# configure options +# __ipv6__ +AC_ARG_ENABLE([ipv6], + [AS_HELP_STRING([--enable-ipv6-support], + [Enable building with support for IPv6 packets [default=yes]])], + [build_ipv6_support="$enableval"], + [build_ipv6_support="yes"]) + +AS_IF([test "x$build_ipv6_support" = "xyes"], + [AC_DEFINE(COAP_IPV6_SUPPORT, [1], [Define to build support for IPv6 packets.])]) + +# configure options +# __af_unix__ +AC_ARG_ENABLE([af_unix], + [AS_HELP_STRING([--enable-af-unix-support], + [Enable building with support for Unix socket packets [default=yes]])], + [build_af_unix_support="$enableval"], + [build_af_unix_support="yes"]) + +AS_IF([test "x$build_af_unix_support" = "xyes"], + [AC_DEFINE(COAP_AF_UNIX_SUPPORT, [1], [Define to build support for Unix socket packets.])]) + +# 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 +# __websockets__ +AC_ARG_ENABLE([websockets], + [AS_HELP_STRING([--enable-websockets], + [Enable building with WebSockets support [default=yes]])], + [build_ws="$enableval"], + [build_ws="yes"]) + +if test "x$build_ws" = "xyes"; then + if test "x$build_tcp" != "xyes"; then + build_ws=no + AC_MSG_WARN([--enable-websockets requires --enable-tcp, so --enable-websockets ignored.]) + fi +fi + +AS_IF([test "x$build_ws" = "xyes"], + [AC_DEFINE(COAP_WS_SUPPORT, [1], [Define to 1 to build with WebSockets support.])]) +AC_SUBST(COAP_WS_SUPPORT) + +# configure options +# __async__ +AC_ARG_ENABLE([async], + [AS_HELP_STRING([--enable-async], + [Enable building with support for async separate responses [default=yes]])], + [build_async="$enableval"], + [build_async="yes"]) + +AS_IF([test "x$build_async" = "xyes"], + [AC_DEFINE(COAP_ASYNC_SUPPORT, [1], [Define to 1 to build with support for async separate responses.])]) + +# configure options +# __observe_persist__ +AC_ARG_ENABLE([async], + [AS_HELP_STRING([--enable-observe-persist], + [Enable building with support for persisting observes over a server restart [default=yes]])], + [build_observe_persist="$enableval"], + [build_observe_persist="yes"]) + +AS_IF([test "x$build_observe_persist" = "xyes"], + [AC_DEFINE(COAP_WITH_OBSERVE_PERSIST, [1], [Define to 1 to build support for persisting observes.])]) + +# configure options +# __q_block__ +# Support for Q-Block according to RFC 9177. +AC_ARG_ENABLE([q-block], + [AS_HELP_STRING([--enable-q-block], + [Enable building with Q-Block support [default=yes]])], + [build_q_block="$enableval"], + [build_q_block="yes"]) + +AS_IF([test "x$build_q_block" = "xyes"], + [AC_DEFINE(COAP_Q_BLOCK_SUPPORT, [1], [Define to 1 to build with Q-Block support.])]) + +# 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 errno.h winsock2.h ws2tcpip.h \ + stdlib.h string.h strings.h sys/socket.h sys/time.h \ + time.h unistd.h sys/unistd.h sys/ioctl.h net/if.h ifaddrs.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 to 1 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 to 1 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 to 1 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 to 1 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 + +AC_ARG_ENABLE([max-logging-level], + [AS_HELP_STRING([--enable-max-logging-level], + [Only build logging code up to and including the specified logging level [default=8]])], + [enable_max_logging_level="$enableval"], + [enable_max_logging_level="8"]) + +if test "x$enable_max_logging_level" != "x8"; then + case x$enable_max_logging_level in + x0) ;; + x1) ;; + x2) ;; + x3) ;; + x4) ;; + x5) ;; + x6) ;; + x7) ;; + *) + AC_MSG_ERROR([--emable-max-logging-level must have a value of 0 through 8 inclusive]) + ;; + esac + AC_DEFINE_UNQUOTED([COAP_MAX_LOGGING_LEVEL], [$enable_max_logging_level], [Define to level if max logging level is not 8]) +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 random 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" + ;; + + *mingw*) + AC_MSG_RESULT([MinGW]) + ADDITIONAL_CFLAGS="-D_GNU_SOURCE -Wno-format -Wno-format-security" + LIBS="${LIBS} -lws2_32" + ;; + + *) + 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.riot +coap_config.h.windows +doc/Makefile +examples/Makefile +examples/lwip/config/coap_config.h +include/coap$LIBCOAP_API_VERSION/coap.h +include/coap$LIBCOAP_API_VERSION/coap.h.riot +include/coap$LIBCOAP_API_VERSION/coap.h.windows +man/coap.txt +man/coap_address.txt +man/coap_async.txt +man/coap_attribute.txt +man/coap_block.txt +man/coap_cache.txt +man/coap_context.txt +man/coap_deprecated.txt +man/coap_encryption.txt +man/coap_endpoint_client.txt +man/coap_endpoint_server.txt +man/coap_handler.txt +man/coap_init.txt +man/coap_io.txt +man/coap_keepalive.txt +man/coap_logging.txt +man/coap_lwip.txt +man/coap_observe.txt +man/coap_oscore.txt +man/coap_pdu_access.txt +man/coap_pdu_setup.txt +man/coap_persist.txt +man/coap_recovery.txt +man/coap_resource.txt +man/coap_session.txt +man/coap_string.txt +man/coap_tls_library.txt +man/coap_uri.txt +man/coap_websockets.txt +man/coap-client.txt +man/coap-oscore-conf.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 + +LIBCOAP_BUILD=`git describe --tags --dirty --always` +if test "x$LIBCOAP_BUILD" = "x"; then + LIBCOAP_BUILD=$PACKAGE_VERSION +fi + +AC_MSG_RESULT([ +libcoap Configuration Summary: + libcoap package version : "$PACKAGE_VERSION" + libcoap package source : "$LIBCOAP_BUILD" + libcoap API version : "$LIBCOAP_API_VERSION" + libcoap ABI version : "$LIBCOAP_ABI_VERSION" + libcoap libtool SO version : "$LIBCOAP_SO_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_ipv4" != "xno"; then + AC_MSG_RESULT([ build with IPv4 support : "yes"]) +else + AC_MSG_RESULT([ build with IPv4 support : "no"]) +fi +if test "x$build_ipv6" != "xno"; then + AC_MSG_RESULT([ build with IPv6 support : "yes"]) +else + AC_MSG_RESULT([ build with IPv6 support : "no"]) +fi +if test "x$build_af_unix" != "xno"; then + AC_MSG_RESULT([ build with Unix socket support : "yes"]) +else + AC_MSG_RESULT([ build with Unix socket 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$build_observe_persist" = "xyes"; then + AC_MSG_RESULT([ build Observe Persist : "yes"]) +else + AC_MSG_RESULT([ build Observe Persist : "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_oscore" != "xno"; then + AC_MSG_RESULT([ enable OSCORE support : "yes"]) +else + AC_MSG_RESULT([ enable OSCORE support : "no"]) +fi +if test "x$build_q_block" != "xno"; then + AC_MSG_RESULT([ enable Q-Block support : "yes"]) +else + AC_MSG_RESULT([ enable Q-Block support : "no"]) +fi +if test "x$enable_max_logging_level" != "x8"; then + AC_MSG_RESULT([ enable max logging level : "$enable_max_logging_level"]) +else + AC_MSG_RESULT([ enable max logging level : "none"]) +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/doc/Doxyfile.in b/doc/Doxyfile.in new file mode 100644 index 0000000..66cacc1 --- /dev/null +++ b/doc/Doxyfile.in @@ -0,0 +1,2614 @@ +# 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@/src/oscore \ + @top_srcdir@/include/coap@LIBCOAP_API_VERSION@ \ + @top_srcdir@/include/oscore \ + @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_contiki.c \ + @top_srcdir@/src/coap_io_lwip.c \ + @top_srcdir@/src/coap_io_riot.c \ + @top_srcdir@/include/coap@LIBCOAP_API_VERSION@/coap_uthash_internal.h \ + @top_srcdir@/include/coap@LIBCOAP_API_VERSION@/coap_utlist_internal.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 +# , /