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