---
title: llarp/dns/name.hpp

---

# llarp/dns/name.hpp



## Namespaces

| Name           |
| -------------- |
| **[llarp](Namespaces/namespacellarp.md)** <br>[crypto.hpp] |
| **[llarp::dns](Namespaces/namespacellarp_1_1dns.md)**  |




## Source code

```cpp
#pragma once

#include <llarp/net/net_int.hpp>
#include <llarp/util/buffer.hpp>

#include <string>
#include <optional>

namespace llarp
{
  namespace dns
  {
    std::optional<std::string>
    DecodeName(llarp_buffer_t* buf, bool trimTrailingDot = false);

    bool
    EncodeNameTo(llarp_buffer_t* buf, std::string_view name);

    std::optional<huint128_t>
    DecodePTR(std::string_view name);

    bool
    NameIsReserved(std::string_view name);

  }  // namespace dns
}  // namespace llarp
```


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

Updated on 2022-09-19 at 17:18:35 +0000
