33 #include "net/net_utils_base.h" 40 template <
class T,
class Archive>
41 inline void do_serialize(Archive &
a, epee::net_utils::network_address& na,
T local)
43 if (
typename Archive::is_saving()) local = na.as<
T>();
45 if (!
typename Archive::is_saving()) na = local;
47 template <
class Archive,
class ver_type>
48 inline void serialize(Archive &
a, epee::net_utils::network_address& na,
const ver_type ver)
51 if (
typename Archive::is_saving())
52 type = na.get_type_id();
56 case epee::net_utils::ipv4_network_address::ID:
57 do_serialize(
a, na, epee::net_utils::ipv4_network_address{0, 0});
60 throw std::runtime_error(
"Unsupported network address type");
63 template <
class Archive,
class ver_type>
64 inline void serialize(Archive &
a, epee::net_utils::ipv4_network_address& na,
const ver_type ver)
67 uint16_t port{na.port()};
70 if (!
typename Archive::is_saving())
71 na = epee::net_utils::ipv4_network_address{ip, port};
74 template <
class Archive,
class ver_type>
82 template <
class Archive,
class ver_type>
Definition: binary_utils.h:36
int64_t last_seen
Definition: p2p_protocol_defs.h:74
const uint32_t T[512]
Definition: groestl_tables.h:33
Definition: unordered_containers_boost_serialization.h:37
AddressType adr
Definition: p2p_protocol_defs.h:72
void serialize(Archive &a, std::unordered_map< h_key, hval > &x, const boost::serialization::version_type ver)
Definition: unordered_containers_boost_serialization.h:126
AddressType adr
Definition: p2p_protocol_defs.h:87
int64_t first_seen
Definition: p2p_protocol_defs.h:89
void do_serialize(Archive &a, epee::net_utils::network_address &na, T local)
Definition: net_peerlist_boost_serialization.h:41
peerid_type id
Definition: p2p_protocol_defs.h:73
peerid_type id
Definition: p2p_protocol_defs.h:88
Definition: p2p_protocol_defs.h:85
string a
Definition: MakeCryptoOps.py:15
Definition: p2p_protocol_defs.h:70