E-MailRelay
Classes | Functions
GNet Namespace Reference

Network classes. More...

Classes

class  AcceptInfo
 A move-only class which is used to return a new()ed socket to calling code, together with associated address information. More...
 
class  Address
 The GNet::Address class encapsulates a TCP/UDP transport address. More...
 
class  Address4
 A 'sockaddr' wrapper class for IPv4 addresses. More...
 
class  Address6
 A 'sockaddr' wrapper class for IPv6 addresses. More...
 
class  AddressLocal
 A 'sockaddr' wrapper class for local-domain addresses. More...
 
class  AddressStorage
 A helper class for calling accept(), getsockname() and getpeername() and hiding the definition of sockaddr_storage. More...
 
class  AddressStorageImp
 A pimple-pattern implementation class used by GNet::AddressStorage.
 
class  Client
 A class for making an outgoing connection to a remote server, with support for socket-level protocols such as TLS/SSL and SOCKS 4a. More...
 
class  ClientPtr
 A smart pointer class for GNet::Client or similar. More...
 
class  ClientPtrBase
 The non-template part of GNet::ClientPtr. More...
 
class  Connection
 An abstract interface which provides information about a network connection. More...
 
class  DatagramSocket
 A derivation of GNet::Socket for a datagram socket. More...
 
class  Descriptor
 A class that encapsulates a network socket file descriptor and an associated windows event handle. More...
 
class  Dnsbl
 A minimal bridge to GNet::DnsBlock. More...
 
class  DnsblImp
 
class  DnsBlock
 Implements DNS blocklisting, as per RFC-5782. More...
 
class  DnsBlockCallback
 A callback interface for GNet::DnsBlock. More...
 
class  DnsBlockResult
 A result structure for GNet::DnsBlock, as delivered by the DnsBlockCallback interface. More...
 
class  DnsBlockServerResult
 A result structure for one DNSBL server. More...
 
class  DnsMessage
 A DNS message parser, with static factory functions for message composition. More...
 
class  DnsMessageNameParser
 An implementation class used by GNet::DnsMessage to parse compressed domain names. More...
 
class  DnsMessageQuestion
 Represents DNS question record. More...
 
class  DnsMessageRecordType
 A static class for mapping between a RR type name, such as "AAAA", and its corresponding numeric value. More...
 
class  DnsMessageRequest
 Represents a DNS query message. More...
 
class  DnsMessageRR
 Represents DNS response record. More...
 
class  DnsMessageRRData
 A trivial mix-in base class that simplifies method names when accessing data from a DnsMessageRR derived class. More...
 
class  Done
 An exception class that is caught separately by GNet::EventEmitter and GNet::TimerList so that onException() callbacks have their 'done' parameter set. More...
 
class  EventEmitter
 Provides static methods to raise an EventHandler event, as used by the various event loop implementations. More...
 
class  EventHandler
 A base class for classes that have a file descriptor and handle asynchronous events from the event loop. More...
 
class  EventLogging
 An interface for GNet classes that define a logging context string. More...
 
class  EventLoggingContext
 A class that sets the G::LogOuput::context() while in scope. More...
 
class  EventLoop
 An abstract base class for a singleton that keeps track of open sockets and their associated handlers. More...
 
class  EventLoopImp
 
class  EventState
 A lightweight object containing an ExceptionHandler pointer, optional ExceptionSource pointer and optional EventLogging pointer. More...
 
class  EventStateUnbound
 The EventStateUnbound class is used as a device to force factory methods to plumb-in an ExceptionSource pointer into the newly-created object as soon as its address is available, before the EventState propagates into base classes and sub-objects. More...
 
class  ExceptionHandler
 An abstract interface for handling exceptions thrown out of event-loop callbacks (socket/future events and timer events). More...
 
class  ExceptionSource
 A mixin base class that identifies the source of an exception when delivered to GNet::ExceptionHandler. More...
 
class  FutureEvent
 A FutureEvent object can be used to send a one-shot event between threads via the event loop, resulting in a call to the relevant event handler. More...
 
class  FutureEventHandler
 A callback interface for GNet::FutureEvent. More...
 
class  FutureEventImp
 A pimple-pattern implementation class used by GNet::FutureEvent.
 
class  Interfaces
 A class for getting a list of network interfaces and their addresses. More...
 
class  InterfacesHandler
 An interface for receiving notification of network changes. More...
 
class  InterfacesNotifier
 A pimple base-class used by GNet::Interfaces. More...
 
class  InterfacesNotifierImp
 Handles read events on a routing netlink socket.
 
class  LineBuffer
 A class that does line buffering, supporting auto-detection of line endings and fixed-size block extraction. More...
 
class  LineBufferState
 Provides information about the state of a line buffer. More...
 
class  LineStore
 A pair of character buffers, one kept by value and the other being an ephemeral extension. More...
 
class  LineStoreIterator
 An iterator class for GNet::LineStore. More...
 
class  Listener
 An interface for a network listener. More...
 
class  Listeners
 Represents a set of listening inputs which can be file-descriptor, interface or network address. More...
 
class  Local
 A static class for getting information about the local machine's network name and address. More...
 
class  Location
 A class that represents the remote target for out-going client connections. More...
 
class  Monitor
 A singleton for monitoring GNet::Client and GNet::ServerPeer connections. More...
 
class  MonitorImp
 A pimple-pattern implementation class for GNet::Monitor.
 
class  MultiServer
 A server that listens on more than one address using a facade pattern to multiple GNet::Server instances. More...
 
class  MultiServerImp
 A GNet::Server class used in GNet::MultiServer.
 
class  RawSocket
 A derivation of GNet::SocketBase for a raw socket, typically of type AF_NETLINK or PF_ROUTE. More...
 
class  Resolver
 A class for synchronous or asynchronous network name to address resolution. More...
 
class  ResolverFuture
 A 'future' shared-state class for asynchronous name resolution that holds parameters and results of a call to getaddrinfo(), as performed by the run() method. More...
 
class  ResolverImp
 A private "pimple" implementation class used by GNet::Resolver to do asynchronous name resolution.
 
class  Server
 A network server class which listens on a specific port and spins off ServerPeer objects for each incoming connection. More...
 
class  ServerPeer
 An abstract base class for the GNet::Server's connection to a remote client. More...
 
class  ServerPeerInfo
 A move-only structure used in GNet::Server::newPeer() and containing the new socket. More...
 
class  Socket
 An internet-protocol socket class. More...
 
class  SocketBase
 A socket base class that holds a non-blocking socket file descriptor and interfaces to the event loop. More...
 
class  SocketProtocol
 An interface for implementing a low-level TLS/SSL protocol layer on top of a connected non-blocking socket. More...
 
class  SocketProtocolImp
 A pimple-pattern implementation class used by GNet::SocketProtocol.
 
class  SocketProtocolSink
 An interface used by GNet::SocketProtocol to deliver data from a socket. More...
 
class  Socks
 Implements the SOCKS4a proxy connection protocol. More...
 
class  StreamSocket
 A derivation of GNet::Socket for a stream socket. More...
 
class  Task
 A class for running an exectuable in a separate process with an asychronous completion callback. More...
 
class  TaskCallback
 An abstract interface for callbacks from GNet::Task. More...
 
class  TaskImp
 A private implementation class used by GNet::Task.
 
class  Timer
 A timer class template in which the timeout is delivered to the specified method. More...
 
class  TimerBase
 An interface used by GNet::TimerList to keep track of pending timeouts and to deliver timeout events. More...
 
class  TimerList
 A singleton which maintains a list of all Timer objects, and interfaces to the event loop on their behalf. More...
 

Functions

int inet_pton_imp (int f, const char *p, void *result)
 
const char * inet_ntop_imp (int f, void *ap, char *buffer, std::size_t n)
 
void swap (Address &a, Address &b) noexcept
 
std::ostream & operator<< (std::ostream &stream, const Descriptor &d)
 
EventState esbindfriend (EventStateUnbound esu, ExceptionSource *esrc) noexcept
 
template<typename T >
EventState esbind (EventStateUnbound esu, T *p)
 
bool operator== (const LineBuffer::Config &a, const LineBuffer::Config &b) noexcept
 
LineStoreIterator operator+ (const LineStoreIterator &in, std::ptrdiff_t n)
 
LineStoreIterator operator- (const LineStoreIterator &in, std::ptrdiff_t n)
 
LineStoreIterator operator+ (std::ptrdiff_t n, const LineStoreIterator &in)
 
std::ptrdiff_t operator- (const LineStoreIterator &a, const LineStoreIterator &b)
 
std::ostream & operator<< (std::ostream &stream, const Location &location)
 
std::vector< Addressnameservers (unsigned int port=53U)
 
std::ostream & operator<< (std::ostream &stream, SocketProtocolImp::State state)
 
std::ostream & operator<< (std::ostream &stream, const SocketProtocolImp::Position &pos)
 
std::ostream & operator<< (std::ostream &stream, const SocketProtocolImp::Segments &segments)
 

Detailed Description

Network classes.

The GNet namespace contains network interface classes based on the Berkley socket and WinSock system APIs.

Key classes are:

Function Documentation

◆ esbind()

template<typename T >
EventState GNet::esbind ( EventStateUnbound  esu,
T *  p 
)

Definition at line 301 of file geventstate.h.

◆ esbindfriend()

EventState GNet::esbindfriend ( EventStateUnbound  esu,
ExceptionSource esrc 
)
inlinenoexcept

Definition at line 294 of file geventstate.h.

◆ inet_ntop_imp()

const char * GNet::inet_ntop_imp ( int  f,
void *  ap,
char *  buffer,
std::size_t  n 
)

Definition at line 595 of file gaddress.cpp.

◆ inet_pton_imp()

int GNet::inet_pton_imp ( int  f,
const char *  p,
void *  result 
)

Definition at line 555 of file gaddress.cpp.

◆ nameservers()

std::vector< GNet::Address > GNet::nameservers ( unsigned int  port = 53U)

Definition at line 28 of file gnameservers_unix.cpp.

◆ operator+() [1/2]

LineStoreIterator GNet::operator+ ( const LineStoreIterator in,
std::ptrdiff_t  n 
)
inline

Definition at line 134 of file glinestore.cpp.

◆ operator+() [2/2]

LineStoreIterator GNet::operator+ ( std::ptrdiff_t  n,
const LineStoreIterator in 
)
inline

Definition at line 146 of file glinestore.cpp.

◆ operator-() [1/2]

std::ptrdiff_t GNet::operator- ( const LineStoreIterator a,
const LineStoreIterator b 
)
inline

Definition at line 152 of file glinestore.cpp.

◆ operator-() [2/2]

LineStoreIterator GNet::operator- ( const LineStoreIterator in,
std::ptrdiff_t  n 
)
inline

Definition at line 140 of file glinestore.cpp.

◆ operator<<() [1/5]

std::ostream & GNet::operator<< ( std::ostream &  stream,
const Descriptor d 
)
inline

Definition at line 116 of file gdescriptor.h.

◆ operator<<() [2/5]

std::ostream & GNet::operator<< ( std::ostream &  stream,
const Location location 
)
inline

Definition at line 163 of file glocation.h.

◆ operator<<() [3/5]

std::ostream & GNet::operator<< ( std::ostream &  stream,
const SocketProtocolImp::Position &  pos 
)

Definition at line 129 of file gsocketprotocol.cpp.

◆ operator<<() [4/5]

std::ostream & GNet::operator<< ( std::ostream &  stream,
const SocketProtocolImp::Segments &  segments 
)

Definition at line 133 of file gsocketprotocol.cpp.

◆ operator<<() [5/5]

std::ostream & GNet::operator<< ( std::ostream &  stream,
SocketProtocolImp::State  state 
)

Definition at line 125 of file gsocketprotocol.cpp.

◆ operator==()

bool GNet::operator== ( const LineBuffer::Config a,
const LineBuffer::Config b 
)
inlinenoexcept

Definition at line 507 of file glinebuffer.h.

◆ swap()

void GNet::swap ( Address a,
Address b 
)
inlinenoexcept

Definition at line 299 of file gaddress.h.