diff --git a/swoc++/include/swoc/swoc_ip.h b/swoc++/include/swoc/swoc_ip.h index 8cc194b..eb6d5ed 100644 --- a/swoc++/include/swoc/swoc_ip.h +++ b/swoc++/include/swoc/swoc_ip.h @@ -63,6 +63,9 @@ union IPEndpoint { // Construct from @a IPAddr explicit IPEndpoint(IPAddr const& addr); + // Construct from @c sockaddr + IPEndpoint(sockaddr const * sa); + /** Break a string in to IP address relevant tokens. * * @param [in] src Source tex.t @@ -1960,6 +1963,10 @@ inline IPEndpoint::IPEndpoint(IPAddr const& addr) { this->assign(addr); } +inline IPEndpoint::IPEndpoint(sockaddr const * sa) { + this->assign(sa); +} + inline IPEndpoint& IPEndpoint::invalidate() { sa.sa_family = AF_UNSPEC;