mirror of
https://github.com/obgm/libcoap.git
synced 2026-12-02 10:57:08 +03:00
DTLS Libraries: Replace HAVE_<dtlslib> defines with COAP_WITH_<dtls_lib>
Prevents possibility of name clashes when integrating with other code / OS.
This commit is contained in:
1 parent
5c1e7cae34
commit
2f4b8843cd
17 files changed
+93
-93
No files matched your search
@@ -168,7 +168,7 @@ SD_COAP_OBJ =$(patsubst %.c,lib-server-dtls/%.o,$(COAP_SRC))
|
||||
|
||||
vpath %.c $(libcoap_dir)/ext/tinydtls $(libcoap_dir)/ext/tinydtls/sha2 $(libcoap_dir)/ext/tinydtls/aes $(libcoap_dir)/ext/tinydtls/ecc
|
||||
|
||||
TINYDTLS_CFLAGS = -I. -I$(libcoap_dir)/ext -I$(libcoap_dir)/ext/tinydtls -DDTLSv12 -DWITH_SHA256 -DSHA2_USE_INTTYPES_H -DDTLS_CHECK_CONTENTTYPE -DHAVE_LIBTINYDTLS -DHAVE_DTLS_SET_LOG_HANDLER=1
|
||||
TINYDTLS_CFLAGS = -I. -I$(libcoap_dir)/ext -I$(libcoap_dir)/ext/tinydtls -DDTLSv12 -DWITH_SHA256 -DSHA2_USE_INTTYPES_H -DDTLS_CHECK_CONTENTTYPE -DCOAP_WITH_LIBTINYDTLS -DHAVE_DTLS_SET_LOG_HANDLER=1
|
||||
|
||||
DTLS_SRC = dtls.c \
|
||||
dtls_debug.c \
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include "coap3/coap_net.h"
|
||||
#include "coap3/resource.h"
|
||||
#include "coap3/coap_subscribe.h"
|
||||
#ifdef HAVE_LIBTINYDTLS
|
||||
#ifdef COAP_WITH_LIBTINYDTLS
|
||||
#ifndef LWIP_TINYDTLS_LOCAL_FIX
|
||||
#define LWIP_TINYDTLS_LOCAL_FIX
|
||||
#include <lwip/ip_addr.h>
|
||||
@@ -36,18 +36,18 @@ typedef struct l_coap_tiny_context_t {
|
||||
} l_coap_tiny_context_t;
|
||||
|
||||
#endif /* LWIP_TINYDTLS_LOCAL_FIX */
|
||||
#endif /* HAVE_LIBTINYDTLS */
|
||||
#endif /* COAP_WITH_LIBTINYDTLS */
|
||||
|
||||
#ifndef MEMP_NUM_COAPCONTEXT
|
||||
#define MEMP_NUM_COAPCONTEXT 1
|
||||
#endif
|
||||
|
||||
#ifndef MEMP_NUM_COAPENDPOINT
|
||||
#ifdef HAVE_LIBTINYDTLS
|
||||
#ifdef COAP_WITH_LIBTINYDTLS
|
||||
#define MEMP_NUM_COAPENDPOINT 2
|
||||
#else /* ! HAVE_LIBTINYDTLS */
|
||||
#else /* ! COAP_WITH_LIBTINYDTLS */
|
||||
#define MEMP_NUM_COAPENDPOINT 1
|
||||
#endif /* ! HAVE_LIBTINYDTLS */
|
||||
#endif /* ! COAP_WITH_LIBTINYDTLS */
|
||||
#endif
|
||||
|
||||
/* 1 is sufficient as this is very short-lived */
|
||||
@@ -163,7 +163,7 @@ LWIP_MEMPOOL(COAP_LG_CRCV, MEMP_NUM_COAPLGCRCV, sizeof(coap_lg_crcv_t), "COAP_LG
|
||||
LWIP_MEMPOOL(COAP_LG_SRCV, MEMP_NUM_COAPLGSRCV, sizeof(coap_lg_srcv_t), "COAP_LG_SRCV")
|
||||
LWIP_MEMPOOL(COAP_DIGEST_CTX, MEMP_NUM_COAPDIGESTCTX, sizeof(coap_digest_t) + sizeof(size_t), "COAP_DIGEST_CTX")
|
||||
#endif /* COAP_SERVER_SUPPORT */
|
||||
#ifdef HAVE_LIBTINYDTLS
|
||||
#ifdef COAP_WITH_LIBTINYDTLS
|
||||
LWIP_MEMPOOL(COAP_DTLS_SESSION, MEMP_NUM_COAPDTLS_SESSION, sizeof(l_session_t), "COAP_DTLS_SESSION")
|
||||
LWIP_MEMPOOL(COAP_DTLS_CONTEXT, MEMP_NUM_COAPDTLS_CONTEXT, sizeof(l_coap_tiny_context_t), "COAP_DTLS_CONTEXT")
|
||||
#endif /* HAVE_LIBTINYDTLS */
|
||||
#endif /* COAP_WITH_LIBTINYDTLS */
|
||||
@@ -34,7 +34,7 @@ SRC := coap_address.c \
|
||||
coap_ws.c
|
||||
|
||||
ifneq (,$(filter libcoap_tinydtls,$(USEMODULE)))
|
||||
CFLAGS += -DHAVE_LIBTINYDTLS
|
||||
CFLAGS += -DCOAP_WITH_LIBTINYDTLS
|
||||
endif
|
||||
|
||||
include $(RIOTBASE)/Makefile.base
|
||||
Reference in new issue
Block a user