libutil++  1.9.3
 All Classes Functions Variables
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
sella::net::SecureTCPSocket Class Reference
Inheritance diagram for sella::net::SecureTCPSocket:
sella::net::TCPSocket sella::net::Socket

Public Types

enum  Protocol : int8_t { SSLv3, TLSv1_0, TLSv1_1, TLSv1_2 }
 
typedef std::shared_ptr
< SecureTCPSocket
shared
 
typedef SecureTCPSocketptr
 
- Public Types inherited from sella::net::TCPSocket
typedef std::shared_ptr
< TCPSocket
shared
 
typedef TCPSocketptr
 
- Public Types inherited from sella::net::Socket
typedef std::shared_ptr< Socketshared
 
typedef Socketptr
 

Public Member Functions

 SecureTCPSocket (int family) throw (SocketException)
 
 SecureTCPSocket (int family, const IPAddressPort &addressport) throw (SocketException)
 
 SecureTCPSocket (int family, const IPAddress &address, const Port &port) throw (SocketException)
 
 SecureTCPSocket (int family, const std::string &address, unsigned short port) throw (SocketException)
 
 SecureTCPSocket (const IPAddressPort &addressport) throw (SocketException)
 
 SecureTCPSocket (const IPAddress &address, const Port &port) throw (SocketException)
 
 SecureTCPSocket (const SecureTCPSocket &sock)=delete
 
void operator= (const SecureTCPSocket &sock)=delete
 
void setCertificateFile (const std::string &certificateFile) throw ()
 
void setPrivateKeyFile (const std::string &privateKeyFile) throw ()
 
void setPasswordFile (const std::string &passwordFile) throw ()
 
void setPassword (const std::string &password) throw ()
 
void setCertificateChainFile (const std::string &certificateChainFile) throw ()
 
void setCACertificateFile (const std::string &caCertificateFile) throw ()
 
void setProtocols (const std::set< Protocol > &protocols=DefaultProtocols) throw ()
 
void setProtocol (Protocol protocol, bool on=true) throw ()
 
void setCiphers (const std::string &ciphers=PerformanceCiphers) throw ()
 
void setPreferServerCiphers (bool on=true) throw ()
 
virtual bool isSecure (void) const throw ()
 
virtual TCPSocket::shared accept (void) throw (SocketException)
 
const char * getSSLLibraryVersion (void) const throw ()
 
const char * getActiveProtocol (void) const throw (SocketException)
 
const char * getActiveCipher (void) const throw (SocketException)
 
virtual ssize_t send (const void *data, size_t len, int flags) throw (SocketException)
 
virtual ssize_t recv (void *data, size_t len, int flags) throw (SocketException)
 
- Public Member Functions inherited from sella::net::TCPSocket
 TCPSocket (int family) throw (SocketException)
 
 TCPSocket (int family, const IPAddressPort &addressport) throw (SocketException)
 
 TCPSocket (int family, const IPAddress &address, const Port &port) throw (SocketException)
 
 TCPSocket (int family, const std::string &address, unsigned short port) throw (SocketException)
 
 TCPSocket (const IPAddressPort &addressport) throw (SocketException)
 
 TCPSocket (const IPAddress &address, const Port &port) throw (SocketException)
 
 TCPSocket (const TCPSocket &sock)=delete
 
void operator= (const TCPSocket &sock)=delete
 
virtual void listen (int backlog=TCPSOCKET_LISTEN_BACKLOG_DEF) throw (SocketException)
 
- Public Member Functions inherited from sella::net::Socket
 Socket (const Socket &sock)=delete
 
void operator= (const Socket &sock)=delete
 
void bind (const IPAddressPort &addressport) throw (SocketException)
 
void bind (const IPAddress &address, const Port &port) throw (SocketException)
 
void bind (const std::string &address=std::string(), const unsigned short port=0) throw (SocketException)
 
void connect (const IPAddressPort &addressport) throw (SocketException)
 
void connect (const IPAddress &address, const Port &port) throw (SocketException)
 
void connect (const std::string &address, const unsigned short port) throw (SocketException)
 
virtual ssize_t send (const std::string &data, int flags=0) throw (SocketException)
 
virtual ssize_t send (const std::vector< uint8_t > &data, int flags=0) throw (SocketException)
 
virtual ssize_t recv (std::string &data, size_t len=RecvSizeDefault, int flags=0) throw (SocketException)
 
virtual ssize_t recv (std::vector< uint8_t > &data, size_t len=RecvSizeDefault, int flags=0) throw (SocketException)
 
int getFD (void) const
 
bool isRead (void) const
 
bool isWrite (void) const
 
bool isExcept (void) const
 
bool hasData (void) const throw (SocketException)
 
int getQueuedBytes (void) const throw (SocketException)
 
IPAddressPort getLocalIPAddressPort (void) const throw (SocketException)
 
IPAddress getLocalIPAddress (void) const throw (SocketException)
 
Port getLocalPort (void) const throw (SocketException)
 
IPAddressPort getRemoteIPAddressPort (void) const throw (SocketException)
 
IPAddress getRemoteIPAddress (void) const throw (SocketException)
 
Port getRemotePort (void) const throw (SocketException)
 
int getFamily (void) const throw ()
 
bool isUsable (void) const throw ()
 
bool hasMux (void) const throw ()
 
void setBlock (bool on=true) throw (SocketException)
 
bool isBlock (void) throw (SocketException)
 
void setIpOptions (const void *option, socklen_t len) throw (SocketException)
 
void setIpPktInfo (bool on=true) throw (SocketException)
 
void setIpRecvTOS (bool on=true) throw (SocketException)
 
void setIpRecvTTL (bool on=true) throw (SocketException)
 
void setIpRecvOpts (bool on=true) throw (SocketException)
 
void setIpRetOpts (bool on=true) throw (SocketException)
 
void setIpTOS (unsigned char tos) throw (SocketException)
 
unsigned char getIpTOS (void) const throw (SocketException)
 
void setIpTTL (int ttl) throw (SocketException)
 
int getIpTTL (void) const throw (SocketException)
 
void setIpHdrIncl (bool on=true) throw (SocketException)
 
void setIpRecvErr (bool on=true) throw (SocketException)
 
void setIpMtuDiscover (bool on=true) throw (SocketException)
 
int getIpMtu (void) const throw (SocketException)
 
void setIpRouterAlert (bool on=true) throw (SocketException)
 
void setIpMulticastTTL (int ttl) throw (SocketException)
 
int getIpMulticastTTL (void) const throw (SocketException)
 
void setIpMulticastLoop (bool on=true) throw (SocketException)
 
void setIpAddMembership (struct ip_mreqn &m) throw (SocketException)
 
void setIpDropMembership (struct ip_mreqn &m) throw (SocketException)
 
void setSoReuseAddr (bool on=true) throw (SocketException)
 
void setSoKeepAlive (bool on=true) throw (SocketException)
 
void setSoNoSigPipe (bool on=true) throw (SocketException)
 
bool getSoAcceptConn (void) const throw (SocketException)
 
void setSoBindToDevice (const std::string &interface) throw (SocketException)
 
void setSoBroadcast (bool on=true) throw (SocketException)
 
void setSoDebug (bool on=true) throw (SocketException)
 
int getSoError (void) const throw (SocketException)
 
void setSoDontRoute (bool on=true) throw (SocketException)
 
void setSoLinger (int onoff, int linger) throw (SocketException)
 
void setSoPriority (int pri) throw (SocketException)
 
void setSoRcvTimeo (struct timeval &tv) throw (SocketException)
 
void setSoSndTimeo (struct timeval &tv) throw (SocketException)
 
void setSoRcvBuf (int bytes) throw (SocketException)
 
void setSoRcvBufForce (int bytes) throw (SocketException)
 
int getSoRcvBuf (void) const throw (SocketException)
 
void setSoSndBuf (int bytes) throw (SocketException)
 
void setSoSndBufForce (int bytes) throw (SocketException)
 
int getSoSndBuf (void) const throw (SocketException)
 
void setSoTimestamp (bool on=true) throw (SocketException)
 
int getSoType (void) throw (SocketException)
 
void setIpv6AddrForm (int family=AF_INET) throw (SocketException)
 
void setIp6AddMembership (struct ipv6_mreq &m) throw (SocketException)
 
void setIp6DropMembership (struct ipv6_mreq &m) throw (SocketException)
 
void setIpv6Mtu (int bytes) throw (SocketException)
 
void setIpv6MtuDiscover (bool on=true) throw (SocketException)
 
void setIpv6MutlicastHops (int hops=-1) throw (SocketException)
 
void setIpv6MutlicastIf (int ifindex) throw (SocketException)
 
void setIpv6MulticastLoop (bool on=true) throw (SocketException)
 
void setIpv6RecvPktInfo (bool on=true) throw (SocketException)
 
void setIpv6RtHdr (bool on=true) throw (SocketException)
 
void setIpv6AuthHdr (bool on=true) throw (SocketException)
 
void setIpv6DstOpts (bool on=true) throw (SocketException)
 
void setIpv6HopOpts (bool on=true) throw (SocketException)
 
void setIpv6FlowInfo (bool on=true) throw (SocketException)
 
void setIpv6HopLimit (bool on=true) throw (SocketException)
 
void setIpv6RecvErr (bool on=true) throw (SocketException)
 
void setIpv6RouterAlert (int option=-1) throw (SocketException)
 
void setIpv6UnicastHops (int limit=-1) throw (SocketException)
 
void setIpv6V6Only (bool on=true) throw (SocketException)
 
bool getIpv6V6Only (void) const throw (SocketException)
 
void mmapRingBuffer (unsigned char **ring, struct tpacket_req &req) throw (SocketException)
 
void munmapRingBuffer (unsigned char **ring, struct tpacket_req &req) throw (SocketException)
 
void setPacketRxRing (struct tpacket_req &req, int version=TPACKET_V2) throw (SocketException)
 
void setPacketTxRing (struct tpacket_req &req, int version=TPACKET_V2) throw (SocketException)
 
int getPacketHdrLen (int version=TPACKET_V2) throw (SocketException)
 
void setPacketLoss (bool drop=true) throw (SocketException)
 

Static Public Member Functions

static const
SecureTCPSocket::shared 
shared_ptr (int family) throw (SocketException)
 
static const
SecureTCPSocket::shared 
shared_ptr (int family, const IPAddressPort &addressport) throw (SocketException)
 
static const
SecureTCPSocket::shared 
shared_ptr (int family, const IPAddress &address, const Port &port) throw (SocketException)
 
static const
SecureTCPSocket::shared 
shared_ptr (int family, const std::string &address, unsigned short port) throw (SocketException)
 
static const
SecureTCPSocket::shared 
shared_ptr (const IPAddressPort &addressport) throw (SocketException)
 
static const
SecureTCPSocket::shared 
shared_ptr (const IPAddress &address, const Port &port) throw (SocketException)
 
- Static Public Member Functions inherited from sella::net::TCPSocket
static const TCPSocket::shared shared_ptr (int family) throw (SocketException)
 
static const TCPSocket::shared shared_ptr (int family, const IPAddressPort &addressport) throw (SocketException)
 
static const TCPSocket::shared shared_ptr (int family, const IPAddress &address, const Port &port) throw (SocketException)
 
static const TCPSocket::shared shared_ptr (int family, const std::string &address, unsigned short port) throw (SocketException)
 
static const TCPSocket::shared shared_ptr (const IPAddressPort &addressport) throw (SocketException)
 
static const TCPSocket::shared shared_ptr (const IPAddress &address, const Port &port) throw (SocketException)
 
- Static Public Member Functions inherited from sella::net::Socket
static unsigned short resolveService (const std::string &service, const std::string &protocol=std::string("tcp")) throw (SocketException)
 

Static Public Attributes

static const std::set< Protocol > DefaultProtocols = { SSLv3, TLSv1_0, TLSv1_1, TLSv1_2 }
 
static const std::string DefaultCiphers = "ALL:!aNULL:!eNULL"
 
static const std::string PerformanceCiphers = "AES128-SHA:RC4-MD5:RC4-SHA:AES256-SHA:HIGH:!DSS:!aNULL:!eNULL"
 
- Static Public Attributes inherited from sella::net::Socket
static const size_t RecvSizeDefault = 65536
 

Protected Member Functions

 SecureTCPSocket (int s, bool unused __attribute__((unused))) throw (SocketException)
 
void init (void) throw (SocketException)
 
void server_init (void) throw (SocketException)
 
void client_init (void) throw (SocketException)
 
void shutdown (void) throw ()
 
virtual void close (void) throw (SocketException)
 
std::vector< std::string > getErrors (void) throw (SocketException)
 
- Protected Member Functions inherited from sella::net::TCPSocket
 TCPSocket (int family, int type, int protocol) throw (SocketException)
 
 TCPSocket (int s, bool unused __attribute__((unused))) throw (SocketException)
 
- Protected Member Functions inherited from sella::net::Socket
 Socket (int s) throw (SocketException)
 
 Socket (int family, int type, int protocol) throw (SocketException)
 

Static Protected Member Functions

static int SSL_password_callback (char *buf, int num, int rwflag, void *userdata)
 
- Static Protected Member Functions inherited from sella::net::Socket
static void initAddr (int family, const std::string &address, unsigned short port, sockaddr_storage &addr, socklen_t size) throw (SocketException)
 

Protected Attributes

SSL_CTX * ctx
 
SSL * ssl
 
bool server
 
std::string certificateFile
 
std::string privateKeyFile
 
std::string passwordFile
 
std::string password
 
std::string certificateChainFile
 
std::string caCertificateFile
 
std::set< Protocol > protocols
 
std::string ciphers
 
bool preferServerCiphers
 
std::mutex mutex
 
- Protected Attributes inherited from sella::net::Socket
int s
 
int family
 
bool usable
 
bool mux
 
bool read
 
bool write
 
bool except
 

Detailed Description

Definition at line 31 of file SecureTCPSocket.h.


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