HTP
0.5
Main Page
Data Structures
Files
File List
Globals
htp
htp_transaction.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
34
/*
35
* @file
36
* @author Ivan Ristic <ivanr@webkreator.com>
37
*/
38
39
#ifndef HTP_TRANSACTION_H
40
#define HTP_TRANSACTION_H
41
42
#ifdef __cplusplus
43
extern
"C"
{
44
#endif
45
46
#include "
htp.h
"
47
53
enum
htp_alloc_strategy_t
{
59
HTP_ALLOC_COPY
= 1,
60
66
HTP_ALLOC_REUSE
= 2
67
};
68
75
enum
htp_tx_req_progress_t
{
76
HTP_REQUEST_NOT_STARTED
= 0,
77
HTP_REQUEST_LINE
= 1,
78
HTP_REQUEST_HEADERS
= 2,
79
HTP_REQUEST_BODY
= 3,
80
HTP_REQUEST_TRAILER
= 4,
81
HTP_REQUEST_COMPLETE
= 5
82
};
83
84
enum
htp_tx_res_progress_t
{
85
HTP_RESPONSE_NOT_STARTED
= 0,
86
HTP_RESPONSE_LINE
= 1,
87
HTP_RESPONSE_HEADERS
= 2,
88
HTP_RESPONSE_BODY
= 3,
89
HTP_RESPONSE_TRAILER
= 4,
90
HTP_RESPONSE_COMPLETE
= 5
91
};
92
93
#define HTP_CONFIG_PRIVATE 0
94
#define HTP_CONFIG_SHARED 1
95
102
htp_tx_t
*
htp_tx_create
(
htp_connp_t
*connp);
103
109
htp_status_t
htp_tx_destroy
(
htp_tx_t
*tx);
110
119
int
htp_tx_get_is_config_shared
(
const
htp_tx_t
*tx);
120
127
void
*
htp_tx_get_user_data
(
const
htp_tx_t
*tx);
128
135
void
htp_tx_register_request_body_data
(
htp_tx_t
*tx,
int
(*callback_fn)(
htp_tx_data_t
*));
136
143
void
htp_tx_register_response_body_data
(
htp_tx_t
*tx,
int
(*callback_fn)(
htp_tx_data_t
*));
144
153
htp_status_t
htp_tx_req_add_param
(
htp_tx_t
*tx,
htp_param_t
*param);
154
163
htp_param_t
*
htp_tx_req_get_param
(
htp_tx_t
*tx,
const
char
*name,
size_t
name_len);
164
175
htp_param_t
*
htp_tx_req_get_param_ex
(
htp_tx_t
*tx,
enum
htp_data_source_t
source,
const
char
*name,
size_t
name_len);
176
183
int
htp_tx_req_has_body
(
const
htp_tx_t
*tx);
184
199
htp_status_t
htp_tx_req_process_body_data
(
htp_tx_t
*tx,
const
void
*data,
size_t
len);
200
214
htp_status_t
htp_tx_req_set_header
(
htp_tx_t
*tx,
const
char
*name,
size_t
name_len,
215
const
char
*value,
size_t
value_len,
enum
htp_alloc_strategy_t
alloc);
216
229
htp_status_t
htp_tx_req_set_headers_clear
(
htp_tx_t
*tx);
230
241
htp_status_t
htp_tx_req_set_line
(
htp_tx_t
*tx,
const
char
*line,
size_t
line_len,
enum
htp_alloc_strategy_t
alloc);
242
253
htp_status_t
htp_tx_req_set_method
(
htp_tx_t
*tx,
const
char
*method,
size_t
method_len,
enum
htp_alloc_strategy_t
alloc);
254
264
void
htp_tx_req_set_method_number
(
htp_tx_t
*tx,
enum
htp_method_t
method_number);
265
276
void
htp_tx_req_set_parsed_uri
(
htp_tx_t
*tx,
htp_uri_t
*parsed_uri);
277
286
void
htp_tx_req_set_protocol_0_9
(
htp_tx_t
*tx,
int
is_protocol_0_9);
287
299
htp_status_t
htp_tx_req_set_protocol
(
htp_tx_t
*tx,
const
char
*protocol,
size_t
protocol_len,
enum
htp_alloc_strategy_t
alloc);
300
316
void
htp_tx_req_set_protocol_number
(
htp_tx_t
*tx,
int
protocol_number);
317
329
htp_status_t
htp_tx_req_set_uri
(
htp_tx_t
*tx,
const
char
*uri,
size_t
uri_len,
enum
htp_alloc_strategy_t
alloc);
330
349
htp_status_t
htp_tx_res_process_body_data
(
htp_tx_t
*tx,
const
void
*data,
size_t
len);
350
364
htp_status_t
htp_tx_res_set_header
(
htp_tx_t
*tx,
const
char
*name,
size_t
name_len,
365
const
char
*value,
size_t
value_len,
enum
htp_alloc_strategy_t
alloc);
366
379
htp_status_t
htp_tx_res_set_headers_clear
(
htp_tx_t
*tx);
380
389
void
htp_tx_res_set_protocol_number
(
htp_tx_t
*tx,
int
protocol_number);
390
402
htp_status_t
htp_tx_res_set_status_line
(
htp_tx_t
*tx,
const
char
*line,
size_t
line_len,
enum
htp_alloc_strategy_t
alloc);
403
411
void
htp_tx_res_set_status_code
(
htp_tx_t
*tx,
int
status_code);
412
423
htp_status_t
htp_tx_res_set_status_message
(
htp_tx_t
*tx,
const
char
*msg,
size_t
msg_len,
enum
htp_alloc_strategy_t
alloc);
424
440
void
htp_tx_set_config
(
htp_tx_t
*tx,
htp_cfg_t
*cfg,
int
is_cfg_shared);
441
448
void
htp_tx_set_user_data
(
htp_tx_t
*tx,
void
*user_data);
449
457
htp_status_t
htp_tx_state_request_complete
(
htp_tx_t
*tx);
458
467
htp_status_t
htp_tx_state_request_headers
(
htp_tx_t
*tx);
468
477
htp_status_t
htp_tx_state_request_line
(
htp_tx_t
*tx);
478
487
htp_status_t
htp_tx_state_request_start
(
htp_tx_t
*tx);
488
496
htp_status_t
htp_tx_state_response_complete
(
htp_tx_t
*tx);
497
505
htp_status_t
htp_tx_state_response_headers
(
htp_tx_t
*tx);
506
514
htp_status_t
htp_tx_state_response_line
(
htp_tx_t
*tx);
515
523
htp_status_t
htp_tx_state_response_start
(
htp_tx_t
*tx);
524
525
#ifdef __cplusplus
526
}
527
#endif
528
529
#endif
/* HTP_HYBRID_H */
Generated by
1.8.4