# otNat64AddressMapping Struct Reference

# otNat64AddressMapping


`#include <openthread/nat64.h>`

Represents an address mapping record for NAT64.

## Summary


> [!NOTE]
> **Note:** The counters will be reset for each mapping session even for the same address pair. Applications can use `mId` to identify different sessions to calculate the packets correctly.

<br />

| ### Public attributes ||
|---|---|
| `https://openthread.io/reference/struct/ot-nat64-address-mapping#structot_nat64_address_mapping_1a0592513cd3b5fff5ba6c8d361fee94a4` | `https://openthread.io/reference/struct/ot-nat64-protocol-counters` Counters. |
| `https://openthread.io/reference/struct/ot-nat64-address-mapping#structot_nat64_address_mapping_1a5cb4aeaf91ea26006ed3978c43d9c21f` | `uint64_t` The unique id for a mapping session. |
| `https://openthread.io/reference/struct/ot-nat64-address-mapping#structot_nat64_address_mapping_1a1585b54b17b90f879ca8a038fdb03005` | `https://openthread.io/reference/struct/ot-ip4-address` The IPv4 address of the mapping. |
| `https://openthread.io/reference/struct/ot-nat64-address-mapping#structot_nat64_address_mapping_1a465438451bbaa1484e17a2a99648e01d` | `https://openthread.io/reference/struct/ot-ip6-address` The IPv6 address of the mapping. |
| `https://openthread.io/reference/struct/ot-nat64-address-mapping#structot_nat64_address_mapping_1adc21f5e27b34c4e80becf6d6d5c65e62` | `uint32_t` Remaining time in milliseconds before the entry expires. |
| `https://openthread.io/reference/struct/ot-nat64-address-mapping#structot_nat64_address_mapping_1a9eb9b191914c682b0fd829e3ecac61bf` | `uint16_t` The source port or ICMP ID of the mapping. |
| `https://openthread.io/reference/struct/ot-nat64-address-mapping#structot_nat64_address_mapping_1ae9d93e4952dfd4f15f21e6f7d3241eb5` | `uint16_t` The translated port or ICMP ID of the mapping. |

## Public attributes

### mCounters

```
otNat64ProtocolCounters otNat64AddressMapping::mCounters
```
Counters.

### mId

```
uint64_t otNat64AddressMapping::mId
```
The unique id for a mapping session.

### mIp4

```
otIp4Address otNat64AddressMapping::mIp4
```
The IPv4 address of the mapping.

### mIp6

```
otIp6Address otNat64AddressMapping::mIp6
```
The IPv6 address of the mapping.

### mRemainingTimeMs

```
uint32_t otNat64AddressMapping::mRemainingTimeMs
```
Remaining time in milliseconds before the entry expires.

The remaining time is relative to the initialization of the `https://openthread.io/reference/struct/ot-nat64-address-mapping-iterator`, i.e., when `https://openthread.io/reference/group/api-nat64#group__api-nat64_1ga6ccdefe59eb89f72755b52df94c27e9a` was called.

### mSrcPortOrId

```
uint16_t otNat64AddressMapping::mSrcPortOrId
```
The source port or ICMP ID of the mapping.

Used when OPENTHREAD_CONFIG_NAT64_PORT_TRANSLATION_ENABLE is true.

### mTranslatedPortOrId

```
uint16_t otNat64AddressMapping::mTranslatedPortOrId
```
The translated port or ICMP ID of the mapping.

Used when OPENTHREAD_CONFIG_NAT64_PORT_TRANSLATION_ENABLE is true.

## Resources

OpenThread API Reference topics originate from the source code, available
on [GitHub](https://github.com/openthread/openthread/tree/main/include/openthread).
For more information, or to contribute to our documentation, refer to
[Resources](https://openthread.io/resources).