| 254 | |
| 255 | |
| 256 | IPv4AddressImpl IPv4AddressImpl::parse(const std::string& addr) |
| 257 | { |
| 258 | if (addr.empty()) return IPv4AddressImpl(); |
| 259 | #if __GNUC__ < 3 || defined(POCO_VXWORKS) |
| 260 | struct in_addr ia; |
| 261 | ia.s_addr = inet_addr(const_cast<char*>(addr.c_str())); |
| 262 | if (ia.s_addr == INADDR_NONE && addr != "255.255.255.255") |
| 263 | return IPv4AddressImpl(); |
| 264 | else |
| 265 | return IPv4AddressImpl(&ia); |
| 266 | #else |
| 267 | struct in_addr ia; |
| 268 | if (inet_aton(addr.c_str(), &ia)) |
| 269 | return IPv4AddressImpl(&ia); |
| 270 | else |
| 271 | return IPv4AddressImpl(); |
| 272 | #endif |
| 273 | } |
| 274 | |
| 275 | |
| 276 | void IPv4AddressImpl::mask(const IPAddressImpl* pMask, const IPAddressImpl* pSet) |
nothing calls this directly
no test coverage detected