diff --git a/Socket/Protocols/INet/INet6Address.cci b/Socket/Protocols/INet/INet6Address.cci index 323968b56f12a99d1fe689ae3b5cf3040d203090..96e87f5e1d8c225f0fada4008958a79115b31204 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 dced404e441c4bd16e9497be5db4ca1639f28378..16d2e44e29875e44b22255853fe790cddaddfa58 100644 --- a/Socket/Protocols/INet/INet6Address.hh +++ b/Socket/Protocols/INet/INet6Address.hh @@ -29,6 +29,7 @@ // Custom includes #include <iostream> #include <string> +#include <netinet/in.h> #include <boost/cstdint.hpp> #include <boost/array.hpp> #include <boost/operators.hpp> @@ -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