HTP  0.5
Functions
htp_connection.c File Reference
#include "htp_config_auto.h"
#include "htp_private.h"

Functions

htp_conn_thtp_conn_create (void)
 
void htp_conn_close (htp_conn_t *conn, const htp_time_t *timestamp)
 
void htp_conn_destroy (htp_conn_t *conn)
 
htp_status_t htp_conn_open (htp_conn_t *conn, const char *client_addr, int client_port, const char *server_addr, int server_port, const htp_time_t *timestamp)
 
htp_status_t htp_conn_remove_tx (htp_conn_t *conn, const htp_tx_t *tx)
 
void htp_conn_track_inbound_data (htp_conn_t *conn, size_t len, const htp_time_t *timestamp)
 
void htp_conn_track_outbound_data (htp_conn_t *conn, size_t len, const htp_time_t *timestamp)
 

Detailed Description

Author
Ivan Ristic ivanr.nosp@m.@web.nosp@m.kreat.nosp@m.or.c.nosp@m.om

Function Documentation

void htp_conn_close ( htp_conn_t conn,
const htp_time_t timestamp 
)

Closes the connection.

Parameters
[in]conn
[in]timestamp
htp_conn_t* htp_conn_create ( void  )

Creates a new connection structure.

Returns
A new connection structure on success, NULL on memory allocation failure.
void htp_conn_destroy ( htp_conn_t conn)

Destroys a connection, as well as all the transactions it contains. It is not possible to destroy a connection structure yet leave any of its transactions intact. This is because transactions need its connection and connection structures hold little data anyway. The opposite is true, though it is possible to delete a transaction but leave its connection alive.

Parameters
[in]conn
htp_status_t htp_conn_open ( htp_conn_t conn,
const char *  remote_addr,
int  remote_port,
const char *  local_addr,
int  local_port,
const htp_time_t timestamp 
)

Opens a connection. This function will essentially only store the provided data for future reference. The timestamp parameter is optional.

Parameters
[in]conn
[in]remote_addr
[in]remote_port
[in]local_addr
[in]local_port
[in]timestamp
Returns
htp_status_t htp_conn_remove_tx ( htp_conn_t conn,
const htp_tx_t tx 
)

Removes the given transaction structure, which makes it possible to safely destroy it. It is safe to destroy transactions in this way because the index of the transactions (in a connection) is preserved.

Parameters
[in]conn
[in]tx
Returns
HTP_OK if transaction was removed (replaced with NULL) or HTP_ERROR if it wasn't found.
void htp_conn_track_inbound_data ( htp_conn_t conn,
size_t  len,
const htp_time_t timestamp 
)

Keeps track of inbound packets and data.

Parameters
[in]conn
[in]len
[in]timestamp
void htp_conn_track_outbound_data ( htp_conn_t conn,
size_t  len,
const htp_time_t timestamp 
)

Keeps track of outbound packets and data.

Parameters
[in]conn
[in]len
[in]timestamp