---
title: llarp::layers::platform::AddressMapping
summary: holds all info about a platform layer to flow layer mapping. 

---

# llarp::layers::platform::AddressMapping



holds all info about a platform layer to flow layer mapping.  [More...](#detailed-description)


`#include <addr_mapper.hpp>`

## Public Functions

|                | Name           |
| -------------- | -------------- |
| bool | **[owns_range](Classes/structllarp_1_1layers_1_1platform_1_1AddressMapping.md#function-owns-range)**(const [IPRange](Classes/structllarp_1_1IPRange.md) & range) const<br>return true if we own this exact range range.  |
| bool | **[allows_ingres](Classes/structllarp_1_1layers_1_1platform_1_1AddressMapping.md#function-allows-ingres)**(const [PlatformAddr](Classes/structllarp_1_1layers_1_1platform_1_1PlatformAddr.md) & src, const [PlatformAddr](Classes/structllarp_1_1layers_1_1platform_1_1PlatformAddr.md) & dst) const<br>return true if we allow ingres (os to lokinet) traffic with this src and dst address  |
| bool | **[allows_egres](Classes/structllarp_1_1layers_1_1platform_1_1AddressMapping.md#function-allows-egres)**(const [PlatformAddr](Classes/structllarp_1_1layers_1_1platform_1_1PlatformAddr.md) & src, const [PlatformAddr](Classes/structllarp_1_1layers_1_1platform_1_1PlatformAddr.md) & dst) const<br>return true if we allow egres (lokinet to os) traffic with this src and dst address  |
| std::string | **[ToString](Classes/structllarp_1_1layers_1_1platform_1_1AddressMapping.md#function-tostring)**() const |
| bool | **[is_exit](Classes/structllarp_1_1layers_1_1platform_1_1AddressMapping.md#function-is-exit)**() const<br>helper that tells us if we permit more than just traffic to dst.  |
| | **[AddressMapping](Classes/structllarp_1_1layers_1_1platform_1_1AddressMapping.md#function-addressmapping)**() =default |
| | **[AddressMapping](Classes/structllarp_1_1layers_1_1platform_1_1AddressMapping.md#function-addressmapping)**(const [AddressMapping](Classes/structllarp_1_1layers_1_1platform_1_1AddressMapping.md) & ) =default |
| | **[AddressMapping](Classes/structllarp_1_1layers_1_1platform_1_1AddressMapping.md#function-addressmapping)**([AddressMapping](Classes/structllarp_1_1layers_1_1platform_1_1AddressMapping.md) && ) =default |
| [AddressMapping](Classes/structllarp_1_1layers_1_1platform_1_1AddressMapping.md) & | **[operator=](Classes/structllarp_1_1layers_1_1platform_1_1AddressMapping.md#function-operator=)**([AddressMapping](Classes/structllarp_1_1layers_1_1platform_1_1AddressMapping.md) && ) =default |
| [AddressMapping](Classes/structllarp_1_1layers_1_1platform_1_1AddressMapping.md) & | **[operator=](Classes/structllarp_1_1layers_1_1platform_1_1AddressMapping.md#function-operator=)**(const [AddressMapping](Classes/structllarp_1_1layers_1_1platform_1_1AddressMapping.md) & ) =default |
| bool | **[operator==](Classes/structllarp_1_1layers_1_1platform_1_1AddressMapping.md#function-operator==)**(const [AddressMapping](Classes/structllarp_1_1layers_1_1platform_1_1AddressMapping.md) & other) const |

## Public Attributes

|                | Name           |
| -------------- | -------------- |
| [flow::FlowInfo](Classes/structllarp_1_1layers_1_1flow_1_1FlowInfo.md) | **[flow_info](Classes/structllarp_1_1layers_1_1platform_1_1AddressMapping.md#variable-flow-info)** <br>the current flow layer info we are using for this mapping.  |
| [PlatformAddr](Classes/structllarp_1_1layers_1_1platform_1_1PlatformAddr.md) | **[src](Classes/structllarp_1_1layers_1_1platform_1_1AddressMapping.md#variable-src)** <br>source and destination addresses for ingres traffic we only allow ingres from src.  |
| [PlatformAddr](Classes/structllarp_1_1layers_1_1platform_1_1PlatformAddr.md) | **[dst](Classes/structllarp_1_1layers_1_1platform_1_1AddressMapping.md#variable-dst)**  |
| std::vector< [IPRange](Classes/structllarp_1_1IPRange.md) > | **[owned_ranges](Classes/structllarp_1_1layers_1_1platform_1_1AddressMapping.md#variable-owned-ranges)** <br>additional ranges we permit ingres traffic bound to as dst and egress traffic from as src.  |

## Detailed Description

```cpp
struct llarp::layers::platform::AddressMapping;
```

holds all info about a platform layer to flow layer mapping. 

lets us keep track of which flow we are using and which kinds of ingres/egres traffic we permit. 

## Public Functions Documentation

### function owns_range

```cpp
bool owns_range(
    const IPRange & range
) const
```

return true if we own this exact range range. 

### function allows_ingres

```cpp
bool allows_ingres(
    const PlatformAddr & src,
    const PlatformAddr & dst
) const
```

return true if we allow ingres (os to lokinet) traffic with this src and dst address 

### function allows_egres

```cpp
bool allows_egres(
    const PlatformAddr & src,
    const PlatformAddr & dst
) const
```

return true if we allow egres (lokinet to os) traffic with this src and dst address 

### function ToString

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


### function is_exit

```cpp
bool is_exit() const
```

helper that tells us if we permit more than just traffic to dst. 

### function AddressMapping

```cpp
AddressMapping() =default
```


### function AddressMapping

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


### function AddressMapping

```cpp
AddressMapping(
    AddressMapping && 
) =default
```


### function operator=

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


### function operator=

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


### function operator==

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


## Public Attributes Documentation

### variable flow_info

```cpp
flow::FlowInfo flow_info;
```

the current flow layer info we are using for this mapping. 

### variable src

```cpp
PlatformAddr src;
```

source and destination addresses for ingres traffic we only allow ingres from src. 

we only route ingres bound for dst. 


### variable dst

```cpp
PlatformAddr dst;
```


### variable owned_ranges

```cpp
std::vector< IPRange > owned_ranges;
```

additional ranges we permit ingres traffic bound to as dst and egress traffic from as src. 

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

Updated on 2023-04-27 at 04:17:17 +0000