• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *  Copyright (c) 2019, 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  * @file
31  *   This file includes compile-time configurations for the Thread Management Framework service.
32  */
33 
34 #ifndef CONFIG_TMF_H_
35 #define CONFIG_TMF_H_
36 
37 /**
38  * @addtogroup config-tmf
39  *
40  * @brief
41  *   This module includes configuration variables for the Thread Management
42  *   Framework service.
43  *
44  * @{
45  */
46 
47 #include "config/border_router.h"
48 
49 /**
50  * @def OPENTHREAD_CONFIG_TMF_ADDRESS_CACHE_ENTRIES
51  *
52  * The number of EID-to-RLOC cache entries.
53  */
54 #ifndef OPENTHREAD_CONFIG_TMF_ADDRESS_CACHE_ENTRIES
55 #if OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE
56 #define OPENTHREAD_CONFIG_TMF_ADDRESS_CACHE_ENTRIES 256
57 #else
58 #define OPENTHREAD_CONFIG_TMF_ADDRESS_CACHE_ENTRIES 32
59 #endif
60 #endif
61 
62 /**
63  * @def OPENTHREAD_CONFIG_TMF_ADDRESS_CACHE_MAX_SNOOP_ENTRIES
64  *
65  * The maximum number of EID-to-RLOC cache entries that can be used for "snoop optimization" where an entry is created
66  * by inspecting a received message.
67  *
68  * By default a 1/16 fraction of `OPENTHREAD_CONFIG_TMF_ADDRESS_CACHE_ENTRIES` is used.
69  */
70 #ifndef OPENTHREAD_CONFIG_TMF_ADDRESS_CACHE_MAX_SNOOP_ENTRIES
71 #define OPENTHREAD_CONFIG_TMF_ADDRESS_CACHE_MAX_SNOOP_ENTRIES (OPENTHREAD_CONFIG_TMF_ADDRESS_CACHE_ENTRIES / 16)
72 #endif
73 
74 /**
75  * @def OPENTHREAD_CONFIG_TMF_SNOOP_CACHE_ENTRY_TIMEOUT
76  *
77  * The timeout value (in seconds) blocking eviction of an address cache entry created through snoop optimization (i.e.,
78  * inspection of a received message). After the timeout expires the entry can be reclaimed again. This timeout allows
79  * a longer response delay for a received message giving more chance that a snooped entry will be used (avoiding
80  * sending Address Query when a response message is sent to same destination from which the message was received
81  * earlier).
82  */
83 #ifndef OPENTHREAD_CONFIG_TMF_SNOOP_CACHE_ENTRY_TIMEOUT
84 #define OPENTHREAD_CONFIG_TMF_SNOOP_CACHE_ENTRY_TIMEOUT 3
85 #endif
86 
87 /**
88  * @def OPENTHREAD_CONFIG_TMF_ADDRESS_QUERY_TIMEOUT
89  *
90  * The timeout value (in seconds) waiting for a address notification response after sending an address query.
91  *
92  * Default: 3 seconds
93  */
94 #ifndef OPENTHREAD_CONFIG_TMF_ADDRESS_QUERY_TIMEOUT
95 #define OPENTHREAD_CONFIG_TMF_ADDRESS_QUERY_TIMEOUT 3
96 #endif
97 
98 /**
99  * @def OPENTHREAD_CONFIG_TMF_ADDRESS_QUERY_INITIAL_RETRY_DELAY
100  *
101  * Initial retry delay for address query (in seconds).
102  *
103  * Default: 15 seconds
104  */
105 #ifndef OPENTHREAD_CONFIG_TMF_ADDRESS_QUERY_INITIAL_RETRY_DELAY
106 #define OPENTHREAD_CONFIG_TMF_ADDRESS_QUERY_INITIAL_RETRY_DELAY 15
107 #endif
108 
109 /**
110  * @def OPENTHREAD_CONFIG_TMF_ADDRESS_QUERY_MAX_RETRY_DELAY
111  *
112  * Maximum retry delay for address query (in seconds).
113  *
114  * Default: 120 seconds
115  */
116 #ifndef OPENTHREAD_CONFIG_TMF_ADDRESS_QUERY_MAX_RETRY_DELAY
117 #define OPENTHREAD_CONFIG_TMF_ADDRESS_QUERY_MAX_RETRY_DELAY 120
118 #endif
119 
120 /**
121  * @def OPENTHREAD_CONFIG_TMF_ALLOW_ADDRESS_RESOLUTION_USING_NET_DATA_SERVICES
122  *
123  * Define as 1 to allow address resolution of on-mesh addresses using Thread Network Data DNS/SRP Service entries.
124  */
125 #ifndef OPENTHREAD_CONFIG_TMF_ALLOW_ADDRESS_RESOLUTION_USING_NET_DATA_SERVICES
126 #define OPENTHREAD_CONFIG_TMF_ALLOW_ADDRESS_RESOLUTION_USING_NET_DATA_SERVICES 1
127 #endif
128 
129 /**
130  * @def OPENTHREAD_CONFIG_TMF_PENDING_DATASET_MINIMUM_DELAY
131  *
132  * Minimum Delay Timer value for a Pending Operational Dataset (in ms).
133  *
134  * Thread specification defines this value as 30,000 ms. Changing from the specified value should be done for testing
135  * only.
136  */
137 #ifndef OPENTHREAD_CONFIG_TMF_PENDING_DATASET_MINIMUM_DELAY
138 #define OPENTHREAD_CONFIG_TMF_PENDING_DATASET_MINIMUM_DELAY 30000
139 #endif
140 
141 /**
142  * @def OPENTHREAD_CONFIG_TMF_PENDING_DATASET_DEFAULT_DELAY
143  *
144  * Default Delay Timer value for a Pending Operational Dataset (in ms).
145  *
146  * Thread specification defines this value as 300,000 ms. Changing from the specified value should be done for testing
147  * only.
148  */
149 #ifndef OPENTHREAD_CONFIG_TMF_PENDING_DATASET_DEFAULT_DELAY
150 #define OPENTHREAD_CONFIG_TMF_PENDING_DATASET_DEFAULT_DELAY 300000
151 #endif
152 
153 /**
154  * @def OPENTHREAD_CONFIG_TMF_ENERGY_SCAN_MAX_RESULTS
155  *
156  * The maximum number of Energy List entries.
157  */
158 #ifndef OPENTHREAD_CONFIG_TMF_ENERGY_SCAN_MAX_RESULTS
159 #define OPENTHREAD_CONFIG_TMF_ENERGY_SCAN_MAX_RESULTS 64
160 #endif
161 
162 /**
163  * @def OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE
164  *
165  * Define to 1 to support injecting Service entries into the Thread Network Data.
166  */
167 #ifndef OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE
168 #define OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE 0
169 #endif
170 
171 /**
172  * @def OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_MAX_ALOCS
173  *
174  * The maximum number of supported Service ALOCs registrations for this device.
175  */
176 #ifndef OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_MAX_ALOCS
177 #define OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_MAX_ALOCS 1
178 #endif
179 
180 /**
181  * @def OPENTHREAD_CONFIG_TMF_NETDIAG_CLIENT_ENABLE
182  *
183  * Define to 1 to enable TMF network diagnostics client.
184  *
185  * The network diagnostic client add API to send diagnostic requests and queries to other node and process the response.
186  * It is enabled by default on Border Routers.
187  */
188 #ifndef OPENTHREAD_CONFIG_TMF_NETDIAG_CLIENT_ENABLE
189 #define OPENTHREAD_CONFIG_TMF_NETDIAG_CLIENT_ENABLE OPENTHREAD_CONFIG_BORDER_ROUTING_ENABLE
190 #endif
191 
192 /**
193  * @def OPENTHREAD_CONFIG_TMF_ANYCAST_LOCATOR_ENABLE
194  *
195  * Define to 1 to enable TMF anycast locator functionality.
196  *
197  * This feature allows a device to determine the mesh local EID and RLOC16 of the closest destination of an anycast
198  * address (if any) through sending `TMF_ANYCAST_LOCATE` requests.
199  */
200 #ifndef OPENTHREAD_CONFIG_TMF_ANYCAST_LOCATOR_ENABLE
201 #define OPENTHREAD_CONFIG_TMF_ANYCAST_LOCATOR_ENABLE 0
202 #endif
203 
204 /**
205  * @def OPENTHREAD_CONFIG_TMF_ANYCAST_LOCATOR_SEND_RESPONSE
206  *
207  * Define to 1 to require the device to listen and respond to `TMF_ANYCAST_LOCATE` requests.
208  *
209  * This config is used only when `OPENTHREAD_CONFIG_TMF_ANYCAST_LOCATOR_ENABLE` is enabled. It is enabled by default.
210  */
211 #ifndef OPENTHREAD_CONFIG_TMF_ANYCAST_LOCATOR_SEND_RESPONSE
212 #define OPENTHREAD_CONFIG_TMF_ANYCAST_LOCATOR_SEND_RESPONSE 1
213 #endif
214 
215 /**
216  * @def OPENTHREAD_CONFIG_TMF_PROXY_DUA_ENABLE
217  *
218  * Define to 1 for Thread 1.2 FTD device to register DUA of its MTD children registered
219  * even if it doesn't enable DUA feature itself.
220  */
221 #ifndef OPENTHREAD_CONFIG_TMF_PROXY_DUA_ENABLE
222 #define OPENTHREAD_CONFIG_TMF_PROXY_DUA_ENABLE (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2)
223 #endif
224 
225 #if OPENTHREAD_CONFIG_TMF_PROXY_DUA_ENABLE && OPENTHREAD_CONFIG_THREAD_VERSION < OT_THREAD_VERSION_1_2
226 #error "Thread 1.2 or higher version is required for OPENTHREAD_CONFIG_TMF_PROXY_DUA_ENABLE"
227 #endif
228 
229 /**
230  * @def OPENTHREAD_CONFIG_TMF_PROXY_MLR_ENABLE
231  *
232  * This setting configures the Multicast Listener Registration parent proxying in Thread 1.2.
233  */
234 #ifndef OPENTHREAD_CONFIG_TMF_PROXY_MLR_ENABLE
235 #define OPENTHREAD_CONFIG_TMF_PROXY_MLR_ENABLE (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2)
236 #endif
237 
238 #if OPENTHREAD_CONFIG_TMF_PROXY_MLR_ENABLE && OPENTHREAD_CONFIG_THREAD_VERSION < OT_THREAD_VERSION_1_2
239 #error "Thread 1.2 or higher version is required for OPENTHREAD_CONFIG_TMF_PROXY_MLR_ENABLE"
240 #endif
241 
242 /**
243  * @}
244  */
245 
246 #endif // CONFIG_TMF_H_
247