Skip to content
Snippets Groups Projects
Commit 5d489516 authored by dw6's avatar dw6
Browse files

adding constructor from in6_addr

INet6Address(in6_addr in6a)
parent 354cc867
No related branches found
No related tags found
No related merge requests found
...@@ -58,6 +58,12 @@ prefix_ senf::INet6Address::INet6Address(boost::uint16_t a0, boost::uint16_t a1, ...@@ -58,6 +58,12 @@ prefix_ senf::INet6Address::INet6Address(boost::uint16_t a0, boost::uint16_t a1,
(*this)[15] = boost::uint8_t(a7); (*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) prefix_ senf::INet6Address senf::INet6Address::from_inet4address(INet4Address addr4)
{ {
INet6Address addr; INet6Address addr;
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
// Custom includes // Custom includes
#include <iostream> #include <iostream>
#include <string> #include <string>
#include <netinet/in.h>
#include <boost/cstdint.hpp> #include <boost/cstdint.hpp>
#include <boost/array.hpp> #include <boost/array.hpp>
#include <boost/operators.hpp> #include <boost/operators.hpp>
...@@ -165,6 +166,8 @@ namespace senf { ...@@ -165,6 +166,8 @@ namespace senf {
boost::uint16_t a3=0u, boost::uint16_t a4=0u, boost::uint16_t a5=0u, 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); boost::uint16_t a6=0u, boost::uint16_t a7=0u);
///< Construct an address constant ///< 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); static INet6Address from_string(std::string const & s, Resolve_t resolve = ResolveINet6);
///< Convert string to address ///< Convert string to address
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment