You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lokinet/llarp/router_version.hpp

41 lines
711 B
C++

4 years ago
#ifndef LLARP_ROUTER_VERSION_HPP
#define LLARP_ROUTER_VERSION_HPP
#include <array>
#include <util/bencode.hpp>
namespace llarp
{
struct RouterVersion : public std::array< uint64_t, 4 >
{
RouterVersion() = default;
explicit RouterVersion(const std::array< uint64_t, 4 >&);
bool
BEncode(llarp_buffer_t* buf) const;
bool
BDecode(llarp_buffer_t* buf);
/// return true if this router version is all zeros
bool
IsEmpty() const;
/// set to be empty
void
Clear();
std::string
ToString() const;
};
inline std::ostream&
operator<<(std::ostream& out, const RouterVersion& rv)
{
return out << rv.ToString();
}
} // namespace llarp
#endif