21#ifndef G_NET_ADDRESS6_H
22#define G_NET_ADDRESS6_H
39 using sockaddr_type = sockaddr_in6 ;
42 explicit Address6(
const std::string & ) ;
43 Address6(
const std::string & ,
const std::string & ) ;
44 Address6(
const std::string & ,
unsigned int ) ;
45 Address6(
unsigned int port ,
int ) ;
46 Address6(
const sockaddr * addr , socklen_t len ,
bool ipv6_scope_id_fixup =
false ) ;
48 static int domain() noexcept ;
49 static unsigned short af() noexcept ;
50 const sockaddr * address()
const ;
51 sockaddr * address() ;
52 static socklen_t length() noexcept ;
53 unsigned long scopeId(
unsigned long default_ = 0UL )
const ;
54 unsigned int port()
const ;
55 void setPort(
unsigned int port ) ;
56 bool setZone(
const std::string & ipv6_zone_name_or_scope_id ) ;
57 void setScopeId(
unsigned long ipv6_scope_id ) ;
58 static bool validString(
const std::string & , std::string * =
nullptr ) ;
59 static bool validStrings(
const std::string & ,
const std::string & , std::string * =
nullptr ) ;
60 static bool validPort(
unsigned int port ) ;
61 static bool validData(
const sockaddr * addr , socklen_t len ) ;
63 bool same(
const Address6 & other ,
bool ipv6_compare_with_scope =
false )
const ;
64 bool sameHostPart(
const Address6 & other ,
bool ipv6_compare_with_scope =
false )
const ;
66 bool isLocal( std::string & )
const ;
67 bool isLinkLocal()
const ;
68 bool isUniqueLocal()
const ;
70 unsigned int bits()
const ;
71 std::string displayString(
bool ipv6_with_scope =
false )
const ;
72 std::string hostPartString(
bool raw =
false )
const ;
73 std::string queryString()
const ;
77 explicit Address6( std::nullptr_t ) ;
78 static const char * setAddress( sockaddr_type & ,
const std::string & ) ;
79 static const char * setHostAddress( sockaddr_type & ,
const std::string & ) ;
80 static const char * setPort( sockaddr_type & ,
unsigned int ) ;
81 static const char * setPort( sockaddr_type & ,
const std::string & ) ;
82 static bool sameAddr( const ::in6_addr & a , const ::in6_addr & b ) ;
83 static bool setZone( sockaddr_type & ,
const std::string & ) ;
86 sockaddr_type m_inet ;
A 'sockaddr' wrapper class for IPv6 addresses.
std::vector< std::string > StringArray
A std::vector of std::strings.