htp_response.c File Reference

#include "htp_config_auto.h"
#include "htp_private.h"

Defines

#define OUT_TEST_NEXT_BYTE_OR_RETURN(X)
#define OUT_PEEK_NEXT(X)
#define OUT_NEXT_BYTE(X)
#define OUT_NEXT_BYTE_OR_RETURN(X)
#define OUT_COPY_BYTE_OR_RETURN(X)

Functions

htp_status_t htp_connp_res_receiver_finalize_clear (htp_connp_t *connp)
htp_status_t htp_connp_RES_BODY_CHUNKED_DATA_END (htp_connp_t *connp)
htp_status_t htp_connp_RES_BODY_CHUNKED_DATA (htp_connp_t *connp)
htp_status_t htp_connp_RES_BODY_CHUNKED_LENGTH (htp_connp_t *connp)
htp_status_t htp_connp_RES_BODY_IDENTITY_CL_KNOWN (htp_connp_t *connp)
htp_status_t htp_connp_RES_BODY_IDENTITY_STREAM_CLOSE (htp_connp_t *connp)
htp_status_t htp_connp_RES_BODY_DETERMINE (htp_connp_t *connp)
htp_status_t htp_connp_RES_HEADERS (htp_connp_t *connp)
htp_status_t htp_connp_RES_LINE (htp_connp_t *connp)
size_t htp_connp_res_data_consumed (htp_connp_t *connp)
htp_status_t htp_connp_RES_FINALIZE (htp_connp_t *connp)
htp_status_t htp_connp_RES_IDLE (htp_connp_t *connp)
int htp_connp_res_data (htp_connp_t *connp, const htp_time_t *timestamp, const void *data, size_t len)

Detailed Description

Author:
Ivan Ristic <ivanr@webkreator.com>

Define Documentation

#define OUT_COPY_BYTE_OR_RETURN (  ) 
Value:
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 (  ) 
Value:
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 (  ) 
Value:
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 (  ) 
Value:
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 (  ) 
Value:
if ((X)->out_current_read_offset >= (X)->out_current_len) { \
    return HTP_DATA; \
}

Function Documentation

htp_status_t htp_connp_RES_BODY_CHUNKED_DATA ( htp_connp_t connp  ) 

Processes a chunk of data.

Parameters:
[in] connp 
Returns:
HTP_OK on state change, HTP_ERROR on error, or HTP_DATA when more data is needed.
htp_status_t htp_connp_RES_BODY_CHUNKED_DATA_END ( htp_connp_t connp  ) 

Consumes bytes until the end of the current line.

Parameters:
[in] connp 
Returns:
HTP_OK on state change, HTP_ERROR on error, or HTP_DATA when more data is needed.
htp_status_t htp_connp_RES_BODY_CHUNKED_LENGTH ( htp_connp_t connp  ) 

Extracts chunk length.

Parameters:
[in] connp 
Returns:
HTP_OK on state change, HTP_ERROR on error, or HTP_DATA when more data is needed.
htp_status_t htp_connp_RES_BODY_DETERMINE ( htp_connp_t connp  ) 

Determines presence (and encoding) of a response body.

Parameters:
[in] connp 
Returns:
HTP_OK on state change, HTP_ERROR on error, or HTP_DATA when more data is needed.
htp_status_t htp_connp_RES_BODY_IDENTITY_CL_KNOWN ( htp_connp_t connp  ) 

Processes an identity response body of known length.

Parameters:
[in] connp 
Returns:
HTP_OK on state change, HTP_ERROR on error, or HTP_DATA when more data is needed.
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.

Parameters:
[in] connp 
Returns:
HTP_OK on state change, HTP_ERROR on error, or HTP_DATA when more data is needed.
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:
[in] connp 
Returns:
The number of bytes consumed from the last data chunk sent for outbound processing.
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.

Parameters:
[in] connp 
Returns:
HTP_OK on state change, HTP_ERROR on error, or HTP_DATA when more data is needed.
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.

Parameters:
[in] connp 
Returns:
HTP_OK on state change, HTP_ERROR on error, or HTP_DATA when more data is needed.
htp_status_t htp_connp_RES_LINE ( htp_connp_t connp  ) 

Parses response line.

Parameters:
[in] connp 
Returns:
HTP_OK on state change, HTP_ERROR on error, or HTP_DATA when more data is needed.
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.

Parameters:
[in] connp 
Returns:
HTP_OK, or a value returned from a callback.

Generated on 1 Jan 2017 for HTP by  doxygen 1.6.1