2021-03-09 22:24:35 +00:00
|
|
|
#pragma once
|
2018-12-03 22:22:59 +00:00
|
|
|
|
2021-03-09 22:24:35 +00:00
|
|
|
#include <llarp/net/net_int.hpp>
|
|
|
|
#include <llarp/util/buffer.hpp>
|
2018-12-12 02:52:51 +00:00
|
|
|
|
2018-12-03 22:22:59 +00:00
|
|
|
#include <string>
|
|
|
|
|
|
|
|
namespace llarp
|
|
|
|
{
|
|
|
|
namespace dns
|
|
|
|
{
|
|
|
|
using Name_t = std::string;
|
|
|
|
|
|
|
|
/// decode name from buffer
|
|
|
|
bool
|
2019-04-26 12:11:34 +00:00
|
|
|
DecodeName(llarp_buffer_t* buf, Name_t& name, bool trimTrailingDot = false);
|
2018-12-03 22:22:59 +00:00
|
|
|
|
|
|
|
/// encode name to buffer
|
|
|
|
bool
|
2020-09-17 19:18:08 +00:00
|
|
|
EncodeName(llarp_buffer_t* buf, Name_t name);
|
2018-12-03 22:22:59 +00:00
|
|
|
|
|
|
|
bool
|
2020-09-17 19:18:08 +00:00
|
|
|
DecodePTR(Name_t name, huint128_t& ip);
|
|
|
|
|
|
|
|
bool
|
|
|
|
NameIsReserved(Name_t name);
|
2018-12-03 22:22:59 +00:00
|
|
|
|
|
|
|
} // namespace dns
|
|
|
|
} // namespace llarp
|