htp_multipart.c File Reference

#include "htp.h"
#include "htp_multipart.h"
Include dependency graph for htp_multipart.c:

Defines

#define PARAM_OTHER   0
#define PARAM_NAME   1
#define PARAM_FILENAME   2

Functions

int htp_mpart_part_process_headers (htp_mpart_part_t *part)
int htp_mpartp_parse_header (htp_mpart_part_t *part, unsigned char *data, size_t len)
htp_mpart_part_thtp_mpart_part_create (htp_mpartp_t *mpartp)
void htp_mpart_part_destroy (htp_mpart_part_t *part)
int htp_mpart_part_finalize_data (htp_mpart_part_t *part)
int htp_mpartp_run_request_file_data_hook (htp_mpart_part_t *part, unsigned char *data, size_t len)
int htp_mpart_part_handle_data (htp_mpart_part_t *part, unsigned char *data, size_t len, int is_line)
htp_mpartp_thtp_mpartp_create (htp_connp_t *connp, char *boundary)
void htp_mpartp_destroy (htp_mpartp_t **_mpartp)
int htp_mpartp_finalize (htp_mpartp_t *mpartp)
int htp_mpartp_parse (htp_mpartp_t *mpartp, unsigned char *data, size_t len)
int htp_mpartp_is_boundary_character (int c)
int htp_mpartp_extract_boundary (bstr *content_type, char **boundary)

Detailed Description

Author:
Ivan Ristic <ivanr@webkreator.com>

Define Documentation

#define PARAM_FILENAME   2
#define PARAM_NAME   1
#define PARAM_OTHER   0

Function Documentation

htp_mpart_part_t* htp_mpart_part_create ( htp_mpartp_t mpartp  ) 

Creates new multipart part.

Parameters:
mpartp 

Here is the call graph for this function:

void htp_mpart_part_destroy ( htp_mpart_part_t part  ) 

Destroys multipart part.

Parameters:
part 

Here is the call graph for this function:

Here is the caller graph for this function:

int htp_mpart_part_finalize_data ( htp_mpart_part_t part  ) 

Finalizes part processing.

Parameters:
part 

Here is the call graph for this function:

Here is the caller graph for this function:

int htp_mpart_part_handle_data ( htp_mpart_part_t part,
unsigned char *  data,
size_t  len,
int  is_line 
)

Handles part data.

Parameters:
part 
data 
len 
is_line 

Here is the call graph for this function:

int htp_mpart_part_process_headers ( htp_mpart_part_t part  ) 

Process part headers. In the current implementation, we only parse the Content-Disposition header if it is present.

Parameters:
part 
Returns:
Success indication

Here is the call graph for this function:

Here is the caller graph for this function:

htp_mpartp_t* htp_mpartp_create ( htp_connp_t connp,
char *  boundary 
)

Creates a new multipart/form-data parser.

Parameters:
boundary 
Returns:
New parser, or NULL on memory allocation failure.

Here is the call graph for this function:

Here is the caller graph for this function:

void htp_mpartp_destroy ( htp_mpartp_t **  _mpartp  ) 

Destroys a multipart/form-data parser.

Parameters:
mpartp 

Here is the call graph for this function:

Here is the caller graph for this function:

int htp_mpartp_extract_boundary ( bstr content_type,
char **  boundary 
)

Extract boundary from the supplied Content-Type request header. The extracted boundary will be allocated on heap.

Parameters:
content_type 
boundary 
Returns:
rc

Here is the call graph for this function:

Here is the caller graph for this function:

int htp_mpartp_finalize ( htp_mpartp_t mpartp  ) 

Finalize parsing.

Parameters:
mpartp 

Here is the call graph for this function:

Here is the caller graph for this function:

int htp_mpartp_is_boundary_character ( int  c  ) 

Determine if the supplied character is allowed in boundary.

Parameters:
c 

Here is the caller graph for this function:

int htp_mpartp_parse ( htp_mpartp_t mpartp,
unsigned char *  data,
size_t  len 
)

Parses a chunk of multipart/form-data data. This function should be called as many times as necessary until all data has been consumed.

Parameters:
mpartp data
len 
Returns:
Status indicator

Here is the call graph for this function:

Here is the caller graph for this function:

int htp_mpartp_parse_header ( htp_mpart_part_t part,
unsigned char *  data,
size_t  len 
)

Parses one part header.

Parameters:
data 
len 
Success indication

Here is the call graph for this function:

Here is the caller graph for this function:

int htp_mpartp_run_request_file_data_hook ( htp_mpart_part_t part,
unsigned char *  data,
size_t  len 
)

Here is the call graph for this function:

Here is the caller graph for this function:


Generated on 28 Jan 2013 for HTP by  doxygen 1.6.1