Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes from Iotivity for draft-ietf-core-coap-tcp-tls and cross-platform support #47

Open
wants to merge 49 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
1b3818d
Patches from IoTivity
dthaler Jul 27, 2016
c1bda6e
Patches from IoTivity
dthaler Jul 27, 2016
673a575
Merge branch 'develop' of https://github.com/dthaler/libcoap into dev…
dthaler Jul 27, 2016
c11591d
Merge branch 'develop' of https://github.com/dthaler/libcoap into dev…
dthaler Jul 27, 2016
0e35a2f
Merge branch 'develop' of https://github.com/dthaler/libcoap into dev…
dthaler Jul 28, 2016
40a6d09
Merge branch 'develop' of https://github.com/dthaler/libcoap into dev…
dthaler Jul 28, 2016
c044245
Merge branch 'develop' of https://github.com/dthaler/libcoap into dev…
dthaler Jul 28, 2016
62c0186
More work on merging IoTivity patches
dthaler Jul 28, 2016
fd5c9ec
More work on merging IoTivity patches
dthaler Jul 28, 2016
72c7ce6
Merge branch 'develop' of https://github.com/dthaler/libcoap into dev…
dthaler Jul 29, 2016
42aedb2
Fix merge bug
dthaler Sep 22, 2016
65e7398
Windows-specific fix
dthaler Sep 22, 2016
e43531b
Port tests to windows
dthaler Sep 22, 2016
749514f
Fix for x86 Windows
dthaler Oct 11, 2016
9feaa9e
Fix release build error
dthaler Oct 14, 2016
9373a4c
Linux compilation fix
dthaler Jan 20, 2017
0012bae
Merge remote-tracking branch 'upstream/develop' into develop
dthaler Jan 20, 2017
fa987b4
Fixes from merging
dthaler Jan 20, 2017
d03c8a0
Addressed feedback from tijuca, don't use negative logic in ifdefs
dthaler Jan 20, 2017
ccc0f01
Fix typo
dthaler Jan 20, 2017
ee5123d
Merge pull request #1 from dthaler/develop
PawelWMS Jan 27, 2017
092d7e2
Fixing C4018 warnings for x86 builds.
PawelWMS Jan 27, 2017
a455214
Merge pull request #2 from PawelWMS/develop
dthaler Jan 27, 2017
bc69a9f
Fix travis issues
dthaler Jan 27, 2017
4d3805f
Merge branch 'develop' of https://github.com/dthaler/libcoap into dev…
dthaler Jan 27, 2017
2238ebb
Fix more travis issues
dthaler Jan 27, 2017
c38dc95
Fix more travis issues
dthaler Jan 27, 2017
7d34f47
Merge branch 'develop' of https://github.com/dthaler/libcoap into dev…
dthaler Jan 27, 2017
8c39fe4
Fix more travis issues
dthaler Jan 27, 2017
62c6792
Fix more travis issues
dthaler Jan 27, 2017
39fabf2
Merge branch 'develop' of https://github.com/dthaler/libcoap into dev…
dthaler Jan 27, 2017
d0ed3e8
Merge branch 'develop' of https://github.com/dthaler/libcoap into dev…
dthaler Jan 27, 2017
60a0af0
Merge branch 'develop' of https://github.com/dthaler/libcoap into dev…
dthaler Feb 9, 2017
40a2641
Fix pdu length truncation
danmihai1 Mar 8, 2017
a8b1149
Merge pull request #4 from danmihai1/develop
dthaler Mar 8, 2017
f21c7fb
Merge remote-tracking branch 'upstream/develop' into develop
dthaler Mar 21, 2017
358bd58
Merge remote-tracking branch 'upstream/develop' into develop
dthaler Apr 3, 2017
d54f001
Fixing libcoap W4 warnings.
PawelWMS Mar 7, 2017
9f1d956
Bracket fixes.
PawelWMS Apr 4, 2017
577804c
Merge pull request #5 from PawelWMS/origin_W4_fix
dthaler Apr 5, 2017
2f6ff0c
Added CoAP over WebSocket support.
SenthilKumarGS Apr 28, 2017
f4d20bc
Merge pull request #6 from SenthilKumarGS/develop
dthaler May 30, 2017
5f2d238
Update pdu.c
Koushik4082 May 17, 2018
5dc2fdc
Update pdu.c
Koushik4082 May 17, 2018
7164418
Merge pull request #1 from Koushik4082/Koushik4082-patch-1
Koushik4082 May 17, 2018
bd60461
Update pdu.h
Koushik4082 May 17, 2018
fa8b2b9
Merge pull request #7 from Koushik4082/develop
dthaler Jun 4, 2018
b497109
Fix for where WITH_TCP is defined, WITH_WS is not.
mwichmann Sep 13, 2018
5a16b17
Merge pull request #8 from mwichmann/ws-fix
dthaler Sep 13, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ coap_send_ack(coap_context_t *context,
return result;
}

#if defined(WITH_POSIX) || defined(WITH_CONTIKI)
#if !defined(WITH_LWIP)
Copy link
Contributor

@tijuca tijuca Sep 23, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't use negative logic here and let that check as it is, it's hard to figure out for some not well knowledge people what !WITH_LWIP means!

static coap_tid_t
coap_send_impl(coap_context_t *context,
const coap_endpoint_t *local_interface,
Expand Down
26 changes: 16 additions & 10 deletions tests/test_options.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,10 +423,16 @@ t_access_option7(void) {

#define TEST_MAX_SIZE 1000

#ifdef _MSC_VER
# define ALIGNED(x)
#else
# define ALIGNED(x) __attribute__ ((aligned (x)))
#endif

static void
t_iterate_option1(void) {
/* CoAP PDU without token, options, or data */
uint8_t teststr[] __attribute__ ((aligned (8))) = {
uint8_t teststr[] ALIGNED(8) = {
0x00, 0x00, 0x00, 0x00
};

Expand All @@ -451,7 +457,7 @@ t_iterate_option1(void) {
static void
t_iterate_option2(void) {
/* CoAP PDU with token but without options and data */
uint8_t teststr[] __attribute__ ((aligned (8))) = {
uint8_t teststr[] ALIGNED(8) = {
0x03, 0x00, 0x00, 0x00, 't', 'o', 'k'
};

Expand All @@ -476,7 +482,7 @@ t_iterate_option2(void) {
static void
t_iterate_option3(void) {
/* CoAP PDU with token and options */
uint8_t teststr[] __attribute__ ((aligned (8))) = {
uint8_t teststr[] ALIGNED(8) = {
0x03, 0x00, 0x00, 0x00, 't', 'o', 'k', 0x13,
'o', 'p', 't', 0x00, 0xd1, 0x10, 'x'
};
Expand Down Expand Up @@ -517,7 +523,7 @@ t_iterate_option3(void) {
static void
t_iterate_option4(void) {
/* CoAP PDU with token, options, and data */
uint8_t teststr[] __attribute__ ((aligned (8))) = {
uint8_t teststr[] ALIGNED(8) = {
0x03, 0x00, 0x00, 0x00, 't', 'o', 'k', 0x13,
'o', 'p', 't', 0x00, 0xd1, 0x10, 'x', 0xff,
'd', 'a', 't', 'a'
Expand Down Expand Up @@ -559,7 +565,7 @@ t_iterate_option4(void) {
static void
t_iterate_option5(void) {
/* CoAP PDU with malformed option */
uint8_t teststr[] __attribute__ ((aligned (8))) = {
uint8_t teststr[] ALIGNED(8) = {
0x00, 0x00, 0x00, 0x00, 0x52, 'o', 'p', 0xee,
0x12, 0x03, 0x00
};
Expand Down Expand Up @@ -591,7 +597,7 @@ static void
t_iterate_option6(void) {
/* option filter */
/* CoAP PDU with token, options, and data */
uint8_t teststr[] __attribute__ ((aligned (8))) = {
uint8_t teststr[] ALIGNED(8) = {
0x00, 0x00, 0x00, 0x00, 0x80, 0x20, 0x00, 0x00,
0xc0, 0x00
};
Expand Down Expand Up @@ -635,7 +641,7 @@ t_iterate_option6(void) {
static void
t_iterate_option7(void) {
/* option filter */
uint8_t teststr[] __attribute__ ((aligned (8))) = {
uint8_t teststr[] ALIGNED(8) = {
0x00, 0x00, 0x00, 0x00, 0x80, 0x20, 0x00, 0x00,
0xc0, 0x00, 0x10, 0x10, 0x00
};
Expand Down Expand Up @@ -681,7 +687,7 @@ t_iterate_option7(void) {
static void
t_iterate_option8(void) {
/* option filter */
uint8_t teststr[] __attribute__ ((aligned (8))) = {
uint8_t teststr[] ALIGNED(8) = {
0x00, 0x00, 0x00, 0x00, 0x80, 0x20, 0x00, 0x00,
0xc0, 0x00, 0x10, 0x10, 0x00
};
Expand Down Expand Up @@ -711,7 +717,7 @@ t_iterate_option8(void) {
static void
t_iterate_option9(void) {
/* options filter: option number too large for filter */
uint8_t teststr[] __attribute__ ((aligned (8))) = {
uint8_t teststr[] ALIGNED(8) = {
0x00, 0x00, 0x00, 0x00, 0x80, 0x20, 0x00, 0x00,
0xc0, 0x00, 0x10, 0x10, 0x00
};
Expand Down Expand Up @@ -741,7 +747,7 @@ t_iterate_option9(void) {
static void
t_iterate_option10(void) {
/* options filter: option numbers in PDU exceed filter size */
uint8_t teststr[] __attribute__ ((aligned (8))) = {
uint8_t teststr[] ALIGNED(8) = {
0x00, 0x00, 0x00, 0x00, 0x80, 0x20, 0x00, 0x00,
0xd0, 0x26, 0xe0, 0x10, 0x00
};
Expand Down
8 changes: 7 additions & 1 deletion tests/test_uri.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,15 @@ t_parse_uri12(void) {
}
}

#ifdef _MSC_VER
# define ALIGNED(x)
#else
# define ALIGNED(x) __attribute__ ((aligned (x)))
#endif

static void
t_parse_uri13(void) {
uint8_t teststr[] __attribute__ ((aligned (8))) = {
uint8_t teststr[] ALIGNED(8) = {
0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 'f', 'o',
'o', 0x3b, '.', 'w', 'e', 'l', 'l', '-',
'k', 'n', 'o', 'w', 'n', 0x04, 'c', 'o',
Expand Down
6 changes: 6 additions & 0 deletions tests/test_wellknown.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
#include <coap.h>

#include <assert.h>
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand Down Expand Up @@ -139,8 +141,12 @@ t_wellknown3(void) {

/* ,</0000> (TEST_URI_LEN + 4 chars) */
for (j = 0; j < num_resources; j++) {
#ifdef HAVE_SNPRINTF
int len = snprintf((char *)uribuf, TEST_URI_LEN + 1,
"%0*d", TEST_URI_LEN, j);
#else
int len = sprintf((char *)uribuf, "%0*d", TEST_URI_LEN, j);
#endif
r = coap_resource_init(uribuf, len, 0);
coap_add_resource(ctx, r);
uribuf += TEST_URI_LEN;
Expand Down