Version 1.3.2
The following list constitutes DSSL's most important data structures. Note that all of these structures should be considered as opaque types and used only as arguments to DSSL API functions.
This is the main structure in DSSL framework that links all the DSSL components together and with libpcap capture adapter.
This structure stores global SSL decryption environment data such as a list of SSL server addresses and SSL session cache for SSL session resumption.
Represents a single SSL session.
Represents SSL server data: IP address, RSA private key, keyfile password, etc.
Represents a single TCP session. This structure is used by DSSL's TCP reassemly code.
Represents a captured network packet. This structure is used by DSSL's TCP reassemly code.
Defines a packet directions within TCP session.
typedef enum NM_PacketDir_ { ePacketDirInvalid, ePacketDirFromClient, ePacketDirFromServer } NM_PacketDir;
Session event codes used in CapEnvSessionCallback callback.
#define DSSL_EVENT_NEW_SESSION 0 #define DSSL_EVENT_SESSION_CLOSING 1
A prototype of CapEnv session event callback function. This callback function is called every time CapEnv is about to create a new session or an existing session is about to be closed.
typedef void (*CapEnvSessionCallback)( struct CapEnv_* env, TcpSession* sess, char event );
A prototype of the session data callback function.
typedef void (*DataCallbackProc)( NM_PacketDir dir, void* user_data, u_char* data, uint32_t len );
A prototype of the session error callback function.
typedef void (*ErrorCallbackProc)( void* user_data, int error_code );
This section documents DSSL public instance management, initialization and data processing API.
Creates a CapEnv structure and initialize it with pcap_t capture handle, TCP session table size and SSL session timeout interval in seconds.
CapEnv* CapEnvCreate( pcap_t* adapter, int sessionTableSize, uint32_t cache_timeout_interval );
Destroys a CapEnv instance and frees allocated memory.
void CapEnvDestroy( CapEnv* env );
Process packets captured by calling by pcap_loop routine on env's pcap handle.
int CapEnvCapture( CapEnv* env );
Sets a callback function that is executed every time a TCP session is created or destroyed within the given CapEnv instance.
void CapEnvSetSessionCallback( CapEnv* env, CapEnvSessionCallback callback, void* user_data, );
Searches env's SSL server list for a server by its IP address and port number.
DSSL_ServerInfo* CapEnvFindDSSL_ServerInfo( CapEnv* env, struct in_addr* server_ip, uint16_t server_port );
Adds SSL server data to CapEnv's DSSL decryption module.
int CapEnvSetSSL_ServerInfo( CapEnv* env, struct in_addr* ip_address, uint16_t port, const char* keyfile, const char* password );
SSL decryption layer has its own API that can be used as a stand-alone interface, bypassing the CapEnv TCP reassembly module. It is designed for applications that have their own TCP reassembly layer.
Creates a DSSL decryption environment object.
DSSL_Env* DSSL_EnvCreate( int session_cache_size, uint32_t cache_timeout_interval );
Destroys DSSL_Env object.
void DSSL_EnvDestroy( DSSL_Env* env );
Adds SSL server data to DSSL_Evn server table.
int DSSL_EnvSetServerInfo( DSSL_Env* env, struct in_addr* ip_address, uint16_t port, const char* keyfile, const char* password );
Initialize DSSL_Session object.
void DSSL_SessionInit( DSSL_Env* env, DSSL_Session* s, DSSL_ServerInfo* si );
Destroy DSSL_Session internal structures. Call this method before freeing the DSSL_Session object.
void DSSL_SessionDeInit( DSSL_Session* s );
Set the data and error callback routines for DSSL_Session object.
void DSSL_SessionSetCallback( DSSL_Session* sess, SessionCallbackProc data_callback, ErrorCallbackProc error_callback, void* user_data );
This is a main SSL layer entry point that process decrypts SSL data and returns decrypted payload through DSSL_Session data callback routine.
int DSSL_SessionProcessData( DSSL_Session* sess, NM_PacketDir dir, u_char* data, uint32_t len );