Commit Graph
695 Commits
Author SHA1 Message Date
Olaf Bergmann e4e2e57218 option.[hc]: new option filter implementation
The implementation of option filters based on coap_opt_filter_t
has changed to improve support for long option numbers. An option
filter is now a sparse field of a fixed size that can hold up to
COAP_OPT_FILTER_LONG options with a number larger than 255, and
up to COAP_OPT_FILTER_SHORT options with a number of 255 or less.

The space taken by coap_opt_filter_t is
2 * ((((COAP_OPT_FILTER_SHORT + 1) >> 1) + COAP_OPT_FILTER_LONG) + 1),
or 12 bytes with the default settings for COAP_OPT_FILTER_SHORT == 6
and COAP_OPT_FILTER_LONG == 2.

Three new functions have been added to the option filter API:
* coap_option_filter_set() to store an option number in a filter,
* coap_option_filter_get() to check if a filter contains a given
  option number, and
* coap_option_filter_unset() to remove an option number from a
  filter.

The previously existing functions coap_option_setb(), coap_option_getb(),
and coap_option_clrb() continue to work on the new option filter
unchanged but now are deprecated.
2015-06-07 12:21:58 +02:00
Olaf Bergmann 6db8e5172d net.c: fixed calculation of mask bit for no-response option
* The shift in function no_response was off by one bit.
* The response code must be checked, not the request method.
2015-06-07 12:21:58 +02:00
Olaf Bergmann bf9a3c7a1b net.c: Implementation of No-Response option
Response suppression according to draft-tcs-coap-no-response-option-11.
2015-06-07 12:21:58 +02:00
Olaf Bergmann c5a1faad0c pdu.h: Added code for No-Response option
IANA has reserved 284 for No-Response, described in
http://www.iana.org/go/draft-tcs-coap-no-response-option

See also:
http://www.iana.org/assignments/core-parameters/core-parameters.xhtml#option-numbers

As a side-effect, COAP_MAX_OPT was set to 65535.
2015-06-07 12:21:57 +02:00
Olaf Bergmann 83c17e8f17 testdriver.c: Remove comment on known bugs
With commit eec9ad2, the two outstanding bugs in the test suite
have been fixed.
2015-06-07 12:21:57 +02:00
Olaf Bergmann 81d4297b50 option.[hc]: Fix type of option parameter
Since CoAP options can have a numeric type between 0 and 65535, the
type parameter of coap_check_option() must be at least 16 bits.
2015-06-07 12:21:57 +02:00
Olaf Bergmann 519da113a3 debug.c: improved output of zero-length option values
The function print_readable() did not add a terminating zero in case
len == 0. Now, the output buffer will always have a terminating '\0'
when buf has at least one byte free (i. e. buflen > 0). Note that the
function result does not include the trailing zero-byte.
2015-06-07 12:15:30 +02:00
Olaf Bergmann 312fc9251b debug.c: made output of coap_show_pdu() more readable
The new format[0] was inspired by the discussion[1] on the IETF CoRE
mailing list. Changes include:

* Print human-readable message type and method/response code
* Output token included in {...} even if token is empty
* Print human-readable option types
* Print human-readable option values where possible
* Print human-readable Content-Format and Block options
* Print hex string included in <<...>> for binary content,
  human-readable string included in '...' for text content
* Use '::' as payload delimiter if message contains a payload

[0] http://www.ietf.org/mail-archive/web/core/current/msg06069.html
[1] http://www.ietf.org/mail-archive/web/core/current/msg06062.html
2015-06-07 12:15:30 +02:00
Olaf Bergmann 1ea9e1c213 Renamed libcoap-1.0.{map,sym,pc.in} to libcoap-1.{map,sym,pc.in}
As commit 8380870 has simplified the API version numbering, these
filenames must be adjusted.
2015-06-07 12:11:48 +02:00
Carsten Schoenert d01e1cad2e expand i/c/coap.h to include additional information
The header coap.h should be the only header file a user has to include
to get functions from the libcoap available. Bu we have to provide not
only the header interface to the user, the user needs also some extra
information like the libcoap version or upstream related infos.

To get these automated in to a shipped coap.h header file we simple can
use some autotool magic and expand some macros while configure is
running and pasing i/c/coap.h.in. By this we can currently add the
following macro variables:

 LIBCOAP_PACKAGE_BUGREPORT -> upstream email contact
 LIBCOAP_PACKAGE_NAME      -> the used package name (libcoap)
 LIBCOAP_PACKAGE_STRING    -> package name + version
 LIBCOAP_PACKAGE_URL       -> upstream homepage
 LIBCOAP_PACKAGE_VERSION   -> the current used version

All these macros variables are expanded from the respective macro names
from the configure run. The variables are prefixed because this with
LIBCOAP_ to not get name clashing on the user side while running the
autotools of the users project.

There are probably more predefined macros needed, but they can be easily
added later into include/coap/coap.h.in.
2015-06-02 20:41:37 +02:00
Carsten Schoenert 83808704ff configure.ac: simplify the API version number
As we never want to break the API it makes no deeper sence to use a
numbered version '1.0' as this is the same as like a simple '1'.
The defined API number is used within the library so a defined version
'1.0' is also used for the namimg inside the library and other tools
reading them from the library.
Let's reduce the API version to '1' and simplify the naming for the
library by this.
2015-06-02 20:41:37 +02:00
Carsten Schoenert 21431bcb2f examples/Makefile.am: small fix for the path declaration 2015-06-02 20:41:37 +02:00
Carsten Schoenert 5f6ae26e2c doc/Doxygen.in: Do not use FreeSans as dot fontname
The FreeSans font isn't shipped by doxygen anymore so we can not asumme
that the font is available on the system of the user.
Just let doxygen pick up a usable font by itself.
2015-06-02 20:41:37 +02:00
Carsten Schoenert a78bd8c876 doc/Makefile.am: respect DESTDIR variable
The old behavior didn't allow a additonal setting of the DESTDIR
variable. This is a serious problem while building within a chroot for
example. Also the implementation of the stamp file was triggering
multiple builds in some cirumstances. This handling is reverted with the
remove of the old stamp file handling.
2015-06-02 20:41:37 +02: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 35524ec1cf CONTRIBUTE: fix up wording, expanding file 2015-06-02 20:41:37 +02:00
Carsten Schoenert b8618fedb7 TODO: adding a TODO file to track needed changes 2015-06-02 20:41:37 +02:00
Olaf Bergmann 8a96bfa5c2 net.h: fixed ugly macro usage in coap_new_message_id()
context->message_id has been incremented as a side-effect of calling
the htons macro. To avoid potential issues with this, the increment
operation has been moved outside the macro call.
2015-05-23 13:58:41 +02:00
Carsten Schoenert a4c163937a i/c/subribe.h: whitespace cleanup, reformatting, no changes
Just some cleanup like whitespace, punctiation marking and indentation
issues.
2015-04-14 16:05:43 +02:00
Carsten Schoenert 1d79a041ba i/c/str.h: whitespace cleanup, reformatting, no changes
Just some cleanup like whitespace, punctiation marking and indentation
issues.
2015-04-14 16:05:42 +02:00
Carsten Schoenert a21adde03e i/c/resource.h: whitespace cleanup, reformatting, no changes
Just some cleanup like whitespace, punctiation marking and indentation
issues.
2015-04-14 16:05:40 +02:00
Carsten Schoenert d15ecb60ec i/c/prng.h: whitespace cleanup, reformatting, no changes
Just some cleanup like whitespace, punctiation marking and indentation
issues.
2015-04-14 16:05:38 +02:00
Carsten Schoenert 5d7c25c289 i/c/pdu.h: whitespace cleanup, reformatting, no changes
Just some cleanup like whitespace, punctiation marking and indentation
issues.
2015-04-14 16:05:36 +02:00
Carsten Schoenert 6588dfe810 i/c/option.h: whitespace cleanup, reformatting, no changes
Just some cleanup like whitespace, punctiation marking and indentation
issues.
2015-04-14 16:05:35 +02:00
Carsten Schoenert 8d22cd6544 i/c/net.h: whitespace cleanup, reformatting, no changes
Just some cleanup like whitespace, punctiation marking and indentation
issues.
2015-04-14 16:05:34 +02:00
Carsten Schoenert c43a47578c i/c/mem.h: fix doxygen warnings, no functional changes
Just fixing up the warning from doxygen so the documentation will be
more usable. Also fixing up some whitespace, punctiation marking and
indentation issues.
2015-04-14 16:05:32 +02:00
Carsten Schoenert 5fca704c4e i/c/hashkey.h: whitespace cleanup, reformatting, no changes
Just some cleanup like whitespace, punctiation marking and indentation
issues.
2015-04-14 16:05:31 +02:00
Carsten Schoenert 9ab6d050e6 i/c/encode.h: whitespace cleanup, reformatting, no changes
Just some cleanup like whitespace, punctiation marking and indentation
issues.
2015-04-14 16:05:28 +02:00
Carsten Schoenert 62ddbd232c i/c/debug.h: whitespace cleanup, reformatting, no changes
Just some cleanup like whitespace, punctiation marking and indentation
issues.
2015-04-14 16:01:34 +02:00
Carsten Schoenert 7af8edf8a9 i/c/coap_time.h: whitespace cleanup, reformatting, no changes
Just some cleanup like whitespace, punctiation marking and indentation
issues.
2015-04-14 16:01:33 +02:00
Carsten Schoenert 54abde5943 i/c/coap_io.h: whitespace cleanup, reformatting, no changes
Just some cleanup like whitespace, punctiation marking and indentation
issues
2015-04-14 16:01:31 +02:00
Carsten Schoenert 9da72684c8 i/c/coap.h: whitespace cleanup, reformatting, no changes
Just some whitespace cleanup.
2015-04-14 16:01:29 +02:00
Carsten Schoenert 4d7752ddf0 i/c/block.h: whitespace cleanup, reformatting, no changes
Just some cleanup like whitespace, punctiation marking and indentation
issues.
2015-04-14 16:01:17 +02:00
Carsten Schoenert e2683eb218 i/c/bits.h: whitespace cleanup, reformating, no changes
Just some cleanup like whitespace, punctiation marking and indentation
issues.
2015-04-14 16:01:09 +02:00
Carsten Schoenert e256844253 i/c/async.h: whitespace cleanup, reformating, no changes
Just some cleanup like whitespace, punctuation marking and indentation
issues.
2015-04-14 15:55:24 +02:00
Carsten Schoenert ed59118841 i/c/address.h: whitespace cleanup, reformating, no changes
Just some cleanup like whitespace, punctiation marking and indentation
issues.
2015-04-14 15:54:33 +02:00
Carsten Schoenert 531c5da5da Doxyfile.in: adding some excludes for lwip related files
Due changes to the *.c and *.h files (added for the lwip support) we have
to exclude files that are not related to the library.
2015-04-14 15:53:27 +02:00
Olaf Bergmann db28c5ac0c CONTRIBUTE: fixed minor nits
Removed word duplication, "is" vs. "are", adj vs. adv
2015-04-14 12:19:40 +02:00
Carsten Schoenert d3d78902db CONTRIBUTE: adding info file for contributers
The file CONTRIBUTE is primarily for user who wants to help to improve
the libcoap project. Please expand this file with helpful informations
for anybody who is interests in helping.

Signed-off-by: Olaf Bergmann <bergmann@tzi.org>
2015-04-14 12:09:59 +02:00
Carsten Schoenert 3b87d7dc8f doxygen: include extra information about extra CFLAGS 2015-04-10 21:09:27 +02:00
Carsten Schoenert a3f3a75556 configure.ac: changing the platform related definitions
Simplifying the various definition for the currently supported
platforms. These are now Linux, Solaris and Darwin platforms. This will
hopefully grow up the next time but for now we only handle some extra
CFLAGS definitions and one extra define for Darwin. So there is not
really a need to handle this in two extra 'case switch' loops.

We have there some additional CFLAGS (right now only extra compiler
switches).  There is some "special" handling needed for getting this
info into the doxygen configuration. This switches are related on the
platform the build is running.
2015-04-10 21:09:27 +02:00
Carsten Schoenert 6d4e85d813 doxygen: switch to svg graphics
With this change doxygen will create SVG graphics (instead of png) which
are zoomable due these are vector graphics.

Suggested-by: Bill Bennet <william.bennett@netcommwireless.com>
2015-04-10 21:08:41 +02:00
Carsten Schoenert 236135f7e7 doxygen: change the behaviour for caller graphics
This commit is based on a suggestion from Bill Bennet.
With this change doxygen is also creating a call and caller dependency
graphic for global functions. This is helpful for understanding the mode
of action inside the libcoap.

Suggested-by: Bill Bennet <william.bennett@netcommwireless.com>
2015-04-10 21:08:33 +02:00
Carsten Schoenert 3f1a7610f5 configure.ac: small adjusting of indention 2015-04-09 20:50:35 +02:00
Carsten Schoenert 47e0c25c38 examples/Makefile.am: changing header includes
The build of the examples is complaining about a function that are not
inline'd. The compiler is mentioned this because we use the '-I'
directive for pointing to the header files. Just say the compiler also
that the header files are system headers so the false positive is going
away.
2015-03-22 14:38:36 +01:00
Carsten Schoenert 98e701dd06 configure.ac: create package.tar.bz2 by default
bzip2 creates archives that are better compressed than the default gzip
format. So running 'make dist' is creating a libcoap-VER.tar.bz2, you
can create a *.tar.gz by running 'make dist-gzip' if you prefer.

The created bzip2 archive is currently 27% smaller than the respective
gzip archive.

   $ ls -sh libcoap-4.1.2.tar.*
   372K libcoap-4.1.2.tar.bz2
   476K libcoap-4.1.2.tar.gz
2015-03-22 14:38:36 +01: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
Carsten Schoenert b1ed21e458 doc/Makefile.am: fix up broken 'make dist'
The make target for creating the distribution tarball (make dist) was
broken some commits ago within the changes in the doc/ subdirectory. The
reason for this is that simple Doxygen has to be runs ones before the
automatism can pick up the files. automake uses dist_pkgdist_DATA as
trigger. So we have to use that variable.

Changing up the makefile template so the call for 'dist_pkgdist_DATA'
*and* 'all-local' is calling 'doxfile.stamp' so fist Doxygen is running.

By doing this also clean up a little bit and prepare the build for be
able to run out of the tree.
2015-03-22 14:35:13 +01:00
Carsten Schoenert da3570cb41 examples/Makefile.am: fix not needed target
The target 'install-exec-am' is obviosly wrong and not really needed.
2015-03-22 13:37:28 +01:00