E-MailRelay
|
A 'sockaddr' wrapper class for local-domain addresses. More...
#include <gaddresslocal.h>
Public Types | |
using | sockaddr_type = sockaddr_un |
Public Member Functions | |
AddressLocal (unsigned int) | |
AddressLocal (const std::string &) | |
AddressLocal (const std::string &, const std::string &) | |
AddressLocal (const std::string &, unsigned int) | |
AddressLocal (unsigned int port, int) | |
AddressLocal (const sockaddr *addr, socklen_t len, bool ipv6_scope_id_fixup=false) | |
const sockaddr * | address () const |
sockaddr * | address () |
socklen_t | length () const noexcept |
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 AddressLocal &other, bool ipv6_compare_with_scope=false) const |
bool | sameHostPart (const AddressLocal &other) 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 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) |
static bool | format (const std::string &) |
A 'sockaddr' wrapper class for local-domain addresses.
Use "netcat -U" or "socat" to connect to local-domain sockets, eg:
Definition at line 54 of file gaddresslocal.h.
using GNet::AddressLocal::sockaddr_type = sockaddr_un |
Definition at line 57 of file gaddresslocal.h.
|
explicit |
Definition at line 76 of file gaddresslocal_unix.cpp.
|
explicit |
Definition at line 114 of file gaddresslocal_unix.cpp.
GNet::AddressLocal::AddressLocal | ( | const std::string & | host_part, |
const std::string & | |||
) |
Definition at line 109 of file gaddresslocal_unix.cpp.
GNet::AddressLocal::AddressLocal | ( | const std::string & | host_part, |
unsigned int | |||
) |
Definition at line 100 of file gaddresslocal_unix.cpp.
GNet::AddressLocal::AddressLocal | ( | unsigned int | port, |
int | |||
) |
Definition at line 81 of file gaddresslocal_unix.cpp.
GNet::AddressLocal::AddressLocal | ( | const sockaddr * | addr, |
socklen_t | len, | ||
bool | ipv6_scope_id_fixup = false |
||
) |
Definition at line 86 of file gaddresslocal_unix.cpp.
sockaddr * GNet::AddressLocal::address | ( | ) |
Definition at line 220 of file gaddresslocal_unix.cpp.
const sockaddr * GNet::AddressLocal::address | ( | ) | const |
Definition at line 215 of file gaddresslocal_unix.cpp.
|
staticnoexcept |
Definition at line 58 of file gaddresslocal_unix.cpp.
unsigned int GNet::AddressLocal::bits | ( | ) | const |
Definition at line 265 of file gaddresslocal_unix.cpp.
std::string GNet::AddressLocal::displayString | ( | bool | ipv6_with_scope = false | ) | const |
Definition at line 145 of file gaddresslocal_unix.cpp.
|
staticnoexcept |
Definition at line 63 of file gaddresslocal_unix.cpp.
|
static |
Definition at line 235 of file gaddresslocal_unix.cpp.
std::string GNet::AddressLocal::hostPartString | ( | bool | raw = false | ) | const |
Definition at line 151 of file gaddresslocal_unix.cpp.
bool GNet::AddressLocal::isAny | ( | ) | const |
Definition at line 260 of file gaddresslocal_unix.cpp.
bool GNet::AddressLocal::isLinkLocal | ( | ) | const |
Definition at line 250 of file gaddresslocal_unix.cpp.
bool GNet::AddressLocal::isLocal | ( | std::string & | ) | const |
Definition at line 240 of file gaddresslocal_unix.cpp.
bool GNet::AddressLocal::isLoopback | ( | ) | const |
Definition at line 245 of file gaddresslocal_unix.cpp.
bool GNet::AddressLocal::isUniqueLocal | ( | ) | const |
Definition at line 255 of file gaddresslocal_unix.cpp.
|
noexcept |
Definition at line 225 of file gaddresslocal_unix.cpp.
unsigned int GNet::AddressLocal::port | ( | ) | const |
Definition at line 205 of file gaddresslocal_unix.cpp.
std::string GNet::AddressLocal::queryString | ( | ) | const |
Definition at line 156 of file gaddresslocal_unix.cpp.
bool GNet::AddressLocal::same | ( | const AddressLocal & | other, |
bool | ipv6_compare_with_scope = false |
||
) | const |
Definition at line 191 of file gaddresslocal_unix.cpp.
bool GNet::AddressLocal::sameHostPart | ( | const AddressLocal & | other | ) | const |
Definition at line 200 of file gaddresslocal_unix.cpp.
unsigned long GNet::AddressLocal::scopeId | ( | unsigned long | default_ = 0UL | ) | const |
Definition at line 210 of file gaddresslocal_unix.cpp.
void GNet::AddressLocal::setPort | ( | unsigned int | port | ) |
Definition at line 119 of file gaddresslocal_unix.cpp.
void GNet::AddressLocal::setScopeId | ( | unsigned long | ipv6_scope_id | ) |
Definition at line 128 of file gaddresslocal_unix.cpp.
bool GNet::AddressLocal::setZone | ( | const std::string & | ipv6_zone_name_or_scope_id | ) |
Definition at line 123 of file gaddresslocal_unix.cpp.
|
static |
Definition at line 161 of file gaddresslocal_unix.cpp.
|
static |
Definition at line 186 of file gaddresslocal_unix.cpp.
|
static |
Definition at line 166 of file gaddresslocal_unix.cpp.
|
static |
Definition at line 180 of file gaddresslocal_unix.cpp.
G::StringArray GNet::AddressLocal::wildcards | ( | ) | const |
Definition at line 230 of file gaddresslocal_unix.cpp.