RIOT: Update to use SOCK i/f, not Posix

Remove all references to Posix functions, using Sock functions as appropriate.

Update coap_address_t to be RIOT specific when doing RIOT builds.
This commit is contained in:
Jon Shallow authored and Jon Shallow committed 2024-03-12 17:15:01 +00:00
1 parent 11d8e7cd72
commit e25cf94d2a
28 files changed
+994 -250

No files matched your search

+12 -2
View File
@@ -14,7 +14,7 @@ if KCONFIG_USEPKG_LIBCOAP
choice LIBCOAP_DEBUG_LEVEL
bool "Set CoAP debugging level"
default LIBCOAP_LOG_WARNING
default LIBCOAP_LOG_INFO
help
Set CoAP debugging level
@@ -57,6 +57,7 @@ config LIBCOAP_IPV4_SUPPORT
Enable IPv4 functionality for CoAP.
If this option is disabled, redundant CoAP IPv4 code is removed.
[RIOT sock gnrc does not support this]
config LIBCOAP_IPV6_SUPPORT
bool "Enable IPv6 support within CoAP"
@@ -66,6 +67,8 @@ config LIBCOAP_IPV6_SUPPORT
If this option is disabled, redundant CoAP IPv6 code is removed.
if USEMODULE_SOCK_TCP
config LIBCOAP_TCP_SUPPORT
bool "Enable TCP support within CoAP"
default n
@@ -74,15 +77,22 @@ config LIBCOAP_TCP_SUPPORT
are to be used. Note that RIOT TCP support also needs to be enabled.
If this option is disabled, redundant CoAP TCP code is removed.
[RIOT sock gnrc does not support this]
endif # USEMODULE_SOCK_TCP
if USEMODULE_LIBCOAP_OSCORE
config LIBCOAP_OSCORE_SUPPORT
bool "Enable OSCORE support within CoAP"
default n
default y
help
Enable OSCORE functionality for CoAP.
If this option is disabled, redundant CoAP OSCORE code is removed.
endif # MODULE_LIBCOAP_OSCORE
config LIBCOAP_OBSERVE_PERSIST
bool "Enable Observe persist support within CoAP"
default n
+14 -5
View File
@@ -1,6 +1,6 @@
PKG_NAME=libcoap
PKG_URL=https://github.com/obgm/libcoap
PKG_VERSION=adcc8e833404dfdd79a8aceb907a747436fa55ab
PKG_VERSION=11d8e7cd72df78c9a56d6f5f6e7cf3cc469c99de
PKG_LICENSE=BSD-2-Clause
LIBCOAP_BUILD_DIR=$(BINDIR)/pkg/$(PKG_NAME)
@@ -9,7 +9,16 @@ LIBCOAP_INCLUDE_DIR=$(RIOTBASE)/build/pkg/$(PKG_NAME)/include/coap3
include $(RIOTBASE)/pkg/pkg.mk
all:
@cp $(LIBCOAP_SOURCE_DIR)/coap_config.h.riot $(LIBCOAP_SOURCE_DIR)/coap_config.h
@cp $(LIBCOAP_INCLUDE_DIR)/coap.h.riot $(LIBCOAP_INCLUDE_DIR)/coap.h
"$(MAKE)" -C $(LIBCOAP_SOURCE_DIR)/src -f $(CURDIR)/Makefile.libcoap
ifneq (,$(filter libcoap_oscore,$(USEMODULE)))
all: libcoap libcoap_oscore
else
all: libcoap
endif
libcoap:
$(QQ)@cp $(LIBCOAP_SOURCE_DIR)/coap_config.h.riot $(LIBCOAP_SOURCE_DIR)/coap_config.h
$(QQ)@cp $(LIBCOAP_INCLUDE_DIR)/coap.h.riot $(LIBCOAP_INCLUDE_DIR)/coap.h
$(QQ)"$(MAKE)" -C $(LIBCOAP_SOURCE_DIR)/src -f $(CURDIR)/Makefile.libcoap
libcoap_oscore:
$(QQ)"$(MAKE)" -C $(LIBCOAP_SOURCE_DIR)/src/oscore -f $(CURDIR)/Makefile.oscore
+6 -5
View File
@@ -1,10 +1,11 @@
USEMODULE += posix_sockets
USEMODULE += posix_headers
USEMODULE += posix_inet
USEMODULE += posix_select
USEMODULE += sock_udp
CFLAGS += -DPOSIX_SETSOCKOPT
USEMODULE += sock_aux_local
USEMODULE += sock_async_event
ifneq (,$(filter libcoap,$(USEPKG)))
USEMODULE += libcoap
endif
ifneq (,$(filter libcoap_oscore,$(USEPKG)))
USEMODULE += libcoap_oscore
endif
+10
View File
@@ -0,0 +1,10 @@
MODULE := libcoap_oscore
SRC := \
oscore.c \
oscore_cbor.c \
oscore_context.c \
oscore_cose.c \
oscore_crypto.c
include $(RIOTBASE)/Makefile.base