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