-
Notifications
You must be signed in to change notification settings - Fork 422
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LwIP: Rework code to use all of libcoap capabilities
Update examples/lwip directory to make it more standalone. Available directories under examples/lwip/ config/ Contains LwiP + CoAP configuration files libcoap/ Link to the libcoap tree lwip/ The LwIP tree lwip-contrib/ The LwIP contrib tree (obsoleted in LwIP master branch) src/ Local modifications to LwIP tinydtls/ Link to the TinyDTLS tree New files to contain the headers for the appropriate build types, with most of the #include removed from the other *.[ch] files. App visibility (selected by build type) include/coap3/coap_include_contiki.h include/coap3/coap_include_lwip.h include/coap3/coap_include_posix.h include/coap3/coap_include_windows.h library visibility (Can have tests for include files etc.) include/coap3/coap_include_contiki_internal.h include/coap3/coap_include_lwip_internal.h include/coap3/coap_include_posix_internal.h include/coap3/coap_include_windows_internal.h mem.[ch] renamed to coap_mem.[ch] to prevent build name clashes. Changed NO_SYS to 0, and so now accept() is renamed to lwip_accept(), socket() is renamed to lwip_socket() etc. Add in TinyDTLS support for packet encryption. Removed a lot of the WITH_LWIP protected code as it is now redundant. Removed LwIP specific files no longer in use. Uses the tap interface to interface with Linux, each new application will use the next available tap interface. tap interfaces can be pre-configured and used.
- Loading branch information
Showing
87 changed files
with
1,624 additions
and
1,362 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* coap_config.h.lwip -- LwIP configuration for libcoap | ||
* | ||
* Copyright (C) 2021 Olaf Bergmann <[email protected]> and others | ||
* Copyright (C) 2021-2022 Olaf Bergmann <[email protected]> and others | ||
* | ||
* SPDX-License-Identifier: BSD-2-Clause | ||
* | ||
|
@@ -12,31 +12,61 @@ | |
#ifndef COAP_CONFIG_H_ | ||
#define COAP_CONFIG_H_ | ||
|
||
#include <lwip/opt.h> | ||
#include <lwip/debug.h> | ||
#include <lwip/def.h> /* provide ntohs, htons */ | ||
#include "lwipopts.h" | ||
|
||
#define WITH_LWIP 1 | ||
|
||
/* Define if TinyDTLS support is to be included */ | ||
#define HAVE_LIBTINYDTLS | ||
|
||
/* Define as 1 if the system has small stack size */ | ||
#ifndef COAP_CONSTRAINED_STACK | ||
#define COAP_CONSTRAINED_STACK 1 | ||
#endif | ||
|
||
/* Define as 1 to build without TCP support. */ | ||
#ifndef COAP_DISABLE_TCP | ||
#define COAP_DISABLE_TCP 1 | ||
#define COAP_DISABLE_TCP 0 | ||
#endif | ||
|
||
/* Define as 1 if libcoap supports client mode code */ | ||
#ifndef COAP_CLIENT_SUPPORT | ||
#define COAP_CLIENT_SUPPORT 1 | ||
#endif | ||
|
||
/* Define as 1 if libcoap supports server mode code */ | ||
#ifndef COAP_SERVER_SUPPORT | ||
#define COAP_SERVER_SUPPORT 1 | ||
#endif | ||
|
||
/* Define if the system has epoll support */ | ||
#undef COAP_EPOLL_SUPPORT | ||
|
||
#define PACKAGE_NAME "libcoap" | ||
#define PACKAGE_VERSION "4.3.0" | ||
#define PACKAGE_STRING "libcoap 4.3.0" | ||
|
||
#define assert(x) LWIP_ASSERT("CoAP assert failed", x) | ||
|
||
/* To keep IPv6 builds happy */ | ||
#define IPV6_MULTICAST_HOPS 0x301 | ||
#define IPV6_PKTINFO IPV6_CHECKSUM | ||
|
||
/* To keep IPv6 builds happy */ | ||
#define OPTVAL_T(t) (t) | ||
#define OPTVAL_GT(t) (t) | ||
|
||
/* it's just provided by libc. i hope we don't get too many of those, as | ||
* actually we'd need autotools again to find out what environment we're | ||
* building in */ | ||
#define HAVE_STRNLEN 1 | ||
|
||
#define HAVE_LIMITS_H | ||
|
||
#define HAVE_SNPRINTF | ||
|
||
#define HAVE_STRUCT_CMSGHDR | ||
|
||
#define ESPIDF_VERSION 1 | ||
|
||
#endif /* COAP_CONFIG_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* coap_config.h.lwip -- LwIP configuration for libcoap | ||
* | ||
* Copyright (C) 2021 Olaf Bergmann <[email protected]> and others | ||
* Copyright (C) 2021-2022 Olaf Bergmann <[email protected]> and others | ||
* | ||
* SPDX-License-Identifier: BSD-2-Clause | ||
* | ||
|
@@ -12,31 +12,61 @@ | |
#ifndef COAP_CONFIG_H_ | ||
#define COAP_CONFIG_H_ | ||
|
||
#include <lwip/opt.h> | ||
#include <lwip/debug.h> | ||
#include <lwip/def.h> /* provide ntohs, htons */ | ||
#include "lwipopts.h" | ||
|
||
#define WITH_LWIP 1 | ||
|
||
/* Define if TinyDTLS support is to be included */ | ||
#define HAVE_LIBTINYDTLS | ||
|
||
/* Define as 1 if the system has small stack size */ | ||
#ifndef COAP_CONSTRAINED_STACK | ||
#define COAP_CONSTRAINED_STACK 1 | ||
#endif | ||
|
||
/* Define as 1 to build without TCP support. */ | ||
#ifndef COAP_DISABLE_TCP | ||
#define COAP_DISABLE_TCP 1 | ||
#define COAP_DISABLE_TCP 0 | ||
#endif | ||
|
||
/* Define as 1 if libcoap supports client mode code */ | ||
#ifndef COAP_CLIENT_SUPPORT | ||
#define COAP_CLIENT_SUPPORT 1 | ||
#endif | ||
|
||
/* Define as 1 if libcoap supports server mode code */ | ||
#ifndef COAP_SERVER_SUPPORT | ||
#define COAP_SERVER_SUPPORT 1 | ||
#endif | ||
|
||
/* Define if the system has epoll support */ | ||
#undef COAP_EPOLL_SUPPORT | ||
|
||
#define PACKAGE_NAME "@PACKAGE_NAME@" | ||
#define PACKAGE_VERSION "@PACKAGE_VERSION@" | ||
#define PACKAGE_STRING "@PACKAGE_STRING@" | ||
|
||
#define assert(x) LWIP_ASSERT("CoAP assert failed", x) | ||
|
||
/* To keep IPv6 builds happy */ | ||
#define IPV6_MULTICAST_HOPS 0x301 | ||
#define IPV6_PKTINFO IPV6_CHECKSUM | ||
|
||
/* To keep IPv6 builds happy */ | ||
#define OPTVAL_T(t) (t) | ||
#define OPTVAL_GT(t) (t) | ||
|
||
/* it's just provided by libc. i hope we don't get too many of those, as | ||
* actually we'd need autotools again to find out what environment we're | ||
* building in */ | ||
#define HAVE_STRNLEN 1 | ||
|
||
#define HAVE_LIMITS_H | ||
|
||
#define HAVE_SNPRINTF | ||
|
||
#define HAVE_STRUCT_CMSGHDR | ||
|
||
#define ESPIDF_VERSION 1 | ||
|
||
#endif /* COAP_CONFIG_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.