HTP  0.3
htp_decompressors.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (c) 2009-2010, Open Information Security Foundation
3  * Copyright (c) 2009-2012, 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  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  * * Neither the name of the Qualys, Inc. nor the names of its
16  * contributors may be used to endorse or promote products derived from
17  * this software without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23  * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30  ***************************************************************************/
31 
37 #ifndef _HTP_DECOMPRESSORS_H
38 #define _HTP_DECOMPRESSORS_H
39 
42 
43 #include "zlib.h"
44 
45 #define GZIP_BUF_SIZE 8192
46 #define GZIP_WINDOW_SIZE -15
47 
48 #define DEFLATE_MAGIC_1 0x1f
49 #define DEFLATE_MAGIC_2 0x8b
50 
51 #define COMPRESSION_NONE 0
52 #define COMPRESSION_GZIP 1
53 #define COMPRESSION_DEFLATE 2
54 
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58 
63 };
64 
69  uint8_t header[10];
70  uint8_t header_len;
71  z_stream stream;
72  unsigned char *buffer;
73  unsigned long crc;
74 };
75 
77 
78 #ifdef __cplusplus
79 }
80 #endif
81 
82 #endif /* _HTP_DECOMPRESSORS_H */
83