Jon Shallow
e1fa280d88
coap_dtls.h: Add in TLS library determination support
...
A new function coap_get_tls_library_version() that returns a pointer to a
coap_tls_version_t structure that contains both the TLS library type libcoap
was compiled against as well as the current TLS library version.
2018-02-10 18:34:42 +00:00
Olaf Bergmann
d3b5535960
pdu.[hc]: Export coap_pdu_resize()
2017-12-22 13:55:37 +01:00
Olaf Bergmann
0c837cdc77
pdu.h: increase Max-Message-Size by 256 B
...
To allow for 8 MiB payloads, the maximum message size value for
TCP has been increased by 256 B option space.
2017-11-11 10:06:16 +01:00
jcmichelou
c93f535d4a
openssl, session: Fix memory leaks.
2017-11-04 23:38:02 +01:00
Olaf Bergmann
a569e16584
coap_time.h: cast COAP_TICKS_PER_SECOND to coap_tick_t for type safety
...
CID 1458396 detected by Coverity scan points out that integer
arithmetics may lead to an overflow without the typecast to
coap_tick_t.
2017-11-03 14:29:49 +01:00
jcmichelou
3f77c117ea
resource: Fix issues #90 , #91 and #92
...
The value of the observe option is kept for each resource rather than being global to the context.
The value of the observe option must wrap to be stay below 2^24.
The value of the observe option must be different from the initial value when a notification is sent.
2017-10-25 20:22:01 +02:00
jcmichelou
e125888ded
openssl: Handshake can also complete in SSL_accept and SSL_connect.
2017-10-21 19:16:23 +02:00
jcmichelou
68a9ea045d
pdu: Use defines for TCP variable header message size constants.
2017-10-21 17:24:56 +02:00
jcmichelou
d89c99f5f8
uri: Add coap+tcp:// and coaps+tcp:// schemes.
2017-10-21 16:52:02 +02:00
jcmichelou
75d89ab295
openssl, io: Fix linux compatibility
2017-10-21 16:11:16 +02:00
jcmichelou
854cc3147f
openssl, session: Add TLS encryption.
2017-10-21 16:11:14 +02:00
jcmichelou
9bb8396b23
coap_session, net.c: Add debug messages on TCP RX/TX.
2017-10-21 16:11:14 +02:00
jcmichelou
58766a137e
coap_dtls.h, openssl: Add function prototypes for TLS support.
2017-10-21 16:11:13 +02:00
jcmichelou
140580f0df
session, pdu, option: Use exact message size calculation for TCP PDU.
2017-10-21 16:11:13 +02:00
jcmichelou
f81cb43fd3
session, pdu: Enforce maximum message size.
2017-10-21 16:11:12 +02:00
jcmichelou
c592c9d11f
session, net, debug: Add TCP signaling messages.
2017-10-21 16:11:12 +02:00
jcmichelou
dfff930805
io, net: Add TCP accept/connect/read/write
2017-10-21 16:11:12 +02:00
jcmichelou
bcfd7a0753
pdu: add support for TCP-style headers
...
Make coap_pdu-t independent of the header style.
Use C99 sized types when applicable.
Use transaction ids in host byte order in the library.
Make coap_pdu_t payload storage grow on demand.
Add parsing and encoding of PDUs with UDP or TCP style headers.
Adapt examples and unit tests to the new PDU format.
2017-10-21 16:11:11 +02:00
obgm
8a30adefa5
Merge pull request #108 from spinetix/log-handler
...
Add a log handler callback.
2017-09-09 01:22:13 +02:00
obgm
abddc07559
Merge pull request #107 from spinetix/handler-lost-con
...
Add handler for lost CON messages.
2017-09-09 01:21:32 +02:00
jcmichelou
d89159fdb4
debug.[hc]: Add a log handler callback.
2017-09-08 20:12:39 +02:00
jcmichelou
25732fc8e6
coap_session.[ch], net.c: Add handler for lost CON messages.
...
Add a slot for storing application-specifc data in session object.
Make the library resilient against client session released in a callback.
2017-09-08 20:02:22 +02:00
jcmichelou
30619691e2
resource.[ch], uri.c[ch]: Query string dependent observe.
...
Remember the query string used during the observe request and pass it to the resource handler.
Support partial notification of observers based on the query string.
2017-09-08 19:50:34 +02:00
Olaf Bergmann
3feee38045
uthash.h: fix compiler warning for missing default case in switch statement
...
Added a no-op default case to switch statement in macro HASH_JEN in order
to fix compiler warning.
2017-08-31 13:14:01 +02:00
Olaf Bergmann
2133742f84
utlist.h, uthash.h: updated to fix compiler warnings
...
With gcc 7.2.0, new compiler warnings related to utlist.h and
uthash.h have occured. Several have been fixed by updating the
header files to the latest version from [1].
[1] https://github.com/troydhanson/uthash
2017-08-31 12:49:47 +02:00
Olaf Bergmann
5c079b72d9
coap_session.[hc]: make message id session-local
...
The message id in the CoAP header is used for reliability when
transferring a CoAP PDU over a non-reliable transport protocol
such as UDP. For message de-duplication, it is useful to have
a monotonously increasing number space within a session. Therefore,
the context-global value has been moved to coap_session_t.
The function coap_new_message_id() now takes a coap_session_t
object as its argument.
2017-08-18 14:15:20 +02:00
Olaf Bergmann
d9a0b4019d
pdu.h: added content format definitions from RFC 8152
...
See https://tools.ietf.org/html/rfc8152#section-16.10
2017-08-02 21:54:31 +02:00
Olaf Bergmann
7dfeb91978
coap.h.in: avoid C++ name mangling for functions in libcoap.h
...
To avoid function names being mangled when compiling with C++,
the inclusion of libcoap.h has been moved into the extern "C"
declaration for coap.h.
2017-08-02 21:11:17 +02:00
obgm
96e536006f
Merge pull request #99 from Trilliant/feature/fixHandlersForNewVerbs
...
resource.h: increase method_handler structure to hold new methods (FETCH, PATCH, IPATCH)
2017-07-10 17:25:07 +02:00
Jean-Michel Julien
8abf63b867
resource.h: increase method_handler structure to hold new methods (FETCH,PATCH,IPATCH)
2017-07-06 15:11:10 -04:00
jcmichelou
ab04f3924f
Fix compilation warnings with gcc.
2017-06-29 19:20:39 +02:00
jcmichelou
7fb4ace2b7
Fix for the signedness warning with gcc.
...
Compact coap_address_t.
Use coap_queue_t for all queues.
OpenSSL warning for close alert should be info level.
Fix OpenSSL log level not working.
Use the application defined MTU in OpenSSL.
coap_log() optimization to avoid generating the log message text before testing the log level.
coap_can_exit() should check the new retransmit queues.
Fix retransmit time sometimes not correctly computed relative to sendqueue_basetime.
Add coap_write() API call for applications with their own main loop.
2017-06-29 18:12:46 +02:00
jcmichelou
4d4f3ba54f
Fix compilation with gcc
2017-06-26 17:42:27 +02:00
jcmichelou
b2fe4a64de
Make MTU configurable.
...
Use static or stack storage for coap_packet_t.
2017-06-26 17:34:01 +02:00
jcmichelou
6e97dbafcf
Add facility for the removal of all queued messages and observations of a session. Apply it to client-side destination unreachable notification.
2017-06-24 17:10:50 +02:00
jcmichelou
4d45219fe5
Add session expiration based on inactivity period and maximum number of idle sessions per endpoint.
...
Server sessions for which a close notify has been received are garbage collected immediately.
2017-06-22 19:13:20 +02:00
jcmichelou
f6047c8e77
Fix gcc warning messages.
2017-06-22 16:13:38 +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
99925a1a97
Add init function for DTLS library.
...
Match dummy functions in coap_notls.c with their prototypes.
2017-06-21 20:57:12 +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
ae13e5127b
Compile with tinydtls and remove warning message with gcc.
2017-06-19 20:37:11 +02:00
jcmichelou
b389a5f6aa
Add skeleton support for tinydtls with new API.
2017-06-19 16:58:12 +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
5b1a8f67bf
Implement coap_session_t concept for POSIX.
2017-06-15 18:42:42 +02:00
jcmichelou
b2ab881ad4
Fix the result of dtls branch merge so that all the examples work (DTLS support not enabled yet)
2017-06-13 14:38:30 +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
jcmichelou
ba68ba85c0
Do not make exported symbols different between release and debug builds, this breaks the ABI of the DLL.
...
Do not make reference to NDEBUG in public headers to modify the ABI. This macro is defined automatically in all windows projects and will create a lot of confusion.
2017-05-07 18:18:33 +02:00
jcmichelou
95d8e2c8e0
Use C-style prototypes for coap_statup and coap_cleanup
2017-05-06 18:25:10 +02:00
jcmichelou
e2c2dc5326
Make LIBCOAP_PACKAGE_XXX macros usables in code
2017-05-06 18:24:59 +02:00
jcmichelou
9b3cf894fc
Use crypto secure version of rand to generate the message ids on windows.
2017-05-05 20:46:29 +02:00