Commit Graph
1458 Commits
Author SHA1 Message Date
Carsten Schoenert eeab614fd1 doc/Makefile.am: put script functionality into Makefile
Remove the dependency on the script build_man_files.sh and place all the
magic into dedicated Makefile targets.
2018-10-18 13:43:49 +02:00
Carsten Schoenert 9de598ac4f doc/Doxyfile.in: adjust paths to top_builddir
If we work out of tree some files are build in top_builddir and not in
top_souredir.
Also fix up the used libcoap API versin by using a global variable here.
2018-10-18 13:43:48 +02:00
Carsten Schoenert 5108566fd5 libcoap-2.{map, sym}: create file in the top_builddir
If you are working out of tree you get a deadloop because you are unable
to recreate the *.{map,sym} file in your current working directory.

configure is thinking the source is already configured in another folder
if you want to call the configure script outside the top_sourcedir and
is requireing a "make distclean' call in top_sourcedir which is also
deleting libcoap-2.{map,sym}. But the source is *always* building these
two files in the top_sourcedir.

This commit is pointing the build of these two files into top_builddir
which is also top_sourcedir if you are doing a in tree build.
2018-10-18 13:43:46 +02:00
Carsten Schoenert fb078d2b39 Makefile.am: remove non existing file from EXTRA_DIST
The file tests/test_common.h has been removed from the source a while
ago, update the EXTRA_DIST accordingly.
2018-10-18 13:43:44 +02:00
Jon Shallow f8bdac31db Update doc build to support out of path builds
Use a new template doc/build_man_files.sh.in to include @top_srcdir@/doc
@top_srcdir@/man as appropropriate.

Update doc/Doxyfile.in in a similar way (and coap/ to coap2/)

Makefile.am autogen.sh configure.ac taught about doc/build_man_files.sh.in

Update doc/Makefile.am to include $(top_srcdir) and $(top_builddir)
2018-10-18 13:41:58 +02:00
Olaf Bergmann 6df3623f39 net.c: fixed wrong doxygen primitive
The previous commit accidently used the wrong doxygen primitive for
copying verbatim data into the output.
2018-10-17 15:13:44 +02:00
Olaf Bergmann a8306bbb15 doxygen: fix warnings 2018-10-17 15:10:38 +02:00
obgm b0df27f17c Merge pull request #262 from mrdeep1/delayqueue-crash
src/net.c: coap_delete_node() not removing node from context->sendqueue
2018-10-17 14:46:12 +02:00
Jon Shallow 9b5841381d src/net.c: coap_delete_node() not removing node from context->sendqueue
When coap_wait_ack() is called, it sets node->session with a bumped
reference counter and does a coap_insert_node(&context->sendqueue, node).
[I cannot find anywhere else where node->session gets set]

If coap_delte_node(node) is called, and node-session is set, it previously only
did a coap_session_release(node->session).

Then when coap_write() is called, it does a coap_retransmit() on all the
context->sendqueue entries, one or more of which could now be a deleted
node.....

The node is now removed if appropriate from context->sendqueue by
coap_delete_node().
2018-10-17 13:37:29 +01:00
obgm 8c35d1d223 Merge pull request #263 from spinetix/win32-4.2
Windows build is broken and libcoap crash on observer release.
2018-10-17 14:36:06 +02:00
jcmichelou 5935867e68 resource.c: Fix run-time exceptions and use C89 syntax.
Fix read-after-free of the token by moving the code before the free.
Fix print of uninitialized heap memory if the token length is 0.
Use C89 syntax for compatibility.
2018-10-08 18:00:18 +02:00
jcmichelou 40144769f4 Windows: repair build before release 4.2
Add coap_hashkey.c to the project.
Fix the include path option for libcoap.
Move the include files back to the "Header Files" filter after the rename.
2018-10-08 17:55:20 +02:00
obgm d90d054e39 Merge pull request #259 from mrdeep1/lwip-fix
lwIP and Contiki coap2 fixes to allow builds
2018-10-05 09:52:14 +02:00
Jon Shallow 7e97595e13 Missing set of coap/ to coap2/ 2018-10-04 14:19:38 +01:00
Olaf Bergmann 726a0f74cf lwip/Makefile: fix include path
need to use include/coap2 after API number increment
2018-10-04 14:27:00 +02:00
Olaf Bergmann 7e9a7f8409 Makefile.libcoap: fix include path for Contiki example 2018-10-04 14:24:48 +02:00
Olaf Bergmann a7a6199a2b pdu_parse_target.c: fix include path 2018-10-04 13:26:01 +02:00
Olaf Bergmann 92dd8281ad Doxyfile.in: read API from include/coap@LIBCOAP_API_VERSION@ v4.2.0-rc1 2018-10-04 13:09:54 +02:00
Olaf Bergmann d9fe5b7201 Makefile.am: added doc/build_man_files.sh to EXTRA_DIST 2018-10-04 13:08:51 +02:00
Olaf Bergmann e782b4291f coap_hashkey.h: moved to include/coap2 2018-10-04 12:53:10 +02:00
Carsten Schoenert 4d5086aba3 Makefile.am: make headers co-installable to previous version(s)
The recently, in the last developemnt circle done TLS related changes to
libcoap had make the library incompatible to the old API and thus to the
old used header files.

The (new) library is already installed with the API suffix and by this
is not conflicting with previous libcoap versions.
Doing the same by this and following commits for the needed header of
libcoap.
2018-10-04 12:49:40 +02:00
Olaf Bergmann 5f00f0e7b1 configure.ac: bumped version prefix to rc1 2018-10-04 12:43:00 +02:00
Jean-Claude Michelou 79542ff4f0 examples: fixes the missing macro S_ISDIR
The Windows build need the S_ISDIR macro here.
2018-10-04 12:43:00 +02:00
Carsten Schoenert f605e1f77e Windows: \include\coap -> \include\coap2 header change 2018-10-04 12:36:26 +02:00
c.schoenert@t-online.de 327b6cd435 man: add $(LIBCOAP_API_VERSION) to header inclusion
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.
2018-10-04 12:36:26 +02:00
Olaf Bergmann 89559e20b9 tests/Makefile.am: adjust the AM_CFLAGS due new header location
Like for the examples the Makefile for the tests needs also to take care
of the new public header source folder.
2018-10-04 12:23:14 +02:00
Carsten Schoenert 6dde2bc9a8 examples: use the coap2 folder for including coap.h
Due the changed installation folder we need to adjust the source path to
coap.h for the files within the files of the examples.
2018-10-04 12:23:14 +02:00
Carsten Schoenert 13fa0dfcdf configure.ac: use the changed new include path for coap.h
The headers are now placed in include/coap2 and automake need to create
the core header file coap.h here.
2018-10-04 12:21:12 +02:00
Carsten Schoenert f584abc19e include: move header files to include/coap2
Automake is using the variable 'libcoap_include_HEADERS' as the list to
install the header files and is this list installing to $(prefix)
basically.
This commit is changing the primary installation folder for the header
files in addition to the previous commit.
2018-10-04 12:21:12 +02:00
c.schoenert@t-online.de 07cc43dc04 Makefile.am: adjust the AM_CFLAGS to use new header location
As we have changed the source folder for the public and private header
files this change needs to make known to the build environment too.
2018-10-04 12:21:12 +02:00
obgm 78944c566c Merge pull request #258 from mrdeep1/session-connected
coap_session.c: Only generate event COAP_EVENT_SESSION_CONNECTED as appropriate
2018-10-04 08:34:59 +02:00
obgm 531408244e Merge pull request #257 from mrdeep1/ccoap_typo
man/coap_handler.txt.in: fix ccoap typo
2018-10-04 08:31:29 +02:00
obgm 51ad74e623 Merge pull request #238 from mrdeep1/tabs-spaces
Delete trailing spaces from files, replace TAB with 8*SPACE
2018-10-02 13:52:45 +02:00
Jon Shallow aa9ac21ab8 coap_session.c: Only generate event COAP_EVENT_SESSION_CONNECTED as appropriate
COAP_EVENT_SESSION_CONNECTED is only for CSM exchange events for reliable
protocols only as per include/coap/coap_event.h

In handling_signaling(), if session->state == COAP_SESSION_STATE_CSM, then
COAP_EVENT_SESSION_CONNECTED needs to be generated. This is done by calling
coap_session_connected().

coap_session_connected() is called from other places, used to flush out
any pending queues after connection has taken place.  It is also called
when CON limiting needs to release any panding queues.

Make coap_session_connected() only call coap_handle_event() if current
session->state == COAP_SESSION_STATE_CSM to limit the event generation.
2018-09-29 14:43:49 +01:00
Jon Shallow 0fe449685a man/coap_handler.txt.in: fix ccoap typo 2018-09-28 17:55:17 +01:00
Jon Shallow f5367ef3de Delete trailing spaces from files, replace TAB with 8*SPACE
"git diff -w" shows no differences

TAB left alone in files that are not C based files or documentation
2018-09-28 17:34:07 +01:00
obgm ee5cee6e6b Merge pull request #248 from mrdeep1/block2
BLOCK option support in coap-server
2018-09-28 18:24:24 +02:00
Anthony Rabine d0dfa0b7c0 missing cast for coap_encodevar_safe() conversion 2018-09-28 18:08:57 +02:00
obgm 6ea51c8a03 Merge pull request #242 from mrdeep1/tls13
Add in support for OpenSSL 1.1.1 to support TLS1.3 (RFC8446)
2018-09-28 17:47:33 +02:00
Jon Shallow 469357b824 BLOCK option support in coap-server
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
2018-09-24 20:49:57 +01:00
obgm a2986f1bdb Merge pull request #239 from mrdeep1/delayqueue-flush
net.c: Flush out delayqueue if a CON times out
2018-09-24 17:54:22 +02:00
obgm 354c7b4e9c Merge pull request #237 from mrdeep1/doxygen-man
Include man pages into Doxygen.  Add landing page for Doxygen
2018-09-24 17:52:31 +02:00
Jon Shallow 8238f628b9 Include man pages into Doxygen. Add landing page for Doxygen
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
2018-09-24 16:46:42 +01:00
obgm 395815e26d Merge pull request #236 from mrdeep1/dtls_event
openssl.c: Global dtls_event variable causing confusion when events happen
2018-09-24 16:28:19 +02:00
obgm e758f338c5 Merge pull request #235 from mrdeep1/observe-con
src/resource.c: Non Confirmable observe requests not getting out if CON pending
2018-09-24 16:25:03 +02:00
obgm 2501ff92c9 Merge pull request #208 from mrdeep1/build-lwip
Update code to build LwIP and Contiki from the examples directory
2018-09-24 16:19:15 +02:00
Jean-Claude Michelou ecfcd37f0c client: Sort options alphabetically, ping is TCP only. 2018-09-24 15:55:57 +02:00
Jean-Claude Michelou 8701fb33c7 pdu.c: Remove downcast warning. 2018-09-24 15:55:54 +02:00
Jean-Claude Michelou 01b2ec78fd examples: Add missing stat macro for win32. 2018-09-24 15:54:11 +02:00
jcmichelou 949d32da86 net.h: Fix documentation of coap_context_set_keepalive() 2018-09-24 15:53:45 +02:00