00001 /*************************************************************************** 00002 * Copyright (c) 2009-2010 Open Information Security Foundation 00003 * Copyright (c) 2010-2013 Qualys, Inc. 00004 * All rights reserved. 00005 * 00006 * Redistribution and use in source and binary forms, with or without 00007 * modification, are permitted provided that the following conditions are 00008 * met: 00009 * 00010 * - Redistributions of source code must retain the above copyright 00011 * notice, this list of conditions and the following disclaimer. 00012 00013 * - Redistributions in binary form must reproduce the above copyright 00014 * notice, this list of conditions and the following disclaimer in the 00015 * documentation and/or other materials provided with the distribution. 00016 00017 * - Neither the name of the Qualys, Inc. nor the names of its 00018 * contributors may be used to endorse or promote products derived from 00019 * this software without specific prior written permission. 00020 * 00021 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00022 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00023 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 00024 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 00025 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00026 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00027 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00028 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 00029 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00030 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00031 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00032 ***************************************************************************/ 00033 00039 #ifndef HTP_CONNECTION_PARSER_H 00040 #define HTP_CONNECTION_PARSER_H 00041 00042 #ifdef __cplusplus 00043 extern "C" { 00044 #endif 00045 00051 void htp_connp_clear_error(htp_connp_t *connp); 00052 00059 void htp_connp_close(htp_connp_t *connp, const htp_time_t *timestamp); 00060 00071 htp_connp_t *htp_connp_create(htp_cfg_t *cfg); 00072 00079 void htp_connp_destroy(htp_connp_t *connp); 00080 00087 void htp_connp_destroy_all(htp_connp_t *connp); 00088 00095 htp_conn_t *htp_connp_get_connection(const htp_connp_t *connp); 00096 00105 htp_tx_t *htp_connp_get_in_tx(const htp_connp_t *connp); 00106 00116 htp_log_t *htp_connp_get_last_error(const htp_connp_t *connp); 00117 00126 htp_tx_t *htp_connp_get_out_tx(const htp_connp_t *connp); 00127 00134 void *htp_connp_get_user_data(const htp_connp_t *connp); 00135 00146 void htp_connp_open(htp_connp_t *connp, const char *client_addr, int client_port, const char *server_addr, 00147 int server_port, htp_time_t *timestamp); 00148 00155 void htp_connp_set_user_data(htp_connp_t *connp, const void *user_data); 00156 00166 int htp_connp_req_data(htp_connp_t *connp, const htp_time_t *timestamp, const void *data, size_t len); 00167 00178 size_t htp_connp_req_data_consumed(htp_connp_t *connp); 00179 00189 int htp_connp_res_data(htp_connp_t *connp, const htp_time_t *timestamp, const void *data, size_t len); 00190 00201 size_t htp_connp_res_data_consumed(htp_connp_t *connp); 00202 00209 htp_tx_t *htp_connp_tx_create(htp_connp_t *connp); 00210 00211 #ifdef __cplusplus 00212 } 00213 #endif 00214 00215 #endif /* HTP_CONNECTION_PARSER_H */