mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-11-19 09:25:28 +00:00
7caa87862e
All #ifndef guards on headers have been removed, I think, in favor of #pragma once Headers are now included as `#include "filename"` if the included file resides in the same directory as the file including it, or any subdirectory therein. Otherwise they are included as `#include <project/top/dir/relative/path/filename>` The above does not include system/os headers.
52 lines
952 B
C++
52 lines
952 B
C++
#pragma once
|
|
|
|
#include <llarp/crypto/types.hpp>
|
|
#include "ip_address.hpp"
|
|
#include <llarp/util/bencode.hpp>
|
|
|
|
#include <iosfwd>
|
|
|
|
/**
|
|
* exit_info.h
|
|
*
|
|
* utilities for handling exits on the llarp network
|
|
*/
|
|
|
|
/// Exit info model
|
|
namespace llarp
|
|
{
|
|
struct ExitInfo
|
|
{
|
|
IpAddress ipAddress;
|
|
IpAddress netmask;
|
|
PubKey pubkey;
|
|
uint64_t version = LLARP_PROTO_VERSION;
|
|
|
|
ExitInfo() = default;
|
|
|
|
ExitInfo(const PubKey& pk, const IpAddress& address) : ipAddress(address), pubkey(pk)
|
|
{}
|
|
|
|
bool
|
|
BEncode(llarp_buffer_t* buf) const;
|
|
|
|
bool
|
|
BDecode(llarp_buffer_t* buf)
|
|
{
|
|
return bencode_decode_dict(*this, buf);
|
|
}
|
|
|
|
bool
|
|
DecodeKey(const llarp_buffer_t& k, llarp_buffer_t* buf);
|
|
|
|
std::ostream&
|
|
print(std::ostream& stream, int level, int spaces) const;
|
|
};
|
|
|
|
inline std::ostream&
|
|
operator<<(std::ostream& out, const ExitInfo& xi)
|
|
{
|
|
return xi.print(out, -1, -1);
|
|
}
|
|
} // namespace llarp
|