Commit Graph
44 Commits
Author SHA1 Message Date
Olaf Bergmann 627e8ca2e3 Makefile.am: add coap_socket_send_pdu to CTAGS_IGNORE
ctags is being used to create the symbol maps for dynamic library
generation. Exported symbols from other platforms such as LWIP
must be excluded from these maps to avoid linker errors for undefined
symbols.

This modification adds the LWIP-specific function coap_socket_send_pdu()
to the exclusion list.
2017-08-04 15:24:32 +02:00
Olaf Bergmann 4e7f909037 Makefile.am: added missing files, fixed ordering 2017-07-11 17:03:04 +02:00
Olaf Bergmann ef778403a6 Makefile.am: added missing files to EXTRA_DIST 2017-07-11 13:00:50 +02:00
Olaf Bergmann a070a8b3bc Merge remote-tracking branch 'tijuca/4upstream' into develop 2017-07-10 14:11:34 +02:00
Carsten Schoenert 7286a52474 DTLS support: export and use related flags to main Makefile
To be able to use the collected CFLAGS and LIBS variables in the main
Makefile substitute DTLS_CFLAGS and DTLS_LIBS with the found values from
previous made checks and exporting them to autoconfigure.
Also define the found development crypto library into the configuration
header file 'coap_config.h.

We may need to add the flags also to examples/Makefiles.am too.
2017-06-30 20:45:10 +02:00
jcmichelou 9490a0c8ab Fix bug in setting the OpenSSL log level make its use consistent with tinydtls
Rename session.c and session.h to coap_session.c and coap_session.h
Use length to PSK hint and identity
Improve packet loss testing
2017-06-22 16:02:03 +02:00
jcmichelou adf1238eae Add DTLS retransmit and recovery.
Add lossy networks debug option in examples.
2017-06-21 20:40:15 +02:00
jcmichelou 2197585f66 Add missing coap_openssl.c file in Makefile.am 2017-06-21 16:21:59 +02:00
jcmichelou ae13e5127b Compile with tinydtls and remove warning message with gcc. 2017-06-19 20:37:11 +02:00
jcmichelou 8353417afb Added session management with simpler DTLS lib API.
Added DTLS support with OpenSSL.
2017-06-18 20:09:47 +02:00
jcmichelou 1c79a4b977 Merge remote-tracking branch 'remotes/obgm/dtls' into dtls-dev with tinydtls support
# Conflicts:
#	Makefile.am
#	configure.ac
#	examples/client.c
#	examples/coap-rd.c
#	examples/coap-server.c
#	include/coap/address.h
#	include/coap/coap_io.h
#	include/coap/net.h
#	include/coap/prng.h
#	libcoap-1.map
#	libcoap-1.sym
#	src/net.c
#	src/platform/posix/coap_io.c
2017-06-12 17:26:25 +02:00
Carsten Schoenert 0ec6fa693a Makefile.am: move target clean-local to distclean-local
Deleting the pkg-config file and also the *.map and *.sym file in a
clean-local target isn't correct as we have no default automatic way to
regenerate *.map and *.sym files before the build of the libcoap is
starting.

Currently there is no need for such a automatic rebuild, the user
normaly doesn't need to do anything on those files. They even don't
should be rebuild by the users in normal cases.
Adding or removing symbols is a sensible thing and the maintenance is
probably up to the developers. Beside that there is the target
'update-map-file' that is used by the developers to (re)build this two
files if needed.

This commit is also adding a new helper target 'dist-local' with a
depency on 'update-map-file' so we are sure to have actual *.map and
*.sym file if we create a tarball for a release.

Moving the .PHONY targets to the end of the Makefile.am as this is the
typical place.
2016-11-18 09:47:46 +01:00
Olaf Bergmann 5b88c1a2c9 Makefile.am: fix include-path for auto-generated coap.h
coap.h is generated in the build path which is different from the
source tree when building out-of-tree.
2016-10-26 15:39:52 +02:00
Carsten Schoenert 18f2309759 make: enable out of tree build
The build environment was lacking the possibility to get libcoap
buildable out of tree, simply checkable by the running 'make distcheck'.
Without this fix the users are impossible to build libcoap in a own
folder that's independed from the source containing folder. Typical use
case would be:

  $ mkdir libcoap-build && cd libcoap-build
  $ /path/to/libcoap-source/configure \
      --srcdir=/path/to/libcoap-source \
      --prefix=/somethere/to-install

This commit enables the out of tree build by adding and changing some
needed variables.
2016-10-26 10:46:50 +02:00
Carsten Schoenert aa7256a812 configure.ac: splitting ctags check into freebsd specific detection
On FreeBSD the default ctags binary isn't usable for getting the tags
from the header files, we need to take the binary exctags explicitly.
Also before the check can be done we need to know on which platform we
running.
2016-10-26 10:46:50 +02:00
Olaf Bergmann 89bf45723c Makefile.am: bugfix: replaced makefile variable by m4-expanded symbol
As automake processing prevents using makefile variables in prefixed
automake constructs such as *la_SOURCES, platform-specific locations
must be spelled out literally.

This fixes issue #30, see https://github.com/obgm/libcoap/issues/30
2016-04-08 15:14:20 +02:00
Olaf Bergmann b734208ed2 coap_event.[hc]: pass library events to application
An application can register a callback function of type
coap_event_handler_t that will be called by the library on certain
events. Currently, the DTLS implementation invokes coap_handle_event()
with session-specific events such as session close or
renegotiation.
2016-04-08 15:14:20 +02:00
Olaf Bergmann 90fb5fdffc dtls: Added basic keystore implementation
coap_keystore.[hc] provides a simple data structure for managing
credentials to be used during DTLS handshake. Each coap_context_t
has its own keystore object that is independent of the actual
DTLS context. Applications can access the keystore during the
entire lifetime of the coap context. The existing implementation
is not thread-safe.
2016-04-08 15:14:20 +02:00
Olaf Bergmann 39698f7ba7 dtls: added initial boilerplate for dtls support
coap_dtls.h defines a generic API for DTLS communication. The
initial version will use tinydtls as implementation.
2016-04-08 15:14:20 +02:00
Olaf Bergmann 63f51418c5 run.[hc]: Add new functions for main loop
This modification provides two new functions, coap_run_once() and
coap_run(), that can be used by applications to drive the library's
I/O logic.
2016-04-08 15:14:20 +02:00
Olaf Bergmann 3d3eb02ad8 net.[hc]: allow multiple endpoints in single context
Endpoints will be attached to the context object using a new function
coap_attach_endpoint(). The sockfd component has been removed from
coap_context_t as it is accessible by the endpoint.
coap_endpoint_t has a new field 'context' that refers to the context
object the respective endpoint has been associated with, or NULL
if it is not attached to any context. An endpoint can be attached
to at least one context at a time.
2016-04-08 15:14:20 +02:00
Olaf Bergmann cfdfd030f9 coap_io.c: Moved to platform/posix/ 2016-04-08 15:14:20 +02:00
Olaf Bergmann 96d572d309 prng.c: move platform-specific PRNG invocation into separate files
This change introduces a new subtree in the library's directory structure.
Platform-specific code now should be placed into the corresponding directory
in src/platform/. To illustrate this, prng.h has been split into three
distinct files, one for each platform (contiki, lwip, posix) and moved into
the respective subdirectory.
2016-04-08 15:14:20 +02:00
Olaf Bergmann a6f7fc76fb Makefile.am, coap.h.in: Remove obsolete header t_list.h
t_list.h has been replaced entirely by utlist.h and thus is not
used anymore. This change removes the last traces.
2016-01-11 18:34:37 +01:00
Carsten Schoenert eb7ae9b461 Makefile.am: adding libcoap.h to the install targets
After the creation of the new header file libcoap.h we need to add this
file to the installation of libcoap.
2016-01-10 17:49:07 +01:00
Carsten Schoenert bbe048ca8b Makefile.am: add more files to distribution
The CONTRIBUTE and TODO file should be included to the tarball as well.
2015-06-02 20:41:37 +02:00
Carsten Schoenert db77014cea fix missing header files for 'make dist'
The run of 'make dist' isn't pickup some also needed header files in
examples/ and tests/ adding the file to EXTRA_DIST.
2015-03-22 14:35:14 +01:00
Olaf Bergmann a5722b0ad1 Makefile.am: adding missing files to tarball.tar.bz2
The fixup for the broken 'make dist' doesn't catch up files in
$top_srcdir.
2015-03-22 14:35:13 +01:00
Olaf Bergmann 41fac9248b Makefile.am: make ctags ignore lwip-specific identifiers
The Makefile uses ctags to build a list of global identifiers
that should be exported in a dynamic library. As ctags has a
very simplistic way of handling preprocessor conditionals, it
cannot detect symbols that are not present on platform POSIX.
In particular, the Solaris ld chokes on the following:

Undefined                       first referenced
 symbol                             in file
coap_pdu_from_pbuf                  ../.libs/libcoap-1.0.so
coap_packet_extract_pbuf            ../.libs/libcoap-1.0.so

The easiest way to fix this is to tell ctags that is should
ignore these identifiers with option -I.
2015-03-13 13:27:31 +01:00
Olaf Bergmann c5028c5013 Makefile.am: make new target check_ctags phony 2015-03-13 13:21:35 +01:00
Carsten Schoenert 60030d0fb4 examples: adding the examples folder to the build
After including the doc/ and the tests/ folder under the hood of the
autotools now adding the examples/ foolder too.
The user is now able to add the build of the example binarys if
configure is called with '--enable-examples' as option. The example
binarys will not be build by default!

Currently only 'coap-client', 'coap-server' and 'rd' is build.
2015-03-12 11:25:26 +01:00
Carsten Schoenert 6d2edc7cfa Makefile.am: moving check_ctags to a target
Calling a shellscript within a Makefile is not POSIX compliant, it's
possible that it would not work on all platforms. But using the check
for ctags as a seperate target within the main Makefile is no problem
and easy to change.

This commit is a addition to 101efbfe69
2015-03-12 11:25:26 +01:00
Olaf Bergmann 4c1af1b2e2 Makefile.am: Added missing src/address.c 2015-03-11 16:12:24 +01:00
Olaf Bergmann 4ca91190d6 Revised time-related functions to get rid of clock_offset for POSIX platform.
* Removed tne preprocessor defines for coap_tick() and coap_clock_init() --
  this made the code less readable and seemed to be of little use.

* Introduced the new type coap_time_t to represent wall clock time. On POSIX,
  this is the number of seconds since the epoch, while on embedded systems
  without a real time clock, this could be the number of seconds since the
  last reboot. The new function coap_ticks_to_rt() is used to convert
  coap_tick_t to coap_time.h. Currently, this is a division by COAP_TICKS_PER_SECOND
  on all platforms.

* POSIX: coap_tick_t is now defined as unsigned long to avoid overflows in
  coap_ticks().
2015-03-08 15:14:43 +01:00
Olaf Bergmann 489df85c88 Check if linker supports scripts for versioning
Use ld's option --version-script where available and fall back
to plain symbol file otherwise. This check uses the m4 macro
AX_CHECK_LINK_FLAG <http://www.gnu.org/software/autoconf-archive/ax_check_link_flag.html>
2015-03-03 19:21:44 +01:00
Olaf Bergmann 101efbfe69 Create symbol file libcoap-$(LIBCOAP_API_VERSION).sym
As not all versions of ld support linker scripts, we need plain
symbol files as fallback. This commit extends the Makefile target
'update-map-file' to create a .sym file in addition to the .map
file.
2015-03-03 19:21:43 +01:00
Carsten Schoenert 96d875ab7a CFLAGS: reorder the various CFLAGS inside the files
Doing up some housekeeping around the used CFLAGS.
To be more generic put the default declaration for additional warning
CFLAGS into configure.ac and clean up the Makefile.am's.

There are the default CFLAGS variable that is a global variable if not
re adjusted inside the different targets.

The second variable for CFLAGS is the AM_CFLAGS definition that is used
inside a Makefile as a global variable.

There is also the possibility to graduate the CFLAGS for a single
target. But currently there are nothing more than one target within each
Makefile so we can set for now the target specific CFLAGS to the
AM_CFLAGS.

A new variable called WARNING_CFLAGS is inside the configure.ac created,
this variable holds all the warnings flags inside. The Makefile.am's are
taking the values and is setting the variable AM_CFLAGS which is used in
the target specific CFLAGS. Also the options 'DWITH_POSIX' and
'D_GNU_SOURCE' are now appended to the CFLAGS if the configure script is
detecting a *-[uc]linux* system.
2015-03-03 19:21:43 +01:00
Carsten Schoenert c9c1a80271 adding the tests/ folder to the build environment
To let the previous added configure option '--enable-tests' really build
the testdriver binary adding the needed changes to the files in the main
folder.
Finally adding a new Makefile.am within the tests/ folder.
2015-03-03 19:21:43 +01:00
Carsten Schoenert 80d74208ce adding the doc/ folder to the build environment
To install the doxygen output, which is generated within doc/html/,
adding the needed checks for the doxygen binary to configure.ac and also
adding the needed doc/Makefile.am file.

Finally tuning doc/Doxyfile.in to let the autotools write the needed
informations into this file while generating the finally created
doc/Doxyfile.
2015-03-03 19:21:43 +01:00
Carsten Schoenert dc2ada4323 adding check for ctags
We need ctags to run the make target 'update-map-file' so we better give
a warning out if ctags wasn't found.
2015-03-03 19:21:43 +01:00
Carsten Schoenert a42f35303c adding dynamic libtool versioning to libcoap
To not fight every time with the logic of libtool for needed versioning
info of libcoap adding some automatism into the autoconf files. So now
there are only three lines to change if a release is planned.
Please note and respect the instructions inside configure.ac to generate
a correct versioning for libtool. But libtool will tell you later if you
doing something wrong with the versions. :)

Some helpful informations can be found on the following websites as
well.

http://ftp.gnu.org/pub/old-gnu/Manuals/libtool-1.4.2/html_chapter/libtool_6.html
https://blog.flameeyes.eu/2010/10/linkers-and-names
https://blog.flameeyes.eu/2009/04/shared-object-version
https://phab.enlightenment.org/w/autotoolsintegration/
https://autotools.io/libtool/version.html
http://www.freesoftwaremagazine.com/articles/building_shared_libraries_once_using_autotools
https://www.sourceware.org/autobook/autobook/autobook_91.html
2015-03-03 19:21:43 +01:00
Carsten Schoenert 45760a922d pkgconfig: adding related package files
To help the users of the libcoap and especially the linker on the users
machines adding a libcoap.pc file that will be installed while the call
of 'make install'.
2015-03-03 19:21:43 +01:00
Carsten Schoenert c7299d9c86 adding install target for public header
To develop something libcoap related people need the public header files
to include the function definitions into their projects.
The public libcoap headers will be installed into the system by the
current order like

.
└── include
   └── coap
       ├── address.h
       ├── async.h
       ├── bits.h
       ├── block.h
       ├── coap.h
       ├── coap_io.h
       ├── coap_time.h
       ├── debug.h
       ├── encode.h
       ├── hashkey.h
       ├── mem.h
       ├── net.h
       ├── option.h
       ├── pdu.h
       ├── prng.h
       ├── resource.h
       ├── str.h
       ├── subscribe.h
       ├── t_list.h
       ├── uri.h
       ├── uthash.h
       └── utlist.h

That's not final! Currently the public header files include the locally
by the autoconf generated coap_config.h header file. These includes have
to be removed before we can call the header really public headers!
2015-03-03 19:21:43 +01:00
Carsten Schoenert 9f06f77004 adding basic files for build environment creation
Start adding basic files for generating all the needed files to create a
working build environment by the autotools. By this currently only the
shared library of libcoap is build.
There is no API version implemented! This has to be done later.
2015-03-03 19:21:43 +01:00