diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2012-05-14 01:17:50 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2012-05-14 01:17:50 +0900 |
| commit | ca60020fa4230b27c0c3ded1ddac375061a027a9 (patch) | |
| tree | e84332d21b1bbfa7093e63c465b5c9e14faf6e32 /src/SocketCore.h | |
| parent | 06405ce97b3da52241adb3f6732846f824823951 (diff) | |
Removed dependency on inet_aton
Implemented inetPton as a replacement of inet_aton. inetPton is
implemented using net::getBinAddr.
This change fixes bug#3525424.
Diffstat (limited to 'src/SocketCore.h')
| -rw-r--r-- | src/SocketCore.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/SocketCore.h b/src/SocketCore.h index 4fad452e..bbf2fe39 100644 --- a/src/SocketCore.h +++ b/src/SocketCore.h @@ -381,6 +381,13 @@ void getInterfaceAddress // message using gai_strerror(3). int inetNtop(int af, const void* src, char* dst, socklen_t size); +// Provides functionality of inet_pton using getBinAddr. If af is +// AF_INET, dst is assumed to be the pointer to struct in_addr. If af +// is AF_INET6, dst is assumed to be the pointer to struct in6_addr. +// +// This function returns 0 if it succeeds, or -1. +int inetPton(int af, const char* src, void* dst); + namespace net { // Stores binary representation of IP address ip which is represented @@ -389,7 +396,7 @@ namespace net { // at least 4. For IPv6 address, dest must be at least 16. Returns the // number of bytes written in dest, that is 4 for IPv4 and 16 for // IPv6. Return 0 if error occurred. -size_t getBinAddr(unsigned char* dest, const std::string& ip); +size_t getBinAddr(void* dest, const std::string& ip); // Verifies hostname against presented identifiers in the certificate. // The implementation is based on the procedure described in RFC 6125. |
