From 98805f70a5e887bb8be3a869c9515c8d50ec3a1b Mon Sep 17 00:00:00 2001 From: Jon Shallow Date: Sat, 8 Aug 2026 09:52:51 +0100 Subject: [PATCH] Documentation tidy up Add in codespell to pre-commit to help fix documentation errors. --- .pre-commit-config.yaml | 5 +++++ CMakeLists.txt | 12 ++++++------ ChangeLog | 4 ++-- Makefile.am | 4 ++-- TODO | 2 +- autogen.sh | 2 +- coap_config.h.riot | 2 +- configure.ac | 2 +- doc/Makefile.am | 2 +- doc/main.md | 2 +- examples/coap-client.c | 2 +- examples/coap-server.c | 2 +- examples/coap_list.c | 2 +- examples/etsi_coaptest.sh | 2 +- examples/oscore-interop-server.c | 2 +- examples/oscore_testcases.sh | 4 ++-- examples/riot/README | 2 +- examples/riot/pkg_libcoap/Kconfig | 6 +++--- include/coap3/coap_asn1_internal.h | 2 +- include/coap3/coap_async.h | 2 +- include/coap3/coap_async_internal.h | 4 ++-- include/coap3/coap_block.h | 6 +++--- include/coap3/coap_block_internal.h | 8 ++++---- include/coap3/coap_cache.h | 2 +- include/coap3/coap_crypto_internal.h | 6 +++--- include/coap3/coap_debug.h | 4 ++-- include/coap3/coap_dgrm_internal.h | 4 ++-- include/coap3/coap_dtls.h | 6 +++--- include/coap3/coap_dtls_internal.h | 2 +- include/coap3/coap_event.h | 2 +- include/coap3/coap_forward_decls.h | 2 +- include/coap3/coap_hashkey_internal.h | 2 +- include/coap3/coap_internal.h | 2 +- include/coap3/coap_layers_internal.h | 2 +- include/coap3/coap_net.h | 16 ++++++++-------- include/coap3/coap_net_internal.h | 16 ++++++++-------- include/coap3/coap_option.h | 8 ++++---- include/coap3/coap_pdu.h | 2 +- include/coap3/coap_proxy.h | 4 ++-- include/coap3/coap_proxy_internal.h | 6 +++--- include/coap3/coap_resource.h | 4 ++-- include/coap3/coap_session_internal.h | 2 +- include/coap3/coap_sha1_internal.h | 2 +- include/coap3/coap_strm_internal.h | 8 ++++---- include/coap3/coap_subscribe.h | 4 ++-- include/coap3/coap_subscribe_internal.h | 2 +- include/coap3/coap_threadsafe_internal.h | 16 ++++++++-------- include/coap3/coap_uri.h | 2 +- include/coap3/coap_uri_internal.h | 2 +- include/oscore/oscore_context.h | 2 +- include/oscore/oscore_cose.h | 2 +- include/oscore/oscore_crypto.h | 10 +++++----- m4/ac_check_cryptolibs.m4 | 2 +- man/coap-oscore-conf.txt.in | 2 +- man/coap-tls-engine-conf.txt.in | 2 +- man/coap_block.txt.in | 2 +- man/coap_call_home.txt.in | 2 +- man/coap_context.txt.in | 2 +- man/coap_encryption.txt.in | 6 +++--- man/coap_handler.txt.in | 8 ++++---- man/coap_init.txt.in | 4 ++-- man/coap_keepalive.txt.in | 4 ++-- man/coap_locking.txt.in | 6 +++--- man/coap_observe.txt.in | 2 +- man/coap_proxy.txt.in | 10 +++++----- man/coap_resource.txt.in | 8 ++++---- man/coap_session.txt.in | 2 +- man/coap_string.txt.in | 2 +- man/coap_threads.txt.in | 6 +++--- src/coap_async.c | 2 +- src/coap_block.c | 12 ++++++------ src/coap_dgrm_posix.c | 2 +- src/coap_gnutls.c | 12 ++++++------ src/coap_io_posix.c | 2 +- src/coap_mbedtls.c | 4 ++-- src/coap_mem_lwip.c | 4 ++-- src/coap_net.c | 20 ++++++++++---------- src/coap_openhitls.c | 12 ++++++------ src/coap_openssl.c | 14 +++++++------- src/coap_oscore.c | 2 +- src/coap_pdu.c | 2 +- src/coap_proxy.c | 4 ++-- src/coap_session.c | 6 +++--- src/coap_subscribe.c | 4 ++-- src/coap_threadsafe.c | 4 ++-- src/coap_tinydtls.c | 2 +- src/coap_uri.c | 2 +- src/coap_wolfssl.c | 14 +++++++------- src/oscore/oscore.c | 6 +++--- src/oscore/oscore_cose.c | 2 +- tests/Makefile.am | 4 ++-- tests/test_options.c | 2 +- 92 files changed, 218 insertions(+), 213 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 24b530b0..9df0be13 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -31,3 +31,8 @@ repos: - id: end-of-file-fixer exclude: 'tests/oss-fuzz/.*_seed_corpus/.*$' - id: check-merge-conflict +- repo: https://github.com/codespell-project/codespell + rev: v2.4.1 + hooks: + - id: codespell + exclude: 'tests/oss-fuzz/.*_seed_corpus/.*$|examples/etsi_iot_01_largedata.txt|AUTHORS|examples/riot/Makefile' diff --git a/CMakeLists.txt b/CMakeLists.txt index 417ba192..ad64e61f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -102,7 +102,7 @@ if(NOT ZEPHYR_BASE) endif() # ! ZEPHYR_BASE if(${CMAKE_VERSION} VERSION_GREATER "3.20.0") if(${CMAKE_VERSION} VERSION_LESS "3.28.0") - cmake_policy(SET CMP0115 OLD) # Supresses libcoap configuration warning + cmake_policy(SET CMP0115 OLD) # Suppresses libcoap configuration warning endif() endif() @@ -646,10 +646,10 @@ if(ENABLE_DTLS) endif() if(((DTLS_BACKEND STREQUAL "default") OR (DTLS_BACKEND STREQUAL "ignore")) AND (NOT DTLS_FOUND)) - # no cryto lib found + # no crypto lib found message( FATAL_ERROR - "cannot find any defined cryto lib, either install one or compile without DTLS support" + "cannot find any defined crypto lib, either install one or compile without DTLS support" ) endif() @@ -689,10 +689,10 @@ elseif(NOT ((OSCORE_BACKEND STREQUAL "none") OR (OSCORE_BACKEND STREQUAL ""))) endif() if((NOT ZEPHYR_BASE) AND (NOT DTLS_FOUND)) - # no defined cryto lib found + # no defined crypto lib found message( FATAL_ERROR - "cannot find any defined cryto lib for OSCORE backend, either install one or compile without OSCORE support" + "cannot find any defined crypto lib for OSCORE backend, either install one or compile without OSCORE support" ) endif() @@ -1045,7 +1045,7 @@ if(ENABLE_DOCS) COMMENT "Generating API documentation with Doxygen" VERBATIM) - message(STATUS "Setup up the Doxygen documention build") + message(STATUS "Setup up the Doxygen documentation build") else(Doxygen_FOUND) message( diff --git a/ChangeLog b/ChangeLog index d1351fb0..3bb38c38 100644 --- a/ChangeLog +++ b/ChangeLog @@ -90,7 +90,7 @@ * 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 Tokens are reused. * Warn when Options are repeated that are not defined as being repeatable. * Support for TLS when using Mbed TLS library. @@ -355,7 +355,7 @@ 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 + several functions to access fields of options (possibly preceded by option jump) 2012-10-25 Olaf Bergmann diff --git a/Makefile.am b/Makefile.am index de7e9e37..2e67c753 100644 --- a/Makefile.am +++ b/Makefile.am @@ -262,7 +262,7 @@ 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 +# if the user wants to install both versions. There will be something used like # libcoap_include_HEADERS = \ # $(top_srcdir)/include/coap-$(LIBCOAP_API_VERSION)/* @@ -401,6 +401,6 @@ distclean-local: ## 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 +## Finally 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/TODO b/TODO index 2c3e994a..3e9075d0 100644 --- a/TODO +++ b/TODO @@ -4,7 +4,7 @@ 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 + Serious -> No regression on the user side, more likely on the libcoap development Minor -> Things that are nice to have, but they are not time critical diff --git a/autogen.sh b/autogen.sh index 9a3a2756..6156cf80 100755 --- a/autogen.sh +++ b/autogen.sh @@ -119,7 +119,7 @@ echo echo " ---> Found all needed tools! That's fine." echo -# countinue otherwise +# continue otherwise test -n "$srcdir" || srcdir=`dirname "$0"` test -n "$srcdir" || srcdir=. diff --git a/coap_config.h.riot b/coap_config.h.riot index c44f3e2d..6cd67521 100644 --- a/coap_config.h.riot +++ b/coap_config.h.riot @@ -20,7 +20,7 @@ /* * For systems that define int as being 2 bytes, need to make sure the - * minimum configuration is set up (overridden if explicitely defined). + * minimum configuration is set up (overridden if explicitly defined). */ #include diff --git a/configure.ac b/configure.ac index 34eec4e3..216bcb22 100644 --- a/configure.ac +++ b/configure.ac @@ -119,7 +119,7 @@ LT_INIT([shared static]) # 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 +# use the new library the same than as the existing old library without losing # existing functionality or breakage. # Increase age by 1 (c:r:a becomes c:r:a+1). # diff --git a/doc/Makefile.am b/doc/Makefile.am index 97848a58..d731a356 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -9,7 +9,7 @@ # COPYING for terms of use. -# We can only perfom the targets in this directory if doxygen is present. +# We can only perform the targets in this directory if doxygen is present. CLEANFILES = \ doxygen_sqlite3.db diff --git a/doc/main.md b/doc/main.md index 20a16111..d83687df 100644 --- a/doc/main.md +++ b/doc/main.md @@ -69,7 +69,7 @@ There is (D)TLS support for the following libraries Documentation ============= -This set of pages contains the current set of documention for the libcoap APIs. +This set of pages contains the current set of documentation for the libcoap APIs. License Information =================== diff --git a/examples/coap-client.c b/examples/coap-client.c index 518fec2f..80b410ef 100644 --- a/examples/coap-client.c +++ b/examples/coap-client.c @@ -667,7 +667,7 @@ usage(const char *program, const char *version) { "\t \t\tRate limit NON transmissions to packets per minute unless\n" "\t \t\ta response is received\n" "\t-K interval\tSend a ping after interval seconds of inactivity\n" - "\t-L value\tSum of one or more COAP_BLOCK_* flag valuess for block\n" + "\t-L value\tSum of one or more COAP_BLOCK_* flag values for block\n" "\t \t\thandling methods. Default is 1 (COAP_BLOCK_USE_LIBCOAP)\n" "\t \t\t(Sum of one or more of 1,2,4,8,16,32 and 512)\n" "\t-N \t\tSend NON-confirmable message\n" diff --git a/examples/coap-server.c b/examples/coap-server.c index cba31d1d..40230e50 100644 --- a/examples/coap-server.c +++ b/examples/coap-server.c @@ -1868,7 +1868,7 @@ usage(const char *program, const char *version) { "\t-I rate_limit_ppm\n" "\t \t\tRate limit NON transmissions to packets per minute unless\n" "\t \t\ta response is received\n" - "\t-L value\tSum of one or more COAP_BLOCK_* flag valuess for block\n" + "\t-L value\tSum of one or more COAP_BLOCK_* flag values for block\n" "\t \t\thandling methods. Default is 1 (COAP_BLOCK_USE_LIBCOAP)\n" "\t \t\t(Sum of one or more of 1,2,4 64, 128 and 512)\n" "\t-N \t\tMake \"observe\" responses NON-confirmable. Even if set\n" diff --git a/examples/coap_list.c b/examples/coap_list.c index b0e77d51..2bd8c7de 100644 --- a/examples/coap_list.c +++ b/examples/coap_list.c @@ -23,7 +23,7 @@ * See 'man coap_pdu_setup' for further information. * * examples/coap_list.[ch] files will be removed in a future release - * They are left here to support building backward compatability of old versions + * They are left here to support building backward compatibility of old versions * of coap-client */ diff --git a/examples/etsi_coaptest.sh b/examples/etsi_coaptest.sh index 4049797f..5ade6936 100755 --- a/examples/etsi_coaptest.sh +++ b/examples/etsi_coaptest.sh @@ -42,7 +42,7 @@ function usage { echo "Usage: `basename $0` [-n testnumber] [-g groupname] [-t timeout] [-P server_port] [-p client port] [-d logdir] [-v] -i interface server_address" 1>&2 echo "-n test case to be accomplished" 1>&2 echo "-g group to be tested" 1>&2 -echo "-t time in seconds until timout for single test" 1>&2 +echo "-t time in seconds until timeout for single test" 1>&2 echo "-i interface to use for tcpdump" 1>&2 echo "-P port of server" 1>&2 echo "-p port client listens on" 1>&2 diff --git a/examples/oscore-interop-server.c b/examples/oscore-interop-server.c index 493f379f..8d3d18e5 100644 --- a/examples/oscore-interop-server.c +++ b/examples/oscore-interop-server.c @@ -421,7 +421,7 @@ usage(const char *program, const char *version) { "\t-G group_if\tUse this interface for listening for the multicast\n" "\t \t\tgroup. This can be different from the implied interface\n" "\t \t\tif the -A option is used\n" - "\t-L value\tSum of one or more COAP_BLOCK_* flag valuess for block\n" + "\t-L value\tSum of one or more COAP_BLOCK_* flag values for block\n" "\t \t\thandling methods. Default is 1 (COAP_BLOCK_USE_LIBCOAP)\n" "\t \t\t(Sum of one or more of 1,2 and 4)\n" "\t-N \t\tMake \"observe\" responses NON-confirmable. Even if set\n" diff --git a/examples/oscore_testcases.sh b/examples/oscore_testcases.sh index 313d346e..489021f7 100755 --- a/examples/oscore_testcases.sh +++ b/examples/oscore_testcases.sh @@ -42,10 +42,10 @@ # Start up the servers only for the different profiles # # -s executable-for-interop-server -# Exectuable to use for the interop server if not the default of ./oscore-interop-server. +# Executable to use for the interop server if not the default of ./oscore-interop-server. # # -c executable-for-client -# Exectuable to use for the coap client if not the default of ./coap-client. +# Executable to use for the coap client if not the default of ./coap-client. # # -P # Output partial client logs diff --git a/examples/riot/README b/examples/riot/README index 15a6b2bf..556371fe 100644 --- a/examples/riot/README +++ b/examples/riot/README @@ -11,7 +11,7 @@ This will * update the RIOT environment with pkg/libcoap, examples/libcoap-client and examples/libcoap-server taken from pkg_libcoap/, examples_client/ and examples_server respectively/. - (updates RIOT's libcoap code to the latest commited version in your + (updates RIOT's libcoap code to the latest committed version in your environment, along with any modified files). * build the client application * build the server application diff --git a/examples/riot/pkg_libcoap/Kconfig b/examples/riot/pkg_libcoap/Kconfig index a97d5800..34a0e698 100644 --- a/examples/riot/pkg_libcoap/Kconfig +++ b/examples/riot/pkg_libcoap/Kconfig @@ -115,7 +115,7 @@ config LIBCOAP_ASYNC_SUPPORT help Enable async separate responses functionality for CoAP. - If this option is disabled, redundent CoAP async separate responses code is removed. + If this option is disabled, redundant CoAP async separate responses code is removed. config LIBCOAP_THREAD_SAFE bool "Enable thread safe support within CoAP" @@ -146,7 +146,7 @@ config LIBCOAP_CLIENT_SUPPORT If this option is disabled, redundant CoAP client only code is removed. If both this option and LIBCOAP_SERVER_SUPPORT are disabled, then - both are automatically enabled for backwards compatability. + both are automatically enabled for backwards compatibility. if LIBCOAP_CLIENT_SUPPORT @@ -168,7 +168,7 @@ config LIBCOAP_SERVER_SUPPORT If this option is disabled, redundant CoAP server only code is removed. If both this option and LIBCOAP_CLIENT_SUPPORT are disabled, then - both are automatically enabled for backwards compatability. + both are automatically enabled for backwards compatibility. if LIBCOAP_SERVER_SUPPORT diff --git a/include/coap3/coap_asn1_internal.h b/include/coap3/coap_asn1_internal.h index 6726567e..8f16ee47 100644 --- a/include/coap3/coap_asn1_internal.h +++ b/include/coap3/coap_asn1_internal.h @@ -101,7 +101,7 @@ coap_binary_t *get_asn1_tag(coap_asn1_tag_t ltag, const uint8_t *ptr, * @param data Pointer to ASN1 object containing EC Private Key * @param size Length of ASN1 object * - * @return The publick key (to be freed off by caller) + * @return The public key (to be freed off by caller) * or @c NULL if not found */ coap_binary_t *get_asn1_spki(const uint8_t *data, size_t size); diff --git a/include/coap3/coap_async.h b/include/coap3/coap_async.h index e7534fa1..d3a2d212 100644 --- a/include/coap3/coap_async.h +++ b/include/coap3/coap_async.h @@ -115,7 +115,7 @@ COAP_DEPRECATED void coap_async_set_app_data(coap_async_t *async, void *app_data * * @param async The async state object. * - * @return The applicaton data pointer. + * @return The application data pointer. */ void *coap_async_get_app_data(const coap_async_t *async); diff --git a/include/coap3/coap_async_internal.h b/include/coap3/coap_async_internal.h index 9695ae8c..32318ff4 100644 --- a/include/coap3/coap_async_internal.h +++ b/include/coap3/coap_async_internal.h @@ -40,7 +40,7 @@ struct coap_async_t { coap_session_t *session; /**< transaction session */ coap_pdu_t *pdu; /**< copy of request pdu */ void *app_data; /**< User definable data pointer */ - coap_app_data_free_callback_t app_cb; /**< callcack to call when async is + coap_app_data_free_callback_t app_cb; /**< callback to call when async is being released (or NULL) */ }; @@ -70,7 +70,7 @@ coap_async_t *coap_register_async_lkd(coap_session_t *session, /** * Checks if there are any pending Async requests - if so, send them off. - * Otherewise return the time remaining for the next Async to be triggered + * Otherwise return the time remaining for the next Async to be triggered * or 0 if nothing to do. * * @param context The current context. diff --git a/include/coap3/coap_block.h b/include/coap3/coap_block.h index 11b3fe31..026c3947 100644 --- a/include/coap3/coap_block.h +++ b/include/coap3/coap_block.h @@ -66,7 +66,7 @@ typedef struct { #define COAP_BLOCK_SINGLE_BODY 0x02 /* Deliver the data as a single body */ #define COAP_BLOCK_TRY_Q_BLOCK 0x04 /* Try Q-Block method */ #define COAP_BLOCK_USE_M_Q_BLOCK 0x08 /* Use M bit when recovering Q-Block2 */ -#define COAP_BLOCK_NO_PREEMPTIVE_RTAG 0x10 /* (cl) Don't use pre-emptive Request-Tags */ +#define COAP_BLOCK_NO_PREEMPTIVE_RTAG 0x10 /* (cl) Don't use preemptive Request-Tags */ #define COAP_BLOCK_STLESS_FETCH 0x20 /* (cl) Assume server supports stateless FETCH */ #define COAP_BLOCK_STLESS_BLOCK2 0x40 /* (svr)Server is stateless for handling Block2 */ #define COAP_BLOCK_NOT_RANDOM_BLOCK1 0x80 /* (svr)Disable server handling random order @@ -267,7 +267,7 @@ COAP_API coap_binary_t *coap_block_build_body(coap_binary_t *body_data, size_t l * @param request The requesting pdu. * @param response The response pdu. * @param media_type The format of the data. - * @param maxage The maxmimum life of the data. If @c -1, then there + * @param maxage The maximum life of the data. If @c -1, then there * is no maxage. * @param length The total length of the data. * @param data The entire data block to transmit. @@ -444,7 +444,7 @@ COAP_API int coap_add_data_large_request_app(coap_session_t *session, * @param response The response pdu. * @param query The query taken from the (original) requesting pdu. * @param media_type The content format of the data. - * @param maxage The maxmimum life of the data. If @c -1, then there + * @param maxage The maximum life of the data. If @c -1, then there * is no maxage. * @param etag ETag to use if not 0. * @param length The total length of the data. diff --git a/include/coap3/coap_block_internal.h b/include/coap3/coap_block_internal.h index 030ea3e8..6d8219db 100644 --- a/include/coap3/coap_block_internal.h +++ b/include/coap3/coap_block_internal.h @@ -32,7 +32,7 @@ extern "C" { /* * Use the top 20 bits of a 64 bit token for tracking current block in large transfer. - * However, if smaller tokens are required. this vould be set up to 48, leaving 16 bits + * However, if smaller tokens are required. this would be set up to 48, leaving 16 bits * for unique tokens. */ #ifndef STATE_MAX_BLK_CNT_BITS @@ -164,7 +164,7 @@ typedef struct coap_lg_xmit_data_t { size_t length; /**< large data length */ coap_get_large_data_t get_func; /**< Where to get data id needed */ coap_release_large_data_t release_func; /**< large data de-alloc function */ - void *app_ptr; /**< applicaton provided ptr for de-alloc function */ + void *app_ptr; /**< application provided ptr for de-alloc function */ uint32_t ref; /**< Reference count */ } coap_lg_xmit_data_t; @@ -174,7 +174,7 @@ typedef struct coap_lg_xmit_data_t { struct coap_lg_xmit_t { struct coap_lg_xmit_t *next; uint8_t blk_size; /**< large block transmission size */ - uint16_t option; /**< large block transmisson CoAP option */ + uint16_t option; /**< large block transmission CoAP option */ int last_block; /**< last acknowledged block number Block1 last transmitted Q-Block2 */ coap_lg_xmit_data_t *data_info; /**< Pointer to large data information */ @@ -495,7 +495,7 @@ coap_lg_xmit_t *coap_find_lg_xmit_response(const coap_session_t *session, * @param response The response pdu. * @param query The query taken from the (original) requesting pdu. * @param media_type The content format of the data. - * @param maxage The maxmimum life of the data. If @c -1, then there + * @param maxage The maximum life of the data. If @c -1, then there * is no maxage. * @param etag ETag to use if not 0. * @param length The total length of the data. diff --git a/include/coap3/coap_cache.h b/include/coap3/coap_cache.h index 5cc72583..04917dc8 100644 --- a/include/coap3/coap_cache.h +++ b/include/coap3/coap_cache.h @@ -214,7 +214,7 @@ const coap_pdu_t *coap_cache_get_pdu(const coap_cache_entry_t *cache_entry); * @deprecated Use coap_cache_set_app_data2() instead. * * @param cache_entry The CoAP cache entry. - * @param data The data pointer to store with wih the cache entry. Note that + * @param data The data pointer to store with with the cache entry. Note that * this data must be valid during the lifetime of @p cache_entry. * @param callback The callback to call to free off this data when the * cache-entry is deleted, or @c NULL if not required. diff --git a/include/coap3/coap_crypto_internal.h b/include/coap3/coap_crypto_internal.h index d047c9ad..dcbdb866 100644 --- a/include/coap3/coap_crypto_internal.h +++ b/include/coap3/coap_crypto_internal.h @@ -61,7 +61,7 @@ typedef struct coap_crypto_aes_ccm_t { * The common structure that holds the Crypto information */ typedef struct coap_crypto_param_t { - cose_alg_t alg; /**< The COSE algorith to use */ + cose_alg_t alg; /**< The COSE algorithm to use */ union { coap_crypto_aes_ccm_t aes; /**< Used if AES type encryption */ coap_crypto_key_t key; /**< The key to use */ @@ -91,7 +91,7 @@ int coap_crypto_check_hkdf_alg(cose_hkdf_alg_t hkdf_alg); /** * Encrypt the provided plaintext data * - * @param params The Encrypt/Decrypt/Hash paramaters. + * @param params The Encrypt/Decrypt/Hash parameters. * @param data The data to encrypt. * @param aad The additional AAD information. * @param result Where to put the encrypted data. @@ -109,7 +109,7 @@ int coap_crypto_aead_encrypt(const coap_crypto_param_t *params, /** * Decrypt the provided encrypted data into plaintext. * - * @param params The Encrypt/Decrypt/Hash paramaters. + * @param params The Encrypt/Decrypt/Hash parameters. * @param data The data to decrypt. * @param aad The additional AAD information. * @param result Where to put the decrypted data. diff --git a/include/coap3/coap_debug.h b/include/coap3/coap_debug.h index af398b1b..0fc67207 100644 --- a/include/coap3/coap_debug.h +++ b/include/coap3/coap_debug.h @@ -64,7 +64,7 @@ typedef enum { COAP_LOG_DEBUG, /* 7 */ COAP_LOG_OSCORE, /* 8 */ COAP_LOG_DTLS_BASE, -#define COAP_LOG_CIPHERS COAP_LOG_DTLS_BASE /* For backward compatability */ +#define COAP_LOG_CIPHERS COAP_LOG_DTLS_BASE /* For backward compatibility */ } coap_log_t; /* @@ -135,7 +135,7 @@ coap_no_log(void) { } #endif /* - * These entries are left here for backward compatability in applications + * These entries are left here for backward compatibility in applications * (which should really "#include "). * and MUST NOT be used anywhere within the libcoap code. * diff --git a/include/coap3/coap_dgrm_internal.h b/include/coap3/coap_dgrm_internal.h index da15a918..79c4fe50 100644 --- a/include/coap3/coap_dgrm_internal.h +++ b/include/coap3/coap_dgrm_internal.h @@ -51,7 +51,7 @@ typedef struct coap_icmp_info_t { * @param remote_addr Filled in after connection initiation with * the remote address. * - * @return @c 1 if succesful, @c 0 if failure of some sort. + * @return @c 1 if successful, @c 0 if failure of some sort. */ int coap_socket_connect_udp(coap_socket_t *sock, const coap_address_t *local_if, @@ -73,7 +73,7 @@ int coap_socket_connect_udp(coap_socket_t *sock, * @param bound_addr Filled in with the address that the UDP layer. * is listening on for new incoming UDP sessions. * - * @return @c 1 if succesful, @c 0 if failure of some sort + * @return @c 1 if successful, @c 0 if failure of some sort */ int coap_socket_bind_udp(coap_socket_t *sock, const coap_address_t *listen_addr, diff --git a/include/coap3/coap_dtls.h b/include/coap3/coap_dtls.h index 8f6bc08d..c91bd4da 100644 --- a/include/coap3/coap_dtls.h +++ b/include/coap3/coap_dtls.h @@ -338,7 +338,7 @@ struct coap_dtls_pki_t { uint8_t use_cid; /**< 1 if DTLS Connection ID is to be * used (Client only, server always enabled) * if supported */ - uint8_t allow_sni_cn_mismatch:1; /**< 1 if SNI and returnd CN allowed to mismatch + uint8_t allow_sni_cn_mismatch:1; /**< 1 if SNI and returned CN allowed to mismatch * (Client only). Not normally set */ uint8_t reserved[1]; /**< Reserved - must be set to 0 for future compatibility */ @@ -427,7 +427,7 @@ typedef struct coap_dtls_cpsk_t { future compatibility */ /* Size of 5 chosen to align to next * parameter, so if newly defined option - * it can use one of the reserverd slot so + * it can use one of the reserved slot so * no need to change * COAP_DTLS_CPSK_SETUP_VERSION and just * decrement the reserved[] count. @@ -517,7 +517,7 @@ typedef struct coap_dtls_spsk_t { future compatibility */ /* Size of 6 chosen to align to next * parameter, so if newly defined option - * it can use one of the reserverd slot so + * it can use one of the reserved slot so * no need to change * COAP_DTLS_SPSK_SETUP_VERSION and just * decrement the reserved[] count. diff --git a/include/coap3/coap_dtls_internal.h b/include/coap3/coap_dtls_internal.h index e4d46dd5..d34f3e27 100644 --- a/include/coap3/coap_dtls_internal.h +++ b/include/coap3/coap_dtls_internal.h @@ -275,7 +275,7 @@ int coap_dtls_receive(coap_session_t *coap_session, #if COAP_SERVER_SUPPORT /** - * Handling client HELLO messages from a new candiate peer. + * Handling client HELLO messages from a new candidate peer. * Note that session->tls is empty. * * @param coap_session The CoAP session. diff --git a/include/coap3/coap_event.h b/include/coap3/coap_event.h index 7703e141..1ac68097 100644 --- a/include/coap3/coap_event.h +++ b/include/coap3/coap_event.h @@ -37,7 +37,7 @@ typedef enum { /* * (D)TLS events for COAP_PROTO_DTLS and COAP_PROTO_TLS */ - /** Triggerred when (D)TLS session closed */ + /** Triggerrd when (D)TLS session closed */ COAP_EVENT_DTLS_CLOSED = 0x0000, /** Triggered when (D)TLS session connected */ COAP_EVENT_DTLS_CONNECTED = 0x01DE, diff --git a/include/coap3/coap_forward_decls.h b/include/coap3/coap_forward_decls.h index 77d10eb0..a888b917 100644 --- a/include/coap3/coap_forward_decls.h +++ b/include/coap3/coap_forward_decls.h @@ -23,7 +23,7 @@ extern "C" { #endif /* - * Define the forward declations for the structures (even non-opaque) + * Define the forward declarations for the structures (even non-opaque) * so that applications (using coap.h) as well as libcoap builds * can reference them (and makes .h file dependencies a lot simpler). */ diff --git a/include/coap3/coap_hashkey_internal.h b/include/coap3/coap_hashkey_internal.h index a7f8dcb1..ec864d9d 100644 --- a/include/coap3/coap_hashkey_internal.h +++ b/include/coap3/coap_hashkey_internal.h @@ -27,7 +27,7 @@ typedef unsigned char coap_key_t[4]; /** * Calculates a fast hash over the given string @p s of length @p len and stores * the result into @p h. Depending on the exact implementation, this function - * cannot be used as one-way function to check message integrity or simlar. + * cannot be used as one-way function to check message integrity or similar. * * @param s The string used for hash calculation. * @param len The length of @p s. diff --git a/include/coap3/coap_internal.h b/include/coap3/coap_internal.h index 93862c76..fff3e5b6 100644 --- a/include/coap3/coap_internal.h +++ b/include/coap3/coap_internal.h @@ -61,7 +61,7 @@ #endif /* ! HAVE_INTTYPES_H */ /* * To handle compilers / libraries that cannot handle %zu/%zd formats. - * Define these separately to whatver the complier / library can work with. + * Define these separately to whatver the compiler / library can work with. */ #ifndef PRIuS #define PRIuS "zu" diff --git a/include/coap3/coap_layers_internal.h b/include/coap3/coap_layers_internal.h index 26dd5cfd..4f1060a4 100644 --- a/include/coap3/coap_layers_internal.h +++ b/include/coap3/coap_layers_internal.h @@ -49,7 +49,7 @@ typedef enum { * * @return >=0 Number of bytes read. * -1 Error error in errno). - * -2 Recieved ICMP unreachable. + * -2 Received ICMP unreachable. */ typedef ssize_t (*coap_layer_read_t)(coap_session_t *session, uint8_t *data, size_t datalen); diff --git a/include/coap3/coap_net.h b/include/coap3/coap_net.h index 84f0cf5d..640cd5b7 100644 --- a/include/coap3/coap_net.h +++ b/include/coap3/coap_net.h @@ -70,7 +70,7 @@ typedef coap_response_t (*coap_response_handler_t)(coap_session_t *session, const coap_mid_t mid); /** - * Negative Acknowedge handler that is used as callback in coap_context_t. + * Negative Acknowledge handler that is used as callback in coap_context_t. * * @param session CoAP session. * @param sent The PDU that was transmitted. @@ -537,7 +537,7 @@ void coap_context_set_max_handshake_sessions(coap_context_t *context, * * @param context The coap_context_t object. * - * @return The maximim number of sessions in (D)TLS handshake value. + * @return The maximum number of sessions in (D)TLS handshake value. */ unsigned int coap_context_get_max_handshake_sessions(const coap_context_t *context); @@ -570,7 +570,7 @@ COAP_API void coap_free_context(coap_context_t *context); * context. * * @param context The CoAP context. - * @param data The data to store with wih the context. Note that this data + * @param data The data to store with with the context. Note that this data * must be valid during the lifetime of @p context. */ COAP_DEPRECATED void coap_set_app_data(coap_context_t *context, void *data); @@ -962,7 +962,7 @@ COAP_API int coap_io_pending(coap_context_t *context); * arrays on output. * @param now Current time. * -* @return timeout Maxmimum number of milliseconds that can be used by a +* @return timeout Maximum number of milliseconds that can be used by a * select() to wait for network events or 0 if wait should be * forever. */ @@ -1003,7 +1003,7 @@ COAP_API void coap_io_do_io(coap_context_t *ctx, coap_tick_t now); * @param ctx The CoAP context * @param now Current time. * - * @return timeout Maxmimum number of milliseconds that can be used by a + * @return timeout Maximum number of milliseconds that can be used by a * epoll_wait() to wait for network events or 0 if wait should be * forever. */ @@ -1111,10 +1111,10 @@ COAP_API coap_fd_t coap_socket_get_fd(coap_socket_t *socket); * * @param context The current CoAP context. * @param read_fds Array to populate with file descriptors in the read pending state. - * @param have_read_fds Updated wth the number of fds found in read pending state. + * @param have_read_fds Updated with the number of fds found in read pending state. * @param max_read_fds Maximum size of read_fds[] array. * @param write_fds Array to populate with file descriptors in the write pending state. - * @param have_write_fds Updated wth the number of fds found in write pending state. + * @param have_write_fds Updated with the number of fds found in write pending state. * @param max_write_fds Maximum size of write_fds[] array. * @param rem_timeout_ms Remaining timeout time to next libcoap activity in milli-secs. * @@ -1234,7 +1234,7 @@ void coap_lwip_set_input_wait_handler(coap_context_t *context, * arrays on output. * @param now Current time. * -* @return timeout Maxmimum number of milliseconds that can be used by a +* @return timeout Maximum number of milliseconds that can be used by a * select() to wait for network events or 0 if wait should be * forever. */ diff --git a/include/coap3/coap_net_internal.h b/include/coap3/coap_net_internal.h index 95765a14..1f2a951f 100644 --- a/include/coap3/coap_net_internal.h +++ b/include/coap3/coap_net_internal.h @@ -70,7 +70,7 @@ struct coap_context_t { /** * list of asynchronous message ids */ coap_async_t *async_state; - int async_state_traversing; /**< If hte async state list is being ttaversed */ + int async_state_traversing; /**< If hhe async state list is being traversed */ #endif /* COAP_ASYNC_SUPPORT */ /** @@ -116,7 +116,7 @@ struct coap_context_t { received */ #endif /* COAP_CLIENT_SUPPORT */ #if COAP_PROXY_SUPPORT - coap_proxy_response_handler_t proxy_response_cb; /**< Called when a reponse + coap_proxy_response_handler_t proxy_response_cb; /**< Called when a response to proxy logic received */ #endif /* COAP_PROXY_SUPPORT */ coap_nack_handler_t nack_cb; /**< Called when a response issue has occurred */ @@ -171,7 +171,7 @@ struct coap_context_t { sessions per endpoint. 0 means no maximum. */ unsigned int max_handshake_sessions; /**< Maximum number of simultaneous - negotating sessions per endpoint. 0 + negotiating sessions per endpoint. 0 means use default. */ unsigned int ping_timeout; /**< Minimum inactivity time before sending a ping message. 0 means @@ -232,7 +232,7 @@ struct coap_context_t { uint8_t context_going_away; /**< Set if coap_free_context() has been called */ #endif /* COAP_SERVER_SUPPORT */ uint32_t block_mode; /**< Zero or more COAP_BLOCK_ or'd options */ - coap_resource_dynamic_create_t dyn_create_handler; /**< Dynamc resource create handler */ + coap_resource_dynamic_create_t dyn_create_handler; /**< Dynamic resource create handler */ uint32_t dynamic_cur; /**< Current number of dynamic resources */ uint32_t dynamic_max; /**< Max number of dynamic resources or 0 is unlimited */ uint32_t max_body_size; /**< Max supported body size or 0 is unlimited */ @@ -772,7 +772,7 @@ int coap_io_pending_lkd(coap_context_t *context); * @param ctx The CoAP context * @param now Current time. * - * @return timeout Maxmimum number of milliseconds that can be used by a + * @return timeout Maximum number of milliseconds that can be used by a * epoll_wait() to wait for network events or 0 if wait should be * forever. */ @@ -807,7 +807,7 @@ unsigned int coap_io_prepare_epoll_lkd(coap_context_t *ctx, coap_tick_t now); * arrays on output. * @param now Current time. * - * @return timeout Maxmimum number of milliseconds that can be used by a + * @return timeout Maximum number of milliseconds that can be used by a * select() to wait for network events or 0 if wait should be * forever. */ @@ -932,10 +932,10 @@ int coap_io_process_with_fds_lkd(coap_context_t *ctx, uint32_t timeout_ms, * * @param context The current CoAP context. * @param read_fds Array to populate with file descriptors in the read pending state. - * @param have_read_fds Updated wth the number of fds found in read pending state. + * @param have_read_fds Updated with the number of fds found in read pending state. * @param max_read_fds Maximum size of read_fds[] array. * @param write_fds Array to populate with file descriptors in the write pending state. - * @param have_write_fds Updated wth the number of fds found in write pending state. + * @param have_write_fds Updated with the number of fds found in write pending state. * @param max_write_fds Maximum size of write_fds[] array. * @param rem_timeout_ms Remaining timeout time to next libcoap activity in milli-secs. * diff --git a/include/coap3/coap_option.h b/include/coap3/coap_option.h index d3eaa6c8..4391806e 100644 --- a/include/coap3/coap_option.h +++ b/include/coap3/coap_option.h @@ -132,7 +132,7 @@ typedef enum coap_sig_abort_opt_t { COAP_SIG_OPT_BAD_CSM_OPTION = 2, /* ____E_U, uint, 0-2 B, none, RFC8323 */ } coap_sig_abort_opt_t; -/* Backward Application compatability */ +/* Backward Application compatibility */ #define COAP_SIGNALING_OPTION_MAX_MESSAGE_SIZE COAP_SIG_OPT_MAX_MESSAGE_SIZE #define COAP_SIGNALING_OPTION_BLOCK_WISE_TRANSFER COAP_SIG_OPT_BLOCK_WISE_TRANSFER #define COAP_SIGNALING_OPTION_EXTENDED_TOKEN_LENGTH COAP_SIG_OPT_EXTENDED_TOKEN_LENGTH @@ -303,7 +303,7 @@ typedef struct { * option list must be performed before coap_option_iterator_init() is called. * * @param pdu The PDU the options of which should be walked through. - * @param oi An iterator object that will be initilized. + * @param oi An iterator object that will be initialized. * @param filter An optional option number filter. * With @p number != @c COAP_OPT_ALL, coap_option_next() * will return only options matching this bitmask. @@ -456,7 +456,7 @@ typedef struct coap_optlist_t { * * Note: Where possible, the option data needs to be stripped of leading zeros * (big endian) to reduce the amount of data needed in the PDU, as well as in - * some cases the maximum data size of an opton can be exceeded if not stripped + * some cases the maximum data size of an option can be exceeded if not stripped * and hence be illegal. This is done by using coap_encode_var_safe() or * coap_encode_var_safe8(). * @@ -477,7 +477,7 @@ coap_optlist_t *coap_new_optlist(coap_option_num_t number, * @param pdu The pdu to add the options to from the chain list * @param optlist_chain The chained list of optlist to add to the pdu * - * @return @c 1 if succesful or @c 0 if failure; + * @return @c 1 if successful or @c 0 if failure; */ int coap_add_optlist_pdu(coap_pdu_t *pdu, coap_optlist_t **optlist_chain); diff --git a/include/coap3/coap_pdu.h b/include/coap3/coap_pdu.h index 50bccc10..d08c6bfa 100644 --- a/include/coap3/coap_pdu.h +++ b/include/coap3/coap_pdu.h @@ -407,7 +407,7 @@ int coap_add_token(coap_pdu_t *pdu, * * Note: Where possible, the option data needs to be stripped of leading zeros * (big endian) to reduce the amount of data needed in the PDU, as well as in - * some cases the maximum data size of an opton can be exceeded if not stripped + * some cases the maximum data size of an option can be exceeded if not stripped * and hence be illegal. This is done by using coap_encode_var_safe() or * coap_encode_var_safe8(). * diff --git a/include/coap3/coap_proxy.h b/include/coap3/coap_proxy.h index 6a2d9f19..38abb9e7 100644 --- a/include/coap3/coap_proxy.h +++ b/include/coap3/coap_proxy.h @@ -31,7 +31,7 @@ extern "C" { /** * coap_proxy_t Proxy definitions. * - * 0x00000007 Old 4.3.5 mappings for backward compatability. + * 0x00000007 Old 4.3.5 mappings for backward compatibility. * 0x00000038 New type mappings. * 0xffffffc0 Bitwise optional actions. * @@ -238,7 +238,7 @@ COAP_API coap_session_t *coap_new_client_session_proxy(coap_context_t *context, * respectively). type must contain at least COAP_PROXY_FWD_DYNAMIC, and @p server_list * must be the same as used in coap_proxy_forward_request(). * - * @param session The CoAP upstream proxy session previosly set up (e.g. via call-home). + * @param session The CoAP upstream proxy session previously set up (e.g. via call-home). * @param use_ip The IP address to match on incoming proxy requests. If NULL, then * the IP address is determined from @p session. * @param use_port The port number to match on incoming proxy requests. If 0, default diff --git a/include/coap3/coap_proxy_internal.h b/include/coap3/coap_proxy_internal.h index b79547f3..c6ed1b4e 100644 --- a/include/coap3/coap_proxy_internal.h +++ b/include/coap3/coap_proxy_internal.h @@ -150,7 +150,7 @@ int coap_proxy_forward_request_lkd(coap_session_t *session, * @param received The received PDU. * @param cache_key Updated with the cache key pointer provided to * coap_proxy_forward_request_lkd(). The caller should - * delete this cach key (unless the client request set up an + * delete this cache key (unless the client request set up an * Observe and there will be unsolicited responses). * * @return One of COAP_RESPONSE_FAIL or COAP_RESPONSE_OK. @@ -196,7 +196,7 @@ coap_session_t *coap_new_client_session_proxy_lkd(coap_context_t *context, * respectively). type must contain at least COAP_PROXY_FWD_DYNAMIC, and @p server_list * must be the same as used in coap_proxy_forward_request(). * - * @param session The CoAP upstream proxy session previosly set up (e.g. via call-home). + * @param session The CoAP upstream proxy session previously set up (e.g. via call-home). * @param use_ip The IP address to match on incoming proxy requests. If NULL, then * the IP address is determined from @p session. * @param use_port The port number to match on incoming proxy requests. If 0, default @@ -212,7 +212,7 @@ coap_proxy_entry_t *coap_proxy_fwd_add_client_session_lkd(coap_session_t *sessio coap_proxy_server_list_t *server_list); /** * coap_proxy_local_write() is used to send the PDU for a session created by - * coap_new_client_session_proxy() into the proxy logic for onward transmittion. + * coap_new_client_session_proxy() into the proxy logic for onward transmission. * * @param session The coap_new_client_session_proxy() generated session. * @param pdu The PDU presented to libcoap by coap_send(). diff --git a/include/coap3/coap_resource.h b/include/coap3/coap_resource.h index 0e1a9b6d..fa8d4a0e 100644 --- a/include/coap3/coap_resource.h +++ b/include/coap3/coap_resource.h @@ -28,7 +28,7 @@ extern "C" { /** * @ingroup application_api - * @defgroup coap_resource Resource Configuraton + * @defgroup coap_resource Resource Configuration * API for setting up resources * @{ */ @@ -532,7 +532,7 @@ typedef uint32_t coap_print_status_t; * with the Block2 option. @p offset is updated during * output as it is consumed. * - * @return If COAP_PRINT_STATUS_ERROR is set, an error occured. Otherwise, + * @return If COAP_PRINT_STATUS_ERROR is set, an error occurred. Otherwise, * the lower 28 bits will indicate the number of characters that * have actually been output into @p buffer. The flag * COAP_PRINT_STATUS_TRUNC indicates that the output has been diff --git a/include/coap3/coap_session_internal.h b/include/coap3/coap_session_internal.h index c2a912a7..64a275ef 100644 --- a/include/coap3/coap_session_internal.h +++ b/include/coap3/coap_session_internal.h @@ -171,7 +171,7 @@ struct coap_session_t { coap_fixed_point_t default_leisure; /**< Mcast leisure time (default 5.0 secs) */ uint32_t probing_rate; /**< Max transfer wait when remote is not - respoding (default 1 byte/sec) */ + responding (default 1 byte/sec) */ #if COAP_Q_BLOCK_SUPPORT uint16_t max_payloads; /**< maximum Q-BlockX payloads before delay (default 10) */ diff --git a/include/coap3/coap_sha1_internal.h b/include/coap3/coap_sha1_internal.h index b0ba1a11..f0b54b6a 100644 --- a/include/coap3/coap_sha1_internal.h +++ b/include/coap3/coap_sha1_internal.h @@ -62,7 +62,7 @@ extern "C" { #endif /* * If you do not have the ISO standard stdint.h header file, then you - * must typdef the following: + * must typedef the following: * name meaning * uint32_t unsigned 32 bit integer * uint8_t unsigned 8 bit integer (i.e., unsigned char) diff --git a/include/coap3/coap_strm_internal.h b/include/coap3/coap_strm_internal.h index 064b9f99..a6292238 100644 --- a/include/coap3/coap_strm_internal.h +++ b/include/coap3/coap_strm_internal.h @@ -44,7 +44,7 @@ extern "C" { * @param remote_addr Filled in after connection initiation with * the remote address. * - * @return @c 1 if succesful, @c 0 if failure of some sort. + * @return @c 1 if successful, @c 0 if failure of some sort. */ int coap_socket_connect_tcp1(coap_socket_t *sock, const coap_address_t *local_if, @@ -62,7 +62,7 @@ int coap_socket_connect_tcp1(coap_socket_t *sock, * @param local_addr Filled in with the final local address. * @param remote_addr Filled in with the final remote address. * - * @return @c 1 if succesful, @c 0 if failure of some sort. + * @return @c 1 if successful, @c 0 if failure of some sort. */ int coap_socket_connect_tcp2(coap_socket_t *sock, coap_address_t *local_addr, @@ -78,7 +78,7 @@ int coap_socket_connect_tcp2(coap_socket_t *sock, * @param bound_addr Filled in with the address that the TCP layer * is listening on for new incoming TCP sessions. * - * @return @c 1 if succesful, @c 0 if failure of some sort. + * @return @c 1 if successful, @c 0 if failure of some sort. */ int coap_socket_bind_tcp(coap_socket_t *sock, const coap_address_t *listen_addr, @@ -96,7 +96,7 @@ int coap_socket_bind_tcp(coap_socket_t *sock, * @param remote_addr Filled in with the remote address. * @param extra Available for use by any underlying network stack. * - * @return @c 1 if succesful, @c 0 if failure of some sort. + * @return @c 1 if successful, @c 0 if failure of some sort. */ int coap_socket_accept_tcp(coap_socket_t *server, coap_socket_t *new_client, diff --git a/include/coap3/coap_subscribe.h b/include/coap3/coap_subscribe.h index e59d3cad..ff6e7045 100644 --- a/include/coap3/coap_subscribe.h +++ b/include/coap3/coap_subscribe.h @@ -182,7 +182,7 @@ typedef int (*coap_resource_deleted_t)(coap_context_t *context, * @param observe_deleted Called when a observe subscription is de-registered. * @param track_observe_value Called every @p save_freq so current observe * value can be tracked. - * @param dyn_resource_added Called whan a dynamic resource is created from the + * @param dyn_resource_added Called when a dynamic resource is created from the * 'unknown' resource for tracking. * @param resource_deleted Called when a resource is removed. * @param save_freq Frequency of change of observe value for calling @@ -201,7 +201,7 @@ void coap_persist_track_funcs(coap_context_t *context, /** * Set up an active subscription for an observe that was previously active - * over a coap-server inadvertant restart. + * over a coap-server inadvertent restart. * * Only UDP sessions currently supported. * diff --git a/include/coap3/coap_subscribe_internal.h b/include/coap3/coap_subscribe_internal.h index f49fe02c..89c50730 100644 --- a/include/coap3/coap_subscribe_internal.h +++ b/include/coap3/coap_subscribe_internal.h @@ -214,7 +214,7 @@ void coap_persist_cleanup(coap_context_t *context); /** * Set up an active subscription for an observe that was previously active - * over a coap-server inadvertant restart. + * over a coap-server inadvertent restart. * * Only UDP sessions currently supported. * diff --git a/include/coap3/coap_threadsafe_internal.h b/include/coap3/coap_threadsafe_internal.h index b1efbed7..5c386a85 100644 --- a/include/coap3/coap_threadsafe_internal.h +++ b/include/coap3/coap_threadsafe_internal.h @@ -69,7 +69,7 @@ extern "C" { * * Note: * libcoap may call a handler, which may in turn call into libcoap, which may - * then call a handler. global_lock will remain locked thoughout this process + * then call a handler. global_lock will remain locked throughout this process * by the same thread. * * Alternatively, coap_lock_callback_release() (or @@ -131,7 +131,7 @@ typedef struct coap_lock_t { void coap_lock_unlock_func(coap_lock_t *lock, const char *file, int line); /** - * Lock the specfic lock. + * Lock the specific lock. * * If this is a nested lock (Public API - libcoap - app call-back - Public API), * then increment the lock->in_callback. @@ -190,7 +190,7 @@ int coap_lock_lock_func(coap_lock_t *lock, const char *file, int line); * global_lock not locked if libcoap not started and @p failed is executed. @p failed must * be code that skips doing the lock protected code. * - * @param lock The specifc lock to lock. + * @param lock The specific lock to lock. * @param failed Code to execute on lock failure. * */ @@ -207,7 +207,7 @@ int coap_lock_lock_func(coap_lock_t *lock, const char *file, int line); * Same thread locked context * Not when called from app call-back * - * @param lock The specifc lock to unlock. + * @param lock The specific lock to unlock. * */ #define coap_lock_specific_unlock(lock) do { \ @@ -388,7 +388,7 @@ int coap_lock_lock_func(coap_lock_t *lock); * global not locked if libcoap not started and @p failed is executed. @p failed must * be code that skips doing the lock protected code. * - * @param lock The specifc lock to lock. + * @param lock The specific lock to lock. * @param failed Code to execute on lock failure * */ @@ -416,7 +416,7 @@ int coap_lock_lock_func(coap_lock_t *lock); * Same thread locked context. * Not when called from app call-back. * - * @param lock The specifc lock to unlock. + * @param lock The specific lock to unlock. * */ #define coap_lock_specific_unlock(lock) do { \ @@ -595,7 +595,7 @@ typedef coap_mutex_t coap_lock_t; * global_lock not locked if libcoap not started and @p failed is executed. @p failed must * be code that skips doing the lock protected code. * - * @param lock The specifc lock to lock. + * @param lock The specific lock to lock. * @param failed Code to execute on lock failure. * */ @@ -619,7 +619,7 @@ typedef coap_mutex_t coap_lock_t; * Unlocked when * Same thread locked context * - * @param lock The specifc lock to unlock. + * @param lock The specific lock to unlock. */ #define coap_lock_specific_unlock(lock) diff --git a/include/coap3/coap_uri.h b/include/coap3/coap_uri.h index 753f65bb..189504c7 100644 --- a/include/coap3/coap_uri.h +++ b/include/coap3/coap_uri.h @@ -383,7 +383,7 @@ coap_string_t *coap_get_uri_path(const coap_pdu_t *request); /** * Define a Path to use if an Uri-Path-Abbrev option fails and the client - * is to retry the request using Uri-Path instread of Uri-Path-Abbrev. + * is to retry the request using Uri-Path instead of Uri-Path-Abbrev. * * @param mapping A path mapping to value for Uri-Path-Abbrev table or NULL if the previous mapping is to be cleared. diff --git a/include/coap3/coap_uri_internal.h b/include/coap3/coap_uri_internal.h index d0696802..70f88ebe 100644 --- a/include/coap3/coap_uri_internal.h +++ b/include/coap3/coap_uri_internal.h @@ -76,7 +76,7 @@ void coap_replace_percents(coap_optlist_t *optlist); const char *coap_map_abbrev_uri_path(coap_upa_chain_t *chain, uint32_t value); /* - * See if the specifiec path with length is on the UPA chain. + * See if the specific path with length is on the UPA chain. * * @param chain The UPA chain to check against. * @param path The URI path to match (without the leading /). diff --git a/include/oscore/oscore_context.h b/include/oscore/oscore_context.h index 524bcfb9..0f44973a 100644 --- a/include/oscore/oscore_context.h +++ b/include/oscore/oscore_context.h @@ -33,7 +33,7 @@ /** * @file oscore_context.h * @brief An implementation of the Object Security for Constrained RESTful - * Enviornments (RFC 8613). + * Environments (RFC 8613). * * \author * Martin Gunnarsson diff --git a/include/oscore/oscore_cose.h b/include/oscore/oscore_cose.h index fdfaa54d..18cd8ec9 100644 --- a/include/oscore/oscore_cose.h +++ b/include/oscore/oscore_cose.h @@ -254,7 +254,7 @@ size_t cose_encrypt0_get_kid_context(cose_encrypt0_t *ptr, void cose_encrypt0_set_kid_context(cose_encrypt0_t *ptr, coap_bin_const_t *kid_context); -/* Returns 1 if successfull, 0 if key is of incorrect length. */ +/* Returns 1 if successful, 0 if key is of incorrect length. */ int cose_encrypt0_set_key(cose_encrypt0_t *ptr, coap_bin_const_t *key); void cose_encrypt0_set_nonce(cose_encrypt0_t *ptr, coap_bin_const_t *nonce); diff --git a/include/oscore/oscore_crypto.h b/include/oscore/oscore_crypto.h index a847d278..7fc00391 100644 --- a/include/oscore/oscore_crypto.h +++ b/include/oscore/oscore_crypto.h @@ -69,7 +69,7 @@ extern "C" { /** * Derive the hmac hash using HMAC-HASH() function. * - * @param hmac_alg The HMAC algorith to use (e.g. sha256). + * @param hmac_alg The HMAC algorithm to use (e.g. sha256). * @param key The key to use. * @param data The data to hash. * @param hmac The result of the hash. @@ -85,7 +85,7 @@ int oscore_hmac_hash(cose_hmac_alg_t hmac_alg, * Derive the pseudorandom key using HKDF-Extract() function. * Uses HMAC-HASH() function. * - * @param hkdf_alg The HKDF algorith to use (e.g. ed25519). + * @param hkdf_alg The HKDF algorithm to use (e.g. ed25519). * @param salt The optional salt value to use. * @param ikm The Input Keying material. * @param hkdf_extract The output pseudorandom key @@ -102,8 +102,8 @@ int oscore_hkdf_extract(cose_hkdf_alg_t hkdf_alg, * Derive the key using HKDF-Expand() function. * Uses HMAC-HASH() function. * - * @param hkdf_alg The HKDF algorith to use (e.g. ed25519). - * @param prk Usually ouptut from HKDF-Extract(). + * @param hkdf_alg The HKDF algorithm to use (e.g. ed25519). + * @param prk Usually output from HKDF-Extract(). * @param info Optional context / application specific information. * @param info_len Length of info (can be 0). * @param okm Output key material. @@ -122,7 +122,7 @@ int oscore_hkdf_expand(cose_hkdf_alg_t hkdf_alg, * Derive the key using HKDF() function. * Invokes the HKDF-Extract() and HKDF-Expand() functions. * - * @param hkdf_alg The HKDF algorith to use (e.g. ed25519). + * @param hkdf_alg The HKDF algorithm to use (e.g. ed25519). * @param salt The optional salt value to use. * @param ikm The Input Keying material. * @param info Optional context / application specific information. diff --git a/m4/ac_check_cryptolibs.m4 b/m4/ac_check_cryptolibs.m4 index 1362ad8c..3bc1b525 100644 --- a/m4/ac_check_cryptolibs.m4 +++ b/m4/ac_check_cryptolibs.m4 @@ -9,7 +9,7 @@ # respective cryptographic library version of GnuTLS, OpenSSL, Mbed TLS, # WolfSSL and TinyDTLS on the host. The variables '$gnutls_version_required', # '$mbedtls_version_required' and '$openssl_version_required' etc. hold the -# minimum required version and are set up externaly in configure.ac. +# minimum required version and are set up externally in configure.ac. # # Example: # diff --git a/man/coap-oscore-conf.txt.in b/man/coap-oscore-conf.txt.in index 3c1d986c..abf7329c 100644 --- a/man/coap-oscore-conf.txt.in +++ b/man/coap-oscore-conf.txt.in @@ -65,7 +65,7 @@ The possible encodings are: *config* :: A set of configuration lines comprising of keyword,encoding,value starting and ending with a single quote '. - Multiple configuraiton lines are supported. + Multiple configuration lines are supported. The valid keywords are: diff --git a/man/coap-tls-engine-conf.txt.in b/man/coap-tls-engine-conf.txt.in index c28c26ab..1644fda3 100644 --- a/man/coap-tls-engine-conf.txt.in +++ b/man/coap-tls-engine-conf.txt.in @@ -69,7 +69,7 @@ The possible keywords are: _parameter_1_ is the numeric value of the or'd set of required ENGINE_METHOD_* or ENGINE_METHOD_ALL. _parameter_1_ can be an ascii representation of a number - or formated as 0xXXXX. _parameter_2_ is ignored. + or formatted as 0xXXXX. _parameter_2_ is ignored. EXAMPLE TLS ENGINE CONFIGURATION FILE ------------------------------------- diff --git a/man/coap_block.txt.in b/man/coap_block.txt.in index a5516f98..63806aa2 100644 --- a/man/coap_block.txt.in +++ b/man/coap_block.txt.in @@ -199,7 +199,7 @@ session _block_mode_. #define COAP_BLOCK_SINGLE_BODY 0x02 /* Deliver the data as a single body */ #define COAP_BLOCK_TRY_Q_BLOCK 0x04 /* Try Q-Block method */ #define COAP_BLOCK_USE_M_Q_BLOCK 0x08 /* (Client) Use M bit when recovering Q-Block2 */ -#define COAP_BLOCK_NO_PREEMPTIVE_RTAG 0x10 /* (Client) Don't use pre-emptive Request-Tags */ +#define COAP_BLOCK_NO_PREEMPTIVE_RTAG 0x10 /* (Client) Don't use preemptive Request-Tags */ #define COAP_BLOCK_STLESS_FETCH 0x20 /* (Client) Assume server supports stateless FETCH */ #define COAP_BLOCK_STLESS_BLOCK2 0x40 /* (Server) Server is stateless for Block2 transfers */ #define COAP_BLOCK_NOT_RANDOM_BLOCK1 0x80 /* (Server) Disable server handling random order block1 */ diff --git a/man/coap_call_home.txt.in b/man/coap_call_home.txt.in index 4274570f..88f9fa44 100644 --- a/man/coap_call_home.txt.in +++ b/man/coap_call_home.txt.in @@ -85,7 +85,7 @@ that the CoAP-Server will exit even all Call-Homes have completed and it is not listening on any endpoint. *NOTE:* If *coap_context_set_session_reconnect_time2*(3) has been used, then the -Call-Home session will get re-used for trying a new connection and so will not +Call-Home session will get reused for trying a new connection and so will not time out like a normal server session until the retry count is reached (or for ever if retry count is 0).. diff --git a/man/coap_context.txt.in b/man/coap_context.txt.in index 5a69b25e..ca078214 100644 --- a/man/coap_context.txt.in +++ b/man/coap_context.txt.in @@ -263,7 +263,7 @@ to 0. The *coap_context_rate_limit_ppm.3*() is used to rate limit the transmission of NON packets to _rate_limit_ppm_ packets per minute. The rate limiting -is done by enforcing a minumum time gap between packet transmission unless +is done by enforcing a minimum time gap between packet transmission unless a response is received. *Function: coap_register_option()* diff --git a/man/coap_encryption.txt.in b/man/coap_encryption.txt.in index 4d1a0676..9fa67e12 100644 --- a/man/coap_encryption.txt.in +++ b/man/coap_encryption.txt.in @@ -230,7 +230,7 @@ supported by suitably compiled Mbed TLS library. *SECTION: PSK Client: coap_dtls_cpsk_t: use_cid* *use_cid* Set to 1 if the DTLS Client is to try to used Connection-ID. -Server is alwys enabled if support available. +Server is always enabled if support available. *SECTION: PSK Client: coap_dtls_cpsk_t: Reserved* @@ -515,7 +515,7 @@ typedef struct coap_dtls_pki_t { uint8_t use_cid; /* 1 if DTLS Connection ID is to be * used (Client only, server always enabled) * if supported */ - uint8_t allow_sni_cn_mismatch:1; /* 1 if SNI and returnd CN allowed to mismatch + uint8_t allow_sni_cn_mismatch:1; /* 1 if SNI and returned CN allowed to mismatch * (Client only). Not normally set */ uint8_t reserved[2]; /* Reserved - must be set to 0 for future compatibility */ @@ -979,7 +979,7 @@ typedef enum coap_pki_define_t { *key.define.ca.[su]_char* and possibly *key.define.ca_len* points to the CA location as defined by *key.define.ca_def*. *key.define.ca.[su]_char* can be -NULL if there is no CA explicitely defined. This definition should only +NULL if there is no CA explicitly defined. This definition should only contain one CA (that has signed the public certificate) as this is passed from the server to the client when requesting the client's certificate. This certificate is also added into the valid root CAs list if not already present. diff --git a/man/coap_handler.txt.in b/man/coap_handler.txt.in index 2f47fa91..780b04d1 100644 --- a/man/coap_handler.txt.in +++ b/man/coap_handler.txt.in @@ -170,13 +170,13 @@ abstracted as described in *coap_pdu_access*(3) for analysis. *NOTE:* _sent_ will only be non NULL when the request PDU is Confirmable and this is an ACK or RST response to the request. In general, matching of -Requests and Responses whould be done by generating unique Tokens for each +Requests and Responses would be done by generating unique Tokens for each Request and then matching up based on the Token in _received_ Response. *NOTE:* _sent_ (if not NULL) may not contain all or any of the data used for the initial request if block transfers are being used. For Block1 requests, the complete data will be lost once the data has been successfully transmitted as -acknowledged by the first response. For Block2 responses, _sent_ gets re-used +acknowledged by the first response. For Block2 responses, _sent_ gets reused to request the next Block2 and so data information is lost. *NOTE:* If the returned value is COAP_RESPONSE_FAIL, then a CoAP RST packet @@ -193,7 +193,7 @@ The nack handler function prototype is defined as: [source, c] ---- /** - * Negative Acknowedge handler that is used as callback in coap_context_t. + * Negative Acknowledge handler that is used as callback in coap_context_t. * * @param session CoAP session. * @param sent The PDU that was transmitted. @@ -301,7 +301,7 @@ typedef enum { /* * (D)TLS events for COAP_PROTO_DTLS and COAP_PROTO_TLS */ - /** Triggerred when (D)TLS session closed */ + /** Triggered when (D)TLS session closed */ COAP_EVENT_DTLS_CLOSED = 0x0000, /** Triggered when (D)TLS session connected */ COAP_EVENT_DTLS_CONNECTED = 0x01DE, diff --git a/man/coap_init.txt.in b/man/coap_init.txt.in index 64190c3c..d3f99d14 100644 --- a/man/coap_init.txt.in +++ b/man/coap_init.txt.in @@ -44,12 +44,12 @@ FUNCTIONS The *coap_startup*() function must be called before any other *coap_**() functions are called. It is used to initialize things like mutexes, -random number gererators, clocks, TLS libraries etc. +random number generators, clocks, TLS libraries etc. *NOTE:* This should be called after any other lower layer is initialized. For example, for LwIP, lwip_init() must be called before *coap_startup*(). -*NOTE:* After the inital call to *coap_startup*(), subsequent calls are ignored +*NOTE:* After the initial call to *coap_startup*(), subsequent calls are ignored until *coap_cleanup*() is called. *Function: coap_cleanup()* diff --git a/man/coap_keepalive.txt.in b/man/coap_keepalive.txt.in index 982ede91..7bda54cb 100644 --- a/man/coap_keepalive.txt.in +++ b/man/coap_keepalive.txt.in @@ -62,12 +62,12 @@ defining the handler to use by using *coap_register_event_handler*() which will be called with a reason of COAP_EVENT_KEEPALIVE_FAILURE. *NOTE:* A keepalive will only be transmitted when there has been no traffic on -the session for _seconds_. It does not regularily repeat every _seconds_. +the session for _seconds_. It does not regularly repeat every _seconds_. *NOTE:* As this may be used to keep an interim NAT device "warm", the exponentially increasing retransmit times for CON requests is limited to _seconds_, but the retransmit counter is not affected. Unless needed, -_seconds_ shold not be set to less than 30. +_seconds_ should not be set to less than 30. *NOTE:* If this is used at the server end of a CoAP session (set up by using *coap_new_endpoint*(3)), keepalives will only be transmitted for sessions diff --git a/man/coap_locking.txt.in b/man/coap_locking.txt.in index 983503fa..f656506c 100644 --- a/man/coap_locking.txt.in +++ b/man/coap_locking.txt.in @@ -112,7 +112,7 @@ call a Public API when in the locked state. *coap_lock_callback_release*() (or *coap_lock_callback_ret_release*()) unlocks *global_lock* when calling app call-back. The allows the app call-back to go off and do other slow/blocking activity. Any app call-back calls to a Public API then -locks up *global_lock* before proceding. +locks up *global_lock* before proceeding. *coap_lock_specific_callback_release*() acts as *coap_lock_callback_release*(), but allows additional locks to be set before doing the call-back, and then @@ -190,14 +190,14 @@ will get executed. *Function: coap_lock_specific_lock()* The *coap_lock_specific_lock*() function is used to lock the specified _lock_ in the -appropriate structue from multiple thread access. If the locking fails for any reason, +appropriate structure from multiple thread access. If the locking fails for any reason, then _failed_statement_ will get executed. *Function: coap_lock_specific_unlock()* The *coap_lock_specific_unlock*() function is used to unlock the specified _lock_ -so that another thread can access the apprpriate structure. +so that another thread can access the appropriate structure. *Function: coap_lock_specific_callback_release()* diff --git a/man/coap_observe.txt.in b/man/coap_observe.txt.in index 4bfc019d..4d067774 100644 --- a/man/coap_observe.txt.in +++ b/man/coap_observe.txt.in @@ -104,7 +104,7 @@ _resource_ is no longer observable. when libcoap creates a "fake GET/FETCH request". The Unknown Resource PUT handler must create a new resource and mark the resource as "observable" if a specific resource needs to be observable. The application must then -manage the deletion of the resource at the appropriate time. Similarily, +manage the deletion of the resource at the appropriate time. Similarly, it is not possible to observe the resource set up by *coap_resource_proxy_uri_init2*() or *coap_resource_reverse_proxy_init*(). diff --git a/man/coap_proxy.txt.in b/man/coap_proxy.txt.in index 299fd503..98f99288 100644 --- a/man/coap_proxy.txt.in +++ b/man/coap_proxy.txt.in @@ -98,7 +98,7 @@ It is possible to define multiple upstream servers for *reverse* and *forward-static* proxy types. Each of these multiple servers needs a different address. These will then be allocated to each new client request in a round-robin fashion. An existing client session will always get directed to the -same upsteam server unless that upstream session has idle timed out. +same upstream server unless that upstream session has idle timed out. For the *forward-dynamic* proxy type, a dummy server needs to be defined if any specific PKI/PSK or OSCORE is required for creating the ongoing session to the @@ -113,11 +113,11 @@ Support for doing a multicast request can be enabled or disabled for an upstream server when using *forward-dynamic*, providing the ongoing session is UDP and the scheme is only coap. -The proxy logic will convert between supported protocals - e.g. coap <> coaps+tcp +The proxy logic will convert between supported protocols - e.g. coap <> coaps+tcp for the incoming and upstream session. Conversions to/from http(s) are not currently supported. -The resourse handler to handle *forward* proxy requests is defined using +The resource handler to handle *forward* proxy requests is defined using *coap_resource_proxy_uri_init2*(3). The resource handler to handle *reverse* proxy requests is defined using @@ -138,7 +138,7 @@ FUNCTIONS ---- /* * coap_proxy_t Proxy definitions. - * 0x00000007 Old 4.3.5 mappings for backward compatability. + * 0x00000007 Old 4.3.5 mappings for backward compatibility. * 0x00000038 New type mappings. * 0xffffffc0 Bitwise optional actions. * @@ -326,7 +326,7 @@ client endpoint. * * @param session CoAP session. * @param sent The PDU that was transmitted. - * @param received The respose PDU that was received, or returned from cache. + * @param received The response PDU that was received, or returned from cache. * @param cache_key Updated with the cache key pointer provided to * coap_proxy_forward_request(). The caller should * delete this cache key (unless the client request set up an diff --git a/man/coap_resource.txt.in b/man/coap_resource.txt.in index 512b5d5b..ad8900bf 100644 --- a/man/coap_resource.txt.in +++ b/man/coap_resource.txt.in @@ -137,20 +137,20 @@ _flags_ can be zero or more of the following definitions or'ed together. [horizontal] *COAP_RESOURCE_FLAGS_NOTIFY_NON*:: -Set the notification message type to non-confirmable for any trigggered +Set the notification message type to non-confirmable for any triggered "observe" responses with type set to confirmable every 5 packets as required by "https://rfc-editor.org/rfc/rfc7641#section-4.5[RFC7641 4.5. Transmission]". See *coap_observe*(3). + *NOTE:* This flag is ignored if COAP_RESOURCE_FLAGS_NOTIFY_CON is set. *COAP_RESOURCE_FLAGS_NOTIFY_NON_ALWAYS*:: -Set the notification message type to always non-confirmable for any trigggered +Set the notification message type to always non-confirmable for any triggered "observe" responses. This should only be used if a upper layer protocol requires it. See *coap_observe*(3). + *NOTE:* This flag is ignored if COAP_RESOURCE_FLAGS_NOTIFY_CON is set. *COAP_RESOURCE_FLAGS_NOTIFY_CON*:: -Set the notification message type to confirmable for any trigggered +Set the notification message type to confirmable for any triggered "observe" responses. See *coap_observe*(3). + *NOTE:* COAP_RESOURCE_FLAGS_NOTIFY_NON is assumed if COAP_RESOURCE_FLAGS_NOTIFY_CON is not set. @@ -247,7 +247,7 @@ more of the COAP_RESOURCE_FLAGS MCAST definitions. *NOTE:* There can only be one reverse-proxy or unknown resource handler per context - attaching a new one overrides the previous definition. -*NOTE:* If resources are created in the request handlers accociated with this +*NOTE:* If resources are created in the request handlers associated with this resource, as multiple threads can be running in the same handler either lock protection needs to be provided in the handler, or consider using *coap_register_dynamic_resource_handler*(3) instead for multi-thread environments. diff --git a/man/coap_session.txt.in b/man/coap_session.txt.in index bf42db37..a3722c52 100644 --- a/man/coap_session.txt.in +++ b/man/coap_session.txt.in @@ -125,7 +125,7 @@ receive queue and send queue. *NOTE:* All client sessions start off with a reference count of 1. If type Server, then the _session_ is added to an idle pool ready for subsequent -re-use. If the Server _session_ is not used for 5 minutes, then it will get +reuse. If the Server _session_ is not used for 5 minutes, then it will get completely freed off. *NOTE:* Unless the application increments the reference count, this is the case for all type server sessions as they start with a reference count of 0. diff --git a/man/coap_string.txt.in b/man/coap_string.txt.in index f82958ac..768f7e23 100644 --- a/man/coap_string.txt.in +++ b/man/coap_string.txt.in @@ -151,7 +151,7 @@ to _size_. The *coap_resize_binary*() function is used resize the size of _s_ to the new size of _new_size_. The data between the old _length_ and the _new_size_ is -unitialized. _length_ is set to _new_size_. +uninitialized. _length_ is set to _new_size_. *Function: coap_delete_binary()* diff --git a/man/coap_threads.txt.in b/man/coap_threads.txt.in index 65dbac40..4bfaa8fd 100644 --- a/man/coap_threads.txt.in +++ b/man/coap_threads.txt.in @@ -49,7 +49,7 @@ application cannot set up and manage its own threading model. Each thread calling *coap_io_process*(3) can receive a packet (a different packet for each thread), call the appropriate application call-back handler and potentially be spending time of consequence in that handler without blocking the -reciept of other input traffic. +receipt of other input traffic. These above listed functions should be called from the main thread. It is assumed that thread-safe code has been enabled. @@ -71,9 +71,9 @@ and so changes can safely be made to any structure that libcoap is using includi invoking any libcoap Public API calls. The second type of call-back is executing without the libcoap lock protections and -so no modications must take place other than by using the libcoap Public API that +so no modifications must take place other than by using the libcoap Public API that is not modifying a determined reference. The second type is used when there is a -likelyhood that the call-back may block on an external event and libcoap in general +likelihood that the call-back may block on an external event and libcoap in general should not be blocked. The list of the second type of call-backs are set up by the following functions: diff --git a/src/coap_async.c b/src/coap_async.c index 8d166cbd..be393ae2 100644 --- a/src/coap_async.c +++ b/src/coap_async.c @@ -151,7 +151,7 @@ coap_async_set_delay_lkd(coap_async_t *async, coap_tick_t delay) { 1000 / COAP_TICKS_PER_SECOND)); } else { async->delay = 0; - coap_log_debug(" %s: Async request indefinately delayed\n", + coap_log_debug(" %s: Async request indefinitely delayed\n", coap_session_str(async->session)); } } diff --git a/src/coap_block.c b/src/coap_block.c index 051b179b..709edb1e 100644 --- a/src/coap_block.c +++ b/src/coap_block.c @@ -2061,7 +2061,7 @@ expire: if (lg_srcv->no_more_seen && lg_srcv->block_option == COAP_OPTION_BLOCK1) { /* * Need to send a separate 4.08 to indicate missing blocks - * Using NON is permissable as per + * Using NON is permissible as per * https://datatracker.ietf.org/doc/html/rfc7252#section-5.2.3 */ coap_pdu_t *pdu; @@ -2816,7 +2816,7 @@ add_block_send(uint32_t num, int is_continue, send_track *out_blocks, * transfer. If so, need to initiate the response with the next blocks * and not trouble the application. * - * If additional responses needed, then these are expicitly sent out and + * If additional responses needed, then these are explicitly sent out and * 'response' is updated to be the last response to be sent. There can be * multiple Q-Block2 in the request, as well as the 'Continue' Q-Block2 * request. @@ -3132,7 +3132,7 @@ internal_issue: error_phrase = coap_response_phrase(response->code); coap_add_data(response, strlen(error_phrase), (const uint8_t *)error_phrase); - /* Keep in cache for 4 * ACK_TIMOUT incase of retry */ + /* Keep in cache for 4 * ACK_TIMOUT in case of retry */ if (lg_xmit) coap_ticks(&lg_xmit->last_all_sent); @@ -4450,7 +4450,7 @@ reinit: max_body_size = max_body; } coap_log_warn("Unable to handle body size %" PRIuS " (max %" PRIu32 ")\n", size2, max_body_size); - /* Try to hint to the server thare is an issue */ + /* Try to hint to the server there is an issue */ coap_send_rst_lkd(session, rcvd); coap_handle_event_lkd(session->context, COAP_EVENT_BLOCK_ISSUE, session); return 1; @@ -4754,7 +4754,7 @@ give_to_app: if (context->max_body_size && length > context->max_body_size) { coap_log_warn("Unable to handle body size %" PRIuS " (max %" PRIu32 ")\n", length, context->max_body_size); - /* Try to hint to the server thare is an issue */ + /* Try to hint to the server there is an issue */ coap_send_rst_lkd(session, rcvd); coap_handle_event_lkd(session->context, COAP_EVENT_BLOCK_ISSUE, session); return 1; @@ -4912,7 +4912,7 @@ fail_resp: if (context->max_body_size && length > context->max_body_size) { coap_log_warn("Unable to handle body size %" PRIuS " (max %" PRIu32 ")\n", length, context->max_body_size); - /* Try to hint to the server thare is an issue */ + /* Try to hint to the server there is an issue */ coap_send_rst_lkd(session, rcvd); coap_handle_event_lkd(session->context, COAP_EVENT_BLOCK_ISSUE, session); return 1; diff --git a/src/coap_dgrm_posix.c b/src/coap_dgrm_posix.c index 83684e00..51ab5161 100644 --- a/src/coap_dgrm_posix.c +++ b/src/coap_dgrm_posix.c @@ -899,7 +899,7 @@ coap_socket_recv(coap_socket_t *sock, coap_packet_t *packet) { mhdr.msg_control = buf; mhdr.msg_controllen = sizeof(buf); - /* set a big first length incase recvmsg() does not implement updating + /* set a big first length in case recvmsg() does not implement updating msg_control as well as preset the first cmsg with bad data */ cmsg = (struct cmsghdr *)buf; cmsg->cmsg_len = CMSG_LEN(sizeof(buf)); diff --git a/src/coap_gnutls.c b/src/coap_gnutls.c index c0cb7358..ed63d90e 100644 --- a/src/coap_gnutls.c +++ b/src/coap_gnutls.c @@ -2652,7 +2652,7 @@ coap_dtls_receive(coap_session_t *c_session, const uint8_t *data, } else { ret = -1; if (ssl_data->pdu_len && !g_env->sent_alert) { - /* Do the handshake again incase of internal timeout */ + /* Do the handshake again in case of internal timeout */ ret = do_gnutls_handshake(c_session, g_env); if (ret == 1) { /* Just connected, so send the data */ @@ -3108,7 +3108,7 @@ static struct hash_algs { cose_alg_t alg; gnutls_digest_algorithm_t dig_type; size_t dig_size; -} hashs[] = { +} hashes[] = { {COSE_ALGORITHM_SHA_1, GNUTLS_DIG_SHA1, 20}, {COSE_ALGORITHM_SHA_256_256, GNUTLS_DIG_SHA256, 32}, {COSE_ALGORITHM_SHA_512, GNUTLS_DIG_SHA512, 64}, @@ -3118,10 +3118,10 @@ static gnutls_digest_algorithm_t get_hash_alg(cose_alg_t alg, size_t *hash_len) { size_t idx; - for (idx = 0; idx < sizeof(hashs) / sizeof(struct hash_algs); idx++) { - if (hashs[idx].alg == alg) { - *hash_len = hashs[idx].dig_size; - return hashs[idx].dig_type; + for (idx = 0; idx < sizeof(hashes) / sizeof(struct hash_algs); idx++) { + if (hashes[idx].alg == alg) { + *hash_len = hashes[idx].dig_size; + return hashes[idx].dig_type; } } coap_log_debug("get_hash_alg: COSE hash %d not supported\n", alg); diff --git a/src/coap_io_posix.c b/src/coap_io_posix.c index b20466c8..8426de95 100644 --- a/src/coap_io_posix.c +++ b/src/coap_io_posix.c @@ -495,7 +495,7 @@ coap_io_process_with_fds_lkd(coap_context_t *ctx, uint32_t timeout_ms, /* * reset to COAP_IO_NO_WAIT (which causes etimeout to become 0) - * incase we have to do another iteration + * in case we have to do another iteration * (COAP_MAX_EPOLL_EVENTS insufficient) */ timeout_ms = COAP_IO_NO_WAIT; diff --git a/src/coap_mbedtls.c b/src/coap_mbedtls.c index 736bc89a..10c49a26 100644 --- a/src/coap_mbedtls.c +++ b/src/coap_mbedtls.c @@ -1194,7 +1194,7 @@ setup_pki_credentials(mbedtls_x509_crt *cacert, } } - /* Add in any root CA definitons */ + /* Add in any root CA definitions */ #if defined(MBEDTLS_FS_IO) if (m_context->root_ca_file) { @@ -2921,7 +2921,7 @@ coap_dtls_receive(coap_session_t *c_session, coap_session_connected(c_session); } else { if (ssl_data->pdu_len) { - /* Do the handshake again incase of internal timeout */ + /* Do the handshake again in case of internal timeout */ ret = do_mbedtls_handshake(c_session, m_env); if (ret == 1) { /* Just connected, so send the data */ diff --git a/src/coap_mem_lwip.c b/src/coap_mem_lwip.c index a17ff3be..75290bd5 100644 --- a/src/coap_mem_lwip.c +++ b/src/coap_mem_lwip.c @@ -10,8 +10,8 @@ */ /** - * @file coap_dgrm_lwip.c - * @brief LwIP Datagram (UDP) specific functions + * @file coap_mem_lwip.c + * @brief Memory handling functions - LwIP specific */ #include "coap3/coap_libcoap_build.h" diff --git a/src/coap_net.c b/src/coap_net.c index 3e7c4b0d..fe2f9322 100644 --- a/src/coap_net.c +++ b/src/coap_net.c @@ -1,4 +1,4 @@ -/* coap_net.c -- CoAP context inteface +/* coap_net.c -- CoAP context interface * * Copyright (C) 2010--2026 Olaf Bergmann and others * @@ -1025,7 +1025,7 @@ coap_option_check_critical(coap_session_t *session, coap_option_iterator_init(pdu, &opt_iter, COAP_OPT_ALL); while (coap_option_next(&opt_iter)) { - /* Check for explicitely reserved option RFC 5272 12.2 Table 7 */ + /* Check for explicitly reserved option RFC 5272 12.2 Table 7 */ /* Need to check reserved options */ switch (opt_iter.number) { case 0: @@ -1457,7 +1457,7 @@ coap_send_test_extended_token(coap_session_t *session) { session->max_token_checked = COAP_EXT_T_CHECKING; /* Checking out this one */ - /* Need to track incase OSCORE / Echo etc. comes back after non-piggy-backed ACK */ + /* Need to track in case OSCORE / Echo etc. comes back after non-piggy-backed ACK */ lg_crcv = coap_block_new_lg_crcv(session, pdu, NULL); if (lg_crcv) { LL_PREPEND(session->lg_crcv, lg_crcv); @@ -1787,7 +1787,7 @@ coap_send_lkd(coap_session_t *session, coap_pdu_t *pdu) { } #endif /* COAP_Q_BLOCK_SUPPORT */ if (observe_action != COAP_OBSERVE_CANCEL) { - /* Warn about re-use of tokens */ + /* Warn about reuse of tokens */ if (session->last_token && coap_binary_equal(&pdu->actual_token, session->last_token)) { if (coap_get_log_level() >= COAP_LOG_DEBUG) { @@ -2709,7 +2709,7 @@ coap_read_session(coap_context_t *ctx, coap_session_t *session, coap_tick_t now) coap_pdu_t *pdu; session->last_rx_tx = now; - /* Need max space incase PDU is updated with updated token etc. */ + /* Need max space in case PDU is updated with updated token etc. */ pdu = coap_pdu_init(0, 0, 0, coap_session_max_pdu_rcv_size(session)); if (!pdu) { return; @@ -2798,7 +2798,7 @@ coap_read_session(coap_context_t *ctx, coap_session_t *session, coap_tick_t now) bytes_read = -1; break; } - /* Need max space incase PDU is updated with updated token etc. */ + /* Need max space in case PDU is updated with updated token etc. */ session->partial_pdu = coap_pdu_init(0, 0, 0, coap_session_max_pdu_rcv_size(session)); if (session->partial_pdu == NULL) { @@ -3114,7 +3114,7 @@ coap_handle_dgram(coap_context_t *ctx, coap_session_t *session, return -1; } - /* Need max space incase PDU is updated with updated token etc. */ + /* Need max space in case PDU is updated with updated token etc. */ pdu = coap_pdu_init(0, 0, 0, coap_session_max_pdu_rcv_size(session)); if (!pdu) goto error; @@ -3179,7 +3179,7 @@ coap_remove_from_queue(coap_queue_t **queue, coap_session_t *session, coap_mid_t return 1; } - /* search message id in queue to remove (only first occurence will be removed) */ + /* search message id in queue to remove (only first occurrence will be removed) */ q = *queue; do { p = q; @@ -3233,7 +3233,7 @@ coap_remove_from_queue_token(coap_queue_t **queue, coap_session_t *session, return 1; } - /* search token in queue to remove (only first occurence will be removed) */ + /* search token in queue to remove (only first occurrence will be removed) */ q = *queue; do { p = q; @@ -3947,7 +3947,7 @@ handle_request(coap_context_t *context, coap_session_t *session, coap_pdu_t *pdu resource = context->unknown_resource; } else if (pdu->code == COAP_REQUEST_CODE_DELETE) { /* - * Request for DELETE on non-existant resource (RFC7252: 5.8.4. DELETE) + * Request for DELETE on non-existent resource (RFC7252: 5.8.4. DELETE) */ coap_log_debug("request for unknown resource '%*.*s'," " return 2.02\n", diff --git a/src/coap_openhitls.c b/src/coap_openhitls.c index 4e17b51f..12164078 100644 --- a/src/coap_openhitls.c +++ b/src/coap_openhitls.c @@ -1210,7 +1210,7 @@ coap_hitls_uio_read(BSL_UIO *uio, void *buf, uint32_t len, } static int32_t -coap_hitls_uio_ctrl(BSL_UIO *uio, int32_t cmd, int32_t larg, void *parg) { +coap_hitls_uio_ctrl(BSL_UIO *uio, int32_t cmd, int32_t l_arg, void *parg) { coap_hitls_env_t *env = (coap_hitls_env_t *)BSL_UIO_GetUserData(uio); if (!env) @@ -1241,7 +1241,7 @@ coap_hitls_uio_ctrl(BSL_UIO *uio, int32_t cmd, int32_t larg, void *parg) { case BSL_UIO_GET_PEER_IP_ADDR: if (!parg || !env->session) return BSL_NULL_INPUT; - if (larg == (int32_t)sizeof(BSL_UIO_CtrlGetPeerIpAddrParam)) { + if (l_arg == (int32_t)sizeof(BSL_UIO_CtrlGetPeerIpAddrParam)) { BSL_UIO_CtrlGetPeerIpAddrParam *param = (BSL_UIO_CtrlGetPeerIpAddrParam *)parg; uint32_t addr_len = (uint32_t)env->session->addr_info.remote.size; @@ -1252,7 +1252,7 @@ coap_hitls_uio_ctrl(BSL_UIO *uio, int32_t cmd, int32_t larg, void *parg) { param->size = addr_len; return BSL_SUCCESS; } - if (env->session->addr_info.remote.size > (socklen_t)larg) + if (env->session->addr_info.remote.size > (socklen_t)l_arg) return BSL_INVALID_ARG; memcpy(parg, &env->session->addr_info.remote.addr.sa, env->session->addr_info.remote.size); @@ -1265,14 +1265,14 @@ coap_hitls_uio_ctrl(BSL_UIO *uio, int32_t cmd, int32_t larg, void *parg) { case BSL_UIO_UDP_GET_MTU_OVERHEAD: if (!parg) return BSL_NULL_INPUT; - if (larg != (int32_t)sizeof(uint8_t)) + if (l_arg != (int32_t)sizeof(uint8_t)) return BSL_INVALID_ARG; *(uint8_t *)parg = coap_hitls_udp_overhead(env); return BSL_SUCCESS; case BSL_UIO_UDP_QUERY_MTU: if (!parg) return BSL_NULL_INPUT; - if (larg != (int32_t)sizeof(uint32_t)) + if (l_arg != (int32_t)sizeof(uint32_t)) return BSL_INVALID_ARG; *(uint32_t *)parg = env->session->mtu > UINT32_MAX ? UINT32_MAX : (uint32_t)env->session->mtu; @@ -1280,7 +1280,7 @@ coap_hitls_uio_ctrl(BSL_UIO *uio, int32_t cmd, int32_t larg, void *parg) { case BSL_UIO_UDP_MTU_EXCEEDED: if (!parg) return BSL_NULL_INPUT; - if (larg != (int32_t)sizeof(bool)) + if (l_arg != (int32_t)sizeof(bool)) return BSL_INVALID_ARG; *(bool *)parg = env->mtu_exceeded != 0; env->mtu_exceeded = 0; diff --git a/src/coap_openssl.c b/src/coap_openssl.c index 4028c706..224491d3 100644 --- a/src/coap_openssl.c +++ b/src/coap_openssl.c @@ -395,7 +395,7 @@ retry: /* parameter 1 is mandatory */ if ((end - begin) == 0) goto bad_entry; - /* Get in paramater #1 */ + /* Get in parameter #1 */ split = memchr(begin, ':', end - begin); if (split == NULL) { /* Single entry - no parameter #2 */ @@ -425,7 +425,7 @@ bad_entry: } /* - * Formating of OpenSSL Engine configuration is:- + * Formatting of OpenSSL Engine configuration is:- * (Must be in this order) * * engine:XXX @@ -4377,7 +4377,7 @@ static struct hash_algs { cose_alg_t alg; const EVP_MD *(*get_hash)(void); size_t length; /* in bytes */ -} hashs[] = { +} hashes[] = { {COSE_ALGORITHM_SHA_1, EVP_sha1, 20}, {COSE_ALGORITHM_SHA_256_64, EVP_sha256, 8}, {COSE_ALGORITHM_SHA_256_256, EVP_sha256, 32}, @@ -4388,10 +4388,10 @@ static const EVP_MD * get_hash_alg(cose_alg_t alg, size_t *length) { size_t idx; - for (idx = 0; idx < sizeof(hashs) / sizeof(struct hash_algs); idx++) { - if (hashs[idx].alg == alg) { - *length = hashs[idx].length; - return hashs[idx].get_hash(); + for (idx = 0; idx < sizeof(hashes) / sizeof(struct hash_algs); idx++) { + if (hashes[idx].alg == alg) { + *length = hashes[idx].length; + return hashes[idx].get_hash(); } } coap_log_debug("get_hash_alg: COSE hash %d not supported\n", alg); diff --git a/src/coap_oscore.c b/src/coap_oscore.c index 2b325a14..c9ed064f 100644 --- a/src/coap_oscore.c +++ b/src/coap_oscore.c @@ -379,7 +379,7 @@ coap_oscore_new_pdu_encrypted(coap_session_t *session, } /* - * Take current PDU, create a new one approriately separated as per RFC8613 + * Take current PDU, create a new one appropriately separated as per RFC8613 * and then encrypt / integrity check the OSCORE data */ coap_pdu_t * diff --git a/src/coap_pdu.c b/src/coap_pdu.c index 96304a7b..5e21ab27 100644 --- a/src/coap_pdu.c +++ b/src/coap_pdu.c @@ -682,7 +682,7 @@ coap_option_check_repeatable(coap_pdu_t *pdu, coap_option_num_t number) { default: coap_log_info("Option number %d is not defined as repeatable\n", number); - /* Accepting it after warning as there may be user defineable options */ + /* Accepting it after warning as there may be user definable options */ break; } return 1; diff --git a/src/coap_proxy.c b/src/coap_proxy.c index 8c1d0253..cd3022d2 100644 --- a/src/coap_proxy.c +++ b/src/coap_proxy.c @@ -369,7 +369,7 @@ coap_proxy_map_type(coap_proxy_t proxy_type) { proxy_type = COAP_PROXY_FWD_DYNAMIC | COAP_PROXY_BIT_MCAST | COAP_PROXY_BIT_STRIP; break; default: - coap_log_warn("Proxy old proxy_type 0x%u unknow\n", proxy_type); + coap_log_warn("Proxy old proxy_type 0x%u unknown\n", proxy_type); proxy_type = COAP_PROXY_FWD_DYNAMIC; break; } @@ -849,7 +849,7 @@ coap_proxy_call_response_handler(coap_session_t *session, const coap_pdu_t *sent return COAP_RESPONSE_FAIL; assert(proxy_req); - /* Incase change in type of request over the proxy */ + /* In case change in type of request over the proxy */ if (proxy_req->pdu) resp_pdu->type = proxy_req->pdu->type; diff --git a/src/coap_session.c b/src/coap_session.c index 6dee3bbb..2ad7d0cc 100644 --- a/src/coap_session.c +++ b/src/coap_session.c @@ -834,7 +834,7 @@ coap_session_delay_pdu(coap_session_t *session, coap_pdu_t *pdu, } else { if (COAP_PROTO_NOT_RELIABLE(session->proto)) { coap_queue_t *q = NULL; - /* Check same mid is not getting re-used in violation of RFC7252 */ + /* Check same mid is not getting reused in violation of RFC7252 */ LL_FOREACH(session->delayqueue, q) { if (q->id == pdu->mid) { coap_log_err("** %s: mid=0x%04x: already in-use - dropped\n", @@ -1342,7 +1342,7 @@ coap_endpoint_get_session(coap_endpoint_t *endpoint, endpoint->context->max_handshake_sessions : COAP_DEFAULT_MAX_HANDSHAKE_SESSIONS)) { /* Maxed out on number of sessions in (D)TLS negotiation state */ - coap_log_debug("Oustanding sessions in COAP_SESSION_STATE_HANDSHAKE too " + coap_log_debug("Outstanding sessions in COAP_SESSION_STATE_HANDSHAKE too " "large. New request ignored\n"); return NULL; } @@ -2452,7 +2452,7 @@ coap_session_set_type_server_lkd(coap_session_t *session) { } /* * (D)TLS will initiate traffic with handshake. - * Reliable protocols will be sending a CSM, so no nead for Ping. + * Reliable protocols will be sending a CSM, so no need for Ping. */ if (session->context) { if (session->context->sessions) { diff --git a/src/coap_subscribe.c b/src/coap_subscribe.c index 4facf747..a7e0151c 100644 --- a/src/coap_subscribe.c +++ b/src/coap_subscribe.c @@ -148,7 +148,7 @@ coap_persist_observe_add_lkd(coap_context_t *context, session = coap_endpoint_get_session(ep, packet, now); if (session == NULL) goto fail; - /* Need max space incase PDU is updated with updated token, huge size etc. */ + /* Need max space in case PDU is updated with updated token, huge size etc. */ pdu = coap_pdu_init(0, 0, 0, 0); if (!pdu) goto fail; @@ -972,7 +972,7 @@ coap_op_dyn_resource_load_disk(coap_context_t *ctx) { coap_log_debug("persist: dynamic resource '%s' being re-created\n", name->s); /* - * Need max space incase PDU is updated with updated token, + * Need max space in case PDU is updated with updated token, * huge size etc. * */ request = coap_pdu_init(0, 0, 0, 0); diff --git a/src/coap_threadsafe.c b/src/coap_threadsafe.c index 70de5210..3cda393b 100644 --- a/src/coap_threadsafe.c +++ b/src/coap_threadsafe.c @@ -212,7 +212,7 @@ coap_io_process_configure_threads(coap_context_t *context, uint32_t thread_count return 0; coap_mutex_lock(&m_io_threads); - /* Need to make sure it is non zero incase coap_log*() is called */ + /* Need to make sure it is non zero in case coap_log*() is called */ if (thread_no == 0) { thread_no = ++max_thread_no; } @@ -290,7 +290,7 @@ void coap_io_process_remove_threads_lkd(coap_context_t *context) { coap_lock_unlock(); coap_mutex_lock(&m_io_threads); - /* Need to make sure it is non zero incase coap_log*() is called */ + /* Need to make sure it is non zero in case coap_log*() is called */ if (thread_no == 0) { thread_no = ++max_thread_no; } diff --git a/src/coap_tinydtls.c b/src/coap_tinydtls.c index b2e4d275..b795c2c2 100644 --- a/src/coap_tinydtls.c +++ b/src/coap_tinydtls.c @@ -1266,7 +1266,7 @@ asn1_derive_keys(coap_tiny_context_t *t_context, } if (!is_pkcs8) { - /* pkcs8 abstraction tested for valid eliptic curve */ + /* pkcs8 abstraction tested for valid elliptic curve */ test = get_asn1_tag(COAP_ASN1_IDENTIFIER, priv_data, priv_len, asn1_verify_curve); if (!test) { diff --git a/src/coap_uri.c b/src/coap_uri.c index ef0f2447..eef81f10 100644 --- a/src/coap_uri.c +++ b/src/coap_uri.c @@ -40,7 +40,7 @@ coap_upa_chain_t *coap_upa_server_mapping_chain = NULL; * @param len The length of @p s. * @param c The character to search. * - * @return A pointer to the first occurence of @p c, or @c NULL + * @return A pointer to the first occurrence of @p c, or @c NULL * if not found. */ COAP_STATIC_INLINE const uint8_t * diff --git a/src/coap_wolfssl.c b/src/coap_wolfssl.c index c299c556..470367c5 100644 --- a/src/coap_wolfssl.c +++ b/src/coap_wolfssl.c @@ -935,7 +935,7 @@ coap_set_user_prefs(WOLFSSL_CTX *ctx) { #endif } -/* Set up DTLS context if not alread done */ +/* Set up DTLS context if not already done */ static int setup_dtls_context(coap_wolfssl_context_t *w_context) { if (!w_context->dtls.ctx) { @@ -1006,7 +1006,7 @@ error: #if !COAP_DISABLE_TCP -/* Set up TLS context if not alread done */ +/* Set up TLS context if not already done */ static int setup_tls_context(coap_wolfssl_context_t *w_context) { if (!w_context->tls.ctx) { @@ -3073,7 +3073,7 @@ static struct hash_algs { cose_alg_t alg; const WOLFSSL_EVP_MD *(*get_hash)(void); size_t length; /* in bytes */ -} hashs[] = { +} hashes[] = { {COSE_ALGORITHM_SHA_1, wolfSSL_EVP_sha1, 20}, {COSE_ALGORITHM_SHA_256_64, wolfSSL_EVP_sha256, 8}, {COSE_ALGORITHM_SHA_256_256, wolfSSL_EVP_sha256, 32}, @@ -3084,10 +3084,10 @@ static const WOLFSSL_EVP_MD * get_hash_alg(cose_alg_t alg, size_t *length) { size_t idx; - for (idx = 0; idx < sizeof(hashs) / sizeof(struct hash_algs); idx++) { - if (hashs[idx].alg == alg) { - *length = hashs[idx].length; - return hashs[idx].get_hash(); + for (idx = 0; idx < sizeof(hashes) / sizeof(struct hash_algs); idx++) { + if (hashes[idx].alg == alg) { + *length = hashes[idx].length; + return hashes[idx].get_hash(); } } coap_log_debug("get_hash_alg: COSE hash %d not supported\n", alg); diff --git a/src/oscore/oscore.c b/src/oscore/oscore.c index 4af25ae9..164bdd02 100644 --- a/src/oscore/oscore.c +++ b/src/oscore/oscore.c @@ -33,7 +33,7 @@ /** * @file oscore.c * @brief An implementation of the Object Security for Constrained RESTful - * Enviornments (RFC 8613). + * Environments (RFC 8613). * * \author Martin Gunnarsson * adapted to libcoap and major rewrite @@ -137,7 +137,7 @@ oscore_prepare_e_aad(oscore_ctx_t *ctx, /* oscore_version, always "1" */ external_aad_len += oscore_cbor_put_unsigned(&external_aad_ptr, &rem_size, 1); - /* Algoritms array with one item*/ + /* Algorithms array with one item*/ external_aad_len += oscore_cbor_put_array(&external_aad_ptr, &rem_size, 1); /* Encryption Algorithm */ external_aad_len += @@ -237,7 +237,7 @@ oscore_encode_option_value(uint8_t *option_buffer, * error: return 0 * OK: return 1 * - * Basic assupmption is that all is preset to 0 or NULL on entry + * Basic assumption is that all is preset to 0 or NULL on entry */ int oscore_decode_option_value(const uint8_t *opt_value, diff --git a/src/oscore/oscore_cose.c b/src/oscore/oscore_cose.c index 8b2e8b44..f247789c 100644 --- a/src/oscore/oscore_cose.c +++ b/src/oscore/oscore_cose.c @@ -399,7 +399,7 @@ cose_encrypt0_set_aad(cose_encrypt0_t *ptr, coap_bin_const_t *aad) { } } -/* Returns 1 if successfull, 0 if key is of incorrect length. */ +/* Returns 1 if successful, 0 if key is of incorrect length. */ int cose_encrypt0_set_key(cose_encrypt0_t *ptr, coap_bin_const_t *key) { if (key == NULL || key->length != 16) { diff --git a/tests/Makefile.am b/tests/Makefile.am index ecc83b43..9c476c42 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -30,12 +30,12 @@ testdriver_SOURCES = \ test_oscore.c # The .a file is uses instead of .la so that testdriver can always access the -# internal functions that are not globaly exposed in a .so file. +# internal functions that are not globally exposed in a .so file. testdriver_LDADD = $(CUNIT_LIBS) $(top_builddir)/.libs/libcoap-$(LIBCOAP_NAME_SUFFIX).a ${DTLS_LIBS} # If there is a API change to something $(LIBCOAP_API_VERSION) > 1 there is # nothing to adopt here. No needed to implement something here because the test -# unit will always be build againts the actual header files! +# unit will always be build against the actual header files! CLEANFILES = testdriver diff --git a/tests/test_options.c b/tests/test_options.c index 3c8593f1..cb9f906b 100644 --- a/tests/test_options.c +++ b/tests/test_options.c @@ -1002,7 +1002,7 @@ t_init_option_tests(void) { OPTION_ACCESSOR_TEST(7, "access option #7"); } else { - fprintf(stderr, "W: cannot add option acessor function test suite (%s)\n", + fprintf(stderr, "W: cannot add option accessor function test suite (%s)\n", CU_get_error_msg()); }