re-established all previous AUD level messages
[strongswan.git] / src / libfast / filter.h
1 /*
2 * Copyright (C) 2008 Martin Willi
3 * Hochschule fuer Technik Rapperswil
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
14 *
15 * $Id$
16 */
17
18 /*
19 * @defgroup filter filter
20 * @{ @ingroup libfast
21 */
22
23 #ifndef FILTER_H_
24 #define FILTER_H_
25
26 #include "request.h"
27 #include "context.h"
28 #include "controller.h"
29
30 typedef struct filter_t filter_t;
31
32 /**
33 * Constructor function for a filter
34 *
35 * @param context session specific context
36 * @param param user supplied param
37 */
38 typedef filter_t *(*filter_constructor_t)(context_t* context, void *param);
39
40 /**
41 * Filter interface, to be implemented by users filters.
42 */
43 struct filter_t {
44
45 /**
46 * Called before the controller handles the request.
47 *
48 * @param request HTTP request
49 * @param p1 first parameter
50 * @param p2 second parameter
51 * @param p3 third parameter
52 * @param p4 forth parameter
53 * @param p5 fifth parameter
54 * @return TRUE to continue request handling
55 */
56 bool (*run)(filter_t *this, request_t *request,
57 char *p0, char *p1, char *p2, char *p3, char *p4, char *p5);
58
59 /**
60 * Destroy the filter instance.
61 */
62 void (*destroy) (filter_t *this);
63 };
64
65 #endif /* FILTER_H_ @} */