E-MailRelay
Namespaces | Classes | Functions
GNet Namespace Reference

Network classes. More...

Namespaces

namespace  DnsBlockImp
 An implementation namespace for GNet::DnsBlock.
 
namespace  DnsMessageRecordTypeImp
 A private implementation namespace for GNet::DnsMessage.
 
namespace  EventHandlerListImp
 An implementation namespace for GNet::EventHandlerList.
 
namespace  ExceptionSinkImp
 An implementation namespace for GNet::ExceptionSink.
 
namespace  SocketImp
 An implementation namespace for G::Socket.
 
namespace  StreamSocketImp
 An implementation namespace for G::StreamSocket.
 

Classes

class  AcceptPair
 A 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. More...
 
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. More...
 
class  ClientPtrBase
 The non-template part of GNet::ClientPtr. More...
 
class  Connection
 An abstract interface which provides address information for 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  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  Done
 An exception class that is detected by GNet::EventHandlerList and results in onException() being called with the 'done' parameter set. More...
 
class  EventHandler
 A base class for classes that handle asynchronous events from the event loop. More...
 
class  EventHandlerList
 A class that maps from a file descriptor to an event handler and exception handler, used in the implemention of classes derived from GNet::EventLoop. 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
 A concrete implementation of GNet::EventLoop using select() in its implementation. More...
 
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  FdSet
 An "fd_set" wrapper class used by GNet::EventLoopImp. More...
 
class  FutureEvent
 A FutureEvent object can be used to send a one-shot event via the event loop 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. More...
 
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. More...
 
class  LineBuffer
 A class that does line buffering, supporting auto-detection of line endings and fixed-size block extraction. More...
 
class  LineBufferConfig
 A configuration structure for GNet::LineBuffer. More...
 
class  LineBufferIterator
 Syntactic sugar for calling GNet::LineBuffer iteration methods. More...
 
class  LineBufferState
 Provides information abount 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  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. More...
 
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. More...
 
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. More...
 
class  Server
 A network server class which listens on a specific port and spins off ServerPeer objects for each incoming connection. More...
 
struct  ServerConfig
 A configuration structure for GNet::Server. More...
 
class  ServerPeer
 An abstract base class for the GNet::Server's connection to a remote client. More...
 
class  ServerPeerConfig
 A structure that GNet::Server uses to configure its ServerPeer objects. More...
 
class  ServerPeerInfo
 A structure used in GNet::Server::newPeer(). 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. More...
 
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. More...
 
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)
 
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::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 611 of file gaddress.cpp.

◆ inet_pton_imp()

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

Definition at line 573 of file gaddress.cpp.

◆ operator+() [1/2]

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

Definition at line 153 of file glinestore.cpp.

◆ operator+() [2/2]

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

Definition at line 165 of file glinestore.cpp.

◆ operator-() [1/2]

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

Definition at line 171 of file glinestore.cpp.

◆ operator-() [2/2]

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

Definition at line 159 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 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.

◆ swap() [1/2]

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

Definition at line 285 of file gaddress.h.

◆ swap() [2/2]

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

Definition at line 175 of file glinestore.cpp.