---
title: llarp::path

---

# llarp::path



## Classes

|                | Name           |
| -------------- | -------------- |
| struct | **[llarp::path::IHopHandler](Classes/structllarp_1_1path_1_1IHopHandler.md)**  |
| struct | **[llarp::path::PathHopConfig](Classes/structllarp_1_1path_1_1PathHopConfig.md)** <br>configuration for a single hop when building a path  |
| struct | **[llarp::path::Path](Classes/structllarp_1_1path_1_1Path.md)** <br>A path we made.  |
| struct | **[llarp::path::PathContext](Classes/structllarp_1_1path_1_1PathContext.md)**  |
| class | **[llarp::path::BuildLimiter](Classes/classllarp_1_1path_1_1BuildLimiter.md)** <br>limiter for path builds prevents overload and such  |
| struct | **[llarp::path::Builder](Classes/structllarp_1_1path_1_1Builder.md)**  |
| struct | **[llarp::path::BuildStats](Classes/structllarp_1_1path_1_1BuildStats.md)** <br>Stats about all our path builds.  |
| struct | **[llarp::path::PathSet](Classes/structllarp_1_1path_1_1PathSet.md)** <br>a set of paths owned by an entity  |
| struct | **[llarp::path::TransitHopInfo](Classes/structllarp_1_1path_1_1TransitHopInfo.md)**  |
| struct | **[llarp::path::TransitHop](Classes/structllarp_1_1path_1_1TransitHop.md)**  |

## Types

|                | Name           |
| -------------- | -------------- |
| enum| **[PathStatus](Namespaces/namespacellarp_1_1path.md#enum-pathstatus)** { ePathBuilding, ePathEstablished, ePathTimeout, ePathFailed, ePathIgnore, ePathExpired}<br>status of a path  |
| using std::shared_ptr< [IHopHandler](Classes/structllarp_1_1path_1_1IHopHandler.md) > | **[HopHandler_ptr](Namespaces/namespacellarp_1_1path.md#using-hophandler-ptr)**  |
| typedef std::shared_ptr< [TransitHop](Classes/structllarp_1_1path_1_1TransitHop.md) > | **[TransitHop_ptr](Namespaces/namespacellarp_1_1path.md#typedef-transithop-ptr)**  |
| using std::shared_ptr< [Builder](Classes/structllarp_1_1path_1_1Builder.md) > | **[Builder_ptr](Namespaces/namespacellarp_1_1path.md#using-builder-ptr)**  |
| using int | **[PathRole](Namespaces/namespacellarp_1_1path.md#using-pathrole)** <br>the role of this path can fulfill  |
| typedef std::shared_ptr< [Path](Classes/structllarp_1_1path_1_1Path.md) > | **[Path_ptr](Namespaces/namespacellarp_1_1path.md#typedef-path-ptr)**  |
| using std::shared_ptr< [PathSet](Classes/structllarp_1_1path_1_1PathSet.md) > | **[PathSet_ptr](Namespaces/namespacellarp_1_1path.md#using-pathset-ptr)**  |

## Functions

|                | Name           |
| -------------- | -------------- |
| bool | **[operator<](Namespaces/namespacellarp_1_1path.md#function-operator<)**(const [PathHopConfig](Classes/structllarp_1_1path_1_1PathHopConfig.md) & lhs, const [PathHopConfig](Classes/structllarp_1_1path_1_1PathHopConfig.md) & rhs) |
| bool | **[operator==](Namespaces/namespacellarp_1_1path.md#function-operator==)**(const [TransitHopInfo](Classes/structllarp_1_1path_1_1TransitHopInfo.md) & lhs, const [TransitHopInfo](Classes/structllarp_1_1path_1_1TransitHopInfo.md) & rhs) |
| bool | **[operator!=](Namespaces/namespacellarp_1_1path.md#function-operator!=)**(const [TransitHopInfo](Classes/structllarp_1_1path_1_1TransitHopInfo.md) & lhs, const [TransitHopInfo](Classes/structllarp_1_1path_1_1TransitHopInfo.md) & rhs) |
| bool | **[operator<](Namespaces/namespacellarp_1_1path.md#function-operator<)**(const [TransitHopInfo](Classes/structllarp_1_1path_1_1TransitHopInfo.md) & lhs, const [TransitHopInfo](Classes/structllarp_1_1path_1_1TransitHopInfo.md) & rhs) |

## Attributes

|                | Name           |
| -------------- | -------------- |
| constexpr std::size_t | **[max_len](Namespaces/namespacellarp_1_1path.md#variable-max-len)** <br>maximum path length  |
| constexpr std::size_t | **[default_len](Namespaces/namespacellarp_1_1path.md#variable-default-len)** <br>default path length  |
| constexpr std::size_t | **[pad_size](Namespaces/namespacellarp_1_1path.md#variable-pad-size)** <br>pad messages to the nearest this many bytes  |
| constexpr std::chrono::milliseconds | **[default_lifetime](Namespaces/namespacellarp_1_1path.md#variable-default-lifetime)** <br>default path lifetime in ms  |
| constexpr std::chrono::milliseconds | **[min_intro_lifetime](Namespaces/namespacellarp_1_1path.md#variable-min-intro-lifetime)** <br>minimum into lifetime we will advertise  |
| constexpr auto | **[intro_spread_slices](Namespaces/namespacellarp_1_1path.md#variable-intro-spread-slices)** <br>number of slices of path lifetime to spread intros out via  |
| constexpr std::chrono::milliseconds | **[intro_path_spread](Namespaces/namespacellarp_1_1path.md#variable-intro-path-spread)** <br>spacing frequency at which we try to build paths for introductions  |
| constexpr std::chrono::milliseconds | **[intro_stale_threshold](Namespaces/namespacellarp_1_1path.md#variable-intro-stale-threshold)** <br>how long away from expiration in millseconds do we consider an intro to become stale  |
| constexpr std::size_t | **[min_intro_paths](Namespaces/namespacellarp_1_1path.md#variable-min-intro-paths)** <br>Minimum paths to keep around for intros; mainly used at startup (the spread, above, should be able to maintain more than this number of paths normally once things are going).  |
| constexpr auto | **[build_timeout](Namespaces/namespacellarp_1_1path.md#variable-build-timeout)** <br>after this many ms a path build times out  |
| constexpr auto | **[latency_interval](Namespaces/namespacellarp_1_1path.md#variable-latency-interval)** <br>measure latency every this interval ms  |
| constexpr auto | **[alive_timeout](Namespaces/namespacellarp_1_1path.md#variable-alive-timeout)** <br>if a path is inactive for this amount of time it's dead  |
| constexpr std::size_t | **[transit_hop_queue_size](Namespaces/namespacellarp_1_1path.md#variable-transit-hop-queue-size)** <br>how big transit hop traffic queues are  |
| constexpr auto | **[MIN_PATH_BUILD_INTERVAL](Namespaces/namespacellarp_1_1path.md#variable-min-path-build-interval)**  |
| constexpr auto | **[PATH_BUILD_RATE](Namespaces/namespacellarp_1_1path.md#variable-path-build-rate)**  |
| constexpr PathRole | **[ePathRoleAny](Namespaces/namespacellarp_1_1path.md#variable-epathroleany)** <br>capable of any role  |
| constexpr PathRole | **[ePathRoleOutboundHS](Namespaces/namespacellarp_1_1path.md#variable-epathroleoutboundhs)** <br>outbound hs traffic capable  |
| constexpr PathRole | **[ePathRoleInboundHS](Namespaces/namespacellarp_1_1path.md#variable-epathroleinboundhs)** <br>inbound hs traffic capable  |
| constexpr PathRole | **[ePathRoleExit](Namespaces/namespacellarp_1_1path.md#variable-epathroleexit)** <br>exit traffic capable  |
| constexpr PathRole | **[ePathRoleSVC](Namespaces/namespacellarp_1_1path.md#variable-epathrolesvc)** <br>service node capable  |
| constexpr PathRole | **[ePathRoleDHT](Namespaces/namespacellarp_1_1path.md#variable-epathroledht)** <br>dht message capable  |

## Types Documentation

### enum PathStatus

| Enumerator | Value | Description |
| ---------- | ----- | ----------- |
| ePathBuilding | |   |
| ePathEstablished | |   |
| ePathTimeout | |   |
| ePathFailed | |   |
| ePathIgnore | |   |
| ePathExpired | |   |



status of a path 

### using HopHandler_ptr

```cpp
using llarp::path::HopHandler_ptr = typedef std::shared_ptr<IHopHandler>;
```


### typedef TransitHop_ptr

```cpp
typedef std::shared_ptr< TransitHop > llarp::path::TransitHop_ptr;
```


### using Builder_ptr

```cpp
using llarp::path::Builder_ptr = typedef std::shared_ptr<Builder>;
```


### using PathRole

```cpp
using llarp::path::PathRole = typedef int;
```

the role of this path can fulfill 

### typedef Path_ptr

```cpp
typedef std::shared_ptr< Path > llarp::path::Path_ptr;
```


### using PathSet_ptr

```cpp
using llarp::path::PathSet_ptr = typedef std::shared_ptr<PathSet>;
```



## Functions Documentation

### function operator<

```cpp
inline bool operator<(
    const PathHopConfig & lhs,
    const PathHopConfig & rhs
)
```


### function operator==

```cpp
inline bool operator==(
    const TransitHopInfo & lhs,
    const TransitHopInfo & rhs
)
```


### function operator!=

```cpp
inline bool operator!=(
    const TransitHopInfo & lhs,
    const TransitHopInfo & rhs
)
```


### function operator<

```cpp
inline bool operator<(
    const TransitHopInfo & lhs,
    const TransitHopInfo & rhs
)
```



## Attributes Documentation

### variable max_len

```cpp
constexpr std::size_t max_len = 8;
```

maximum path length 

### variable default_len

```cpp
constexpr std::size_t default_len = 4;
```

default path length 

### variable pad_size

```cpp
constexpr std::size_t pad_size = 128;
```

pad messages to the nearest this many bytes 

### variable default_lifetime

```cpp
constexpr std::chrono::milliseconds default_lifetime = 20min;
```

default path lifetime in ms 

### variable min_intro_lifetime

```cpp
constexpr std::chrono::milliseconds min_intro_lifetime = default_lifetime / 2;
```

minimum into lifetime we will advertise 

### variable intro_spread_slices

```cpp
constexpr auto intro_spread_slices = 4;
```

number of slices of path lifetime to spread intros out via 

### variable intro_path_spread

```cpp
constexpr std::chrono::milliseconds intro_path_spread = default_lifetime / intro_spread_slices;
```

spacing frequency at which we try to build paths for introductions 

### variable intro_stale_threshold

```cpp
constexpr std::chrono::milliseconds intro_stale_threshold =
        default_lifetime - intro_path_spread;
```

how long away from expiration in millseconds do we consider an intro to become stale 

### variable min_intro_paths

```cpp
constexpr std::size_t min_intro_paths = 4;
```

Minimum paths to keep around for intros; mainly used at startup (the spread, above, should be able to maintain more than this number of paths normally once things are going). 

### variable build_timeout

```cpp
constexpr auto build_timeout = 10s;
```

after this many ms a path build times out 

### variable latency_interval

```cpp
constexpr auto latency_interval = 20s;
```

measure latency every this interval ms 

### variable alive_timeout

```cpp
constexpr auto alive_timeout = latency_interval * 1.5;
```

if a path is inactive for this amount of time it's dead 

### variable transit_hop_queue_size

```cpp
constexpr std::size_t transit_hop_queue_size = 256;
```

how big transit hop traffic queues are 

### variable MIN_PATH_BUILD_INTERVAL

```cpp
static constexpr auto MIN_PATH_BUILD_INTERVAL = 500ms;
```


### variable PATH_BUILD_RATE

```cpp
static constexpr auto PATH_BUILD_RATE = 100ms;
```


### variable ePathRoleAny

```cpp
constexpr PathRole ePathRoleAny = 0;
```

capable of any role 

### variable ePathRoleOutboundHS

```cpp
constexpr PathRole ePathRoleOutboundHS = (1 << 0);
```

outbound hs traffic capable 

### variable ePathRoleInboundHS

```cpp
constexpr PathRole ePathRoleInboundHS = (1 << 1);
```

inbound hs traffic capable 

### variable ePathRoleExit

```cpp
constexpr PathRole ePathRoleExit = (1 << 2);
```

exit traffic capable 

### variable ePathRoleSVC

```cpp
constexpr PathRole ePathRoleSVC = (1 << 3);
```

service node capable 

### variable ePathRoleDHT

```cpp
constexpr PathRole ePathRoleDHT = (1 << 4);
```

dht message capable 




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

Updated on 2023-01-09 at 16:43:38 +0000