Commit Graph
1509 Commits
Author SHA1 Message Date
Jon Shallow c216a8801d Update the etsi test cases in the examples directory
examples/etsi_coaptest.sh
examples/etsi_testcases.sh

Minor corrections to the scripts to get them working
2018-12-07 20:22:56 +00:00
Jon Shallow 78c59ff300 Add in support for building coap-etsi_iot_01 and coap-tiny examples
examples/Makefile.am

Support building the additional examples using 'make check'.

.gitignore

Ignore the new examples executables.
2018-12-07 20:22:56 +00:00
Jon Shallow 157985cb95 Update examples/tiny.c to use the new API
Update all the coap_ calls to use the new API, and the updated structures.
Introduce using session instead of context.
Correct all the compiler warnings.
2018-12-07 20:22:45 +00:00
Jon Shallow 37e7a974a6 Update examples/etsi_iot_01.c to use the new API
Update all the coap_ calls to use the new API, and the updated structures.
Introduce using session instead of context.
Correct all the compiler warnings.
Keep the payload in the resource rather than separately.
2018-12-07 20:14:40 +00:00
Olaf Bergmann 3b72bce3f0 AUTHORS: include author names of substantial contributions
The authors file now lists the names of authors that have siginificantly
contributed to the current code base. A link to the GH contributors'
page is included as a reference to authors with fewer or minor
contributions.
2018-12-05 09:15:50 +01:00
Olaf Bergmann bac6b61a4e client.c, coap-server.c: updated copyright information 2018-12-01 09:27:24 +01:00
obgm ea4bca7335 Merge pull request #277 from nmeum/fix-U-option
coap-client: The -U option doesn't expect an argument
2018-11-28 13:15:11 +01:00
Sören Tempel 1c789a7beb coap-client: The -U option doesn't expect an argument
Thus it must not be postfixed with a colon character in the optstring.
While at it move the option to the beginning of the opstring to the
other options which don't expect an argument.

Without this commit the -U option is unusable.
2018-11-28 13:00:33 +01:00
obgm 47fc7a8bb8 Merge pull request #271 from mrdeep1/block1
Fix packet recovery support for BLOCK1 option in examples for lossy connections
2018-11-28 13:00:26 +01:00
Olaf Bergmann 96fdf63264 Dockerfile.develop: need cn-cbor docs before install
The install target of cn-cbor's Makefile fails when the documentation
files have not been generated. To fix this, the doc target is
explicitly invoked before install.
2018-11-28 10:16:20 +01:00
obgm 54956954ca Merge pull request #273 from mrdeep1/gnutls
Add in support for GnuTLS >= 3.3.0
2018-11-28 10:11:59 +01:00
Jon Shallow ad383aa3b2 Replace signal() with sigaction() in examples
examples/coap-server.c:
examples/etsi_iot_01.c:

Replace signal() with sigaction() for handling SIGINT or SIGTERM

examples/client.c:

Include sigaction() for catching SIGINT or SIGTERM for a clean shutdown.
2018-11-27 15:33:53 +00:00
Jon Shallow e935d068ff src/coap_tinydtls.c: Clean up to remove compiler warnings
undef PACKAGE_* so that TinyDTLS versions are used instead

include dtls_debug.h to get in the correct function definitions instead of
hardcoding some of them.

Create a read-write version of some of the const parameters passed in to
the interim functions before calling the underlying TinyDTLS functions.
2018-11-27 15:33:52 +00:00
Jon Shallow e172e6865b Include GnuTLs in the Travis build
.travis.yml

Add in the gnutls build.

build-env/Dockerfile.build-env
build-env/Dockerfile.develop

Add in libgnutls28-dev to the apt-get list.

scripts/build.sh
scripts/dist.sh

Support TLS set to gnutls for building.
2018-11-27 15:33:52 +00:00
Jon Shallow 48ee2ec551 Documentation support for building libcoap with GnuTLS
BUILDING:

Also include documentation on how to get TinyDTLS submodule into
the project.
2018-11-27 15:33:52 +00:00
Jon Shallow 3e8071f011 Update man pages with GnuTLS support
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()
2018-11-27 15:33:43 +00:00
Jon Shallow cbfa1790d3 Update examples to include using coap_string_tls_version() in usage()
examples/client.c
examples/coap-rd.c
examples/coap-server.c

Add in call to coap_string_tls_version() in usage().
2018-11-27 11:42:21 +00:00
Jon Shallow 72740cb687 tests/test_tls.c: Add in GnuTLS build support
HAVE_GNUTLS -> HAVE_LIBGNUTLS

Correct TinyDTLS version checks as TinyDTLS is now returning the
actual TinyDTLS library version.

For TinyDTLS builds, #undef PACKAGE_* to remove compiler warnings.
2018-11-27 11:42:21 +00:00
Jon Shallow d8b399cfc9 New coap_show_tls_version() and coap_string_tls_version() functions
These new functions can be used to either update a buffer with, or coap_log()
out the current runtime TLS library along with the version of the library
that libcoap was built against.

include/coap2/debug.h
src/debug.c
libcoap-2.map
libcoap-2.sym

Support for the new functions coap_show_tls_version() and coap_string_tls_version().
2018-11-27 11:42:21 +00:00
Jon Shallow 8a3b46eee4 Bump minimum GnuTLS version to 3.3.0
Makefile.am

Include src/coap_gnutls.c

configure.ac

Update minimum GnuTLS version to 3.3.0
2018-11-27 11:42:21 +00:00
Jon Shallow 3d932bdcd4 Revert out commit c362d56 disabling gnutls support
Re-enable building with --with-gnutls
2018-11-27 11:42:21 +00:00
Jon Shallow d144a1d5b0 src/coap_notls.c: Include ignoring GnuTLS builds 2018-11-27 11:42:21 +00:00
Jon Shallow 11de84bcc7 src/coap_gnutls.c: Add in GnuTLS support interface module
src/coap_gnutls.c

New file including support for GnuTLS >= 3.3.0
2018-11-27 11:42:21 +00:00
Jon Shallow 4a543d1198 Extend coap_tls_version_t to include both built and runtime TLS versions
This allows an application to determine what the built version is
as well as what the runtime version of a TLS library is.

include/coap2/coap_dtls.h

Add built_version to coap_tls_version_t

src/coap_openssl.c
src/coap_tinydtls.c

Additionally populate coap_tls_version_t with build_version when
coap_get_tls_library_version() is called.

src/coap_tinydtls.c

Correct the version returned as actual TinyDTLS version instead the
binary value of a DTLS packet type.
2018-11-27 11:42:04 +00:00
Carsten Schoenert ea29a48fd7 spelling: fix whith -> with 2018-11-24 13:59:54 +01:00
Carsten Schoenert 1d1eb455d6 spelling: fix seperate -> separate 2018-11-24 13:59:47 +01:00
Carsten Schoenert df6c2529f9 spelling: fix outputing -> outputting 2018-11-24 13:59:41 +01:00
Carsten Schoenert 32eea645b1 spelling: fix compatability -> compatibility 2018-11-24 13:59:34 +01:00
Carsten Schoenert 637a09cfbd spelling: fix bandwith -> bandwidth 2018-11-24 13:58:44 +01:00
Carsten Schoenert 55d359d259 spelling: fix apropriate -> appropriate 2018-11-24 13:57:14 +01:00
obgm 22e4ffda5a Merge pull request #276 from neuronabr/neuronabr
Add missing semicolon.
2018-11-24 13:34:23 +01:00
neuronabr f56ce3d10c Add missing semicolon. 2018-11-23 18:00:18 +01:00
obgm 1eadd91366 Merge pull request #269 from mrdeep1/replace_debug_etc
Replace debug(), info() & warn() macros with appropriate coap_log()
2018-11-11 18:18:41 +01:00
Jon Shallow a1be686921 Fix packet recovery support for BLOCK1 option in examples for lossy connections
examples/client.c
 examples/coap-server.c

For the client, the next block to transmit is always now the last acknowledged
block plus one.

If the client receives a duplicate BLOCK1 ACK, the duplicate ACK is ignored by
checking the message ids.

For the server, it no longer rejectes a duplicate BLOCK1 request, but does
still object if there is a gap in the provided data due to a missing block.
In otherwords, the blocks must arrive sequentially from the client.
2018-11-11 13:30:42 +00:00
Jon Shallow 04ced3e5e5 Replace debug(), info() & warn() macros with appropriate coap_log()
This then removes the need for name polution/confict of debug(), info() and
warn() when building other projects that use libcoap and need to #include the
libcoap header files

Updated:
 examples/client.c
 examples/contiki/coap-observer.c
 examples/etsi_iot_01.c
 include/coap2/debug.h
 src/async.c
 src/block.c
 src/coap_io.c
 src/coap_openssl.c
 src/coap_session.c
 src/coap_tinydtls.c
 src/debug.c
 src/mem.c
 src/net.c
 src/option.c
 src/pdu.c
 src/resource.c
 src/uri.c

If the debug() etc. macros are still required, then the change to
include/coap2/debug.h just needs to be reverted.

There are also a couple of space changes - to cause log output to be columnar
e.g "ERR" was padded to "ERR ", so that "EMRG" or "ERR " log output output was
aligned in the same way.

This is a replacement for PR#51, and partially deals with name polution issues
raised in Issue #50.

Parameter re-aligned some long strings, splitting strings across multiple lines
2018-11-10 20:27:50 +00:00
Olaf Bergmann 3c75958f33 configure.ac: fix typo for tinydtls build
In the overview at the end of configure, tinyDTLS was incorrectly
listed as "OpenSSL around".
2018-11-08 11:27:59 +01:00
Olaf Bergmann 839bdc5418 Revert "examples/Makefile.am: remove $(DTLS_LIBS) variable"
This reverts commit 91bfd5b103 because
it introduced a wrong variable substitution:

The problem here is that top_srcdir is . in the top-level Makefile, so
the link command ends up having this:

  [...]   ../.libs/libcoap-2-tinydtls.a -L./ext/tinydtls -ltinydtls

Whereas, in examples/Makefile.am, top_srcdir is .., so using DTLS_LIBS
would be correctly replaced by

          ../.libs/libcoap-2-tinydtls.a -L../ext/tinydtls -ltinydtls

The same holds for the Makefile in the subdirectory tests.
2018-11-08 11:24:04 +01:00
Carsten Schoenert c362d561fd configure.ac: disable the usage of GnuTLS library
The libcoap development isn't currently ready to also use the GnuTLS
cryptography library and development files within the release of 4.2.0.
An available configure option '--with-gnutls' or the preferred automatic
usage of the GnuTLS cryptography functions within the libcoap library
without some real usability would confuse users for sure.

This commit removes the visible implementation of the additional
configure option '--with-gnutls' but also some internal checking and
logic of variables to control the linking of libcoap.

This commit can simply be reverted once 4.2.0 is released and the usage
of the needed cryptography functions from the GnuTLS library will get
implemented.

Note: Normally the part of the source that is now commented out would
      would just get removed as we are working with git, but I dropped
      that so it's probably easier to see without the usage of git what
      was changed.
2018-11-06 17:37:55 +01:00
Carsten Schoenert 5ae059faa8 configure.ac: small spelling fixups
No functional changes, just some orthography corrections.
2018-11-06 17:37:55 +01:00
Carsten Schoenert 91bfd5b103 examples/Makefile.am: remove $(DTLS_LIBS) variable
Using the variable $(DTLS_LIBS) in the *_LDADD isn't correct, for
controlling the linker flags the *.la file is normally holding all the
required information.

This was introduced by 5687681d71 and is
partially removed by this commit.
2018-11-06 17:37:55 +01:00
Carsten Schoenert d3bed24f3c configure.ac: fix evaluate logic for library suffix
If a user isn't explicitly disabling the DTLS support for libcoap or
requesting the usage of tinydtls then instead the configure script needs
to detect at least the development files for GnuTLS or OpenSSL.
If not the script must break and give up with an error message.

Because of some wrong logic within the evaluation if one of both TLS
libraries was found configure was *not* stopping with an error message.

The logic to check the possibilities of an automatic usage of the TLS
libraries was different, the check for GnuTLS was correct but on
OpenSSL a wrong check condition chain was used, it should and must have
been the same on both libraries. This commit is fixing this.
As all conditions must the true in theses check to set the correct
variables which are used later within configure.

But the sanity check at the end was also not completely correct and
failing so configure was not running into the desired error break.
2018-11-06 17:37:55 +01:00
obgm afebab206b Merge pull request #268 from mrdeep1/doc1
Clarify coap_resource_unknown_init() usage documentation
2018-11-01 13:45:59 +01:00
Jon Shallow 4c95c50528 Clarify coap_resource_unknown_init() usage documentation
include/coap2/resource.h
man/coap_resource.txt.in
modified:   src/net.c (comment only)
2018-10-29 09:27:04 +00:00
Olaf Bergmann 8a98277b82 .travis.yml: add stage dist with scripts/dist.sh job 2018-10-26 17:46:40 +02:00
Olaf Bergmann 5bd36c1526 scripts/dist.sh: CI-script for testing make dist
This script creates a libcoap archive, unpacks it and does an
out-of-tree build and installation afterwards. The environment
variables PLATFORM, TESTS, TLS and DOCS control the build
configuration. Suggested invocation from travis CI is:

  PLATFORM=posix TESTS=yes TLS=no DOCS=yes scripts/dist.sh
2018-10-26 17:46:08 +02:00
Olaf Bergmann 3c2413eac7 build.sh: control documentation build
If the environment variable DOCS is set to yes, --enable-documentation
will be set during configure, --disable-documentation otherwise (the
previous default).
2018-10-26 17:45:04 +02:00
Olaf Bergmann 3cb1453dee Dockerfile.build-env: added doxygen-dependencies
To automate packaging tests (i.e., check that 'make dist' and
out-of-tree builds work), the packages for building the documentation
must be present.
2018-10-25 17:45:34 +02:00
Olaf Bergmann 3d1d67b721 Dockerfile.develop: Update libcoap include path
Header files are now located in include/coap2.
2018-10-25 17:44:01 +02:00
Olaf Bergmann 00486a4f46 configure.ac: set release state to rc2 v4.2.0-rc2 2018-10-25 11:06:20 +02:00
Olaf Bergmann 97919c5c64 doc/Makefile.am: add main.md to EXTRA_DIST 2018-10-25 11:05:33 +02:00