MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / parse

Method parse

base/poco/Net/src/IPAddressImpl.cpp:256–273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

254
255
256IPv4AddressImpl 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
276void IPv4AddressImpl::mask(const IPAddressImpl* pMask, const IPAddressImpl* pSet)

Callers

nothing calls this directly

Calls 5

IPv4AddressImplClass · 0.85
IPv6AddressImplClass · 0.85
emptyMethod · 0.45
findMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected