---
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 <platform_addr.hpp>`

## Public Functions

|                | Name           |
| -------------- | -------------- |
| | **[PlatformAddr](Classes/structllarp_1_1layers_1_1platform_1_1PlatformAddr.md#function-platformaddr)**() =default |
| | **[PlatformAddr](Classes/structllarp_1_1layers_1_1platform_1_1PlatformAddr.md#function-platformaddr)**(const [PlatformAddr](Classes/structllarp_1_1layers_1_1platform_1_1PlatformAddr.md) & ) =default |
| | **[PlatformAddr](Classes/structllarp_1_1layers_1_1platform_1_1PlatformAddr.md#function-platformaddr)**([PlatformAddr](Classes/structllarp_1_1layers_1_1platform_1_1PlatformAddr.md) && ) =default |
| [PlatformAddr](Classes/structllarp_1_1layers_1_1platform_1_1PlatformAddr.md) & | **[operator=](Classes/structllarp_1_1layers_1_1platform_1_1PlatformAddr.md#function-operator=)**(const [PlatformAddr](Classes/structllarp_1_1layers_1_1platform_1_1PlatformAddr.md) & ) =default |
| [PlatformAddr](Classes/structllarp_1_1layers_1_1platform_1_1PlatformAddr.md) & | **[operator=](Classes/structllarp_1_1layers_1_1platform_1_1PlatformAddr.md#function-operator=)**([PlatformAddr](Classes/structllarp_1_1layers_1_1platform_1_1PlatformAddr.md) && ) =default |
| | **[PlatformAddr](Classes/structllarp_1_1layers_1_1platform_1_1PlatformAddr.md#function-platformaddr)**(net::ipaddr_t addr) |
| | **[PlatformAddr](Classes/structllarp_1_1layers_1_1platform_1_1PlatformAddr.md#function-platformaddr)**(const std::string & str) |
| | **[PlatformAddr](Classes/structllarp_1_1layers_1_1platform_1_1PlatformAddr.md#function-platformaddr)**([huint128_t](Classes/structllarp_1_1huint__t.md) addr) |
| std::string | **[ToString](Classes/structllarp_1_1layers_1_1platform_1_1PlatformAddr.md#function-tostring)**() const<br>string representation  |
| net::ipaddr_t | **[as_ipaddr_t](Classes/structllarp_1_1layers_1_1platform_1_1PlatformAddr.md#function-as-ipaddr-t)**() const<br>convert to variant. compacts to ipv4 if it is a mapped address.  |
| bool | **[operator==](Classes/structllarp_1_1layers_1_1platform_1_1PlatformAddr.md#function-operator==)**(const [PlatformAddr](Classes/structllarp_1_1layers_1_1platform_1_1PlatformAddr.md) & other) const |
| bool | **[operator!=](Classes/structllarp_1_1layers_1_1platform_1_1PlatformAddr.md#function-operator!=)**(const [PlatformAddr](Classes/structllarp_1_1layers_1_1platform_1_1PlatformAddr.md) & other) const |
| bool | **[operator<](Classes/structllarp_1_1layers_1_1platform_1_1PlatformAddr.md#function-operator<)**(const [PlatformAddr](Classes/structllarp_1_1layers_1_1platform_1_1PlatformAddr.md) & other) const |

## Public Attributes

|                | Name           |
| -------------- | -------------- |
| net::ipv6addr_t | **[ip](Classes/structllarp_1_1layers_1_1platform_1_1PlatformAddr.md#variable-ip)** <br>ip network address  |
| net::flowlabel_t | **[flowlabel](Classes/structllarp_1_1layers_1_1platform_1_1PlatformAddr.md#variable-flowlabel)** <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() =default
```


### function PlatformAddr

```cpp
PlatformAddr(
    const PlatformAddr & 
) =default
```


### function PlatformAddr

```cpp
PlatformAddr(
    PlatformAddr && 
) =default
```


### function operator=

```cpp
PlatformAddr & operator=(
    const PlatformAddr & 
) =default
```


### function operator=

```cpp
PlatformAddr & operator=(
    PlatformAddr && 
) =default
```


### function PlatformAddr

```cpp
explicit PlatformAddr(
    net::ipaddr_t addr
)
```


### function PlatformAddr

```cpp
explicit PlatformAddr(
    const std::string & str
)
```


### function PlatformAddr

```cpp
explicit PlatformAddr(
    huint128_t addr
)
```


### function ToString

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

string representation 

### function as_ipaddr_t

```cpp
net::ipaddr_t as_ipaddr_t() const
```

convert to variant. compacts to ipv4 if it is a mapped address. 

### function operator==

```cpp
bool operator==(
    const PlatformAddr & other
) const
```


### function operator!=

```cpp
bool operator!=(
    const PlatformAddr & other
) const
```


### function operator<

```cpp
bool operator<(
    const PlatformAddr & other
) const
```


## Public Attributes Documentation

### variable ip

```cpp
net::ipv6addr_t ip {};
```

ip network address 

### variable flowlabel

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

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-03-06 at 20:36:34 +0000