diff options
author | Thomas Snider <tjps636@gmail.com> | 2018-01-26 02:48:56 -0800 |
---|---|---|
committer | Thomas Snider <tjps636@gmail.com> | 2018-04-16 13:24:14 -0700 |
commit | 2c084a6609bed24979c2a144743007f8b10a5c70 (patch) | |
tree | df9527a3ce02aa01c5d55fd6b660ead4698e954b /src/netaddress.h | |
parent | 07825088f9cfd8abece774b9d978c36ab90ce3d1 (diff) |
net: Minor accumulated cleanups
Diffstat (limited to 'src/netaddress.h')
-rw-r--r-- | src/netaddress.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/netaddress.h b/src/netaddress.h index 38f8709257..f8f2ab99ff 100644 --- a/src/netaddress.h +++ b/src/netaddress.h @@ -38,15 +38,16 @@ class CNetAddr public: CNetAddr(); explicit CNetAddr(const struct in_addr& ipv4Addr); - void Init(); void SetIP(const CNetAddr& ip); + private: /** * Set raw IPv4 or IPv6 address (in network byte order) * @note Only NET_IPV4 and NET_IPV6 are allowed for network. */ void SetRaw(Network network, const uint8_t *data); + public: /** * Transform an arbitrary string into a non-routable ipv6 address. * Useful for mapping resolved addresses back to their source. @@ -87,7 +88,7 @@ class CNetAddr bool GetIn6Addr(struct in6_addr* pipv6Addr) const; friend bool operator==(const CNetAddr& a, const CNetAddr& b); - friend bool operator!=(const CNetAddr& a, const CNetAddr& b); + friend bool operator!=(const CNetAddr& a, const CNetAddr& b) { return !(a == b); } friend bool operator<(const CNetAddr& a, const CNetAddr& b); ADD_SERIALIZE_METHODS; @@ -124,7 +125,7 @@ class CSubNet bool IsValid() const; friend bool operator==(const CSubNet& a, const CSubNet& b); - friend bool operator!=(const CSubNet& a, const CSubNet& b); + friend bool operator!=(const CSubNet& a, const CSubNet& b) { return !(a == b); } friend bool operator<(const CSubNet& a, const CSubNet& b); ADD_SERIALIZE_METHODS; @@ -148,12 +149,11 @@ class CService : public CNetAddr CService(const CNetAddr& ip, unsigned short port); CService(const struct in_addr& ipv4Addr, unsigned short port); explicit CService(const struct sockaddr_in& addr); - void Init(); unsigned short GetPort() const; bool GetSockAddr(struct sockaddr* paddr, socklen_t *addrlen) const; bool SetSockAddr(const struct sockaddr* paddr); friend bool operator==(const CService& a, const CService& b); - friend bool operator!=(const CService& a, const CService& b); + friend bool operator!=(const CService& a, const CService& b) { return !(a == b); } friend bool operator<(const CService& a, const CService& b); std::vector<unsigned char> GetKey() const; std::string ToString() const; |