---
title: llarp/layers/flow/name_resolver.hpp

---

# llarp/layers/flow/name_resolver.hpp



## Namespaces

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

## Classes

|                | Name           |
| -------------- | -------------- |
| class | **[llarp::layers::flow::NameResolver](Classes/classllarp_1_1layers_1_1flow_1_1NameResolver.md)**  |




## Source code

```cpp
#pragma once

#include "flow_addr.hpp"
#include <chrono>
#include <functional>
#include <memory>
#include <optional>

#include <oxenc/variant.h>

#include <llarp/util/types.hpp>
#include <llarp/dns/question.hpp>
#include <string_view>
#include <variant>
#include <vector>

namespace llarp::layers::flow
{

  class NameCache;
  class FlowLayer;

  class NameResolver
  {
    NameCache& _name_cache;
    FlowLayer& _parent;

   public:
    NameResolver(const NameResolver&) = delete;
    NameResolver(NameResolver&&) = delete;
    NameResolver(NameCache& name_cache, FlowLayer& parent);

    void
    resolve_flow_addr_async(std::string name, std::function<void(std::optional<FlowAddr>)> handler);

    static bool
    name_well_formed(std::string_view name);
  };

}  // namespace llarp::layers::flow
```


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

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