3 #include "p2p/Serialize.h" 32 Address(uint8_t
const * & in,
size_t & size);
36 virtual void serialize(std::vector<uint8_t> & out)
const override;
37 virtual json toJson()
const override;
42 uint32_t
time()
const {
return time_; }
45 uint64_t
services()
const {
return services_; }
48 uint8_t
const *
ipv6()
const {
return ipv6_.data(); }
51 uint8_t
const *
ipv4()
const {
return ipv6_.data() + 12; }
54 int port()
const {
return port_; }
60 std::array<uint8_t, 16> ipv6_;
An abstract class that enables an object to be serialized by the serialization functions.
Definition: Serialize.h:27
uint8_t const * ipv4() const
Returns the IP address in IPV4 form.
Definition: Address.h:51
uint32_t time() const
Returns the timestamp.
Definition: Address.h:42
A description of a network node.
Definition: Address.h:14
uint64_t services() const
Returns the services.
Definition: Address.h:45
uint8_t const * ipv6() const
Returns the IP address in IPV6 form.
Definition: Address.h:48
int port() const
Returns the port.
Definition: Address.h:54
Bitcoin Network Layer.
Definition: Address.h:7