Willy Tarreau | 2dd0d47 | 2006-06-29 17:53:05 +0200 | [diff] [blame] | 1 | #ifndef _COMMON_APPSESS_H |
| 2 | #define _COMMON_APPSESS_H |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 3 | |
Willy Tarreau | 51041c7 | 2007-09-09 21:56:53 +0200 | [diff] [blame] | 4 | /* |
| 5 | * The time between two calls of appsession_refresh in ms. |
| 6 | */ |
| 7 | #define TBLCHKINT 5000 |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 8 | |
| 9 | #include <sys/time.h> |
| 10 | |
Willy Tarreau | e3ba5f0 | 2006-06-29 18:54:54 +0200 | [diff] [blame] | 11 | #include <common/config.h> |
Willy Tarreau | 63963c6 | 2007-05-13 21:29:55 +0200 | [diff] [blame] | 12 | #include <common/memory.h> |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 13 | |
| 14 | #include <types/task.h> |
| 15 | |
| 16 | typedef struct appsessions { |
| 17 | char *sessid; |
| 18 | char *serverid; |
Willy Tarreau | 0c303ee | 2008-07-07 00:09:58 +0200 | [diff] [blame] | 19 | int expire; /* next expiration time for this application session (in tick) */ |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 20 | unsigned long int request_count; |
Willy Tarreau | 51041c7 | 2007-09-09 21:56:53 +0200 | [diff] [blame] | 21 | struct list hash_list; |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 22 | } appsess; |
| 23 | |
Willy Tarreau | 63963c6 | 2007-05-13 21:29:55 +0200 | [diff] [blame] | 24 | extern struct pool_head *pool2_appsess; |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 25 | |
| 26 | struct app_pool { |
Willy Tarreau | 63963c6 | 2007-05-13 21:29:55 +0200 | [diff] [blame] | 27 | struct pool_head *sessid; |
| 28 | struct pool_head *serverid; |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 29 | }; |
| 30 | |
| 31 | extern struct app_pool apools; |
| 32 | extern int have_appsession; |
| 33 | |
| 34 | |
| 35 | /* Callback for hash_lookup */ |
| 36 | int match_str(const void *key1, const void *key2); |
| 37 | |
| 38 | /* Callback for destroy */ |
Willy Tarreau | 51041c7 | 2007-09-09 21:56:53 +0200 | [diff] [blame] | 39 | void destroy(appsess *data); |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 40 | |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 41 | int appsession_task_init(void); |
| 42 | int appsession_init(void); |
| 43 | void appsession_cleanup(void); |
| 44 | |
Willy Tarreau | 2dd0d47 | 2006-06-29 17:53:05 +0200 | [diff] [blame] | 45 | #endif /* _COMMON_APPSESS_H */ |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 46 | |
| 47 | /* |
| 48 | * Local variables: |
| 49 | * c-indent-level: 8 |
| 50 | * c-basic-offset: 8 |
| 51 | * End: |
| 52 | */ |