blob: eb9ba2d0ff3c25cc2f59bb11b6ca962f3b61d997 [file] [log] [blame]
Willy Tarreau2dd0d472006-06-29 17:53:05 +02001#ifndef _COMMON_APPSESS_H
2#define _COMMON_APPSESS_H
Willy Tarreaubaaee002006-06-26 02:48:02 +02003
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 Tarreau2dd0d472006-06-29 17:53:05 +02009#include <common/chtbl.h>
Willy Tarreaue3ba5f02006-06-29 18:54:54 +020010#include <common/config.h>
Willy Tarreau2dd0d472006-06-29 17:53:05 +020011#include <common/hashpjw.h>
12#include <common/list.h>
Willy Tarreaubaaee002006-06-26 02:48:02 +020013
14#include <types/task.h>
15
16typedef 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)
24extern void **pool_appsess;
25
26struct 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
33extern struct app_pool apools;
34extern int have_appsession;
35
36
37/* Callback for hash_lookup */
38int match_str(const void *key1, const void *key2);
39
40/* Callback for destroy */
41void destroy(void *data);
42
43#if defined(DEBUG_HASH)
44static void print_table(const CHTbl *htbl);
45#endif
46
47int appsession_refresh(struct task *t);
48int appsession_task_init(void);
49int appsession_init(void);
50void appsession_cleanup(void);
51
Willy Tarreau2dd0d472006-06-29 17:53:05 +020052#endif /* _COMMON_APPSESS_H */
Willy Tarreaubaaee002006-06-26 02:48:02 +020053
54/*
55 * Local variables:
56 * c-indent-level: 8
57 * c-basic-offset: 8
58 * End:
59 */