---
title: llarp::layers::route::RouteLayer

---

# llarp::layers::route::RouteLayer





## Public Functions

|                | Name           |
| -------------- | -------------- |
| | **[RouteLayer](Classes/classllarp_1_1layers_1_1route_1_1RouteLayer.md#function-routelayer)**([AbstractRouter](Classes/structllarp_1_1AbstractRouter.md) & ) |
| [Destination](Classes/classllarp_1_1layers_1_1route_1_1Destination.md) * | **[create_destination](Classes/classllarp_1_1layers_1_1route_1_1RouteLayer.md#function-create-destination)**(const [path::TransitHopInfo](Classes/structllarp_1_1path_1_1TransitHopInfo.md) & info, [PubKey](Classes/structllarp_1_1PubKey.md) src, [RouterID](Classes/structllarp_1_1RouterID.md) dst)<br>create a routing destination belonging to pubkey+endpoint transithop going to a snode.  |
| bool | **[remove_destination_on](Classes/classllarp_1_1layers_1_1route_1_1RouteLayer.md#function-remove-destination-on)**(const [path::TransitHopInfo](Classes/structllarp_1_1path_1_1TransitHopInfo.md) & info)<br>remove a routing destination for an existing endpoint transit hop.  |
| size_t | **[remove_destinations_to](Classes/classllarp_1_1layers_1_1route_1_1RouteLayer.md#function-remove-destinations-to)**(const [PubKey](Classes/structllarp_1_1PubKey.md) & src, const [RouterID](Classes/structllarp_1_1RouterID.md) & dst)<br>remove all routing destination from a source to a destination.  |
| size_t | **[remove_destinations_from](Classes/classllarp_1_1layers_1_1route_1_1RouteLayer.md#function-remove-destinations-from)**(const [PubKey](Classes/structllarp_1_1PubKey.md) & dst)<br>remove all routing destination from a source.  |
| [Destination](Classes/classllarp_1_1layers_1_1route_1_1Destination.md) * | **[destination_to](Classes/classllarp_1_1layers_1_1route_1_1RouteLayer.md#function-destination-to)**(const [PathID_t](Classes/structllarp_1_1PathID__t.md) & rxid)<br>get a routing destination given a local path rxID.  |
| [Destination](Classes/classllarp_1_1layers_1_1route_1_1Destination.md) * | **[destination_from](Classes/classllarp_1_1layers_1_1route_1_1RouteLayer.md#function-destination-from)**(const [PathID_t](Classes/structllarp_1_1PathID__t.md) & txid)<br>get a routing destination given its local path txid.  |
| std::vector< [Destination](Classes/classllarp_1_1layers_1_1route_1_1Destination.md) * > | **[all_destinations_from](Classes/classllarp_1_1layers_1_1route_1_1RouteLayer.md#function-all-destinations-from)**(const [PubKey](Classes/structllarp_1_1PubKey.md) & src)<br>get all routing destinations given the source pubkey going to a snode dst.  |
| [Destination](Classes/classllarp_1_1layers_1_1route_1_1Destination.md) * | **[destination_on](Classes/classllarp_1_1layers_1_1route_1_1RouteLayer.md#function-destination-on)**(const [path::TransitHopInfo](Classes/structllarp_1_1path_1_1TransitHopInfo.md) & info) const<br>maybe fetch a routing destination that was previously created for an endpoint transit hop.  |

## Public Functions Documentation

### function RouteLayer

```cpp
explicit RouteLayer(
    AbstractRouter & 
)
```


### function create_destination

```cpp
Destination * create_destination(
    const path::TransitHopInfo & info,
    PubKey src,
    RouterID dst
)
```

create a routing destination belonging to pubkey+endpoint transithop going to a snode. 

### function remove_destination_on

```cpp
bool remove_destination_on(
    const path::TransitHopInfo & info
)
```

remove a routing destination for an existing endpoint transit hop. 

returns true if we removed something. 


### function remove_destinations_to

```cpp
size_t remove_destinations_to(
    const PubKey & src,
    const RouterID & dst
)
```

remove all routing destination from a source to a destination. 

returns the number of entries we removed. 


### function remove_destinations_from

```cpp
size_t remove_destinations_from(
    const PubKey & dst
)
```

remove all routing destination from a source. 

returns the number of entries we removed. 


### function destination_to

```cpp
Destination * destination_to(
    const PathID_t & rxid
)
```

get a routing destination given a local path rxID. 

### function destination_from

```cpp
Destination * destination_from(
    const PathID_t & txid
)
```

get a routing destination given its local path txid. 

### function all_destinations_from

```cpp
std::vector< Destination * > all_destinations_from(
    const PubKey & src
)
```

get all routing destinations given the source pubkey going to a snode dst. 

### function destination_on

```cpp
Destination * destination_on(
    const path::TransitHopInfo & info
) const
```

maybe fetch a routing destination that was previously created for an endpoint transit hop. 

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

Updated on 2023-03-06 at 20:36:34 +0000