---
title: llarp::layers::platform::PlatformAddr
summary: a (ipv6 address, flowlabel) tuple that we use for platform layer side addressing 

---

# llarp::layers::platform::PlatformAddr



a (ipv6 address, flowlabel) tuple that we use for platform layer side addressing 


`#include <driver_base.hpp>`

## Public Functions

|                | Name           |
| -------------- | -------------- |
| | **[PlatformAddr](Classes/structllarp_1_1layers_1_1platform_1_1PlatformAddr.md#function-platformaddr)**(net::ipaddr_t ip_, std::optional< net::flowlabel_t > flow_ =std::nullopt)<br>construct from ip address, ipv4 addresses are converted to mapped addresses.  |
| std::string | **[ToString](Classes/structllarp_1_1layers_1_1platform_1_1PlatformAddr.md#function-tostring)**() const<br>string representation  |

## Public Attributes

|                | Name           |
| -------------- | -------------- |
| net::ipv6addr_t | **[ip](Classes/structllarp_1_1layers_1_1platform_1_1PlatformAddr.md#variable-ip)** <br>our local ip to use in the mapping  |
| net::flowlabel_t | **[flow](Classes/structllarp_1_1layers_1_1platform_1_1PlatformAddr.md#variable-flow)** <br>flowlabel, ingored if ip is a v4 mapped address this is used as a metric to do flow layer isolation where we can use different identities and / or paths on each.  |

## Public Functions Documentation

### function PlatformAddr

```cpp
PlatformAddr(
    net::ipaddr_t ip_,
    std::optional< net::flowlabel_t > flow_ =std::nullopt
)
```

construct from ip address, ipv4 addresses are converted to mapped addresses. 

optional flow label can be given, constructor will throw if we give it a flow label with an ipv4 address or ipv6 mapped address. 


### function ToString

```cpp
std::string ToString() const
```

string representation 

## Public Attributes Documentation

### variable ip

```cpp
net::ipv6addr_t ip;
```

our local ip to use in the mapping 

### variable flow

```cpp
net::flowlabel_t flow {};
```

flowlabel, ingored if ip is a v4 mapped address this is used as a metric to do flow layer isolation where we can use different identities and / or paths on each. 

defaults to zero. 


-------------------------------

Updated on 2023-01-23 at 14:22:33 +0000