HTP  0.3
Data Structures | Defines | Typedefs | Functions
htp_multipart.h File Reference
#include "bstr.h"
#include "dslib.h"
#include "htp.h"
Include dependency graph for htp_multipart.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  htp_mpart_part_t
struct  htp_mpartp_t

Defines

#define MULTIPART_PART_UNKNOWN   0
#define MULTIPART_PART_TEXT   1
#define MULTIPART_PART_FILE   2
#define MULTIPART_PART_PREAMBLE   3
#define MULTIPART_PART_EPILOGUE   4
#define MULTIPART_MODE_LINE   0
#define MULTIPART_MODE_DATA   1
#define MULTIPART_STATE_DATA   1
#define MULTIPART_STATE_BOUNDARY   2
#define MULTIPART_STATE_BOUNDARY_IS_LAST1   3
#define MULTIPART_STATE_BOUNDARY_IS_LAST2   4
#define MULTIPART_STATE_BOUNDARY_EAT_LF   5
#define MULTIPART_DEFAULT_FILE_EXTRACT_LIMIT   16
#define HTP_MULTIPART_MIME_TYPE   "multipart/form-data"

Typedefs

typedef struct htp_mpartp_t htp_mpartp_t
typedef struct htp_mpart_part_t htp_mpart_part_t

Functions

htp_mpartp_thtp_mpartp_create (htp_connp_t *connp, char *boundary)
void htp_mpartp_destroy (htp_mpartp_t **mpartp)
int htp_mpartp_parse (htp_mpartp_t *mpartp, unsigned char *data, size_t len)
int htp_mpartp_finalize (htp_mpartp_t *mpartp)
htp_mpart_part_thtp_mpart_part_create (htp_mpartp_t *mpartp)
int htp_mpart_part_receive_data (htp_mpart_part_t *part, unsigned char *data, size_t len, int line)
int htp_mpart_part_finalize_data (htp_mpart_part_t *part)
void htp_mpart_part_destroy (htp_mpart_part_t *part)
int htp_mpartp_extract_boundary (bstr *content_type, char **boundary)
int htp_mpartp_run_request_file_data_hook (htp_mpart_part_t *part, unsigned char *data, size_t len)

Detailed Description

Author:
Ivan Ristic <ivanr@webkreator.com>

Define Documentation

#define HTP_MULTIPART_MIME_TYPE   "multipart/form-data"
#define MULTIPART_MODE_DATA   1
#define MULTIPART_MODE_LINE   0
#define MULTIPART_PART_EPILOGUE   4
#define MULTIPART_PART_FILE   2
#define MULTIPART_PART_PREAMBLE   3
#define MULTIPART_PART_TEXT   1
#define MULTIPART_PART_UNKNOWN   0
#define MULTIPART_STATE_BOUNDARY   2
#define MULTIPART_STATE_DATA   1

Typedef Documentation

typedef struct htp_mpartp_t htp_mpartp_t

Function Documentation

Creates new multipart part.

Parameters:
mpartp

Here is the call graph for this function:

Destroys multipart part.

Parameters:
part

Here is the call graph for this function:

Here is the caller graph for this function:

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_receive_data ( htp_mpart_part_t part,
unsigned char *  data,
size_t  len,
int  line 
)
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_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:
mpartpdata
len
Returns:
Status indicator

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: