• 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 IP6 service.
32  */
33 
34 #ifndef CONFIG_IP6_H_
35 #define CONFIG_IP6_H_
36 
37 /**
38  * @addtogroup config-ip6
39  *
40  * @brief
41  *   This module includes configuration variables for the IP6 service.
42  *
43  * @{
44  */
45 
46 #include "config/border_routing.h"
47 #include "config/misc.h"
48 
49 /**
50  * @def OPENTHREAD_CONFIG_IP6_MAX_EXT_UCAST_ADDRS
51  *
52  * The maximum number of supported IPv6 addresses allows to be externally added.
53  */
54 #ifndef OPENTHREAD_CONFIG_IP6_MAX_EXT_UCAST_ADDRS
55 #define OPENTHREAD_CONFIG_IP6_MAX_EXT_UCAST_ADDRS 4
56 #endif
57 
58 /**
59  * @def OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS
60  *
61  * The maximum number of supported IPv6 multicast addresses allows to be externally added.
62  */
63 #ifndef OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS
64 #define OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS 2
65 #endif
66 
67 /**
68  * @def OPENTHREAD_CONFIG_IP6_HOP_LIMIT_DEFAULT
69  *
70  * This setting configures the default hop limit of IPv6.
71  */
72 #ifndef OPENTHREAD_CONFIG_IP6_HOP_LIMIT_DEFAULT
73 #define OPENTHREAD_CONFIG_IP6_HOP_LIMIT_DEFAULT 64
74 #endif
75 
76 /**
77  * @def OPENTHREAD_CONFIG_IP6_MAX_DATAGRAM_LENGTH
78  *
79  * This setting configures the max datagram length of IPv6.
80  */
81 #ifndef OPENTHREAD_CONFIG_IP6_MAX_DATAGRAM_LENGTH
82 #define OPENTHREAD_CONFIG_IP6_MAX_DATAGRAM_LENGTH 1280
83 #endif
84 
85 /**
86  * @def OPENTHREAD_CONFIG_ENABLE_IP6_FRAGMENTATION
87  *
88  * Define as 1 to enable IPv6 Fragmentation support.
89  */
90 #ifndef OPENTHREAD_CONFIG_IP6_FRAGMENTATION_ENABLE
91 #define OPENTHREAD_CONFIG_IP6_FRAGMENTATION_ENABLE 0
92 #endif
93 
94 /**
95  * @def OPENTHREAD_CONFIG_IP6_MAX_ASSEMBLED_DATAGRAM
96  *
97  * This setting configures the max datagram length of a unfragmented IPv6 packet.
98  */
99 #ifndef OPENTHREAD_CONFIG_IP6_MAX_ASSEMBLED_DATAGRAM
100 #define OPENTHREAD_CONFIG_IP6_MAX_ASSEMBLED_DATAGRAM 2000
101 #endif
102 
103 /**
104  * @def OPENTHREAD_CONFIG_IP6_REASSEMBLY_TIMEOUT
105  *
106  * This setting configures the reassembly timeout for IPv6 in seconds.
107  *
108  * RFC 2460 \> 60 seconds
109  */
110 #ifndef OPENTHREAD_CONFIG_IP6_REASSEMBLY_TIMEOUT
111 #define OPENTHREAD_CONFIG_IP6_REASSEMBLY_TIMEOUT 60
112 #endif
113 
114 /**
115  * @def OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE
116  *
117  * Define as 1 to enable support for adding of auto-configured SLAAC addresses by OpenThread.
118  */
119 #ifndef OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE
120 #define OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE 0
121 #endif
122 
123 /**
124  * @def OPENTHREAD_CONFIG_IP6_SLAAC_NUM_ADDRESSES
125  *
126  * The number of auto-configured SLAAC addresses. Applicable only if OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE is enabled.
127  */
128 #ifndef OPENTHREAD_CONFIG_IP6_SLAAC_NUM_ADDRESSES
129 #define OPENTHREAD_CONFIG_IP6_SLAAC_NUM_ADDRESSES 4
130 #endif
131 
132 /**
133  * @def OPENTHREAD_CONFIG_IP6_SLAAC_DEPRECATION_INTERVAL
134  *
135  * Specifies the deprecating time of SLAAC addresses in seconds.
136  *
137  * Applicable only if OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE is enabled.
138  *
139  * Deprecating interval is used once an on-mesh prefix is removed from Network Data before removing the SLAAC address.
140  */
141 #ifndef OPENTHREAD_CONFIG_IP6_SLAAC_DEPRECATION_INTERVAL
142 #define OPENTHREAD_CONFIG_IP6_SLAAC_DEPRECATION_INTERVAL 300
143 #endif
144 
145 /**
146  * @def OPENTHREAD_CONFIG_MPL_SEED_SET_ENTRIES
147  *
148  * The number of MPL Seed Set entries for duplicate detection.
149  */
150 #ifndef OPENTHREAD_CONFIG_MPL_SEED_SET_ENTRIES
151 #define OPENTHREAD_CONFIG_MPL_SEED_SET_ENTRIES 35
152 #endif
153 
154 /**
155  * @def OPENTHREAD_CONFIG_MPL_SEED_SET_ENTRY_LIFETIME
156  *
157  * The MPL Seed Set entry lifetime in seconds.
158  */
159 #ifndef OPENTHREAD_CONFIG_MPL_SEED_SET_ENTRY_LIFETIME
160 #define OPENTHREAD_CONFIG_MPL_SEED_SET_ENTRY_LIFETIME 5
161 #endif
162 
163 /**
164  * @def OPENTHREAD_CONFIG_MPL_DYNAMIC_INTERVAL_ENABLE
165  *
166  * Define as 1 to enable dynamic MPL interval feature.
167  *
168  * If this feature is enabled, the MPL forward interval will be adjusted dynamically according to
169  * the network scale, which helps to reduce multicast latency.
170  */
171 #ifndef OPENTHREAD_CONFIG_MPL_DYNAMIC_INTERVAL_ENABLE
172 #define OPENTHREAD_CONFIG_MPL_DYNAMIC_INTERVAL_ENABLE 0
173 #endif
174 
175 /**
176  * @def OPENTHREAD_CONFIG_TCP_ENABLE
177  *
178  * Define as 1 to enable TCP.
179  */
180 #ifndef OPENTHREAD_CONFIG_TCP_ENABLE
181 #define OPENTHREAD_CONFIG_TCP_ENABLE 1
182 #endif
183 
184 /**
185  * @def OPENTHREAD_CONFIG_TLS_ENABLE
186  *
187  * Define as 1 to enable support for TLS over TCP.
188  */
189 #ifndef OPENTHREAD_CONFIG_TLS_ENABLE
190 #define OPENTHREAD_CONFIG_TLS_ENABLE (OPENTHREAD_CONFIG_TCP_ENABLE || OPENTHREAD_CONFIG_BLE_TCAT_ENABLE)
191 #endif
192 
193 /**
194  * @def OPENTHREAD_CONFIG_IP6_ALLOW_LOOP_BACK_HOST_DATAGRAMS
195  *
196  * Define as 1 to allow IPv6 datagrams from Host to be looped back to Host.
197  */
198 #ifndef OPENTHREAD_CONFIG_IP6_ALLOW_LOOP_BACK_HOST_DATAGRAMS
199 #define OPENTHREAD_CONFIG_IP6_ALLOW_LOOP_BACK_HOST_DATAGRAMS 1
200 #endif
201 
202 /**
203  * @def OPENTHREAD_CONFIG_IP6_BR_COUNTERS_ENABLE
204  *
205  * Define as 1 to enable IPv6 Border Routing counters.
206  */
207 #ifndef OPENTHREAD_CONFIG_IP6_BR_COUNTERS_ENABLE
208 #define OPENTHREAD_CONFIG_IP6_BR_COUNTERS_ENABLE OPENTHREAD_CONFIG_BORDER_ROUTING_ENABLE
209 #endif
210 
211 /**
212  * @def OPENTHREAD_CONFIG_IP6_RESTRICT_FORWARDING_LARGER_SCOPE_MCAST_WITH_LOCAL_SRC
213  *
214  * Define as 1 to restrict multicast forwarding to larger scope from local sources.
215  */
216 #ifndef OPENTHREAD_CONFIG_IP6_RESTRICT_FORWARDING_LARGER_SCOPE_MCAST_WITH_LOCAL_SRC
217 #define OPENTHREAD_CONFIG_IP6_RESTRICT_FORWARDING_LARGER_SCOPE_MCAST_WITH_LOCAL_SRC 0
218 #endif
219 
220 /**
221  * @}
222  */
223 
224 #endif // CONFIG_IP6_H_
225