GSsl::Protocol Class Reference

An SSL protocol class. More...

#include <gssl.h>

List of all members.

Public Types

enum  Result { Result_ok, Result_read, Result_write, Result_error }
typedef size_t size_type
typedef ssize_t ssize_type
typedef void(* LogFn )(int, const std::string &)

Public Member Functions

 Protocol (const Library &)
 Constructor.
 Protocol (const Library &, LogFn, bool hexdump=defaultHexdump())
 Constructor.
 ~Protocol ()
 Destructor.
Result connect (int fd)
 Starts the protocol actively.
Result accept (int fd)
 Starts the protocol passively.
Result stop ()
 Initiates the protocol shutdown.
Result read (char *buffer, size_type buffer_size_in, ssize_type &data_size_out)
 Reads data into the supplied buffer.
Result write (const char *buffer, size_type data_size_in, ssize_type &data_size_out)
 Writes data.

Static Public Member Functions

static std::string str (Result result)
 Converts a result enumeration into a printable string.
static bool defaultHexdump ()
 Returns a default value for the constructor parameter.


Detailed Description

An SSL protocol class.

The protocol object is tied to a particular socket file descriptor.

Definition at line 40 of file gssl.h.


Member Typedef Documentation

typedef size_t GSsl::Protocol::size_type

Definition at line 43 of file gssl.h.

typedef ssize_t GSsl::Protocol::ssize_type

Definition at line 44 of file gssl.h.

typedef void(* GSsl::Protocol::LogFn)(int, const std::string &)


Member Enumeration Documentation

Enumerator:
Result_ok 
Result_read 
Result_write 
Result_error 

Definition at line 45 of file gssl.h.


Constructor & Destructor Documentation

GSsl::Protocol::Protocol ( const Library library  )  [explicit]

Constructor.

Definition at line 299 of file gssl_openssl.cpp.

GSsl::Protocol::Protocol ( const Library library,
LogFn  log,
bool  hexdump = defaultHexdump() 
)

Constructor.

Definition at line 305 of file gssl_openssl.cpp.

GSsl::Protocol::~Protocol (  ) 

Destructor.

Definition at line 310 of file gssl_openssl.cpp.


Member Function Documentation

GSsl::Protocol::Result GSsl::Protocol::connect ( int  fd  ) 

Starts the protocol actively.

Definition at line 324 of file gssl_openssl.cpp.

References GSsl::ProtocolImp::connect().

GSsl::Protocol::Result GSsl::Protocol::accept ( int  fd  ) 

Starts the protocol passively.

Definition at line 329 of file gssl_openssl.cpp.

References GSsl::ProtocolImp::accept().

GSsl::Protocol::Result GSsl::Protocol::stop (  ) 

Initiates the protocol shutdown.

Definition at line 334 of file gssl_openssl.cpp.

References GSsl::ProtocolImp::stop().

GSsl::Protocol::Result GSsl::Protocol::read ( char *  buffer,
size_type  buffer_size_in,
ssize_type data_size_out 
)

Reads data into the supplied buffer.

Note that a retry will need the same buffer pointer value.

Definition at line 339 of file gssl_openssl.cpp.

References GSsl::ProtocolImp::read().

GSsl::Protocol::Result GSsl::Protocol::write ( const char *  buffer,
size_type  data_size_in,
ssize_type data_size_out 
)

Writes data.

Note that a retry will need the same buffer pointer value.

Definition at line 344 of file gssl_openssl.cpp.

References GSsl::ProtocolImp::write().

std::string GSsl::Protocol::str ( Protocol::Result  result  )  [static]

Converts a result enumeration into a printable string.

Used in logging and diagnostics.

Definition at line 315 of file gssl_openssl.cpp.

References Result_error, Result_ok, Result_read, and Result_write.

bool GSsl::Protocol::defaultHexdump (  )  [static]

Returns a default value for the constructor parameter.

Definition at line 577 of file gssl_openssl.cpp.


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

Generated on Fri Apr 18 15:56:14 2008 for E-MailRelay by  doxygen 1.5.5