Prefix-based constructors for IPAddress

This commit is contained in:
Aleksandar Fabijanic
2012-06-12 03:16:44 +00:00
parent 74b8911d13
commit 771d5ed0b0
5 changed files with 541 additions and 443 deletions

View File

@@ -116,6 +116,18 @@ public:
/// may be specified. The scope ID will be ignored if an IPv4
/// address is specified.
IPAddress(unsigned prefix, Family family);
/// Creates an IPAddress mask with the given length of prefix.
#if defined(_WIN32)
IPAddress(const SOCKET_ADDRESS& socket_address);
/// Creates an IPAddress from a SOCKET_ADDRESS wrapper for Windows.
#endif
IPAddress(const struct sockaddr& sockaddr);
/// Same for struct sock_addr on POSIX.
~IPAddress();
/// Destroys the IPAddress.