---
title: llarp::net::TrafficPolicy
summary: information about what traffic an endpoint will carry 

---

# llarp::net::TrafficPolicy



information about what traffic an endpoint will carry 


`#include <traffic_policy.hpp>`

## Public Functions

|                | Name           |
| -------------- | -------------- |
| bool | **[BEncode](Classes/structllarp_1_1net_1_1TrafficPolicy.md#function-bencode)**([llarp_buffer_t](Classes/structllarp__buffer__t.md) * buf) const |
| bool | **[BDecode](Classes/structllarp_1_1net_1_1TrafficPolicy.md#function-bdecode)**([llarp_buffer_t](Classes/structllarp__buffer__t.md) * buf) |
| util::StatusObject | **[ExtractStatus](Classes/structllarp_1_1net_1_1TrafficPolicy.md#function-extractstatus)**() const |
| bool | **[AllowsTraffic](Classes/structllarp_1_1net_1_1TrafficPolicy.md#function-allowstraffic)**(const [IPPacket](Classes/structllarp_1_1net_1_1IPPacket.md) & pkt) const<br>returns true if we allow the traffic in this ip packet returns false otherwise  |

## Public Attributes

|                | Name           |
| -------------- | -------------- |
| std::set< [IPRange](Classes/structllarp_1_1IPRange.md) > | **[ranges](Classes/structllarp_1_1net_1_1TrafficPolicy.md#variable-ranges)** <br>ranges that are explicitly allowed  |
| std::set< [ProtocolInfo](Classes/structllarp_1_1net_1_1ProtocolInfo.md) > | **[protocols](Classes/structllarp_1_1net_1_1TrafficPolicy.md#variable-protocols)** <br>protocols that are explicity allowed  |

## Public Functions Documentation

### function BEncode

```cpp
bool BEncode(
    llarp_buffer_t * buf
) const
```


### function BDecode

```cpp
bool BDecode(
    llarp_buffer_t * buf
)
```


### function ExtractStatus

```cpp
util::StatusObject ExtractStatus() const
```


### function AllowsTraffic

```cpp
bool AllowsTraffic(
    const IPPacket & pkt
) const
```

returns true if we allow the traffic in this ip packet returns false otherwise 

## Public Attributes Documentation

### variable ranges

```cpp
std::set< IPRange > ranges;
```

ranges that are explicitly allowed 

### variable protocols

```cpp
std::set< ProtocolInfo > protocols;
```

protocols that are explicity allowed 

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

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