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