lokinet/llarp/service/convotag.hpp
dr7ana f574cd798f Clang format include sorting + CMake
- includes are now sorted in consistent, logical order; first step in an attempt to fix the tomfoolery (no relation to Tom) brought in by include-what-you-use
- shuffled around some cmake linking to simplify dependency graph
- superfluous files removed
2024-01-31 07:54:12 -08:00

37 lines
689 B
C++

#pragma once
#include <llarp/net/net.hpp>
#include <llarp/net/net_int.hpp>
#include <llarp/util/aligned.hpp>
namespace llarp::service
{
struct ConvoTag final : AlignedBuffer<16>
{
using AlignedBuffer<16>::AlignedBuffer;
void
Randomize() override;
sockaddr_in6
ToV6() const;
void
FromV6(sockaddr_in6 saddr);
};
} // namespace llarp::service
namespace std
{
template <>
struct hash<llarp::service::ConvoTag>
{
size_t
operator()(const llarp::service::ConvoTag& tag) const
{
std::hash<std::string_view> h{};
return h(std::string_view{reinterpret_cast<const char*>(tag.data()), tag.size()});
}
};
} // namespace std