Problem: formatting inconsistent

Solution: applied clang-format
This commit is contained in:
sigiesec
2018-02-01 11:46:09 +01:00
parent 6d8baea714
commit 41f459e1dc
331 changed files with 13208 additions and 13691 deletions

View File

@@ -37,81 +37,85 @@
namespace zmq
{
class tcp_address_t
{
public:
tcp_address_t ();
tcp_address_t (const sockaddr *sa, socklen_t sa_len);
virtual ~tcp_address_t ();
class tcp_address_t
{
public:
// This function translates textual TCP address into an address
// structure. If 'local' is true, names are resolved as local interface
// names. If it is false, names are resolved as remote hostnames.
// If 'ipv6' is true, the name may resolve to IPv6 address.
int
resolve (const char *name_, bool local_, bool ipv6_, bool is_src_ = false);
tcp_address_t ();
tcp_address_t (const sockaddr *sa, socklen_t sa_len);
virtual ~tcp_address_t ();
// This function translates textual TCP address into an address
// structure. If 'local' is true, names are resolved as local interface
// names. If it is false, names are resolved as remote hostnames.
// If 'ipv6' is true, the name may resolve to IPv6 address.
int resolve (const char *name_, bool local_, bool ipv6_, bool is_src_ = false);
// The opposite to resolve()
virtual int to_string (std::string &addr_);
// The opposite to resolve()
virtual int to_string (std::string &addr_);
#if defined ZMQ_HAVE_WINDOWS
unsigned short family () const;
unsigned short family () const;
#else
sa_family_t family () const;
sa_family_t family () const;
#endif
const sockaddr *addr () const;
socklen_t addrlen () const;
const sockaddr *addr () const;
socklen_t addrlen () const;
const sockaddr *src_addr () const;
socklen_t src_addrlen () const;
bool has_src_addr () const;
const sockaddr *src_addr () const;
socklen_t src_addrlen () const;
bool has_src_addr () const;
protected:
int resolve_nic_name (const char *nic_, bool ipv6_, bool is_src_ = false);
int resolve_interface (const char *interface_, bool ipv6_, bool is_src_ = false);
int resolve_hostname (const char *hostname_, bool ipv6_, bool is_src_ = false);
protected:
int resolve_nic_name (const char *nic_, bool ipv6_, bool is_src_ = false);
int resolve_interface (const char *interface_,
bool ipv6_,
bool is_src_ = false);
int
resolve_hostname (const char *hostname_, bool ipv6_, bool is_src_ = false);
#if defined ZMQ_HAVE_WINDOWS
int get_interface_name(unsigned long index, char ** dest) const;
int wchar_to_utf8(const WCHAR * src, char ** dest) const;
int get_interface_name (unsigned long index, char **dest) const;
int wchar_to_utf8 (const WCHAR *src, char **dest) const;
#endif
union {
sockaddr generic;
sockaddr_in ipv4;
sockaddr_in6 ipv6;
} address;
union {
sockaddr generic;
sockaddr_in ipv4;
sockaddr_in6 ipv6;
} source_address;
bool _has_src_addr;
};
class tcp_address_mask_t : public tcp_address_t
union
{
public:
tcp_address_mask_t ();
sockaddr generic;
sockaddr_in ipv4;
sockaddr_in6 ipv6;
} address;
// This function enhances tcp_address_t::resolve() with ability to parse
// additional cidr-like(/xx) mask value at the end of the name string.
// Works only with remote hostnames.
int resolve (const char *name_, bool ipv6_);
union
{
sockaddr generic;
sockaddr_in ipv4;
sockaddr_in6 ipv6;
} source_address;
bool _has_src_addr;
};
// The opposite to resolve()
int to_string (std::string &addr_);
class tcp_address_mask_t : public tcp_address_t
{
public:
tcp_address_mask_t ();
int mask () const;
// This function enhances tcp_address_t::resolve() with ability to parse
// additional cidr-like(/xx) mask value at the end of the name string.
// Works only with remote hostnames.
int resolve (const char *name_, bool ipv6_);
bool match_address (const struct sockaddr *ss, const socklen_t ss_len) const;
// The opposite to resolve()
int to_string (std::string &addr_);
private:
int address_mask;
};
int mask () const;
bool match_address (const struct sockaddr *ss,
const socklen_t ss_len) const;
private:
int address_mask;
};
}
#endif