Move address_info.hpp to llarp/

pull/137/head
Michael 6 years ago
parent e76d49e92c
commit f51384f92e
No known key found for this signature in database
GPG Key ID: 2D51757B47E2434C

@ -1,12 +1,13 @@
#ifndef LLARP_NET_HPP
#define LLARP_NET_HPP
#include <llarp/address_info.hpp>
#include <llarp/net.h>
#include <functional>
#include <address_info.hpp>
#include "logger.hpp"
#include "mem.hpp"
#include <llarp/string_view.hpp>
#include <llarp/net.h>
#include <llarp/net_int.hpp>
#include <llarp/string_view.hpp>
#include <functional>
#include <vector>
#include <stdlib.h> // for itoa

@ -1,11 +1,11 @@
#ifndef LLARP_NET_ADDR_HPP
#define LLARP_NET_ADDR_HPP
#include <string>
#include <address_info.hpp>
#include <llarp/net.h>
#include <llarp/address_info.hpp>
#include <llarp/net.hpp>
#include <llarp/string_view.hpp>
#include <llarp/net.hpp>
#include <string>
namespace llarp
{

@ -1,8 +1,9 @@
#ifndef LLARP_RC_HPP
#define LLARP_RC_HPP
#include <llarp/address_info.hpp>
#include <llarp/crypto.h>
#include <address_info.hpp>
#include <llarp/bencode.hpp>
#include <llarp/crypto.h>
#include <llarp/exit_info.hpp>
#include <vector>

@ -1,4 +1,4 @@
#include <llarp/address_info.hpp>
#include <address_info.hpp>
#ifndef _WIN32
#include <arpa/inet.h>
#endif
@ -25,17 +25,17 @@ namespace llarp
}
bool
AddressInfo::operator==(const AddressInfo &other) const
operator==(const AddressInfo& lhs, const AddressInfo& rhs)
{
// we don't care about rank
return pubkey == other.pubkey && port == other.port
&& dialect == other.dialect && ip == other.ip;
return lhs.pubkey == rhs.pubkey && lhs.port == rhs.port
&& lhs.dialect == rhs.dialect && lhs.ip == rhs.ip;
}
bool
AddressInfo::operator<(const AddressInfo &other) const
operator<(const AddressInfo& lhs, const AddressInfo& rhs)
{
return rank < other.rank || ip < other.ip || port < other.port;
return lhs.rank < rhs.rank || lhs.ip < rhs.ip || lhs.port < rhs.port;
}
bool

@ -48,12 +48,6 @@ namespace llarp
AddressInfo&
operator=(const AddressInfo& other);
bool
operator==(const AddressInfo& other) const;
bool
operator<(const AddressInfo& other) const;
bool
BEncode(llarp_buffer_t* buf) const override;
@ -84,6 +78,13 @@ namespace llarp
};
};
bool
operator==(const AddressInfo& lhs, const AddressInfo& rhs);
bool
operator<(const AddressInfo& lhs, const AddressInfo& rhs);
} // namespace llarp
#endif
Loading…
Cancel
Save