As coap-server now sets up 2 (or 4) endpoints, UDP and TCP based, all
subsequent endpoints are pre-pended to the ctx->endpoint list. Thus
ctx->endpoint will always be TCP based. Setting IPV6_JOIN_GROUP on a TCP
socket is a no-no.
As join() is complex function, it should be within libcoap so as to not require
detailed knowledge of how internal structures work (which really should be
opaque to the application writer).
include/coap2/net.h:
src/net.c:
libcoap-2.map:
libcoap-2.sym:
Create coap_join_mcast_group() in src/net.c (as it is a network layer
function using the (fixed) join() code. (Iterate through the ctx->endpoint list
looking for UDP based endpoints and only do the IPV6_JOIN_GROUP on them.)
There is no support for WITH_CONTIKI or WITH_LWIP at this point (returns -1).
examples/coap-server.c:
Remove join() code and replace call to join() with coap_join_mcast_group()
examples/coap-rd.c:
Remove join() code and replace call to join() with coap_join_mcast_group()
man/coap-rd.txt.in:
Correct a typo in the coap-ed man page
Currently the following complaint is in the build logs
man/Makefile.am:56: warning: ':='-style assignments are not portable
man/Makefile.am:56: warning: shell for fil in $(TXT3: non-POSIX variable name
man/Makefile.am:56: (probably a GNU make extension)
Correct issue by using
configure.ac:
AC_SUBST([DOLLAR_SIGN],[$])
man/Makefile.am:
to substiture for $ as in $(shell ...
and replace := with =
Part Three:
man/Makefile.am:
Determine additional man pages created by a2x with A2X_EXTRA_PAGES.
Set EXTRA_PAGES for the hand crafted additional man pages.
Clean out the additional installed coap_*.3 man pages using uninstall-man:
in man/Makefile.am
Add in -n option to support making require_peer_cert configurable, by default
it is enabled unless -n is set.
examples/coap-server.c:
Code changes.
man/coap-server.txt.in
Update documentation
Re-organize usage() and man pages to seperate out the PSK and PKI options
for clarity - as they may not be available for all TLS library versions
examples/client.c
examples/coap-server.c
man/coap-client.txt.in
man/coap-server.txt.in
man/coap-client.txt.in
man/coap-rd.txt.in
man/coap-server.txt.in
Document usage over -v7 for extra GnuTLS library output.
man/coap_attribute.txt.in
man/coap_context.txt.in
man/coap_encryption.txt.in
man/coap_handler.txt.in
man/coap_logging.txt.in
man/coap_observe.txt.in
man/coap_pdu_setup.txt.in
man/coap_recovery.txt.in
man/coap_resource.txt.in
man/coap_session.txt.in
man/coap_tls_library.txt.in
Include new -lcoap-@LIBCOAP_API_VERSION@-gnutls option.
Remove trailing spaces at end of line
man/coap_encryption.txt.in
Update with GnuTLS information
man/coap_logging.txt.in
Update with more information about logging levels.
man/coap_tls_library.txt.in
Include new functions coap_show_tls_version() and coap_string_tls_version()
Adding the version of the API to the include directive on the examples
to fulfill the correct information within the man pages related to the
changes made to the library source if API version related modifications
are done.
hashkey.[ch] files restored (now prefixed with coap_)
LWIP and Contiki builds now include these files
block.[ch]:
New function coap_add_data_blocked_response() to simplify GET
responses and handle adding in BLOCK2 options as appropriate.
Needs coap_hash() to generate ETag option.
net.c:
Determine if Block2 is in use, and add to coap_add_observer().
resource.[ch]:
Include Block2 request in coap_add_observer().
subscribe.h:
Include Block2 definition in coap_subscriber_t for using during
observe responses.
pdu.h:
Update comment.
coap-client.c:
No longer causes duplicate calls to coap_show_pdu()
(one in library, one in coap-client for the same PDU).
If a block'ed response received and observing, now observing continues.
(Fixes#166).
Send Observe Cancel with Block2 option if -b defined
coap-server.c:
Replaced all option setting, data addition etc. with new
coap_add_data_blocked_response() function in the GET handlers.
(Fixes#246 Issue 2).
Support PUT with BLOCK1.
(Fixes#246 Issue 1).
Add in -N option to send observe responses as non-confirmable.
Handle small wait_ms values correctly (after being decremented) for testing
whether observe should be triggered or not.
Refresh time every second by making COAP_RESOURCE_CHECK_TIME 1
Manuals:
Add in new function coap_add_data_blocked_response()
Update coap_observe with coap_delete_observer(s) functions
Correct example typo and use new function in hnd_get_time().
Add in -N option to coap-server(5)
Be more specific about COAP_RESOURCE_FLAGS_NOTIFY_NON and
COAP_RESOURCE_FLAGS_NOTIFY_CON usage for observe.
Files:
Makefile.am
Makefile.libcoap
examples/client.c
examples/coap-server.c
examples/lwip/Makefile
include/coap/block.h
include/coap/coap_hashkey.h
include/coap/pdu.h
include/coap/resource.h
include/coap/subscribe.h
libcoap-2.map
libcoap-2.sym
man/Makefile.am
man/coap-server.txt.in
man/coap_handler.txt.in
man/coap_observe.txt.in
man/coap_pdu_setup.txt.in
man/coap_resource.txt.in
src/block.c
src/coap_hashkey.c
src/net.c
src/resource.c
Added in a new landing page for Main Page
doc/main.md (new)
Enabled Tree View of whats available
Disable Related Pages TAB as it fills up with the man pages
- updated doc/Doxyfile.in
Get a2x to also generate html man pages which are then included. These
html files are updated to correct the lowercasing of NAME and SYNOPSIS.
The SEE ALSO references to other man pages are made hyper links.
- done by doc/build_man_files.sh (new)
Created a new TAB Manual Pages
Created a new TAB Depricated Items
- done by modifing DoxygenLayout.xml file using doc/build_man_files.sh
Updated .gitignore to ignore additional files and autogen.sh to clean them up
man/coap*txt.in updated to display as expected in Doxygen.
This only updates documentation
.gitignore
Makefile.am
autogen.sh
doc/Doxyfile.in
doc/Makefile.am
doc/build_man_files.sh (New)
doc/main.md (New)
include/coap/debug.h
include/coap/encode.h
include/coap/option.h
include/coap/pdu.h
include/coap/prng.h
man/Makefile.am
man/coap.txt.in
man/coap_attribute.txt.in
man/coap_context.txt.in
man/coap_encryption.txt.in
man/coap_handler.txt.in
man/coap_logging.txt.in
man/coap_observe.txt.in
man/coap_pdu_setup.txt.in
man/coap_recovery.txt.in
man/coap_resource.txt.in
man/coap_session.txt.in
man/coap_tls_library.txt.in
dtls_event is a static variable, declared outside of all the functions which
tracks (D)TLS errors for generating events etc.
If there are multiple SSL sessions being set up to the same server (as per
Happy Eyeballs for the DOTS protocol) it is possible to asynchronously get
dtls_event updated and the wrong SSL session then acts on it.
Make dtls_event a part of coap_session_t to maintain seperation.
Preset dtls_event to -1 in coap_make_session().
Update coap_event_handler() to have the 3rd parameter as
coap_session_t *session instead of void *arg as the parameter is always session.
Updated coap_event_handler_t to have session as the 3rd parameter.
Add in new registration handler coap_register_event_handler() to be consistent
with all the other coap_register_XXX_handler()s.
Consequently, coap_set_event_handler() and coap_clear_enent_handler() are
deprecated.
Update coap_handler(3) to include new coap_register_event_handler().
(PR #183 event definitions are included presumptive on #183 getting merged)
OpenSSL 1.1.0 has support for making decisions during receipt of
the Client Hello - the call back function is set up using
SSL_CTX_set_tlsext_servername_callback() which is called later in the
Client Hello processing - but called every Client Hello.
Certificates and Preshared Keys have to be set up in the SSL CTX before
SSL_Accept() is called, making the code messy to decide whether this is a
PKI or PSK incoming request to handle things accordingly if both are
defined. SNI has to create a new SSL CTX to handle different server names
with different crtificates.
OpenSSL 1.1.1 introduces a new function SSL_CTX_set_client_hello_cb().
The call back is invoked early on in the Client Hello processing giving
the ability to easily use different Preshared Keys, Certificates etc.
Certificates do not have to be set up in the SSL CTX before SSL_Accept is
called.
Later in the Client Hello code, the callback for
SSL_CTX_set_tlsext_servername_callback() is still called, but only if SNI
is being used by the client, so cannot be used for doing things the
OpenSSL 1.1.0 way.
OpenSSL 1.1.1 supports TLS1.3.
Consequently, this code has to have compile time options to include /
exclude code based on whether compiled against 1.1.0 or 1.1.1, as well as
have additional run time checks.
Updated:
examples/client.c
examples/coap-server.c
include/coap/coap_dtls.h
man/coap_context.txt.in
man/coap_encryption.txt.in
man/coap_session.txt.in
src/coap_openssl.c
In addition, the callback app_override_tls_setup_call_back has been removed
from coap_dtls_pki_t and replaced with additional_tls_setup_call_back
as app_override_tls_setup_call_back became very messy with 2 versions
of OpenSSL. If the application now wants to make additional checks/
changes etc., app_override_tls_setup_call_back will get invoked after
the defined configuration checks are done.
SNI has been added into coap-client for testing / demonstration
New struct coap_binary_t - same as coap_string_t, used for tokens
Deprecate struct str with the intent of removing it downstream as it
polutes namespace.
Make end of coap_string_t data a NUL.
Updated coap_make_str_const(), removing .length= and .s= to keep upstream
compilers happy.
Update Doxygen for str.h
Files:
examples/client.c
examples/coap-rd.c
examples/coap-server.c
examples/contiki/server.c
examples/etsi_iot_01.c
include/coap/resource.h
include/coap/str.h
include/coap/subscribe.h
man/coap_observe.txt.in
src/net.c
src/resource.c
src/str.c
src/uri.c
tests/test_options.c
Update
Add in -d max option, which then causes coap_resource_unknown_init() to get
called.
Number of dynamic resoures is limited by 'max'. The current set of resources
can be determined by using .well-known/core
If max is reached, 4.06 is returned.
Fixed typo in man coap_resource(3) in example for unknown resources
Split out old coap_context(3) into coap_context(3), coap_encryption(3) and
coap_session(3) with coap_encryption(3) primarily updated to reflect the
updated PKI configuration options.
coap-client.txt.in
coap-server.txt.in
Update with new options making use of updated PKI interface
examples/client.c
Add in support for using PKI certificates
examples/coap-server.c
Add in support for using PKI certificates
remove default PSK key
Add in '-h hint' option
Make Usage reflect actual options available to use
man/coap-client.txt.in
Include the missing options
Update -A option to be a single entity
Sort the options into ascending order as reported by Usage
man/coap-server.txt.in
Include the missing options
Add in '-h hint' option
Update code / examples / man pages with the updated function.
include/coap/libcoap.h:
Add in new define COAP_DEPRECATED to generate compiler warnings when used
include/coap/encode.h
New coap_encode_var_safe() function that includes the size of the output
buffer as a parameter.
Make coap_encode_var_bytes() a wrapper for coap_encode_var_safe() and
mark it as COAP_DEPRECATED for backwards compatability
src/encode.c:
New coap_encode_var_safe() function that includes the size of the output
buffer as a parameter.
examples/coap-server.c:
examples/contiki/server.c:
Make the ticks resource consistent in case
coap_add_optlist_pdu() sorted the options for insertion, but did not update
the coap_optlist_t head (whch may then no longer point to the first entry in the
sorted chain) and so when coap_delete_optlist() was called, the first few
entries of the sorted chain may not get deleted.
Fixed by making it
coap_add_optlist_pdu(coap_pdu_t *pdu, coap_optlist_t** optlist_chain)
instead of
coap_add_optlist_pdu(coap_pdu_t *pdu, coap_optlist_t* optlist_chain)
Additionally deleted options_start() and options_next() as they are not
required - Issue #184.
examples/client.c:
Fix coap_add_optlist_pdu() call
include/coap/options.h:
Fix coap_add_optlist_pdu() call
libcoap-2.{map|sym}:
Delete options_start()
man/coap_observe.txt.in:
man/coap_pdu_setup.txt.in:
Update docmentation
src/option.c:
Update coap_add_optlist_pdu()
tests/test_pdu.c:
New tests for checkout out coap_insert_optlist() and coap_add_optlist_pdu()
functions
General:
Embolden -lcoap linking definitions
Embolden NOTE:
man/Makefile:
Reduce data written into missing .3 files
man/coap_attribute.txt.in:
Fix a typo
Updated man/coap.txt.in
Updated configure.ac
Updated man/Makefile.am
Also include the man pages where there are more than 9 definitions in the
SYNOPSIS as we are limited to 10 in hte NAMES section
man/coap_attribute.txt.in: Tidy up output
man/coap_context.txt.in: Correct ports and protocols in the examples
man/coap_observe.txt.in: Update with the new optlist functions
man/coap_recovery.txt.in: Include how recovery times are calculated
man/coap_resource.txt.in: Tidy up output
man/coap_tls_library.txt.in: Tidy up output
man/coap_handler.txt.in: Update with new library naming