HTP 0.5
htp_urlencoded.h
Go to the documentation of this file.
1/***************************************************************************
2 * Copyright (c) 2009-2010 Open Information Security Foundation
3 * Copyright (c) 2010-2013 Qualys, Inc.
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met:
9 *
10 * - Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12
13 * - Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16
17 * - Neither the name of the Qualys, Inc. nor the names of its
18 * contributors may be used to endorse or promote products derived from
19 * this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 ***************************************************************************/
33
39#ifndef _HTP_URLENCODED_H
40#define _HTP_URLENCODED_H
41
42#ifdef __cplusplus
43extern "C" {
44#endif
45
48
49#define HTP_URLENP_DEFAULT_PARAMS_SIZE 32
50
51#define HTP_URLENP_STATE_KEY 1
52#define HTP_URLENP_STATE_VALUE 2
53
54// The MIME type that triggers the parser. Must be lowercase.
55#define HTP_URLENCODED_MIME_TYPE "application/x-www-form-urlencoded"
56
57#include "htp.h"
58
66
70 unsigned char argument_separator;
71
74
77
78 // Private fields; these are used during the parsing process only
79 int _state;
83};
84
91
94};
95
98
99void htp_urlenp_set_argument_separator(htp_urlenp_t *urlenp, unsigned char argument_separator);
100void htp_urlenp_set_decode_url_encoding(htp_urlenp_t *urlenp, int decode_url_encoding);
101
102htp_status_t htp_urlenp_parse_partial(htp_urlenp_t *urlenp, const void *data, size_t len);
103htp_status_t htp_urlenp_parse_complete(htp_urlenp_t *urlenp, const void *data, size_t len);
105
106#ifdef __cplusplus
107}
108#endif
109
110#endif /* _HTP_URLENCODED_H */
111
int htp_status_t
Definition htp_core.h:46
htp_urlenp_t * htp_urlenp_create(htp_tx_t *tx)
Definition htp_urlencoded.c:176
htp_status_t htp_urlenp_parse_partial(htp_urlenp_t *urlenp, const void *data, size_t len)
Definition htp_urlencoded.c:269
htp_status_t htp_urlenp_parse_complete(htp_urlenp_t *urlenp, const void *data, size_t len)
Definition htp_urlencoded.c:254
void htp_urlenp_set_decode_url_encoding(htp_urlenp_t *urlenp, int decode_url_encoding)
void htp_urlenp_set_argument_separator(htp_urlenp_t *urlenp, unsigned char argument_separator)
htp_status_t htp_urlenp_finalize(htp_urlenp_t *urlenp)
Definition htp_urlencoded.c:238
void htp_urlenp_destroy(htp_urlenp_t *urlenp)
Definition htp_urlencoded.c:207
Definition bstr_builder.h:50
Definition bstr.h:57
Definition htp_table_private.h:63
Definition htp.h:208
Definition htp_urlencoded.h:88
bstr * name
Definition htp_urlencoded.h:90
bstr * value
Definition htp_urlencoded.h:93
Definition htp_urlencoded.h:63
htp_table_t * params
Definition htp_urlencoded.h:76
unsigned char argument_separator
Definition htp_urlencoded.h:70
int _state
Definition htp_urlencoded.h:79
htp_tx_t * tx
Definition htp_urlencoded.h:65
bstr * _name
Definition htp_urlencoded.h:81
int decode_url_encoding
Definition htp_urlencoded.h:73
int _complete
Definition htp_urlencoded.h:80
bstr_builder_t * _bb
Definition htp_urlencoded.h:82