---
title: llarp/layers/route/route_layer.hpp

---

# llarp/layers/route/route_layer.hpp



## Namespaces

| Name           |
| -------------- |
| **[llarp](Namespaces/namespacellarp.md)** <br>[crypto.hpp] |
| **[llarp::layers](Namespaces/namespacellarp_1_1layers.md)**  |
| **[llarp::layers::route](Namespaces/namespacellarp_1_1layers_1_1route.md)**  |

## Classes

|                | Name           |
| -------------- | -------------- |
| class | **[llarp::layers::route::RouteLayer](Classes/classllarp_1_1layers_1_1route_1_1RouteLayer.md)**  |




## Source code

```cpp
#pragma once

#include <llarp/path/transit_hop.hpp>
#include <llarp/crypto/types.hpp>
#include <memory>
#include "destination.hpp"

namespace llarp
{
  struct AbstractRouter;
}

namespace llarp::layers::route
{

  class RouteLayer
  {
    std::vector<std::unique_ptr<Destination>> _destinations;

   public:
    explicit RouteLayer(AbstractRouter&);

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

    bool
    remove_destination_on(const path::TransitHopInfo& info);

    size_t
    remove_destinations_to(const PubKey& src, const RouterID& dst);

    size_t
    remove_destinations_from(const PubKey& dst);

    Destination*
    destination_to(const PathID_t& rxid);

    Destination*
    destination_from(const PathID_t& txid);

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

    Destination*
    destination_on(const path::TransitHopInfo& info) const;
  };
}  // namespace llarp::layers::route
```


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

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