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 detected by GNet::EventHandlerList and results in onException() being called with the 'done' parameter set. More...
 
class  EventEmitter
 An EventHandler and ExceptionSink tuple, with methods to raise an event and handle any exceptions. More...
 
class  EventHandler
 A base class for classes that have a file descriptor and handle asynchronous events from the event loop. 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  ExceptionHandler
 An abstract interface for handling exceptions thrown out of event-loop callbacks (socket/future events and timer events). More...
 
class  ExceptionSink
 A tuple containing an ExceptionHandler interface pointer and a bound 'exception source' pointer. More...
 
class  ExceptionSinkUnbound
 A potential ExceptionSink that is realised by bind()ing an exception source pointer. More...
 
class  ExceptionSource
 A mixin base class that identifies the source of an exception when delivered to GNet::ExceptionHandler and optionally provides an indentifier for logging purposes. 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
 Used by GNet::MultiServer to represent a set of listening inputs (fd, interface or 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)
 
bool operator== (const LineBuffer::Config &a, const LineBuffer::Config &b) noexcept
 
LineStoreIterator operator+ (const LineStoreIterator &in, ptrdiff_t n)
 
LineStoreIterator operator- (const LineStoreIterator &in, ptrdiff_t n)
 
LineStoreIterator operator+ (ptrdiff_t n, const LineStoreIterator &in)
 
ptrdiff_t operator- (const LineStoreIterator &a, const LineStoreIterator &b)
 
void swap (LineStoreIterator &a, LineStoreIterator &b) noexcept
 
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

◆ inet_ntop_imp()

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

Definition at line 597 of file gaddress.cpp.

◆ inet_pton_imp()

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

Definition at line 557 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,
ptrdiff_t  n 
)
inline

Definition at line 149 of file glinestore.cpp.

◆ operator+() [2/2]

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

Definition at line 161 of file glinestore.cpp.

◆ operator-() [1/2]

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

Definition at line 167 of file glinestore.cpp.

◆ operator-() [2/2]

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

Definition at line 155 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 171 of file glocation.h.

◆ operator<<() [3/5]

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

Definition at line 130 of file gsocketprotocol.cpp.

◆ operator<<() [4/5]

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

Definition at line 134 of file gsocketprotocol.cpp.

◆ operator<<() [5/5]

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

Definition at line 126 of file gsocketprotocol.cpp.

◆ operator==()

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

Definition at line 498 of file glinebuffer.h.

◆ swap() [1/2]

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

Definition at line 298 of file gaddress.h.

◆ swap() [2/2]

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

Definition at line 171 of file glinestore.cpp.