5 #ifndef BITCOIN_NETADDRESS_H 6 #define BITCOIN_NETADDRESS_H 8 #if defined(HAVE_CONFIG_H) 37 CNetAddr(
const struct in_addr& ipv4Addr);
70 std::string
ToStringIP(
bool fUseGetnameinfo =
true)
const;
73 bool GetInAddr(
struct in_addr* pipv4Addr)
const;
74 std::vector<unsigned char>
GetGroup()
const;
77 CNetAddr(
const struct in6_addr& pipv6Addr);
78 bool GetIn6Addr(
struct in6_addr* pipv6Addr)
const;
86 template <
typename Stream,
typename Operation>
87 inline void SerializationOp(Stream& s, Operation ser_action,
int nType,
int nVersion) {
123 template <
typename Stream,
typename Operation>
124 inline void SerializationOp(Stream& s, Operation ser_action,
int nType,
int nVersion) {
140 CService(
const struct in_addr& ipv4Addr,
unsigned short port);
141 CService(
const struct sockaddr_in& addr);
143 void SetPort(
unsigned short portIn);
144 unsigned short GetPort()
const;
145 bool GetSockAddr(
struct sockaddr* paddr, socklen_t *addrlen)
const;
150 std::vector<unsigned char>
GetKey()
const;
151 std::string
ToString(
bool fUseGetnameinfo =
true)
const;
155 CService(
const struct in6_addr& ipv6Addr,
unsigned short port);
156 CService(
const struct sockaddr_in6& addr);
160 template <
typename Stream,
typename Operation>
161 inline void SerializationOp(Stream& s, Operation ser_action,
int nType,
int nVersion) {
163 unsigned short portN = htons(
port);
165 if (ser_action.ForRead())
170 #endif // BITCOIN_NETADDRESS_H
friend bool operator<(const CService &a, const CService &b)
std::vector< unsigned char > GetKey() const
std::string ToStringIP(bool fUseGetnameinfo=true) const
std::string ToString() const
uint8_t netmask[16]
Netmask, in network byte order.
void SetRaw(Network network, const uint8_t *data)
std::vector< unsigned char > GetGroup() const
friend bool operator!=(const CSubNet &a, const CSubNet &b)
friend bool operator<(const CSubNet &a, const CSubNet &b)
void SetIP(const CNetAddr &ip)
unsigned short GetPort() const
friend bool operator==(const CNetAddr &a, const CNetAddr &b)
std::string ToStringIPPort(bool fUseGetnameinfo=true) const
CNetAddr network
Network (base) address.
void SetPort(unsigned short portIn)
friend bool operator!=(const CService &a, const CService &b)
friend bool operator!=(const CNetAddr &a, const CNetAddr &b)
int GetReachabilityFrom(const CNetAddr *paddrPartner=NULL) const
friend bool operator<(const CNetAddr &a, const CNetAddr &b)
bool GetIn6Addr(struct in6_addr *pipv6Addr) const
bool valid
Is this value valid? (only used to signal parse errors)
void SerializationOp(Stream &s, Operation ser_action, int nType, int nVersion)
std::string ToStringPort() const
bool SetSockAddr(const struct sockaddr *paddr)
std::string ToString() const
void SerializationOp(Stream &s, Operation ser_action, int nType, int nVersion)
friend bool operator==(const CService &a, const CService &b)
unsigned int GetByte(int n) const
bool SetSpecial(const std::string &strName)
bool GetInAddr(struct in_addr *pipv4Addr) const
enum Network GetNetwork() const
bool GetSockAddr(struct sockaddr *paddr, socklen_t *addrlen) const
void SerializationOp(Stream &s, Operation ser_action, int nType, int nVersion)
friend bool operator==(const CSubNet &a, const CSubNet &b)
bool Match(const CNetAddr &addr) const