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 | |
| 4 | #define TBLSIZ 10 |
| 5 | #define TBLCHKINT 5000 /* The time between two calls of appsession_refresh in ms */ |
| 6 | |
| 7 | #include <sys/time.h> |
| 8 | |
Willy Tarreau | 2dd0d47 | 2006-06-29 17:53:05 +0200 | [diff] [blame] | 9 | #include <common/chtbl.h> |
Willy Tarreau | e3ba5f0 | 2006-06-29 18:54:54 +0200 | [diff] [blame] | 10 | #include <common/config.h> |
Willy Tarreau | 2dd0d47 | 2006-06-29 17:53:05 +0200 | [diff] [blame] | 11 | #include <common/hashpjw.h> |
| 12 | #include <common/list.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; |
| 19 | struct timeval expire; /* next expiration time for this application session */ |
| 20 | unsigned long int request_count; |
| 21 | } appsess; |
| 22 | |
| 23 | #define sizeof_appsess sizeof(struct appsessions) |
| 24 | extern void **pool_appsess; |
| 25 | |
| 26 | struct app_pool { |
| 27 | void **sessid; |
| 28 | void **serverid; |
| 29 | int ses_waste, ses_use, ses_msize; |
| 30 | int ser_waste, ser_use, ser_msize; |
| 31 | }; |
| 32 | |
| 33 | extern struct app_pool apools; |
| 34 | extern int have_appsession; |
| 35 | |
| 36 | |
| 37 | /* Callback for hash_lookup */ |
| 38 | int match_str(const void *key1, const void *key2); |
| 39 | |
| 40 | /* Callback for destroy */ |
| 41 | void destroy(void *data); |
| 42 | |
| 43 | #if defined(DEBUG_HASH) |
| 44 | static void print_table(const CHTbl *htbl); |
| 45 | #endif |
| 46 | |
| 47 | int appsession_refresh(struct task *t); |
| 48 | int appsession_task_init(void); |
| 49 | int appsession_init(void); |
| 50 | void appsession_cleanup(void); |
| 51 | |
Willy Tarreau | 2dd0d47 | 2006-06-29 17:53:05 +0200 | [diff] [blame] | 52 | #endif /* _COMMON_APPSESS_H */ |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 53 | |
| 54 | /* |
| 55 | * Local variables: |
| 56 | * c-indent-level: 8 |
| 57 | * c-basic-offset: 8 |
| 58 | * End: |
| 59 | */ |