[nat64] change BORDER_ROUTING_NAT64 to NAT64_BORDER_ROUTING (#8047)

We decided to rename BORDER_ROUTING_NAT64 to NAT64_BORDER_ROUTING so
the flag won't be confusing since we have NAT64_TRANSLATOR which does
not depends on the border routing manager.
This commit is contained in:
Song GUO
2022-08-31 12:05:28 +08:00
committed by GitHub
parent 3d60038bcb
commit bce7c1ae1f
24 changed files with 122 additions and 77 deletions

View File

@ -77,7 +77,6 @@ ot_option(OT_BACKBONE_ROUTER_MULTICAST_ROUTING OPENTHREAD_CONFIG_BACKBONE_ROUTER
ot_option(OT_BORDER_AGENT OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE "border agent")
ot_option(OT_BORDER_ROUTER OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE "border router")
ot_option(OT_BORDER_ROUTING OPENTHREAD_CONFIG_BORDER_ROUTING_ENABLE "border routing")
ot_option(OT_BORDER_ROUTING_NAT64 OPENTHREAD_CONFIG_BORDER_ROUTING_NAT64_ENABLE "border routing NAT64")
ot_option(OT_CHANNEL_MANAGER OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE "channel manager")
ot_option(OT_CHANNEL_MONITOR OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE "channel monitor")
ot_option(OT_CHILD_SUPERVISION OPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE "child supervision")
@ -115,6 +114,7 @@ ot_option(OT_MLE_LONG_ROUTES OPENTHREAD_CONFIG_MLE_LONG_ROUTES_ENABLE "MLE long
ot_option(OT_MLR OPENTHREAD_CONFIG_MLR_ENABLE "Multicast Listener Registration (MLR)")
ot_option(OT_MTD_NETDIAG OPENTHREAD_CONFIG_TMF_NETWORK_DIAG_MTD_ENABLE "TMF network diagnostics on MTDs")
ot_option(OT_MULTIPLE_INSTANCE OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE "multiple instances")
ot_option(OT_NAT64_BORDER_ROUTING OPENTHREAD_CONFIG_NAT64_BORDER_ROUTING_ENABLE "border routing NAT64")
ot_option(OT_NAT64_TRANSLATOR OPENTHREAD_CONFIG_NAT64_TRANSLATOR_ENABLE "NAT64 translator support")
ot_option(OT_NEIGHBOR_DISCOVERY_AGENT OPENTHREAD_CONFIG_NEIGHBOR_DISCOVERY_AGENT_ENABLE "neighbor discovery agent")
ot_option(OT_NETDATA_PUBLISHER OPENTHREAD_CONFIG_NETDATA_PUBLISHER_ENABLE "Network Data publisher")

View File

@ -12,8 +12,6 @@ This page lists the available common switches with description. Unless stated ot
| BORDER_AGENT | OT_BORDER_AGENT | Enables support for border agent. In most cases, enable this switch if you are building On-mesh Commissioner or Border Router with External Commissioning support. |
| BORDER_ROUTER | OT_BORDER_ROUTER | Enables support for Border Router. This switch is usually combined with the BORDER_AGENT and UDP_FORWARD (or PLATFORM_UDP in case of RCP design) switches to build Border Router device. |
| BORDER_ROUTING | OT_BORDER_ROUTING | Enables bi-directional border routing between Thread and Infrastructure networks for Border Router. |
| BORDER_ROUTING_NAT64 | OT_BORDER_ROUTING_NAT64 | Enables NAT64 border routing support for Border Router. |
| NAT64_TRANSLATOR | OT_NAT64_TRANSLATOR | Enables NAT64 translator for Border Router. |
| BUILTIN_MBEDTLS_MANAGEMENT | OT_BUILTIN_MBEDTLS_MANAGEMENT | Enables the built-in mbedTLS management. Enable this switch if the external mbedTLS is used, but mbedTLS memory allocation and debug config should be managed internally by OpenThread. |
| CHANNEL_MANAGER | OT_CHANNEL_MANAGER | Enables support for channel manager. Enable this switch on devices that are supposed to request a Thread network channel change. This switch should be used only with an FTD build. |
| CHANNEL_MONITOR | OT_CHANNEL_MONITOR | Enables support for channel monitor. Enable this switch on devices that are supposed to determine the cleaner channels. |
@ -55,6 +53,8 @@ This page lists the available common switches with description. Unless stated ot
| MLR | OT_MLR | Enables Multicast Listener Registration feature for Thread 1.2. |
| MTD_NETDIAG | OT_MTD_NETDIAG | Enables the TMF network diagnostics on MTDs. |
| MULTIPLE_INSTANCE | OT_MULTIPLE_INSTANCE | Enables multiple OpenThread instances. |
| NAT64_BORDER_ROUTING | OT_NAT64_BORDER_ROUTING | Enables NAT64 border routing support for Border Router. |
| NAT64_TRANSLATOR | OT_NAT64_TRANSLATOR | Enables NAT64 translator for Border Router. |
| NETDATA_PUBLISHER | OT_NETDATA_PUBLISHER | Enables support for Thread Network Data publisher. |
| PING_SENDER | OT_PING_SENDER | Enables support for ping sender. |
| OTNS | OT_OTNS | Enables support for [OpenThread Network Simulator](https://github.com/openthread/ot-ns). Enable this switch if you are building OpenThread for OpenThread Network Simulator. |

View File

@ -34,7 +34,6 @@ BIG_ENDIAN ?= 0
BORDER_AGENT ?= 0
BORDER_ROUTER ?= 0
BORDER_ROUTING ?= 0
BORDER_ROUTING_NAT64 ?= 0
COAP ?= 0
COAP_BLOCK ?= 0
COAP_OBSERVE ?= 0
@ -73,6 +72,7 @@ MLE_LONG_ROUTES ?= 0
MLR ?= 0
MTD_NETDIAG ?= 0
MULTIPLE_INSTANCE ?= 0
NAT64_BORDER_ROUTING ?= 0
NAT64_TRANSLATOR ?= 0
NEIGHBOR_DISCOVERY_AGENT ?= 0
NETDATA_PUBLISHER ?= 0
@ -118,8 +118,8 @@ ifeq ($(BORDER_ROUTING),1)
COMMONCFLAGS += -DOPENTHREAD_CONFIG_BORDER_ROUTING_ENABLE=1
endif
ifeq ($(BORDER_ROUTING_NAT64),1)
COMMONCFLAGS += -DOPENTHREAD_CONFIG_BORDER_ROUTING_NAT64_ENABLE=1
ifeq ($(NAT64_BORDER_ROUTING),1)
COMMONCFLAGS += -DOPENTHREAD_CONFIG_NAT64_BORDER_ROUTING_ENABLE=1
endif
ifeq ($(NAT64_TRANSLATOR),1)

View File

@ -216,7 +216,7 @@ otError otBorderRoutingGetOnLinkPrefix(otInstance *aInstance, otIp6Prefix *aPref
*
* NAT64 Prefix might not be advertised in the Thread network.
*
* `OPENTHREAD_CONFIG_BORDER_ROUTING_NAT64_ENABLE` must be enabled.
* `OPENTHREAD_CONFIG_NAT64_BORDER_ROUTING_ENABLE` must be enabled.
*
* @param[in] aInstance A pointer to an OpenThread instance.
* @param[out] aPrefix A pointer to where the prefix will be output to.

View File

@ -53,7 +53,7 @@ extern "C" {
* @note This number versions both OpenThread platform and user APIs.
*
*/
#define OPENTHREAD_API_VERSION (239)
#define OPENTHREAD_API_VERSION (240)
/**
* @addtogroup api-instance

View File

@ -46,7 +46,7 @@ extern "C" {
* @addtogroup api-nat64
*
* @brief This module includes functions and structs for the NAT64 function on the border router. These functions are
* only available when `OPENTHREAD_CONFIG_BORDER_ROUTING_NAT64_ENABLE` is enabled.
* only available when `OPENTHREAD_CONFIG_NAT64_BORDER_ROUTING_ENABLE` is enabled.
*
* @{
*

View File

@ -37,8 +37,6 @@ readonly OT_BUILD_OPTIONS=(
"-DOT_BORDER_AGENT=ON"
"-DOT_BORDER_ROUTER=ON"
"-DOT_BORDER_ROUTING=ON"
"-DOT_BORDER_ROUTING_NAT64=ON"
"-DOT_NAT64_TRANSLATOR=ON"
"-DOT_COAP=ON"
"-DOT_COAP_BLOCK=ON"
"-DOT_COAP_OBSERVE=ON"
@ -64,6 +62,8 @@ readonly OT_BUILD_OPTIONS=(
"-DOT_LOG_LEVEL_DYNAMIC=ON"
"-DOT_MAC_FILTER=ON"
"-DOT_MTD_NETDIAG=ON"
"-DOT_NAT64_BORDER_ROUTING=ON"
"-DOT_NAT64_TRANSLATOR=ON"
"-DOT_NEIGHBOR_DISCOVERY_AGENT=ON"
"-DOT_PING_SENDER=ON"
"-DOT_PLATFORM=external"

View File

@ -95,7 +95,7 @@ build_all_features()
local options_1_3=(
"-DOPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE=1"
"-DOPENTHREAD_CONFIG_BORDER_ROUTING_NAT64_ENABLE=1"
"-DOPENTHREAD_CONFIG_NAT64_BORDER_ROUTING_ENABLE=1"
"-DOPENTHREAD_CONFIG_NAT64_TRANSLATOR_ENABLE=1"
"-DOPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE=1"
"-DOPENTHREAD_CONFIG_DUA_ENABLE=1"

View File

@ -57,7 +57,7 @@ build_all_features()
local options=(
"-DOT_BACKBONE_ROUTER=ON"
"-DOT_BORDER_ROUTING=ON"
"-DOT_BORDER_ROUTING_NAT64=ON"
"-DOT_NAT64_BORDER_ROUTING=ON"
"-DOT_NAT64_TRANSLATOR=ON"
"-DOT_CSL_RECEIVER=ON"
"-DOT_MLR=ON"

View File

@ -83,8 +83,6 @@ readonly OT_CLANG_TIDY_BUILD_OPTS=(
'-DOT_BORDER_AGENT=ON'
'-DOT_BORDER_ROUTER=ON'
'-DOT_BORDER_ROUTING=ON'
'-DOT_BORDER_ROUTING_NAT64=ON'
'-DOT_NAT64_TRANSLATOR=ON'
'-DOT_CHANNEL_MANAGER=ON'
'-DOT_CHANNEL_MONITOR=ON'
'-DOT_CHILD_SUPERVISION=ON'
@ -114,6 +112,8 @@ readonly OT_CLANG_TIDY_BUILD_OPTS=(
'-DOT_LINK_METRICS_SUBJECT=ON'
'-DOT_MAC_FILTER=ON'
'-DOT_MTD_NETDIAG=ON'
'-DOT_NAT64_BORDER_ROUTING=ON'
'-DOT_NAT64_TRANSLATOR=ON'
'-DOT_NETDATA_PUBLISHER=ON'
'-DOT_PING_SENDER=ON'
'-DOT_REFERENCE_DEVICE=ON'

View File

@ -297,9 +297,9 @@ do_build_otbr_docker()
fi
if [[ ${NAT64} == 1 ]]; then
otbr_options+=("-DOTBR_BORDER_ROUTING_NAT64=ON")
otbr_options+=("-DOT_NAT64_BORDER_ROUTING=ON")
else
otbr_options+=("-DOTBR_BORDER_ROUTING_NAT64=OFF")
otbr_options+=("-DOT_NAT64_BORDER_ROUTING=OFF")
fi
local otbr_docker_image=${OTBR_DOCKER_IMAGE:-otbr-ot12-backbone-ci}

View File

@ -386,7 +386,7 @@ Done
Get the local NAT64 prefix of the Border Router.
`OPENTHREAD_CONFIG_BORDER_ROUTING_NAT64_ENABLE` is required.
`OPENTHREAD_CONFIG_NAT64_BORDER_ROUTING_ENABLE` is required.
```bash
> br nat64prefix

View File

@ -585,7 +585,7 @@ template <> otError Interpreter::Process<Cmd("br")>(Arg aArgs[])
SuccessOrExit(error = otBorderRoutingGetOnLinkPrefix(GetInstancePtr(), &onLinkPrefix));
OutputIp6PrefixLine(onLinkPrefix);
}
#if OPENTHREAD_CONFIG_BORDER_ROUTING_NAT64_ENABLE
#if OPENTHREAD_CONFIG_NAT64_BORDER_ROUTING_ENABLE
/**
* @cli br nat64prefix
* @code
@ -622,7 +622,7 @@ template <> otError Interpreter::Process<Cmd("br")>(Arg aArgs[])
OutputIp6Prefix(prefix);
OutputLine(" prf:%s", PreferenceToString(preference));
}
#endif // OPENTHREAD_CONFIG_BORDER_ROUTING_NAT64_ENABLE
#endif // OPENTHREAD_CONFIG_NAT64_BORDER_ROUTING_ENABLE
/**
* @cli br rioprf (high,med,low)
* @code

View File

@ -785,6 +785,7 @@ source_set("libopenthread_core_config") {
"config/mac.h",
"config/misc.h",
"config/mle.h",
"config/nat64.h",
"config/netdata_publisher.h",
"config/openthread-core-config-check.h",
"config/parent_search.h",

View File

@ -508,6 +508,7 @@ HEADERS_COMMON = \
config/mac.h \
config/misc.h \
config/mle.h \
config/nat64.h \
config/netdata_publisher.h \
config/openthread-core-config-check.h \
config/parent_search.h \

View File

@ -89,7 +89,7 @@ otError otBorderRoutingGetOnLinkPrefix(otInstance *aInstance, otIp6Prefix *aPref
return AsCoreType(aInstance).Get<BorderRouter::RoutingManager>().GetOnLinkPrefix(AsCoreType(aPrefix));
}
#if OPENTHREAD_CONFIG_BORDER_ROUTING_NAT64_ENABLE
#if OPENTHREAD_CONFIG_NAT64_BORDER_ROUTING_ENABLE
otError otBorderRoutingGetNat64Prefix(otInstance *aInstance, otIp6Prefix *aPrefix)
{
return AsCoreType(aInstance).Get<BorderRouter::RoutingManager>().GetNat64Prefix(AsCoreType(aPrefix));

View File

@ -127,7 +127,7 @@ void InfraIf::DiscoverNat64PrefixDone(uint32_t aIfIndex, const Ip6::Prefix &aPre
VerifyOrExit(mInitialized && mIsRunning, error = kErrorInvalidState);
VerifyOrExit(aIfIndex == mIfIndex, error = kErrorInvalidArgs);
#if OPENTHREAD_CONFIG_BORDER_ROUTING_NAT64_ENABLE
#if OPENTHREAD_CONFIG_NAT64_BORDER_ROUTING_ENABLE
Get<RoutingManager>().UpdateInfraIfNat64Prefix(aPrefix);
#endif

View File

@ -71,7 +71,7 @@ RoutingManager::RoutingManager(Instance &aInstance)
, mRouteInfoOptionPreference(NetworkData::kRoutePreferenceMedium)
, mLocalOnLinkPrefix(aInstance)
, mDiscoveredPrefixTable(aInstance)
#if OPENTHREAD_CONFIG_BORDER_ROUTING_NAT64_ENABLE
#if OPENTHREAD_CONFIG_NAT64_BORDER_ROUTING_ENABLE
, mInfraIfNat64PrefixStaleTimer(aInstance, HandleInfraIfNat64PrefixStaleTimer)
#endif
, mDiscoveredPrefixStaleTimer(aInstance, HandleDiscoveredPrefixStaleTimer)
@ -82,7 +82,7 @@ RoutingManager::RoutingManager(Instance &aInstance)
mFavoredDiscoveredOnLinkPrefix.Clear();
mBrUlaPrefix.Clear();
#if OPENTHREAD_CONFIG_BORDER_ROUTING_NAT64_ENABLE
#if OPENTHREAD_CONFIG_NAT64_BORDER_ROUTING_ENABLE
mInfraIfNat64Prefix.Clear();
mLocalNat64Prefix.Clear();
mAdvertisedNat64Prefix.Clear();
@ -97,7 +97,7 @@ Error RoutingManager::Init(uint32_t aInfraIfIndex, bool aInfraIfIsRunning)
SuccessOrExit(error = LoadOrGenerateRandomBrUlaPrefix());
mLocalOmrPrefix.GenerateFrom(mBrUlaPrefix);
#if OPENTHREAD_CONFIG_BORDER_ROUTING_NAT64_ENABLE
#if OPENTHREAD_CONFIG_NAT64_BORDER_ROUTING_ENABLE
GenerateNat64Prefix();
#endif
mLocalOnLinkPrefix.Generate();
@ -175,7 +175,7 @@ exit:
return error;
}
#if OPENTHREAD_CONFIG_BORDER_ROUTING_NAT64_ENABLE
#if OPENTHREAD_CONFIG_NAT64_BORDER_ROUTING_ENABLE
Error RoutingManager::GetNat64Prefix(Ip6::Prefix &aPrefix)
{
Error error = kErrorNone;
@ -234,7 +234,7 @@ exit:
return error;
}
#if OPENTHREAD_CONFIG_BORDER_ROUTING_NAT64_ENABLE
#if OPENTHREAD_CONFIG_NAT64_BORDER_ROUTING_ENABLE
void RoutingManager::DiscoverInfraIfNat64Prefix(void)
{
Error error = kErrorNone;
@ -297,7 +297,7 @@ void RoutingManager::Start(void)
UpdateDiscoveredPrefixTableOnNetDataChange();
mLocalOnLinkPrefix.Start();
StartRouterSolicitationDelay();
#if OPENTHREAD_CONFIG_BORDER_ROUTING_NAT64_ENABLE
#if OPENTHREAD_CONFIG_NAT64_BORDER_ROUTING_ENABLE
mInfraIfNat64PrefixStaleTimer.Start(0);
#endif
}
@ -314,7 +314,7 @@ void RoutingManager::Stop(void)
mLocalOnLinkPrefix.Stop();
#if OPENTHREAD_CONFIG_BORDER_ROUTING_NAT64_ENABLE
#if OPENTHREAD_CONFIG_NAT64_BORDER_ROUTING_ENABLE
if (mAdvertisedNat64Prefix.IsValidNat64())
{
UnpublishExternalRoute(mAdvertisedNat64Prefix);
@ -574,7 +574,7 @@ exit:
return;
}
#if OPENTHREAD_CONFIG_BORDER_ROUTING_NAT64_ENABLE
#if OPENTHREAD_CONFIG_NAT64_BORDER_ROUTING_ENABLE
void RoutingManager::EvaluateNat64Prefix(void)
{
Ip6::Prefix nat64Prefix;
@ -629,7 +629,7 @@ void RoutingManager::EvaluateRoutingPolicy(void)
// 0. Evaluate on-link, OMR and NAT64 prefixes.
EvaluateOnLinkPrefix();
EvaluateOmrPrefix();
#if OPENTHREAD_CONFIG_BORDER_ROUTING_NAT64_ENABLE
#if OPENTHREAD_CONFIG_NAT64_BORDER_ROUTING_ENABLE
EvaluateNat64Prefix();
#endif
@ -1042,7 +1042,7 @@ void RoutingManager::HandleRoutingPolicyTimer(Timer &aTimer)
aTimer.Get<RoutingManager>().EvaluateRoutingPolicy();
}
#if OPENTHREAD_CONFIG_BORDER_ROUTING_NAT64_ENABLE
#if OPENTHREAD_CONFIG_NAT64_BORDER_ROUTING_ENABLE
void RoutingManager::HandleInfraIfNat64PrefixStaleTimer(Timer &aTimer)
{
aTimer.Get<RoutingManager>().HandleInfraIfNat64PrefixStaleTimer();

View File

@ -188,7 +188,7 @@ public:
*/
Error GetOnLinkPrefix(Ip6::Prefix &aPrefix);
#if OPENTHREAD_CONFIG_BORDER_ROUTING_NAT64_ENABLE
#if OPENTHREAD_CONFIG_NAT64_BORDER_ROUTING_ENABLE
/**
* This method returns the local NAT64 prefix.
*
@ -221,7 +221,7 @@ public:
*
*/
void UpdateInfraIfNat64Prefix(const Ip6::Prefix &aPrefix);
#endif // OPENTHREAD_CONFIG_BORDER_ROUTING_NAT64_ENABLE
#endif // OPENTHREAD_CONFIG_NAT64_BORDER_ROUTING_ENABLE
/**
* This method processes a received ICMPv6 message from the infrastructure interface.
@ -640,7 +640,7 @@ private:
void EvaluateOnLinkPrefix(void);
#if OPENTHREAD_CONFIG_BORDER_ROUTING_NAT64_ENABLE
#if OPENTHREAD_CONFIG_NAT64_BORDER_ROUTING_ENABLE
void DiscoverInfraIfNat64Prefix(void);
void GenerateNat64Prefix(void);
void EvaluateNat64Prefix(void);
@ -664,7 +664,7 @@ private:
static void HandleDiscoveredPrefixStaleTimer(Timer &aTimer);
void HandleDiscoveredPrefixStaleTimer(void);
static void HandleRoutingPolicyTimer(Timer &aTimer);
#if OPENTHREAD_CONFIG_BORDER_ROUTING_NAT64_ENABLE
#if OPENTHREAD_CONFIG_NAT64_BORDER_ROUTING_ENABLE
static void HandleInfraIfNat64PrefixStaleTimer(Timer &aTimer);
void HandleInfraIfNat64PrefixStaleTimer(void);
#endif
@ -714,7 +714,7 @@ private:
DiscoveredPrefixTable mDiscoveredPrefixTable;
#if OPENTHREAD_CONFIG_BORDER_ROUTING_NAT64_ENABLE
#if OPENTHREAD_CONFIG_NAT64_BORDER_ROUTING_ENABLE
// The latest NAT64 prefix discovered on the infrastructure interface.
Ip6::Prefix mInfraIfNat64Prefix;
// The NAT64 prefix allocated from the /48 BR ULA prefix.

View File

@ -71,34 +71,4 @@
#define OPENTHREAD_CONFIG_BORDER_ROUTER_REQUEST_ROUTER_ROLE 1
#endif
/**
* @def OPENTHREAD_CONFIG_NAT64_TRANSLATOR_ENABLE
*
* Define to 1 to enable the internal NAT64 translator.
*
*/
#ifndef OPENTHREAD_CONFIG_NAT64_TRANSLATOR_ENABLE
#define OPENTHREAD_CONFIG_NAT64_TRANSLATOR_ENABLE 0
#endif
/**
* @def OPENTHREAD_CONFIG_NAT64_MAX_MAPPINGS
*
* Specifies maximum number of active mappings for NAT64.
*
*/
#ifndef OPENTHREAD_CONFIG_NAT64_MAX_MAPPINGS
#define OPENTHREAD_CONFIG_NAT64_MAX_MAPPINGS 254
#endif
/**
* @def OPENTHREAD_CONFIG_NAT64_IDLE_TIMEOUT_SECONDS
*
* Specifies timeout in seconds before removing an inactive address mapping.
*
*/
#ifndef OPENTHREAD_CONFIG_NAT64_IDLE_TIMEOUT_SECONDS
#define OPENTHREAD_CONFIG_NAT64_IDLE_TIMEOUT_SECONDS 7200
#endif
#endif // CONFIG_BORDER_ROUTER_H_

View File

@ -76,14 +76,4 @@
#define OPENTHREAD_CONFIG_BORDER_ROUTING_MAX_ON_MESH_PREFIXES 16
#endif
/**
* @def OPENTHREAD_CONFIG_BORDER_ROUTING_NAT64_ENABLE
*
* Define to 1 to enable Border Routing NAT64 support.
*
*/
#ifndef OPENTHREAD_CONFIG_BORDER_ROUTING_NAT64_ENABLE
#define OPENTHREAD_CONFIG_BORDER_ROUTING_NAT64_ENABLE 0
#endif
#endif // CONFIG_BORDER_ROUTING_H_

78
src/core/config/nat64.h Normal file
View File

@ -0,0 +1,78 @@
/*
* Copyright (c) 2022, The OpenThread Authors.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/**
* @file
* This file includes compile-time configurations for NAT64.
*
*/
#ifndef CONFIG_NAT64_H_
#define CONFIG_NAT64_H_
/**
* @def OPENTHREAD_CONFIG_NAT64_TRANSLATOR_ENABLE
*
* Define to 1 to enable the internal NAT64 translator.
*
*/
#ifndef OPENTHREAD_CONFIG_NAT64_TRANSLATOR_ENABLE
#define OPENTHREAD_CONFIG_NAT64_TRANSLATOR_ENABLE 0
#endif
/**
* @def OPENTHREAD_CONFIG_NAT64_MAX_MAPPINGS
*
* Specifies maximum number of active mappings for NAT64.
*
*/
#ifndef OPENTHREAD_CONFIG_NAT64_MAX_MAPPINGS
#define OPENTHREAD_CONFIG_NAT64_MAX_MAPPINGS 254
#endif
/**
* @def OPENTHREAD_CONFIG_NAT64_IDLE_TIMEOUT_SECONDS
*
* Specifies timeout in seconds before removing an inactive address mapping.
*
*/
#ifndef OPENTHREAD_CONFIG_NAT64_IDLE_TIMEOUT_SECONDS
#define OPENTHREAD_CONFIG_NAT64_IDLE_TIMEOUT_SECONDS 7200
#endif
/**
* @def OPENTHREAD_CONFIG_NAT64_BORDER_ROUTING_ENABLE
*
* Define to 1 to enable NAT64 support in Border Routing Manager.
*
*/
#ifndef OPENTHREAD_CONFIG_NAT64_BORDER_ROUTING_ENABLE
#define OPENTHREAD_CONFIG_NAT64_BORDER_ROUTING_ENABLE 0
#endif
#endif

View File

@ -632,4 +632,8 @@
"OPENTHREAD_CONFIG_SRP_CLIENT_UPDATE_TX_MIN_DELAY and OPENTHREAD_CONFIG_SRP_CLIENT_UPDATE_TX_MAX_DELAY"
#endif
#ifdef OPENTHREAD_CONFIG_BORDER_ROUTING_NAT64_ENABLE
#error "OPENTHREAD_CONFIG_BORDER_ROUTING_NAT64_ENABLE was replaced by OPENTHREAD_CONFIG_NAT64_BORDER_ROUTING_ENABLE"
#endif
#endif // OPENTHREAD_CORE_CONFIG_CHECK_H_

View File

@ -84,6 +84,7 @@
#include "config/mac.h"
#include "config/misc.h"
#include "config/mle.h"
#include "config/nat64.h"
#include "config/netdata_publisher.h"
#include "config/parent_search.h"
#include "config/ping_sender.h"