E-MailRelay

Public Types | Public Member Functions | Static Public Member Functions | List of all members
GNet::Address4 Class Reference

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

`#include <gaddress4.h>`

## Public Types
using | sockaddr_type = sockaddr_in

## Public Member Functions
| Address4 (unsigned int)
| Address4 (const std::string &)
| Address4 (const std::string &, const std::string &)
| Address4 (const std::string &, unsigned int)
| Address4 (unsigned int port, int)
| Address4 (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 Address4 &other, bool ipv6_compare_with_scope=false) const
bool | sameHostPart (const Address4 &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 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)
static bool | format (std::string)

## Detailed Description

A 'sockaddr' wrapper class for IPv4 addresses.

Definition at line 36 of file gaddress4.h.

## Member Typedef Documentation

## ◆ sockaddr_type

using GNet::Address4::sockaddr_type = sockaddr_in

Definition at line 39 of file gaddress4.h.

## Constructor & Destructor Documentation

## ◆ Address4() [1/6]

GNet::Address4::Address4 | ( | unsigned int | port | ) |
| explicit

Definition at line 60 of file gaddress4.cpp.

## ◆ Address4() [2/6]

GNet::Address4::Address4 | ( | const std::string & | display_string | ) |
| explicit

Definition at line 107 of file gaddress4.cpp.

## ◆ Address4() [3/6]

GNet::Address4::Address4 | ( | const std::string & | host_part,
|  | const std::string & | port_part
| ) |  |

Definition at line 97 of file gaddress4.cpp.

## ◆ Address4() [4/6]

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

Definition at line 87 of file gaddress4.cpp.

## ◆ Address4() [5/6]

GNet::Address4::Address4 | ( | unsigned int | port,
|  | int |
| ) |  |

Definition at line 68 of file gaddress4.cpp.

## ◆ Address4() [6/6]

GNet::Address4::Address4 | ( | const sockaddr * | addr,
|  | socklen_t | len,
|  | bool | ipv6_scope_id_fixup = `false`
| ) |  |

Definition at line 76 of file gaddress4.cpp.

## Member Function Documentation

## ◆ address() [1/2]

sockaddr * GNet::Address4::address | ( |  | ) |

Definition at line 267 of file gaddress4.cpp.

## ◆ address() [2/2]

const sockaddr * GNet::Address4::address | ( |  | ) | const

Definition at line 262 of file gaddress4.cpp.

## ◆ af()

unsigned short GNet::Address4::af | ( |  | ) |
| static noexcept

Definition at line 43 of file gaddress4.cpp.

## ◆ bits()

unsigned int GNet::Address4::bits | ( |  | ) | const

Definition at line 398 of file gaddress4.cpp.

## ◆ displayString()

std::string GNet::Address4::displayString | ( | bool | ipv6_with_scope = `false` | ) | const

Definition at line 171 of file gaddress4.cpp.

## ◆ domain()

int GNet::Address4::domain | ( |  | ) |
| static noexcept

Definition at line 48 of file gaddress4.cpp.

## ◆ format()

bool GNet::Address4::format | ( | std::string | s | ) |
| static

Definition at line 377 of file gaddress4.cpp.

## ◆ hostPartString()

std::string GNet::Address4::hostPartString | ( | bool | raw = `false` | ) | const

Definition at line 179 of file gaddress4.cpp.

## ◆ isAny()

bool GNet::Address4::isAny | ( |  | ) | const

Definition at line 445 of file gaddress4.cpp.

## ◆ isLinkLocal()

bool GNet::Address4::isLinkLocal | ( |  | ) | const

Definition at line 430 of file gaddress4.cpp.

## ◆ isLocal()

bool GNet::Address4::isLocal | ( | std::string & | reason | ) | const

Definition at line 407 of file gaddress4.cpp.

## ◆ isLoopback()

bool GNet::Address4::isLoopback | ( |  | ) | const

Definition at line 424 of file gaddress4.cpp.

## ◆ isUniqueLocal()

bool GNet::Address4::isUniqueLocal | ( |  | ) | const

Definition at line 436 of file gaddress4.cpp.

## ◆ length()

socklen_t GNet::Address4::length | ( |  | ) |
| static noexcept

Definition at line 272 of file gaddress4.cpp.

## ◆ port()

unsigned int GNet::Address4::port | ( |  | ) | const

Definition at line 252 of file gaddress4.cpp.

## ◆ queryString()

std::string GNet::Address4::queryString | ( |  | ) | const

Definition at line 190 of file gaddress4.cpp.

## ◆ same()

bool GNet::Address4::same | ( | const Address4 & | other,
|  | bool | ipv6_compare_with_scope = `false`
| ) |  | const

Definition at line 230 of file gaddress4.cpp.

## ◆ sameHostPart()

bool GNet::Address4::sameHostPart | ( | const Address4 & | other | ) | const

Definition at line 239 of file gaddress4.cpp.

## ◆ scopeId()

unsigned long GNet::Address4::scopeId | ( | unsigned long | default_ = `0UL` | ) | const

Definition at line 257 of file gaddress4.cpp.

## ◆ setPort()

void GNet::Address4::setPort | ( | unsigned int | port | ) |

Definition at line 140 of file gaddress4.cpp.

## ◆ setScopeId()

void GNet::Address4::setScopeId | ( | unsigned long | ipv6_scope_id | ) |

Definition at line 167 of file gaddress4.cpp.

## ◆ setZone()

bool GNet::Address4::setZone | ( | const std::string & | ipv6_zone_name_or_scope_id | ) |

Definition at line 162 of file gaddress4.cpp.

## ◆ validData()

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

Definition at line 197 of file gaddress4.cpp.

## ◆ validPort()

bool GNet::Address4::validPort | ( | unsigned int | port | ) |
| static

Definition at line 223 of file gaddress4.cpp.

## ◆ validString()

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

Definition at line 202 of file gaddress4.cpp.

## ◆ validStrings()

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

Definition at line 211 of file gaddress4.cpp.

## ◆ wildcards()

G::StringArray GNet::Address4::wildcards | ( |  | ) | const

Definition at line 277 of file gaddress4.cpp.

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

- /usr/src/slapt-src-x86_64/network/emailrelay/emailrelay-2.3/src/gnet/gaddress4.h
- /usr/src/slapt-src-x86_64/network/emailrelay/emailrelay-2.3/src/gnet/gaddress4.cpp