Commit Graph
22 Commits
Author SHA1 Message Date
Jon Shallow 8237c1d801 Copyright: Update to 2024 2024-01-02 08:45:59 +00:00
Jon Shallow 203d228638 RIOT: library fixes for different build types
coap_debug.h: Support logging level set to _COAP_LOG_EMERG
coap_pdu.h: handle small ints
coap_pdu_internal.h: handle small ints
coap_session_internal.h: handle small ints
coap_uthash_internal.h: handle small ints
coap_block.c: Handle small ints
coap_debug.c: Fix use of vsnprintf() and vfprintf()
coap_pdu.c: Handle small ints
coap_tinydtls.c: Handle small ints
coap_uri.c: Fix alignment issue in coap_new_uri()

uncrustify run on RIOT examples to conform to RIOT's coding standards/
2023-10-23 14:38:57 +01:00
Jon Shallow 26302a076b coap-server.c: Add in support for output to syslog 2023-10-19 11:26:41 +01:00
Jon Shallow 8683a3177c coap_cleanup: Allow coap_startup() to be called after coap_cleanup() 2023-10-04 22:02:31 +01:00
Jon Shallow e2910a5bf1 naming: Rename remaining *.[ch] files that are not prefixed with coap_
include/coap3/block.h -> include/coap3/coap_block.h
include/coap3/pdu.h -> include/coap3/coap_pdu.h
include/coap3/resource.h -> include/coap3/coap_resource.h
src/block.c -> src/coap_block.c
src/net.c -> src/coap_net.c
src/pdu.c -> src/coap_pdu.c
src/resource.c -> src/coap_resource.c
2023-07-13 08:59:22 +01:00
Jon Shallow 8f068c0bbf pre-commit: Include re-styled include files to checks 2023-07-11 20:17:10 +01:00
Jon Shallow f4666c2ea9 LwIP: Support disabling LwIP's IPv6 support 2023-06-08 17:40:08 +01:00
Jon Shallow 8d869fff04 RIOT: Update to support latest libcoap code
Add in examples and pkg/build information
2023-06-05 12:47:15 +01:00
Jon Shallow 9d66e47241 coap_debug.c: Split out coap_print_ip_addr() from coap_print_addr()
Sometimes just the IP address is required, not the port as well.
2023-05-05 12:00:33 +01:00
Jon Shallow aee4c3fa6e logging: Support defining maximum logging level
This allows for code reduction if not all logging levels are required.

Done by defining ./configure --enable-max-logging-level=X, where X can have
the value of 0 through 8 inclusive.

COAP_LOG_EMERG is always logged.

Can save up to 40k bytes.
2023-04-12 09:55:13 +01:00
Jon Shallow f0f20c285d syslog.h: Leave in conditional LOG_ definitions for now 2023-04-10 14:19:09 +01:00
Jon Shallow 6599297edb syslog.h: Remove all references to syslog.h
syslog.h is no longer required for libcoap as all LOG_ usage has been replaced
with COAP_LOG_.

Added #include <stdio.h> to example code for code-client and coap-server as
a hint should application code be using LOG_.
2023-04-10 14:03:13 +01:00
kkrentz 79c66705a1 Updates Contiki-specific code to Contiki-NG 2023-02-08 16:05:09 +00:00
Jon Shallow 3552b53be4 Copyright: Update copyright date to end 2023 as appropriate 2023-01-02 11:45:10 +00:00
Jon Shallow 3897d2334c Logging: Make logging consistent across (D)TLS libraries
Set up coap_log_t as an enum, using syslog variable names prefixed by
COAP_.

Add function coap_dtls_log() for logging information from (D)TLS libraries.

Update the log output to have use Lower-case variants for the logging levels to
indicate that output is from the (D)TLS library instead of the CoAP library.

(D)TLS libraries updated to be consistent in the usage of
coap_dtls_set_log_level()/coap_dtls_get_log_level().

Add in coap_log_emerg(), coap_log_alert() etc. as wrappers to reduce the line
length required for log entries.  Updating all the coap_log() functions to
no longer use syslog variants will be a part of a separate PR.

Added in the "-V" option to the examples, with an initial default of
COAP_LOG_ERR, separating out the CoAP and (D)TLS logging levels.

Note: TinyDTLS log output will be consistent when built against a TinyDTLS
version that contains support for an external logging handler.
2022-11-03 16:02:36 +00:00
Jon Shallow 64e5641017 versioning: Make current git describe available
Add new function coap_package_build() which returns "git describe --tags"
if available at library build time, else standard package version.

The value of "git describe --tags" is created at run time and passed in as
a compiler -D definition.

Update copyright end dates for updated files.
2022-02-02 11:24:52 +00:00
Jon Shallow 0aeb0d6247 doxygen: Tidy up Modules and Files tab information
doc/module_api_wrap.h: New

Used to split modules into Application and Internal only.

include/coap/*.h:

Module (@defgroup) description put into group application_api or internal_api
as appropriate.

Add in @file information if missing.

src/*.c

Add in @file information.
2021-09-30 16:59:04 +01:00
Jon Shallow a7f53b4d6b coap_debug.h: Allow <syslog.h> to be included before and after <coap3/coap.h>
The syslog LOG_ definitions are defined in <syslog.h> and can be defined in
coap_debug.h (wrapped by a HAVE_SYSLOG_H wrapper to prevent duplicaton).

However, the coding order of
  include <coap3/coap.h>
  include <stdio.h
works, but
  include <stdio.h
  include <coap3/coap.h>
but fails if the application build environment does not define HAVE_SYSLOG_H
(as is the case of the examples in the examples/ directory).

The former "just" happens to work as the values of the variables are the same.

This fix is to remove the coap_log_t enum and replace it by simple #define
if LOG_ALERT etc. is not already defined.

Make coap_log_t int to remove Visual Studio compile warnings.
2021-09-28 12:10:04 +01:00
Olaf Bergmann 60421db0a5 Add SPDX-License-Identifier to source files
This change adds 'SPDX-License-Identifier: BSD-2-Clause' [1] to
the source code files that originate in the libcoap project.

Note that not all files are tagged because they are pulled in
from other sources and thus may fall under a different license.
More information about these is contained in the LICENSE file.

[1] https://spdx.org/licenses/BSD-2-Clause.html
2021-06-08 18:14:03 +02:00
Jon Shallow aaf4d874d4 TLS Support: Move common TLS support descriptions into libcoap
Added new function coap_string_tls_support() for outputting what key types the
TLS library supports to remove duplicated code out of the examples.
2021-05-12 18:02:37 +01:00
Jon Shallow 14cf0fe9e5 struct: Remove struct prefix for structures that are typedef'd 2021-04-26 16:52:14 +01:00
Olaf Bergmann 3f7ba0afc8 Bump API version to 3, release candidate 2 2021-04-21 14:38:54 +02:00