]>
Commit | Line | Data |
---|---|---|
965e99b5 MW |
1 | /* |
2 | * Copyright (C) 2007 Martin Willi | |
19ef2aec TB |
3 | * |
4 | * Copyright (C) secunet Security Networks AG | |
965e99b5 MW |
5 | * |
6 | * This program is free software; you can redistribute it and/or modify it | |
7 | * under the terms of the GNU General Public License as published by the | |
8 | * Free Software Foundation; either version 2 of the License, or (at your | |
9 | * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>. | |
10 | * | |
11 | * This program is distributed in the hope that it will be useful, but | |
12 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | |
13 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
14 | * for more details. | |
552cc11b MW |
15 | */ |
16 | ||
17 | /** | |
890f2098 | 18 | * @defgroup fast_session fast_session |
552cc11b | 19 | * @{ @ingroup libfast |
965e99b5 MW |
20 | */ |
21 | ||
890f2098 MW |
22 | #ifndef FAST_SESSION_H_ |
23 | #define FAST_SESSION_H_ | |
965e99b5 | 24 | |
890f2098 MW |
25 | #include "fast_request.h" |
26 | #include "fast_controller.h" | |
27 | #include "fast_filter.h" | |
965e99b5 | 28 | |
890f2098 | 29 | typedef struct fast_session_t fast_session_t; |
965e99b5 MW |
30 | |
31 | /** | |
527b3f0c | 32 | * Session handling class, instantiated for each user session. |
965e99b5 | 33 | */ |
890f2098 | 34 | struct fast_session_t { |
7daf5226 | 35 | |
965e99b5 | 36 | /** |
552cc11b | 37 | * Get the session ID of the session. |
965e99b5 MW |
38 | * |
39 | * @return session ID | |
40 | */ | |
890f2098 | 41 | char* (*get_sid)(fast_session_t *this); |
7daf5226 | 42 | |
965e99b5 | 43 | /** |
552cc11b | 44 | * Add a controller instance to the session. |
965e99b5 MW |
45 | * |
46 | * @param controller controller to add | |
47 | */ | |
890f2098 | 48 | void (*add_controller)(fast_session_t *this, fast_controller_t *controller); |
7daf5226 | 49 | |
965e99b5 | 50 | /** |
6de28173 | 51 | * Add a filter instance to the session. |
552cc11b MW |
52 | * |
53 | * @param filter filter to add | |
54 | */ | |
890f2098 | 55 | void (*add_filter)(fast_session_t *this, fast_filter_t *filter); |
7daf5226 | 56 | |
552cc11b MW |
57 | /** |
58 | * Process a request in this session. | |
965e99b5 MW |
59 | * |
60 | * @param request request to process | |
965e99b5 | 61 | */ |
890f2098 | 62 | void (*process)(fast_session_t *this, fast_request_t *request); |
7daf5226 | 63 | |
965e99b5 | 64 | /** |
890f2098 | 65 | * Destroy the fast_session_t. |
965e99b5 | 66 | */ |
890f2098 | 67 | void (*destroy) (fast_session_t *this); |
965e99b5 MW |
68 | }; |
69 | ||
70 | /** | |
552cc11b | 71 | * Create a session new session. |
965e99b5 | 72 | * |
552cc11b | 73 | * @param context user defined session context instance |
76a98ee2 | 74 | * @return client session, NULL on error |
965e99b5 | 75 | */ |
890f2098 | 76 | fast_session_t *fast_session_create(fast_context_t *context); |
965e99b5 | 77 | |
1490ff4d | 78 | #endif /** SESSION_H_ @}*/ |