From: dw6 Date: Wed, 19 Mar 2008 10:23:35 +0000 (+0000) Subject: adding constructor from in6_addr X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=d99f412f95e9c56b4f7e6fee860cd80234c89107;p=senf.git adding constructor from in6_addr INet6Address(in6_addr in6a) git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@745 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/Socket/Protocols/INet/INet6Address.cci b/Socket/Protocols/INet/INet6Address.cci index 323968b..96e87f5 100644 --- a/Socket/Protocols/INet/INet6Address.cci +++ b/Socket/Protocols/INet/INet6Address.cci @@ -58,6 +58,12 @@ prefix_ senf::INet6Address::INet6Address(boost::uint16_t a0, boost::uint16_t a1, (*this)[15] = boost::uint8_t(a7); } +prefix_ senf::INet6Address::INet6Address(in6_addr in6addr){ + senf::INet6Address::from_data(&in6addr.s6_addr[0]); +} + + + prefix_ senf::INet6Address senf::INet6Address::from_inet4address(INet4Address addr4) { INet6Address addr; diff --git a/Socket/Protocols/INet/INet6Address.hh b/Socket/Protocols/INet/INet6Address.hh index dced404..16d2e44 100644 --- a/Socket/Protocols/INet/INet6Address.hh +++ b/Socket/Protocols/INet/INet6Address.hh @@ -29,6 +29,7 @@ // Custom includes #include #include +#include #include #include #include @@ -165,6 +166,8 @@ namespace senf { boost::uint16_t a3=0u, boost::uint16_t a4=0u, boost::uint16_t a5=0u, boost::uint16_t a6=0u, boost::uint16_t a7=0u); ///< Construct an address constant + + INet6Address(in6_addr in6addr); ///< Construct from std c struct static INet6Address from_string(std::string const & s, Resolve_t resolve = ResolveINet6); ///< Convert string to address