17 #ifndef HH_SENF_Socket_Protocols_INet_INet6Address_ 18 #define HH_SENF_Socket_Protocols_INet_INet6Address_ 1 22 #include <netinet/in.h> 23 #include <boost/cstdint.hpp> 24 #include <boost/array.hpp> 25 #include <boost/operators.hpp> 120 :
public boost::array<boost::uint8_t,16>,
158 explicit INet6Address(boost::uint16_t a0=0u, boost::uint16_t a1=0u, boost::uint16_t a2=0u,
159 boost::uint16_t a3=0u, boost::uint16_t a4=0u, boost::uint16_t a5=0u,
160 boost::uint16_t a6=0u, boost::uint16_t a7=0u);
184 template <
class InputIterator>
276 void network(boost::uint64_t net);
277 void id(boost::uint64_t
id);
323 template <
unsigned a0,
unsigned a1,
unsigned a2=0u,
unsigned a3=0u,
unsigned a4=0u,
324 unsigned a5=0u,
unsigned a6=0u,
unsigned a7=0u,
unsigned a8=0u>
327 :
public detail::CheckINet6Network_impl<a0,a1,a2,a3,a4,a5,a6,a7,a8>
336 :
public boost::equality_comparable<INet6Network>,
353 unsigned prefix_len()
const;
368 INet6Network subnet(boost::uint64_t net,
unsigned prefix_len);
383 unsigned prefix_len_;
386 unsigned prefix_len_checked(
unsigned prefix_len)
const;
bool groupId() const
true, if the id()'s group bit is set
ScopeId scope() const
Get address's scope.
static INet6Address from_string(std::string const &s, Resolve_t resolve=ResolveINet6)
Convert string to address.
INet4Address inet4address() const
Return embedded INet4 address.
bool inet4Compatible() const
true, if address is INet4 compatible
bool unicast() const
true, if address is unicast
Check INet6Address against a fixed network prefix.
bool embeddedRpAddr() const
true, if R bit is set
bool universalId() const
true, if the id() is universally assigned
bool globalMulticastAddr() const
true, if T bit is not set
static INet6Address const Loopback
The loopback (::1) address.
in6_addr toin6_addr() const
get the linux in6_addr struct (convenience only)
INet6Network network() const
Return /64 Network of this address.
std::ostream & operator<<(std::ostream &os, INet6Address const &addr)
Output INet6Address instance as it's string representation.
INet4Address public header.
bool linkScope() const
true, if address is link-local unicast or multicast
static INet6Address const AllNodes
The 'all nodes' link-local multicast address.
static INet6Address from_inet4address(INet4Address const &addr)
Construct an INet6-mapped INet4 address.
bool operator==(EUI64 const &eui64, MACAddress const &mac)
static INet6Address const AllRouters
The 'all routers' link-local multicast address.
static INet6Address from_in6addr(in6_addr const &in6addr)
Construct from std C struct.
bool boolean_test() const
true, if address != '::' (None)
bool inet4Mapped() const
true, if address is INet4 mapped
EUI64 id() const
Return interface id (EUID-64)
INet6Address(senf::NoInit_t)
Construct uninitialized (!) address.
static INet6Address from_data(InputIterator i)
Construct address from 16 bytes of raw data.
std::istream & operator>>(std::istream &is, INet6Address &addr)
Try to initialize INet6Address instance from a string representation.
bool globalScope() const
true, if address is global unicast or multicast
static INet6Address from_eui64(EUI64 const &eui)
Construct link-local INet6 address.
bool hasEUI64() const
true, if address is based on an EUID-64
static INet6Address const None
The empty (::0) address.
ScopeId
Possible scope values.
bool multicast() const
true, if address is multicast
static INet6Address from_mac(MACAddress const &mac)
Construct a link-local INet6 address.
bool prefixMulticastAddr() const
true, if P bit is set