Commit Graph
756 Commits
Author SHA1 Message Date
Olaf Bergmann 8bb7ec80e7 scripts/build.sh: bugfix: stay in top directory for non-posix platforms
When TESTS=yes is given, the scripts invokes the test driver from
the top build directory. Platform-specific actions hence must ensure
that they stay in that directory and keep the last exit code.
2016-02-16 12:13:18 +01:00
Olaf Bergmann 5b094eb432 .travis.yml: Added package docbook-xml
a2x (asciidoc) depends on the Docbook XML DTD contained in the
docbook-xml package.
2016-02-16 12:03:56 +01:00
Olaf Bergmann 3afe2e94ac build.sh: pass exit code to caller 2016-02-15 18:25:00 +01:00
Olaf Bergmann 693c648830 .travis.yml: bugfix: package name libcunit1-dev 2016-02-15 16:36:45 +01:00
Olaf Bergmann ec1d463927 .travis.yml: Added travis CI script
This file specifies a travis build matrix.
2016-02-15 16:13:30 +01:00
Olaf Bergmann 641b8ed196 scripts/build.sh: Added build script to facilitate CI
The build script invokes configure and make with different
parameters depending on the environment variables PLATFORM
and TESTS. PLATFORM currently must be one of 'posix', 'contiki', or
'lwip'. If TESTS is set to 'yes' or 'true', the option --enable-tests
will be passed to configure and tests/testdriver will be invoked
after configuration and make.
2016-02-15 16:04:59 +01:00
Carsten Schoenert 8a8790cfc3 fixup small typos, no functional changes
There are few miss spelled words 'reponse', fixed up into the meaned word
'response'.
2016-01-29 16:31:53 +01:00
obgm 20a8c5567f Merge pull request #25 from onovo1/patch-2
Fixed: return 4.00 Bad Request in case of a malformed /.well-known/core (Update net.c)
2016-01-28 14:46:42 +01:00
obgm 4ae33c8f7e Merge pull request #24 from onovo1/patch-1
Fix typo in the attribute parameter to the right format "core.rd". (Update coap-rd.c)
2016-01-28 14:45:29 +01:00
onovo1 4c5c0e6c61 Update net.c 2016-01-28 13:57:00 +02:00
onovo1 fe69ba5fb6 Update coap-rd.c
According to the Core Resource directory draft [1]. The discovery of the registration should be done using the /.well-known/core and including a Resource Type (rt) with the value "core.rd". Like that:
GET /.well-known/core?rt=core.rd
There is a typo in the libcoap which accept the "core-rd" instead of the "core.rd" parameter. Fixing that in this version.

[1] - https://tools.ietf.org/html/draft-ietf-core-resource-directory-05#section-5.1
2016-01-28 10:34:14 +02:00
Carsten Schoenert 90e245e9fe remarking the change of the projects homepage
As started with other commits put on some more variables with the
changed location of the project.

in addition to 7452d7d50f
2016-01-15 23:33:53 +01: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
Olaf Bergmann 7452d7d50f coap-server.c: updated URI to libcoap's homepage in resource '/' 2016-01-10 18:06:26 +01:00
Carsten Schoenert b4973f1d73 fixup argument list for uip_ds6_prefix_add
uip_ds6_prefix_add is using 6 arguments, better use explicit argument
list than let the compiler decide. Some compiler will complain if some
optionally arguments are missed.
2016-01-10 17:49:07 +01:00
Carsten Schoenert 4f1515ab09 Contiki: undefine COAP_MAX_BLOCK_SZX before redefine
COAP_MAX_BLOCK_SZX is defined to "2" already before a define rule for
CONTIKI_TARGET_CC2538DK, just add a simply undefine line before the
redefine of COAP_MAX_BLOCK_SZX to make the compiler happy.
2016-01-10 17:49:07 +01:00
Carsten Schoenert f4166a536f coap.h: adding main header file into various source files
After splitting of the platform header part within libcoap some source
files that use functions of the network stack need to include coap.h
(which is including the libcoap.h) to get the platform specific header file
for the network stack.
Sort list of included headers in alphabetical order.
2016-01-10 17:49:07 +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 5032b292e4 libcoap.h: introduce new header file for libcoap
To get a proper public header setup for libcoap we need to split out the
static and platform related header files.
This commit is about creating the platform specific header file which
have to contain platform relevant header and or declarations and is
included by the coap.h header file.
Currently there is only Contiki as non Linux/BSD based platform we have
to take care. Potentially there is more to come.
2016-01-10 17:49:07 +01:00
Carsten Schoenert 0e59edc231 i/c/*.h: more public header cleanup
Resume the cleaning of the public header files, no functional changes.

Reformatting the infos in the head of the header files, restructure header
inclusion check to be more generic. Reorder some include directives in a
alphabetical order. Remove including instructions for C++ stuff, it's
already done in the coap.h header, and the user only has to include this
header file.

Dropping the prefixing of the include guarding of uthash.h because it would
cause trouble with the macro handling in TinyDLS.
Thanks Olaf for reminding this!
2016-01-10 17:49:07 +01:00
Carsten Schoenert 489eb73f0c i/c/*.h: remove obsolete #ifdef HAVE_* constructs
The various variable checks within the public header files are not
useful as such checks doesn't have to be done in these files.

The public header files have only to provide the function declarations
and some macro definitions, any check for the availability of needed
other system header files has to be done by the user on his own.

TODO: The check for syslog.h in debug.h has to be moved out of the
public part into the source of the library later.
2016-01-10 17:49:07 +01:00
Olaf Bergmann d90bc9164e fixed issue #17: COPYING and README.md named the wrong license
LICENSE.BSD is a 2-clause ("simplified") BSD license. The files
COPYING and README.md erroneously have termed it the "revised BSD
license".
2015-12-19 13:41:08 +01:00
Carsten Schoenert a0b31e74d1 configure.ac: increase dep on Autoconf 2.64 2015-12-16 16:09:34 +01:00
Olaf Bergmann a5b61409a5 coap_io.c: set local address after bind for new endpoint
This fixes a bug reported by Daniel Petrie:

"When the coap-client is used and a local address to bind to is
specified, but the local port is not specified, I get errors for the
response coming in from an unexpected interface and the response is
dropped/ignored."

The solution here is to call getsockname() after successful bind()
in coap_new_endpoint() to set ep->addr to the actual transport
address being used.
2015-10-27 13:05:03 +01:00
Olaf Bergmann 3f5a797776 net.c: fixed critical option check
The limitation of COAP_OPT_FILTER_SHORT to six entries made the
critical option check fail e.g. for Block2. This change hard-codes
the built-in critical options in coap_option_check_critical() so
that up to COAP_OPT_FILTER_SHORT short options and COAP_OPT_FILTER_LONG
long options can be registered dynamically.

Please note that registering critical options that are already known
(i.e. listed in pdu.h and checked in coap_option_check_critical())
is a waste of storage space.
2015-10-01 19:27:50 +02:00
Olaf Bergmann 2da31de732 configure.ac: fix disable options
The options --disable-documentation and --disable-examples did
not have the desired effect in some configurations. Now, if any
of documentation or examples is disabled, the manual pages in
the examples folder are not created.
2015-09-30 19:46:34 +02:00
Olaf Bergmann 683337890e bugfix: add flag for CON/NON notification messages
Two new flags COAP_RESOURCE_FLAGS_NOTIFY_NON and
COAP_RESOURCE_FLAGS_NOTIFY_CON have been added to control the
message type for notifications to send. The default type is
COAP_RESOURCE_FLAGS_NOTIFY_NON which can be changed with the
function coap_resource_set_mode().

The observer-specific flag has been removed.
2015-09-29 09:03:18 +02:00
franc0is 11daf0545a Fix coap_ticks platforms with no _POSIX_TIMERS
(cherry picked from commit bde305210e)
2015-09-09 14:04:44 +02:00
Olaf Bergmann 7f2134db6f client.c: fixed empty service parameter in getaddrinfo call
Baptiste Clenet <bapclenet@gmail.com> has pointed out that passing
an empty string causes address resolution to fail in certain cases.
This modification replaces the service parameter in the getaddrinfo
call with NULL as suggested.
2015-09-08 18:06:03 +02:00
Olaf Bergmann eef94ce673 Merge remote-tracking branch 'github-obgm/develop' into develop
Re-sync with github version of libcoap. Accidently, a PR has been
accepted that was fixed on the SF master version during the July
outage.
2015-08-23 10:49:53 +02:00
obgm a06449d25b Merge pull request #1 from cgundogan/fix_readme
README: translate oder => or
2015-07-21 11:06:07 +02:00
Cenk Gündoğan a5ac6e2917 README: translate oder => or 2015-07-20 19:20:46 +02:00
Carsten Schoenert 63924379e3 testdriver: switch linking to the shared library
The testdriver was linked against the statically generated library of
libcoap. By this the testdriver will *always* find any symbols, no
matter if it is a private or public symbol.
Due this the testing behavior isn't the same as a user would use the
shared library and can get a potentially pitfall even if the testdriver
was successful.

Due previous changes to the public header the testdriver source needs
now the local header coap_config.h to find all needed functions so there
are small changes needed to the source files.
2015-07-04 19:35:10 +02:00
Carsten Schoenert ea9c1cbedb i/c/*.h: remove references to coap_config.h
The public header doesn't have to include a local dynamically created
header file from the autotools. This would break the usability of the
public header files.
2015-07-04 19:35:02 +02:00
Olaf Bergmann 889ba08ad0 updated map files to reflect API changes
Commit 1baa816 moved the implementation of coap_clock_init() and
coap_ticks_to_rt() to coap_time.c. This commit updates the public
API of the shared lib accordingly.
2015-06-28 15:12:27 +02:00
Olaf Bergmann 1baa8163b5 coap_time.[hc]: make ticks relative to global offset for POSIX
For POSIX platforms, ticks have been absolute which caused an
overflow on 32-bit architectures. This modification makes values
returned by coap_ticks() relative to a global offset stored
internally in coap_clock_offset.
2015-06-28 15:04:52 +02:00
Olaf Bergmann 838d5ce37b configure.ac: make A2X precious
A2X is explicitly declared with AC_ARG_VAR to allow users to pass
a custom value to configure. Thus, users who do not have a2x
installed can invoke

  A2X=/bin/true ./configure --enable-examples

to prevent configure stopping on the a2x check.
2015-06-27 15:38:32 +02:00
Carsten Schoenert 842a4135a7 CONTRIBUTE: update section 6 due latest changes 2015-06-22 21:25:43 +02:00
Carsten Schoenert 19d66df457 .gitignore: adding man pages and related temp files 2015-06-22 21:25:43 +02:00
Carsten Schoenert b1099ed620 autogen.sh: rework the cleaning option
Added the new files from the examples/ folder and remove the leading '\'
from various lines, it's useless.
2015-06-22 21:25:43 +02:00
Carsten Schoenert 141eefdbb6 a2x: adding a check for needed helper
The previous commit added some asciidoc based man pages that need a2x
from the asciidoc package. To ensure the build will not break due a not
available a2x binary we better check before.
2015-06-22 21:25:43 +02:00
Carsten Schoenert 3e9afb1460 examples/*: adding example binaries man page support
This commmit adds the build of man pages for the binaries from the
example/ folder, in detail these are coap-client.5, coap-rd.5 and
coap-server.5.
The source of the man pages is written in asciidoc so the build
environment must have access to a installed asciidoc package.
2015-06-22 21:25:43 +02:00
Carsten Schoenert cb55cb44da examples/*coap-client*: whitespace cleanup, reformatting, no changes
Just some cleanup like whitespace, punctiation marking and indentation
issues.
2015-06-19 20:54:31 +02:00
Carsten Schoenert 60bb15edd7 examples/coap-server.c: whitespace cleanup, reformatting, no changes
Just some cleanup like whitespace, punctiation marking and indentation
issues.
2015-06-19 20:54:31 +02:00
Carsten Schoenert bda1a2360b examples/coap-rd.c: whitespace cleanup, reformatting, no changes
Just some cleanup like whitespace, punctiation marking and indentation
issues.
2015-06-19 20:54:30 +02:00
Carsten Schoenert 1043892391 rename the example binaries to more strict naming schema
To normalize (and in preparation for manpages) the currently used files
for the example implementation of a CoAP based client, server and a
resource directory various files and variables are rename to coap-*.
2015-06-19 20:53:47 +02:00
Carsten Schoenert 1a4113ca7e autogen.sh: adopt cleaning after API change
The pkg-config file is now named libcoap-1.pc and was forgotten to
change too in autogen.sh while changing the API versioning within the
commits 1ea9e1c and 24a83b7.
2015-06-19 20:53:47 +02:00
Carsten Schoenert f0f271778f drop previous renamed *.in files
With commit cda3b72 the migration to a fully Autotools controled build
environment was started which is now finished. The previous used *.in
files was renamed to *.in.old to hold some maybe usefull informations
from the old system. We don't need this renamed files any longer so kill
it with fire.
2015-06-19 20:52:47 +02:00
Olaf Bergmann 155adae29a coap_io.c: Include multicast addresses in is_local_if()
is_local_if() checks if a message's destination address matches
a local interface. As multicast requests are allowed on either
interface, this function now returns true when the destination
address is a multicast address.
2015-06-10 18:25:32 +02:00
Olaf Bergmann ee931e8f37 examples/client.c: Removed multicast join
As the client can send to multicast groups without explicitly joining,
this code is not required here and instead moved to the server
implementation.
2015-06-10 18:10:43 +02:00