#include "htp_config_auto.h"
#include "htp_private.h"
#define IN_COPY_BYTE_OR_RETURN | ( | X | ) |
if ((X)->in_current_read_offset < (X)->in_current_len) { \ (X)->in_next_byte = (X)->in_current_data[(X)->in_current_read_offset]; \ (X)->in_current_read_offset++; \ (X)->in_stream_offset++; \ } else { \ return HTP_DATA_BUFFER; \ }
#define IN_NEXT_BYTE | ( | X | ) |
if ((X)->in_current_read_offset < (X)->in_current_len) { \ (X)->in_next_byte = (X)->in_current_data[(X)->in_current_read_offset]; \ (X)->in_current_read_offset++; \ (X)->in_current_consume_offset++; \ (X)->in_stream_offset++; \ } else { \ (X)->in_next_byte = -1; \ }
#define IN_NEXT_BYTE_OR_RETURN | ( | X | ) |
if ((X)->in_current_read_offset < (X)->in_current_len) { \ (X)->in_next_byte = (X)->in_current_data[(X)->in_current_read_offset]; \ (X)->in_current_read_offset++; \ (X)->in_current_consume_offset++; \ (X)->in_stream_offset++; \ } else { \ return HTP_DATA; \ }
#define IN_PEEK_NEXT | ( | X | ) |
if ((X)->in_current_read_offset >= (X)->in_current_len) { \ (X)->in_next_byte = -1; \ } else { \ (X)->in_next_byte = (X)->in_current_data[(X)->in_current_read_offset]; \ }
#define IN_TEST_NEXT_BYTE_OR_RETURN | ( | X | ) |
if ((X)->in_current_read_offset >= (X)->in_current_len) { \ return HTP_DATA; \ }
htp_status_t htp_connp_REQ_BODY_CHUNKED_DATA | ( | htp_connp_t * | connp | ) |
Processes a chunk of data.
[in] | connp |
htp_status_t htp_connp_REQ_BODY_CHUNKED_DATA_END | ( | htp_connp_t * | connp | ) |
Consumes bytes until the end of the current line.
[in] | connp |
htp_status_t htp_connp_REQ_BODY_CHUNKED_LENGTH | ( | htp_connp_t * | connp | ) |
Extracts chunk length.
[in] | connp |
htp_status_t htp_connp_REQ_BODY_DETERMINE | ( | htp_connp_t * | connp | ) |
Determines presence (and encoding) of a request body.
[in] | connp |
htp_status_t htp_connp_REQ_BODY_IDENTITY | ( | htp_connp_t * | connp | ) |
Processes identity request body.
[in] | connp |
htp_status_t htp_connp_REQ_CONNECT_CHECK | ( | htp_connp_t * | connp | ) |
Performs a check for a CONNECT transaction to decide whether inbound parsing needs to be suspended.
[in] | connp |
htp_status_t htp_connp_REQ_CONNECT_PROBE_DATA | ( | htp_connp_t * | connp | ) |
Determines whether inbound parsing needs to continue or stop. In case the data appears to be plain text HTTP, we try to continue.
[in] | connp |
htp_status_t htp_connp_REQ_CONNECT_WAIT_RESPONSE | ( | htp_connp_t * | connp | ) |
Determines whether inbound parsing, which was suspended after encountering a CONNECT transaction, can proceed (after receiving the response).
[in] | connp |
int htp_connp_req_data | ( | htp_connp_t * | connp, | |
const htp_time_t * | timestamp, | |||
const void * | data, | |||
size_t | len | |||
) |
[in] | connp | |
[in] | timestamp | |
[in] | data | |
[in] | len |
size_t htp_connp_req_data_consumed | ( | htp_connp_t * | connp | ) |
Returns how many bytes from the current data chunks were consumed so far.
[in] | connp |
htp_status_t htp_connp_REQ_FINALIZE | ( | htp_connp_t * | connp | ) |
htp_status_t htp_connp_REQ_HEADERS | ( | htp_connp_t * | connp | ) |
Parses request headers.
[in] | connp |
htp_status_t htp_connp_REQ_IDLE | ( | htp_connp_t * | connp | ) |
The idle state is where the parser will end up after a transaction is processed. If there is more data available, a new request will be started.
[in] | connp |
htp_status_t htp_connp_REQ_IGNORE_DATA_AFTER_HTTP_0_9 | ( | htp_connp_t * | connp | ) |
htp_status_t htp_connp_REQ_LINE | ( | htp_connp_t * | connp | ) |
Parses request line.
[in] | connp |
htp_status_t htp_connp_REQ_LINE_complete | ( | htp_connp_t * | connp | ) |
Parse the request line.
[in] | connp |
htp_status_t htp_connp_REQ_PROTOCOL | ( | htp_connp_t * | connp | ) |
Determines request protocol.
[in] | connp |
htp_status_t htp_connp_req_receiver_finalize_clear | ( | htp_connp_t * | connp | ) |
Finalizes an existing data receiver hook by sending any outstanding data to it. The hook is then removed so that it receives no more data.
[in] | connp |