[nat64] implement nat64 translator (ot::Nat64::Translator) (#7836)

This commit:

- implements the core logic for translating packets for NAT64,
  including the public APIs exposed to platform daemons.

- includes changes for POSIX platform, use `OT_POSIX_NAT64_CIDR`,
  `OPENTHREAD_POSIX_CONFIG_NAT64_CIDR` for setting the CIDR for NAT64
  during build time.

- exposes `otNat64Send(otInstance *aInstance, otMessage *aMessage)`
  and `void otNat64SetReceiveIp4Callback(otInstance *aInstance,
  otNat64ReceiveIp4Callback aCallback, void *aContext)`.
This commit is contained in:
Song GUO
2022-08-18 22:28:26 -07:00
committed by GitHub
parent 20aee3fa70
commit e84f05c641
32 changed files with 1343 additions and 22 deletions
+1
View File
@@ -13,6 +13,7 @@ This page lists the available common switches with description. Unless stated ot
| 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. |
+5
View File
@@ -73,6 +73,7 @@ MLE_LONG_ROUTES ?= 0
MLR ?= 0
MTD_NETDIAG ?= 0
MULTIPLE_INSTANCE ?= 0
NAT64_TRANSLATOR ?= 0
NEIGHBOR_DISCOVERY_AGENT ?= 0
NETDATA_PUBLISHER ?= 0
OTNS ?= 0
@@ -121,6 +122,10 @@ ifeq ($(BORDER_ROUTING_NAT64),1)
COMMONCFLAGS += -DOPENTHREAD_CONFIG_BORDER_ROUTING_NAT64_ENABLE=1
endif
ifeq ($(NAT64_TRANSLATOR),1)
COMMONCFLAGS += -DOPENTHREAD_CONFIG_NAT64_TRANSLATOR_ENABLE=1
endif
ifeq ($(COAP),1)
COMMONCFLAGS += -DOPENTHREAD_CONFIG_COAP_API_ENABLE=1
endif