-
Notifications
You must be signed in to change notification settings - Fork 70
/
avs_coap_config.h.in
185 lines (167 loc) · 5.97 KB
/
avs_coap_config.h.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
/*
* Copyright 2017-2024 AVSystem <[email protected]>
* AVSystem CoAP library
* All rights reserved.
*
* Licensed under the AVSystem-5-clause License.
* See the attached LICENSE file for details.
*/
#ifndef AVS_COAP_CONFIG_H
#define AVS_COAP_CONFIG_H
/**
* @file avs_coap_config.h
*
* avs_coap library configuration.
*
* The preferred way to compile avs_coap is to use CMake, in which case this
* file will be generated automatically by CMake.
*
* However, to provide compatibility with various build systems used especially
* by embedded platforms, it is alternatively supported to compile avs_coap by
* other means, in which case this file will need to be provided manually.
*
* <strong>NOTE: To compile this library without using CMake, you need to
* configure avs_commons first. Please refer to documentation in the
* <c>avs_commons_config.h</c> file (provided in the repository as
* <c>avs_commons_config.h.in</c>) for details.</strong>
*
* <strong>avs_coap requires the following avs_commons components to be
* enabled:</strong>
*
* - @c avs_buffer
* - @c avs_compat_threading
* - @c avs_list
* - @c avs_net
* - @c avs_sched
* - @c avs_stream
* - @c avs_utils
* - @c avs_log (if @c WITH_AVS_COAP_LOGS is enabled)
* - @c avs_persistence (if @c WITH_AVS_COAP_OBSERVE_PERSISTENCE is enabled)
* - @c avs_crypto (if @c WITH_AVS_COAP_OSCORE is enabled)
*
* In the repository, this file is provided as <c>avs_coap_config.h.in</c>,
* intended to be processed by CMake. If editing this file manually, please copy
* or rename it to <c>avs_coap_config.h</c> and for each of the
* <c>\#cmakedefine</c> directives, please either replace it with regular
* <c>\#define</c> to enable it, or comment it out to disable. You may also need
* to replace variables wrapped in <c>\@</c> signs with concrete values. Please
* refer to the comments above each of the specific definition for details.
*
* If you are editing a file previously generated by CMake, these
* <c>\#cmakedefine</c>s will be already replaced by either <c>\#define</c> or
* commented out <c>\#undef</c> directives.
*/
/**
* Enable support for block-wise transfers (RFC 7959).
*
* If this flag is disabled, attempting to send a message bigger than the
* internal buffer will fail; incoming messages may still carry BLOCK1 or BLOCK2
* options, but they will not be interpreted by the library in any way.
*/
#cmakedefine WITH_AVS_COAP_BLOCK
/**
* Enable support for observations (RFC 7641).
*/
#cmakedefine WITH_AVS_COAP_OBSERVE
/**
* Turn on cancelling observation on a timeout.
*
* Only meaningful if <c>WITH_AVS_COAP_OBSERVE</c> is enabled.
*
* NOTE: LwM2M specification requires LwM2M server to send Cancel Observation
* request. Meanwhile CoAP RFC 7641 states that timeout on notification should
* cancel it. This setting is to enable both of these behaviors with default
* focused on keeping observations in case of bad connectivity.
*/
#cmakedefine WITH_AVS_COAP_OBSERVE_CANCEL_ON_TIMEOUT
/**
* Force cancelling observation, even if a confirmable notification yielding
* an error response is not acknowledged or rejected with RST by the observer.
*
* This is a circumvention for some non-compliant servers that respond with an
* RST message to a confirmable notification yielding an error response. This
* setting makes the library cancel the observation in such cases, even though
* the notification is formally rejected. Additionally, it will also make the
* library cancel the observation if no response is received at all.
*/
#cmakedefine WITH_AVS_COAP_OBSERVE_FORCE_CANCEL_ON_UNACKED_ERROR
/**
* Enable support for observation persistence (<c>avs_coap_observe_persist()</c>
* and <c>avs_coap_observe_restore()</c> calls).
*
* Only meaningful if <c>WITH_AVS_COAP_OBSERVE</c> is enabled.
*/
#cmakedefine WITH_AVS_COAP_OBSERVE_PERSISTENCE
/**
* Enable support for the streaming API
*/
#cmakedefine WITH_AVS_COAP_STREAMING_API
/**
* Enable support for UDP transport.
*
* NOTE: Enabling at least one transport is necessary for the library to be
* useful.
*/
#cmakedefine WITH_AVS_COAP_UDP
/**
* Enable support for TCP transport (RFC 8323).
*
* NOTE: Enabling at least one transport is necessary for the library to be
* useful.
*/
#cmakedefine WITH_AVS_COAP_TCP
/**
* Enable support for OSCORE (RFC 8613).
*
* IMPORTANT: Only available with the OSCORE feature. Ignored in the open
* source version.
*/
#cmakedefine WITH_AVS_COAP_OSCORE
/**
* Use OSCORE version from draft-ietf-core-object-security-08 instead of the
* final version (RFC 8613).
*
* Only meaningful if <c>WITH_AVS_COAP_OSCORE</c> is enabled.
*
* IMPORTANT: Only available with the OSCORE feature. Ignored in the open
* source version.
*/
#cmakedefine WITH_AVS_COAP_OSCORE_DRAFT_8
/**
* Maximum number of notification tokens stored to match Reset responses to.
*
* Only meaningful if <c>WITH_AVS_COAP_OBSERVE</c> and <c>WITH_AVS_COAP_UDP</c>
* are enabled.
*
* If editing this file manually, <c>@COAP_UDP_NOTIFY_CACHE_SIZE@</c> shall be
* replaced with a positive integer literal. The default value defined in CMake
* build scripts is 4.
*/
#define AVS_COAP_UDP_NOTIFY_CACHE_SIZE @COAP_UDP_NOTIFY_CACHE_SIZE@
/**
* Enable sending diagnostic payload in error responses.
*/
#cmakedefine WITH_AVS_COAP_DIAGNOSTIC_MESSAGES
/**
* Enable logging in avs_coap.
*
* If this flag is disabled, no logging is compiled into the binary at all.
*/
#cmakedefine WITH_AVS_COAP_LOGS
/**
* Enable TRACE-level logs in avs_coap.
*
* Only meaningful if <c>WITH_AVS_COAP_LOGS</c> is enabled.
*/
#cmakedefine WITH_AVS_COAP_TRACE_LOGS
/**
* Enable poisoning of unwanted symbols when compiling avs_coap.
*
* Requires a compiler that supports <c>\#pragma GCC poison</c>.
*
* This is mostly useful during development, to ensure that avs_commons do not
* attempt to call functions considered harmful in this library, such as printf.
* This is not guaranteed to work as intended on every platform.
*/
#cmakedefine WITH_AVS_COAP_POISONING
#endif // AVS_COAP_CONFIG_H