libcoap 4.3.5-develop-146e0bb
Loading...
Searching...
No Matches
coap_internal.h
Go to the documentation of this file.
1/*
2 * coap_internal.h -- Structures, Enums & Functions that are not exposed to
3 * application programming
4 *
5 * Copyright (C) 2019-2026 Jon Shallow <supjps-libcoap@jpshallow.com>
6 *
7 * SPDX-License-Identifier: BSD-2-Clause
8 *
9 * This file is part of the CoAP library libcoap. Please see README for terms
10 * of use.
11 */
12
13/*
14 * All libcoap library files should include this file which then pulls in all
15 * of the other appropriate header files.
16 *
17 * Note: This file should never be included in application code (with the
18 * possible exception of internal test suites).
19 */
20
26#ifndef COAP_INTERNAL_H_
27#define COAP_INTERNAL_H_
28
29#include "coap_config.h"
30
31/*
32 * Correctly set up assert() based on NDEBUG for libcoap
33 */
34#if defined(HAVE_ASSERT_H) && !defined(assert)
35# include <assert.h>
36#endif
37
38#if defined(HAVE_ERRNO_H)
39# include <errno.h>
40#endif
41
42#if defined(HAVE_LIMITS_H)
43# include <limits.h>
44#endif
45
46#ifdef HAVE_INTTYPES_H
47#include <inttypes.h>
48#else /* ! HAVE_INTTYPES_H */
49#ifndef PRIx32
50#define PRIx32 "x"
51#endif /* ! PRIx32 */
52#ifndef PRIu32
53#define PRIu32 "u"
54#endif /* ! PRIu32 */
55#ifndef PRIx64
56#define PRIx64 "lx"
57#endif /* ! PRIx64 */
58#ifndef PRIu64
59#define PRIu64 "lu"
60#endif /* ! PRIu64 */
61#endif /* ! HAVE_INTTYPES_H */
62/*
63 * To handle compilers / libraries that cannot handle %zu/%zd formats.
64 * Define these separately to whatver the complier / library can work with.
65 */
66#ifndef PRIuS
67#define PRIuS "zu"
68#endif /* PRIuS */
69#ifndef PRIdS
70#define PRIdS "zd"
71#endif /* PRIdS */
72
73#if defined(HAVE_STDDEF_H)
74# include <stddef.h>
75#endif
76
77#if defined(HAVE_STDLIB_H)
78# include <stdlib.h>
79#endif
80
81#if defined(HAVE_STDINT_H)
82# include <stdint.h>
83#endif
84
85#if defined(HAVE_STDIO_H)
86# include <stdio.h>
87#endif
88
89#if defined(HAVE_STRING_H)
90# include <string.h>
91#endif
92
93#if defined(HAVE_STRINGS_H)
94# include <strings.h>
95#endif
96
97#if defined(HAVE_SYS_TYPES_H)
98# include <sys/types.h>
99#endif
100
101/* By default without either configured, these need to be set */
102#if ! COAP_SERVER_SUPPORT
103#if ! COAP_CLIENT_SUPPORT
104#define COAP_SERVER_SUPPORT 1
105#define COAP_CLIENT_SUPPORT 1
106#endif /* ! COAP_CLIENT_SUPPORT */
107#endif /* ! COAP_SERVER_SUPPORT */
108
109/* By default without either configured, these need to be set */
110#if ! COAP_IPV4_SUPPORT
111#if ! COAP_IPV6_SUPPORT
112#define COAP_IPV4_SUPPORT 1
113#define COAP_IPV6_SUPPORT 1
114#endif /* ! COAP_IPV6_SUPPORT */
115#endif /* ! COAP_IPV4_SUPPORT */
116
117#if ! COAP_SERVER_SUPPORT
118#if COAP_ASYNC_SUPPORT
119/* ASYNC is only there for Server code */
120#undef COAP_ASYNC_SUPPORT
121#define COAP_ASYNC_SUPPORT 0
122#endif /* COAP_ASYNC_SUPPORT */
123#endif /* ! COAP_SERVER_SUPPORT */
124
125#include "coap3/coap.h"
126
127/*
128 * Include all the header files that are for internal use only.
129 */
130
131#if COAP_OSCORE_SUPPORT
132/* Specific OSCORE general .h files */
133typedef struct oscore_ctx_t oscore_ctx_t;
134#include "oscore/oscore.h"
135#include "oscore/oscore_cbor.h"
136#include "oscore/oscore_cose.h"
138#include "oscore/oscore_crypto.h"
139#endif /* COAP_OSCORE_SUPPORT */
140
141/* Specifically defined internal .h files */
142#include "coap_asn1_internal.h"
143#include "coap_async_internal.h"
144#include "coap_block_internal.h"
145#include "coap_cache_internal.h"
146#if COAP_OSCORE_SUPPORT || COAP_WS_SUPPORT
147#include "coap_crypto_internal.h"
148#endif /* COAP_OSCORE_SUPPORT || COAP_WS_SUPPORT */
149#include "coap_debug_internal.h"
150#include "coap_dgrm_internal.h"
151#include "coap_dtls_internal.h"
153#include "coap_io_internal.h"
154#include "coap_layers_internal.h"
155#include "coap_mutex_internal.h"
156#include "coap_net_internal.h"
157#include "coap_netif_internal.h"
158#if COAP_OSCORE_SUPPORT
159#include "coap_oscore_internal.h"
160#endif /* COAP_OSCORE_SUPPORT */
161#include "coap_pdu_internal.h"
162#include "coap_prng_internal.h"
163#include "coap_proxy_internal.h"
166#include "coap_sha1_internal.h"
167#include "coap_strm_internal.h"
170#include "coap_uri_internal.h"
171#include "coap_utlist_internal.h"
172#include "coap_uthash_internal.h"
173#include "coap_ws_internal.h"
174
175#endif /* COAP_INTERNAL_H_ */
Primary include file.
CoAP ASN.1 internal information.
CoAP async internal information.
CoAP block internal information.
CoAP cache internal information.
COAP crypto internal information.
CoAP Logging support internal information.
CoAP Datagram (UDP) internal information.
Internal CoAP DTLS support.
Definition of hash key type and helper functions.
Internal network I/O functions.
Internal layer I/O functions.
CoAP mutex mechanism wrapper.
CoAP context internal information.
Internal CoAP Netif support.
CoAP OSCORE internal information.
CoAP PDU internal information.
Internal Pseudo Random Numbers.
CoAP Proxy internal information.
Generic resource internal handling.
CoAP session internal information.
Provides SHA1 support for WebSockets.
CoAP Stream (TCP) internal information.
CoAP subscribe internal information.
CoAP mapping of locking functions.
CoAP URI internal information.
Internal CoAP WebSockets support.
An implementation of the Object Security for Constrained RESTful Environments (RFC 8613).
An implementation of the Concise Binary Object Representation (RFC).
An implementation of the Object Security for Constrained RESTful Enviornments (RFC 8613).
An implementation of the CBOR Object Signing and Encryption (RFC).
An implementation of the Hash Based Key Derivation Function (RFC) and wrappers for AES-CCM*.