#include "htp_config_auto.h"
#include "htp_private.h"
#define OUT_COPY_BYTE_OR_RETURN | ( | X | ) |
if ((X)->out_current_read_offset < (X)->out_current_len) { \ (X)->out_next_byte = (X)->out_current_data[(X)->out_current_read_offset]; \ (X)->out_current_read_offset++; \ (X)->out_stream_offset++; \ } else { \ return HTP_DATA_BUFFER; \ }
#define OUT_NEXT_BYTE | ( | X | ) |
if ((X)->out_current_read_offset < (X)->out_current_len) { \ (X)->out_next_byte = (X)->out_current_data[(X)->out_current_read_offset]; \ (X)->out_current_read_offset++; \ (X)->out_current_consume_offset++; \ (X)->out_stream_offset++; \ } else { \ (X)->out_next_byte = -1; \ }
#define OUT_NEXT_BYTE_OR_RETURN | ( | X | ) |
if ((X)->out_current_read_offset < (X)->out_current_len) { \ (X)->out_next_byte = (X)->out_current_data[(X)->out_current_read_offset]; \ (X)->out_current_read_offset++; \ (X)->out_current_consume_offset++; \ (X)->out_stream_offset++; \ } else { \ return HTP_DATA; \ }
#define OUT_PEEK_NEXT | ( | X | ) |
if ((X)->out_current_read_offset >= (X)->out_current_len) { \ (X)->out_next_byte = -1; \ } else { \ (X)->out_next_byte = (X)->out_current_data[(X)->out_current_read_offset]; \ }
#define OUT_TEST_NEXT_BYTE_OR_RETURN | ( | X | ) |
if ((X)->out_current_read_offset >= (X)->out_current_len) { \ return HTP_DATA; \ }
htp_status_t htp_connp_RES_BODY_CHUNKED_DATA | ( | htp_connp_t * | connp | ) |
Processes a chunk of data.
[in] | connp |
htp_status_t htp_connp_RES_BODY_CHUNKED_DATA_END | ( | htp_connp_t * | connp | ) |
Consumes bytes until the end of the current line.
[in] | connp |
htp_status_t htp_connp_RES_BODY_CHUNKED_LENGTH | ( | htp_connp_t * | connp | ) |
Extracts chunk length.
[in] | connp |
htp_status_t htp_connp_RES_BODY_DETERMINE | ( | htp_connp_t * | connp | ) |
Determines presence (and encoding) of a response body.
[in] | connp |
htp_status_t htp_connp_RES_BODY_IDENTITY_CL_KNOWN | ( | htp_connp_t * | connp | ) |
Processes an identity response body of known length.
[in] | connp |
htp_status_t htp_connp_RES_BODY_IDENTITY_STREAM_CLOSE | ( | htp_connp_t * | connp | ) |
Processes identity response body of unknown length. In this case, we assume the response body consumes all data until the end of the stream.
[in] | connp |
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.
[in] | connp | |
[in] | timestamp | Optional. |
[in] | data | |
[in] | len |
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.
[in] | connp |
htp_status_t htp_connp_RES_FINALIZE | ( | htp_connp_t * | connp | ) |
htp_status_t htp_connp_RES_HEADERS | ( | htp_connp_t * | connp | ) |
Parses response headers.
[in] | connp |
htp_status_t htp_connp_RES_IDLE | ( | htp_connp_t * | connp | ) |
The response idle state will initialize response processing, as well as finalize each transactions after we are done with it.
[in] | connp |
htp_status_t htp_connp_RES_LINE | ( | htp_connp_t * | connp | ) |
Parses response line.
[in] | connp |
htp_status_t htp_connp_res_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 |