E-MailRelay
Public Types | Public Member Functions | Static Public Member Functions | List of all members
GNet::Address6 Class Reference

A 'sockaddr' wrapper class for IPv6 addresses. More...

#include <gaddress6.h>

Public Types

using sockaddr_type = sockaddr_in6
 

Public Member Functions

 Address6 (unsigned int)
 
 Address6 (const std::string &)
 
 Address6 (const std::string &, const std::string &)
 
 Address6 (const std::string &, unsigned int)
 
 Address6 (unsigned int port, int)
 
 Address6 (const sockaddr *addr, socklen_t len, bool ipv6_scope_id_fixup=false)
 
const sockaddr * address () const
 
sockaddr * address ()
 
unsigned long scopeId (unsigned long default_=0UL) const
 
unsigned int port () const
 
void setPort (unsigned int port)
 
bool setZone (const std::string &ipv6_zone_name_or_scope_id)
 
void setScopeId (unsigned long ipv6_scope_id)
 
bool same (const Address6 &other, bool ipv6_compare_with_scope=false) const
 
bool sameHostPart (const Address6 &other, bool ipv6_compare_with_scope=false) const
 
bool isLoopback () const
 
bool isLocal (std::string &) const
 
bool isLinkLocal () const
 
bool isUniqueLocal () const
 
bool isAny () const
 
unsigned int bits () const
 
std::string displayString (bool ipv6_with_scope=false) const
 
std::string hostPartString (bool raw=false) const
 
std::string queryString () const
 
G::StringArray wildcards () const
 

Static Public Member Functions

static int domain () noexcept
 
static unsigned short af () noexcept
 
static socklen_t length () noexcept
 
static bool validString (const std::string &, std::string *=nullptr)
 
static bool validStrings (const std::string &, const std::string &, std::string *=nullptr)
 
static bool validPort (unsigned int port)
 
static bool validData (const sockaddr *addr, socklen_t len)
 

Detailed Description

A 'sockaddr' wrapper class for IPv6 addresses.

Definition at line 36 of file gaddress6.h.

Member Typedef Documentation

◆ sockaddr_type

using GNet::Address6::sockaddr_type = sockaddr_in6

Definition at line 39 of file gaddress6.h.

Constructor & Destructor Documentation

◆ Address6() [1/6]

GNet::Address6::Address6 ( unsigned int  port)
explicit

Definition at line 65 of file gaddress6.cpp.

◆ Address6() [2/6]

GNet::Address6::Address6 ( const std::string &  display_string)
explicit

Definition at line 121 of file gaddress6.cpp.

◆ Address6() [3/6]

GNet::Address6::Address6 ( const std::string &  host_part,
const std::string &  port_part 
)

Definition at line 111 of file gaddress6.cpp.

◆ Address6() [4/6]

GNet::Address6::Address6 ( const std::string &  host_part,
unsigned int  port 
)

Definition at line 101 of file gaddress6.cpp.

◆ Address6() [5/6]

GNet::Address6::Address6 ( unsigned int  port,
int   
)

Definition at line 73 of file gaddress6.cpp.

◆ Address6() [6/6]

GNet::Address6::Address6 ( const sockaddr *  addr,
socklen_t  len,
bool  ipv6_scope_id_fixup = false 
)

Definition at line 81 of file gaddress6.cpp.

Member Function Documentation

◆ address() [1/2]

sockaddr * GNet::Address6::address ( )

Definition at line 332 of file gaddress6.cpp.

◆ address() [2/2]

const sockaddr * GNet::Address6::address ( ) const

Definition at line 325 of file gaddress6.cpp.

◆ af()

unsigned short GNet::Address6::af ( )
staticnoexcept

Definition at line 46 of file gaddress6.cpp.

◆ bits()

unsigned int GNet::Address6::bits ( ) const

Definition at line 431 of file gaddress6.cpp.

◆ displayString()

std::string GNet::Address6::displayString ( bool  ipv6_with_scope = false) const

Definition at line 220 of file gaddress6.cpp.

◆ domain()

int GNet::Address6::domain ( )
staticnoexcept

Definition at line 51 of file gaddress6.cpp.

◆ hostPartString()

std::string GNet::Address6::hostPartString ( bool  raw = false) const

Definition at line 230 of file gaddress6.cpp.

◆ isAny()

bool GNet::Address6::isAny ( ) const

Definition at line 482 of file gaddress6.cpp.

◆ isLinkLocal()

bool GNet::Address6::isLinkLocal ( ) const

Definition at line 464 of file gaddress6.cpp.

◆ isLocal()

bool GNet::Address6::isLocal ( std::string &  reason) const

Definition at line 441 of file gaddress6.cpp.

◆ isLoopback()

bool GNet::Address6::isLoopback ( ) const

::1/128

Definition at line 456 of file gaddress6.cpp.

◆ isUniqueLocal()

bool GNet::Address6::isUniqueLocal ( ) const

Definition at line 473 of file gaddress6.cpp.

◆ length()

socklen_t GNet::Address6::length ( )
staticnoexcept

Definition at line 337 of file gaddress6.cpp.

◆ port()

unsigned int GNet::Address6::port ( ) const

Definition at line 315 of file gaddress6.cpp.

◆ queryString()

std::string GNet::Address6::queryString ( ) const

Definition at line 241 of file gaddress6.cpp.

◆ same()

bool GNet::Address6::same ( const Address6 other,
bool  ipv6_compare_with_scope = false 
) const

Definition at line 286 of file gaddress6.cpp.

◆ sameHostPart()

bool GNet::Address6::sameHostPart ( const Address6 other,
bool  ipv6_compare_with_scope = false 
) const

Definition at line 296 of file gaddress6.cpp.

◆ scopeId()

unsigned long GNet::Address6::scopeId ( unsigned long  default_ = 0UL) const

Definition at line 320 of file gaddress6.cpp.

◆ setPort()

void GNet::Address6::setPort ( unsigned int  port)

Definition at line 170 of file gaddress6.cpp.

◆ setScopeId()

void GNet::Address6::setScopeId ( unsigned long  ipv6_scope_id)

Definition at line 215 of file gaddress6.cpp.

◆ setZone()

bool GNet::Address6::setZone ( const std::string &  ipv6_zone_name_or_scope_id)

Definition at line 192 of file gaddress6.cpp.

◆ validData()

bool GNet::Address6::validData ( const sockaddr *  addr,
socklen_t  len 
)
static

Definition at line 253 of file gaddress6.cpp.

◆ validPort()

bool GNet::Address6::validPort ( unsigned int  port)
static

Definition at line 279 of file gaddress6.cpp.

◆ validString()

bool GNet::Address6::validString ( const std::string &  s,
std::string *  reason_p = nullptr 
)
static

Definition at line 258 of file gaddress6.cpp.

◆ validStrings()

bool GNet::Address6::validStrings ( const std::string &  host_part,
const std::string &  port_part,
std::string *  reason_p = nullptr 
)
static

Definition at line 267 of file gaddress6.cpp.

◆ wildcards()

G::StringArray GNet::Address6::wildcards ( ) const

Definition at line 407 of file gaddress6.cpp.


The documentation for this class was generated from the following files: