adding constructor from in6_addr
dw6 [Wed, 19 Mar 2008 10:23:35 +0000 (10:23 +0000)]
INet6Address(in6_addr in6a)

git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@745 270642c3-0616-0410-b53a-bc976706d245

Socket/Protocols/INet/INet6Address.cci
Socket/Protocols/INet/INet6Address.hh

index 323968b..96e87f5 100644 (file)
@@ -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;
index dced404..16d2e44 100644 (file)
@@ -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