htp_multipart_private.h File Reference
#include "htp_multipart.h"
Go to the source code of this file.
Data Structures |
struct | htp_mpartp_t |
Defines |
#define | CD_PARAM_OTHER 0 |
#define | CD_PARAM_NAME 1 |
#define | CD_PARAM_FILENAME 2 |
#define | DEFAULT_FILE_EXTRACT_LIMIT 16 |
Enumerations |
enum | htp_part_mode_t { MODE_LINE = 0,
MODE_DATA = 1
} |
enum | htp_multipart_state_t {
STATE_INIT = 0,
STATE_DATA = 1,
STATE_BOUNDARY = 2,
STATE_BOUNDARY_IS_LAST1 = 3,
STATE_BOUNDARY_IS_LAST2 = 4,
STATE_BOUNDARY_EAT_LWS = 5,
STATE_BOUNDARY_EAT_LWS_CR = 6
} |
Functions |
htp_status_t | htp_mpartp_run_request_file_data_hook (htp_multipart_part_t *part, const unsigned char *data, size_t len) |
htp_status_t | htp_mpart_part_process_headers (htp_multipart_part_t *part) |
htp_status_t | htp_mpartp_parse_header (htp_multipart_part_t *part, const unsigned char *data, size_t len) |
htp_status_t | htp_mpart_part_handle_data (htp_multipart_part_t *part, const unsigned char *data, size_t len, int is_line) |
int | htp_mpartp_is_boundary_character (int c) |
htp_multipart_part_t * | htp_mpart_part_create (htp_mpartp_t *parser) |
htp_status_t | htp_mpart_part_finalize_data (htp_multipart_part_t *part) |
void | htp_mpart_part_destroy (htp_multipart_part_t *part, int gave_up_data) |
htp_status_t | htp_mpart_part_parse_c_d (htp_multipart_part_t *part) |
Detailed Description
- Author:
- Ivan Ristic <ivanr@webkreator.com>
Define Documentation
#define CD_PARAM_FILENAME 2 |
#define DEFAULT_FILE_EXTRACT_LIMIT 16 |
Enumeration Type Documentation
- Enumerator:
STATE_INIT |
Initial state, after the parser has been created but before the boundary initialized.
|
STATE_DATA |
Processing data, waiting for a new line (which might indicate a new boundary).
|
STATE_BOUNDARY |
Testing a potential boundary.
|
STATE_BOUNDARY_IS_LAST1 |
Checking the first byte after a boundary.
|
STATE_BOUNDARY_IS_LAST2 |
Checking the second byte after a boundary.
|
STATE_BOUNDARY_EAT_LWS |
Consuming linear whitespace after a boundary.
|
STATE_BOUNDARY_EAT_LWS_CR |
Used after a CR byte is detected in STATE_BOUNDARY_EAT_LWS.
|
- Enumerator:
MODE_LINE |
When in line mode, the parser is handling part headers.
|
MODE_DATA |
When in data mode, the parser is consuming part data.
|
Function Documentation
Creates a new Multipart part.
- Parameters:
-
- Returns:
- New part instance, or NULL on memory allocation failure.
Destroys a part.
- Parameters:
-
[in] | part | |
[in] | gave_up_data | |
Finalizes part processing.
- Parameters:
-
- Returns:
- HTP_OK on success, HTP_ERROR on failure.
Handles part data.
- Parameters:
-
[in] | part | |
[in] | data | |
[in] | len | |
[in] | is_line | |
- Returns:
- HTP_OK on success, HTP_ERROR on failure.
Parses the Content-Disposition part header.
- Parameters:
-
- Returns:
- HTP_OK on success (header found and parsed), HTP_DECLINED if there is no C-D header or if it could not be processed, and HTP_ERROR on fatal error.
Processes part headers.
- Parameters:
-
- Returns:
- HTP_OK on success, HTP_ERROR on failure.
int htp_mpartp_is_boundary_character |
( |
int |
c |
) |
|
Parses one part header.
- Parameters:
-
[in] | part | |
[in] | data | |
[in] | len | |
- Returns:
- HTP_OK on success, HTP_DECLINED on parsing error, HTP_ERROR on fatal error.