Go to the source code of this file.
|
void | htp_connp_clear_error (htp_connp_t *connp) |
|
void | htp_connp_close (htp_connp_t *connp, const htp_time_t *timestamp) |
|
htp_connp_t * | htp_connp_create (htp_cfg_t *cfg) |
|
void | htp_connp_destroy (htp_connp_t *connp) |
|
void | htp_connp_destroy_all (htp_connp_t *connp) |
|
htp_conn_t * | htp_connp_get_connection (const htp_connp_t *connp) |
|
htp_tx_t * | htp_connp_get_in_tx (const htp_connp_t *connp) |
|
htp_log_t * | htp_connp_get_last_error (const htp_connp_t *connp) |
|
htp_tx_t * | htp_connp_get_out_tx (const htp_connp_t *connp) |
|
void * | htp_connp_get_user_data (const htp_connp_t *connp) |
|
void | htp_connp_open (htp_connp_t *connp, const char *client_addr, int client_port, const char *server_addr, int server_port, htp_time_t *timestamp) |
|
void | htp_connp_set_user_data (htp_connp_t *connp, const void *user_data) |
|
int | htp_connp_req_data (htp_connp_t *connp, const htp_time_t *timestamp, const void *data, size_t len) |
|
size_t | htp_connp_req_data_consumed (htp_connp_t *connp) |
|
int | htp_connp_res_data (htp_connp_t *connp, const htp_time_t *timestamp, const void *data, size_t len) |
|
size_t | htp_connp_res_data_consumed (htp_connp_t *connp) |
|
htp_tx_t * | htp_connp_tx_create (htp_connp_t *connp) |
|
Clears the most recent error, if any.
- Parameters
-
Closes the connection associated with the supplied parser.
- Parameters
-
[in] | connp | |
[in] | timestamp | Optional. |
Creates a new connection parser using the provided configuration. Because the configuration structure is used directly, in a multithreaded environment you are not allowed to change the structure, ever. If you have a need to change configuration on per-connection basis, make a copy of the configuration structure to go along with every connection parser.
- Parameters
-
- Returns
- New connection parser instance, or NULL on error.
Destroys the connection parser and its data structures, leaving all the data (connection, transactions, etc) intact.
- Parameters
-
Destroys the connection parser, its data structures, as well as the connection and its transactions.
- Parameters
-
Returns the connection associated with the connection parser.
- Parameters
-
- Returns
- htp_conn_t instance, or NULL if one is not available.
Retrieves the pointer to the active inbound transaction. In connection parsing mode there can be many open transactions, and up to 2 active transactions at any one time. This is due to HTTP pipelining. Can be NULL.
- Parameters
-
- Returns
- Active inbound transaction, or NULL if there isn't one.
Returns the last error that occurred with this connection parser. Do note, however, that the value in this field will only be valid immediately after an error condition, but it is not guaranteed to remain valid if the parser is invoked again.
- Parameters
-
- Returns
- A pointer to an htp_log_t instance if there is an error, or NULL if there isn't.
Retrieves the pointer to the active outbound transaction. In connection parsing mode there can be many open transactions, and up to 2 active transactions at any one time. This is due to HTTP pipelining. Can be NULL.
- Parameters
-
- Returns
- Active outbound transaction, or NULL if there isn't one.
void* htp_connp_get_user_data |
( |
const htp_connp_t * |
connp | ) |
|
Retrieve the user data associated with this connection parser.
- Parameters
-
- Returns
- User data, or NULL if there isn't any.
void htp_connp_open |
( |
htp_connp_t * |
connp, |
|
|
const char * |
client_addr, |
|
|
int |
client_port, |
|
|
const char * |
server_addr, |
|
|
int |
server_port, |
|
|
htp_time_t * |
timestamp |
|
) |
| |
Opens connection.
- Parameters
-
[in] | connp | |
[in] | client_addr | Client address |
[in] | client_port | Client port |
[in] | server_addr | Server address |
[in] | server_port | Server port |
[in] | timestamp | Optional. |
int htp_connp_req_data |
( |
htp_connp_t * |
connp, |
|
|
const htp_time_t * |
timestamp, |
|
|
const void * |
data, |
|
|
size_t |
len |
|
) |
| |
- Parameters
-
[in] | connp | |
[in] | timestamp | |
[in] | data | |
[in] | len | |
- Returns
- HTP_STREAM_DATA, HTP_STREAM_ERROR or STEAM_STATE_DATA_OTHER (see QUICK_START). HTP_STREAM_CLOSED and HTP_STREAM_TUNNEL are also possible.
size_t htp_connp_req_data_consumed |
( |
htp_connp_t * |
connp | ) |
|
Returns the number of bytes consumed from the most recent inbound data chunk. Normally, an invocation of htp_connp_req_data() will consume all data from the supplied buffer, but there are circumstances where only partial consumption is possible. In such cases HTP_STREAM_DATA_OTHER will be returned. Consumed bytes are no longer necessary, but the remainder of the buffer will be need to be saved for later.
- Parameters
-
- Returns
- The number of bytes consumed from the last data chunk sent for inbound processing.
Returns how many bytes from the current data chunks were consumed so far.
- Parameters
-
- Returns
- The number of bytes consumed.
int htp_connp_res_data |
( |
htp_connp_t * |
connp, |
|
|
const htp_time_t * |
timestamp, |
|
|
const void * |
data, |
|
|
size_t |
len |
|
) |
| |
Process a chunk of outbound (server or response) data.
- Parameters
-
[in] | connp | |
[in] | timestamp | Optional. |
[in] | data | |
[in] | len | |
- Returns
- HTP_OK on state change, HTP_ERROR on error, or HTP_DATA when more data is needed
size_t htp_connp_res_data_consumed |
( |
htp_connp_t * |
connp | ) |
|
Returns the number of bytes consumed from the most recent outbound data chunk. Normally, an invocation of htp_connp_res_data() will consume all data from the supplied buffer, but there are circumstances where only partial consumption is possible. In such cases HTP_STREAM_DATA_OTHER will be returned. Consumed bytes are no longer necessary, but the remainder of the buffer will be need to be saved for later.
- Parameters
-
- Returns
- The number of bytes consumed from the last data chunk sent for outbound processing.
void htp_connp_set_user_data |
( |
htp_connp_t * |
connp, |
|
|
const void * |
user_data |
|
) |
| |
Associate user data with the supplied parser.
- Parameters
-
Create a new transaction using the connection parser provided.
- Parameters
-
- Returns
- Transaction instance on success, NULL on failure.