• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *  Copyright (c) 2018, The OpenThread Authors.
3  *  All rights reserved.
4  *
5  *  Redistribution and use in source and binary forms, with or without
6  *  modification, are permitted provided that the following conditions are met:
7  *  1. Redistributions of source code must retain the above copyright
8  *     notice, this list of conditions and the following disclaimer.
9  *  2. Redistributions in binary form must reproduce the above copyright
10  *     notice, this list of conditions and the following disclaimer in the
11  *     documentation and/or other materials provided with the distribution.
12  *  3. Neither the name of the copyright holder nor the
13  *     names of its contributors may be used to endorse or promote products
14  *     derived from this software without specific prior written permission.
15  *
16  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17  *  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18  *  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19  *  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20  *  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21  *  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22  *  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23  *  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24  *  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25  *  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26  *  POSSIBILITY OF SUCH DAMAGE.
27  */
28 
29 /**
30  * This header file defines the OpenThread core configuration options used in NCP build for `toranj` test framework.
31  *
32  */
33 
34 #if !defined(OPENTHREAD_CORE_TORANJ_CONFIG_SIMULATION_H_) && !defined(OPENTHREAD_CORE_TORANJ_CONFIG_POSIX_H_)
35 #error "This header file should only be included through the platform-specific one"
36 #endif
37 
38 #ifndef OPENTHREAD_RADIO
39 #define OPENTHREAD_RADIO 0
40 #endif
41 
42 #ifndef OPENTHREAD_RADIO
43 #define OPENTHREAD_RADIO_CLI 0
44 #endif
45 
46 /**
47  * @def OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE
48  *
49  * Define to 1 to enable Thread Test Harness reference device support.
50  *
51  */
52 #define OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE 1
53 
54 /**
55  * @def OPENTHREAD_CONFIG_UPTIME_ENABLE
56  *
57  * Define to 1 to enable tracking the uptime of OpenThread instance.
58  *
59  */
60 #define OPENTHREAD_CONFIG_UPTIME_ENABLE 1
61 
62 /**
63  * @def OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE
64  *
65  * Define to 1 to enable Border Router support.
66  *
67  */
68 #define OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE 1
69 
70 /**
71  * @def OPENTHREAD_CONFIG_BORDER_ROUTING_ENABLE
72  *
73  * Define to 1 to enable Border Routing support.
74  *
75  */
76 #define OPENTHREAD_CONFIG_BORDER_ROUTING_ENABLE 1
77 
78 /**
79  * @def OPENTHREAD_CONFIG_COMMISSIONER_ENABLE
80  *
81  * Define to 1 to enable Commissioner support.
82  *
83  */
84 #define OPENTHREAD_CONFIG_COMMISSIONER_ENABLE 1
85 
86 /**
87  * @def OPENTHREAD_CONFIG_COMMISSIONER_MAX_JOINER_ENTRIES
88  *
89  * The maximum number of Joiner entries maintained by the Commissioner.
90  *
91  */
92 #define OPENTHREAD_CONFIG_COMMISSIONER_MAX_JOINER_ENTRIES 4
93 
94 /**
95  * @def OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE
96  *
97  * Define to 1 to enable Border Agent support.
98  *
99  */
100 #define OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE 1
101 
102 /**
103  * @def OPENTHREAD_CONFIG_DIAG_ENABLE
104  *
105  * Define to 1 to enable Factory Diagnostics support.
106  *
107  */
108 #define OPENTHREAD_CONFIG_DIAG_ENABLE 1
109 
110 /**
111  * @def OPENTHREAD_CONFIG_JOINER_ENABLE
112  *
113  * Define to 1 to enable Joiner support.
114  *
115  */
116 #define OPENTHREAD_CONFIG_JOINER_ENABLE 1
117 
118 /**
119  * @def OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE
120  *
121  * Define to 1 to support injecting Service entries into the Thread Network Data.
122  *
123  */
124 #define OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE 1
125 
126 /**
127  * @def OPENTHREAD_CONFIG_NETDATA_PUBLISHER_ENABLE
128  *
129  * Define to 1 to enable Network Data Publisher.
130  *
131  */
132 #define OPENTHREAD_CONFIG_NETDATA_PUBLISHER_ENABLE 1
133 
134 /**
135  * @def OPENTHREAD_CONFIG_TMF_ANYCAST_LOCATOR_ENABLE
136  *
137  * Define to 1 to enable TMF anycast locator functionality.
138  *
139  */
140 #define OPENTHREAD_CONFIG_TMF_ANYCAST_LOCATOR_ENABLE 1
141 
142 /**
143  * @def OPENTHREAD_CONFIG_LEGACY_ENABLE
144  *
145  * Define to 1 to enable legacy network support.
146  *
147  */
148 #define OPENTHREAD_CONFIG_LEGACY_ENABLE 1
149 
150 /**
151  * @def OPENTHREAD_CONFIG_ECDSA_ENABLE
152  *
153  * Define to 1 to enable ECDSA support.
154  *
155  */
156 #define OPENTHREAD_CONFIG_ECDSA_ENABLE 1
157 
158 /**
159  * @def OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE
160  *
161  * Define to 1 to enable the Jam Detection service.
162  *
163  */
164 #define OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE 1
165 
166 /**
167  * @def OPENTHREAD_CONFIG_NUM_MESSAGE_BUFFERS
168  *
169  * The number of message buffers in the buffer pool.
170  *
171  */
172 #define OPENTHREAD_CONFIG_NUM_MESSAGE_BUFFERS 256
173 
174 /**
175  * @def OPENTHREAD_CONFIG_MESSAGE_USE_HEAP_ENABLE
176  *
177  * Whether use heap allocator for message buffers.
178  *
179  */
180 #define OPENTHREAD_CONFIG_MESSAGE_USE_HEAP_ENABLE 0
181 
182 /**
183  * @def OPENTHREAD_CONFIG_TMF_ADDRESS_CACHE_ENTRIES
184  *
185  * The number of EID-to-RLOC cache entries.
186  *
187  */
188 #define OPENTHREAD_CONFIG_TMF_ADDRESS_CACHE_ENTRIES 16
189 
190 /**
191  * @def OPENTHREAD_CONFIG_TMF_ADDRESS_QUERY_TIMEOUT
192  *
193  * The timeout value (in seconds) waiting for a address notification response after sending an address query.
194  *
195  * Default: 3 seconds
196  *
197  */
198 #define OPENTHREAD_CONFIG_TMF_ADDRESS_QUERY_TIMEOUT 6
199 
200 /**
201  * @def OPENTHREAD_CONFIG_TMF_ADDRESS_QUERY_INITIAL_RETRY_DELAY
202  *
203  * Initial retry delay for address query (in seconds).
204  *
205  */
206 #define OPENTHREAD_CONFIG_TMF_ADDRESS_QUERY_INITIAL_RETRY_DELAY 4
207 
208 /**
209  * @def OPENTHREAD_CONFIG_TMF_ADDRESS_QUERY_MAX_RETRY_DELAY
210  *
211  * Maximum retry delay for address query (in seconds).
212  *
213  * Default: 28800 seconds (480 minutes or 8 hours)
214  *
215  */
216 #define OPENTHREAD_CONFIG_TMF_ADDRESS_QUERY_MAX_RETRY_DELAY 120
217 
218 /**
219  * @def OPENTHREAD_CONFIG_TMF_ADDRESS_CACHE_MAX_SNOOP_ENTRIES
220  *
221  * The maximum number of EID-to-RLOC cache entries that can be uses for "snoop optimization" where an entry is created
222  * by inspecting a received message.
223  *
224  */
225 #define OPENTHREAD_CONFIG_TMF_ADDRESS_CACHE_MAX_SNOOP_ENTRIES 2
226 
227 /**
228  * @def OPENTHREAD_CONFIG_TMF_SNOOP_CACHE_ENTRY_TIMEOUT
229  *
230  * The timeout value (in seconds) blocking eviction of an address cache entry created through snoop optimization (i.e.,
231  * inspection of a received message). After the timeout expires the entry can be reclaimed again. This timeout allows
232  * a longer response delay for a received message giving more chance that a snooped entry will be used (avoiding
233  * sending Address Query when a response message is sent to same destination from which the message was received
234  * earlier).
235  *
236  */
237 #define OPENTHREAD_CONFIG_TMF_SNOOP_CACHE_ENTRY_TIMEOUT 3
238 
239 /**
240  * @def OPENTHREAD_CONFIG_MLE_MAX_CHILDREN
241  *
242  * The maximum number of children.
243  *
244  */
245 #define OPENTHREAD_CONFIG_MLE_MAX_CHILDREN 32
246 
247 /**
248  * @def OPENTHREAD_CONFIG_MLE_CHILD_TIMEOUT_DEFAULT
249  *
250  * The default child timeout value (in seconds).
251  *
252  */
253 #define OPENTHREAD_CONFIG_MLE_CHILD_TIMEOUT_DEFAULT 120
254 
255 /**
256  * @def OPENTHREAD_CONFIG_MLE_IP_ADDRS_PER_CHILD
257  *
258  * The maximum number of supported IPv6 address registrations per child.
259  *
260  */
261 #define OPENTHREAD_CONFIG_MLE_IP_ADDRS_PER_CHILD 10
262 
263 /**
264  * @def OPENTHREAD_CONFIG_IP6_MAX_EXT_UCAST_ADDRS
265  *
266  * The maximum number of supported IPv6 addresses allows to be externally added.
267  *
268  */
269 #define OPENTHREAD_CONFIG_IP6_MAX_EXT_UCAST_ADDRS 8
270 
271 /**
272  * @def OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS
273  *
274  * The maximum number of supported IPv6 multicast addresses allows to be externally added.
275  *
276  */
277 #define OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS 4
278 
279 /**
280  * @def OPENTHREAD_CONFIG_MAC_FILTER_ENABLE
281  *
282  * Define to 1 to enable MAC filter support.
283  *
284  */
285 #define OPENTHREAD_CONFIG_MAC_FILTER_ENABLE 1
286 
287 /**
288  * @def OPENTHREAD_CONFIG_MAC_FILTER_SIZE
289  *
290  * The number of MAC Filter entries.
291  *
292  */
293 #define OPENTHREAD_CONFIG_MAC_FILTER_SIZE 80
294 
295 /**
296  * @def OPENTHREAD_CONFIG_LOG_LEVEL
297  *
298  * The log level (used at compile time).
299  *
300  */
301 #define OPENTHREAD_CONFIG_LOG_LEVEL OT_LOG_LEVEL_INFO
302 
303 /**
304  * @def OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE
305  *
306  * Define as 1 to enable dynamic log level control.
307  *
308  */
309 #define OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE 1
310 
311 /**
312  * @def OPENTHREAD_CONFIG_LOG_PREPEND_UPTIME
313  *
314  * Define as 1 to prepend the current uptime to all log messages.
315  *
316  */
317 #define OPENTHREAD_CONFIG_LOG_PREPEND_UPTIME 1
318 
319 /**
320  * @def OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL
321  *
322  * Define to prepend the log level to all log messages
323  *
324  */
325 #define OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL 1
326 
327 /**
328  * @def OPENTHREAD_CONFIG_LOG_SUFFIX
329  *
330  * Define suffix to append at the end of logs.
331  *
332  */
333 #define OPENTHREAD_CONFIG_LOG_SUFFIX ""
334 
335 /**
336  * @def OPENTHREAD_CONFIG_LOG_PLATFORM
337  *
338  * Define to enable platform region logging.
339  *
340  */
341 #define OPENTHREAD_CONFIG_LOG_PLATFORM 1
342 
343 /**
344  * @def OPENTHREAD_CONFIG_NCP_HDLC_ENABLE
345  *
346  * Define to 1 to enable NCP HDLC support.
347  *
348  */
349 #define OPENTHREAD_CONFIG_NCP_HDLC_ENABLE 1
350 
351 /**
352  * @def OPENTHREAD_CONFIG_NCP_TX_BUFFER_SIZE
353  *
354  *  The size of NCP message buffer in bytes
355  *
356  */
357 #define OPENTHREAD_CONFIG_NCP_TX_BUFFER_SIZE 4096
358 
359 /**
360  * @def OPENTHREAD_CONFIG_MLE_STEERING_DATA_SET_OOB_ENABLE
361  *
362  * Enable setting steering data out of band.
363  *
364  */
365 #define OPENTHREAD_CONFIG_MLE_STEERING_DATA_SET_OOB_ENABLE 1
366 
367 /**
368  * @def OPENTHREAD_CONFIG_MLE_INFORM_PREVIOUS_PARENT_ON_REATTACH
369  *
370  * Define as 1 for a child to inform its previous parent when it attaches to a new parent.
371  *
372  * If this feature is enabled, when a device attaches to a new parent, it will send an IP message (with empty payload
373  * and mesh-local IP address as the source address) to its previous parent.
374  *
375  */
376 #define OPENTHREAD_CONFIG_MLE_INFORM_PREVIOUS_PARENT_ON_REATTACH 1
377 
378 /**
379  * @def OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE
380  *
381  * Define as 1 to enable Channel Manager support.
382  *
383  */
384 #define OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE 1
385 
386 /**
387  * @def OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE
388  *
389  * Define as 1 to enable Channel Monitor support.
390  *
391  */
392 #define OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE 1
393 
394 /**
395  * @def OPENTHREAD_CONFIG_CHANNEL_MANAGER_MINIMUM_DELAY
396  *
397  * The minimum delay in seconds used by Channel Manager module for performing a channel change.
398  *
399  * The minimum delay should preferably be longer than maximum data poll interval used by all sleepy-end-devices within
400  * the Thread network.
401  *
402  * Applicable only if Channel Manager feature is enabled (i.e., `OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE` is set).
403  *
404  */
405 #define OPENTHREAD_CONFIG_CHANNEL_MANAGER_MINIMUM_DELAY 2
406 
407 /**
408  * @def OPENTHREAD_CONFIG_CHANNEL_MANAGER_THRESHOLD_TO_SKIP_FAVORED
409  *
410  * This threshold specifies the minimum occupancy rate difference between two channels for the Channel Manager to
411  * prefer an unfavored channel over the best favored one. This is used when (auto) selecting a channel based on the
412  * collected channel quality data by "channel monitor" feature.
413  *
414  * The difference is based on the `ChannelMonitor::GetChannelOccupancy()` definition which provides the average
415  * percentage of RSSI samples (within a time window) indicating that channel was busy (i.e., RSSI value higher than
416  * a threshold). Value 0 maps to 0% and 0xffff maps to 100%.
417  *
418  * Applicable only if Channel Manager feature is enabled (i.e., `OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE` is set).
419  *
420  */
421 #define OPENTHREAD_CONFIG_CHANNEL_MANAGER_THRESHOLD_TO_SKIP_FAVORED (0xffff * 7 / 100)
422 
423 /**
424  * @def OPENTHREAD_CONFIG_CHANNEL_MANAGER_THRESHOLD_TO_CHANGE_CHANNEL
425  *
426  * This threshold specifies the minimum occupancy rate difference required between the current channel and a newly
427  * selected channel for Channel Manager to allow channel change to the new channel.
428  *
429  * The difference is based on the `ChannelMonitor::GetChannelOccupancy()` definition which provides the average
430  * percentage of RSSI samples (within a time window) indicating that channel was busy (i.e., RSSI value higher than
431  * a threshold). Value 0 maps to 0% rate and 0xffff maps to 100%.
432  *
433  * Applicable only if Channel Manager feature is enabled (i.e., `OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE` is set).
434  *
435  */
436 #define OPENTHREAD_CONFIG_CHANNEL_MANAGER_THRESHOLD_TO_CHANGE_CHANNEL (0xffff * 10 / 100)
437 
438 /**
439  * @def OPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE
440  *
441  * Define to 1 to enable Child Supervision support.
442  *
443  */
444 #define OPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE 1
445 
446 /**
447  * @def OPENTHREAD_CONFIG_TMF_PENDING_DATASET_MINIMUM_DELAY
448  *
449  * Minimum Delay Timer value for a Pending Operational Dataset (in ms).
450  *
451  * Thread specification defines this value as 30,000. Changing from the specified value should be done for testing only.
452  *
453  * For `toranj` test script the value is decreased so that the tests can be run faster.
454  *
455  */
456 #define OPENTHREAD_CONFIG_TMF_PENDING_DATASET_MINIMUM_DELAY 1000
457 
458 /**
459  * @def OPENTHREAD_CONFIG_NCP_ENABLE_MCU_POWER_STATE_CONTROL
460  *
461  * Define to 1 to enable support controlling of desired power state of NCP's micro-controller.
462  *
463  * The power state specifies the desired power state of NCP's micro-controller (MCU) when the underlying platform's
464  * operating system enters idle mode (i.e., all active tasks/events are processed and the MCU can potentially enter a
465  * energy-saving power state).
466  *
467  * The power state primarily determines how the host should interact with the NCP and whether the host needs an
468  * external trigger (a "poke") before it can communicate with the NCP or not.
469  *
470  * When enabled, the platform is expected to provide `otPlatSetMcuPowerState()` and `otPlatGetMcuPowerState()`
471  * functions (please see `openthread/platform/misc.h`). Host can then control the power state using
472  * `SPINEL_PROP_MCU_POWER_STATE`.
473  *
474  */
475 #define OPENTHREAD_CONFIG_NCP_ENABLE_MCU_POWER_STATE_CONTROL 1
476 
477 /**
478  * @def OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE
479  *
480  * Define as 1 to enable support for adding of auto-configured SLAAC addresses by OpenThread.
481  *
482  */
483 #define OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE 1
484 
485 /**
486  * @def OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE
487  *
488  * Define to 1 to enable DNS Client support.
489  *
490  */
491 #define OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE 1
492 
493 /**
494  * @def OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE
495  *
496  * Define to 1 to enable SRP Client support.
497  *
498  */
499 #define OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE 1
500 
501 /**
502  * @def OPENTHREAD_CONFIG_SRP_SERVER_ENABLE
503  *
504  * Define to 1 to enable SRP Server support.
505  *
506  */
507 #define OPENTHREAD_CONFIG_SRP_SERVER_ENABLE 1
508 
509 /**
510  * @def OPENTHREAD_CONFIG_SRP_CLIENT_DOMAIN_NAME_CHANGE_ENABLE
511  *
512  * Define to 1 for the SRP client implementation to provides APIs to allow domain name to be set/changed.
513  *
514  */
515 #define OPENTHREAD_CONFIG_SRP_CLIENT_DOMAIN_NAME_API_ENABLE 1
516 
517 /**
518  * @def OPENTHREAD_CONFIG_HISTORY_TRACKER_ENABLE
519  *
520  * Define as 1 to enable History Tracker module.
521  *
522  */
523 #define OPENTHREAD_CONFIG_HISTORY_TRACKER_ENABLE 1
524 
525 /**
526  * @def OPENTHREAD_CONFIG_DNSSD_SERVER_ENABLE
527  *
528  * Define to 1 to enable DNS-SD Server support.
529  *
530  */
531 #define OPENTHREAD_CONFIG_DNSSD_SERVER_ENABLE 1
532 
533 /**
534  * @def OPENTHREAD_CONFIG_DELAY_AWARE_QUEUE_MANAGEMENT_ENABLE
535  *
536  * Define to 1 to enable delay-aware queue management for the send queue.
537  *
538  */
539 #define OPENTHREAD_CONFIG_DELAY_AWARE_QUEUE_MANAGEMENT_ENABLE 1
540 
541 #if OPENTHREAD_RADIO
542 /**
543  * @def OPENTHREAD_CONFIG_MAC_SOFTWARE_ACK_TIMEOUT_ENABLE
544  *
545  * Define to 1 if you want to enable software ACK timeout logic.
546  *
547  */
548 #define OPENTHREAD_CONFIG_MAC_SOFTWARE_ACK_TIMEOUT_ENABLE 1
549 
550 /**
551  * @def OPENTHREAD_CONFIG_MAC_SOFTWARE_RETRANSMIT_ENABLE
552  *
553  * Define to 1 if you want to enable software retransmission logic.
554  *
555  */
556 #define OPENTHREAD_CONFIG_MAC_SOFTWARE_RETRANSMIT_ENABLE 1
557 
558 /**
559  * @def OPENTHREAD_CONFIG_MAC_SOFTWARE_CSMA_BACKOFF_ENABLE
560  *
561  * Define to 1 if you want to enable software CSMA-CA backoff logic.
562  *
563  */
564 #define OPENTHREAD_CONFIG_MAC_SOFTWARE_CSMA_BACKOFF_ENABLE 1
565 
566 /**
567  * @def OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_SECURITY_ENABLE
568  *
569  * Define to 1 if you want to enable software transmission security logic.
570  *
571  */
572 #define OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_SECURITY_ENABLE 1
573 
574 /**
575  * @def OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_TIMING_ENABLE
576  *
577  * Define to 1 to enable software transmission target time logic.
578  *
579  */
580 #define OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_TIMING_ENABLE 1
581 #endif // OPENTHREAD_RADIO
582