HTP
0.3
Main Page
Related Pages
Data Structures
Files
File List
Globals
htp
hooks.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 _HOOKS_H
38
#define _HOOKS_H
39
40
#include "
dslib.h
"
41
42
#ifdef _HTP_H
43
#define HOOK_ERROR HTP_ERROR
44
#define HOOK_OK HTP_OK
45
#define HOOK_DECLINED HTP_DECLINED
46
#else
47
#define HOOK_ERROR -1
48
#define HOOK_OK 0
49
#define HOOK_DECLINED 1
50
#endif
51
52
typedef
struct
htp_hook_t
htp_hook_t
;
53
typedef
struct
htp_callback_t
htp_callback_t
;
54
typedef
int (*
htp_callback_fn_t
) (
void
*);
55
56
#ifdef __cplusplus
57
extern
"C"
{
58
#endif
59
60
struct
htp_hook_t
{
61
list_t
*
callbacks
;
62
};
63
64
struct
htp_callback_t
{
65
htp_callback_fn_t
fn
;
66
};
67
68
int
hook_register
(
htp_hook_t
**hook,
htp_callback_fn_t
callback_fn);
69
int
hook_run_one
(
htp_hook_t
*hook,
void
*data);
70
int
hook_run_all
(
htp_hook_t
*hook,
void
*data);
71
72
htp_hook_t
*
hook_create
(
void
);
73
htp_hook_t
*
hook_copy
(
htp_hook_t
*hook);
74
void
hook_destroy
(
htp_hook_t
*hook);
75
76
77
#ifdef __cplusplus
78
}
79
#endif
80
81
#endif
/* _HOOKS_H */
82
Generated by
1.8.1.2