blob: 6c2494d95ba687c4e37fcfc9245b07e1cc14064e [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
Willy Tarreau51041c72007-09-09 21:56:53 +02004/*
5 * The time between two calls of appsession_refresh in ms.
6 */
7#define TBLCHKINT 5000
Willy Tarreaubaaee002006-06-26 02:48:02 +02008
9#include <sys/time.h>
10
Willy Tarreaue3ba5f02006-06-29 18:54:54 +020011#include <common/config.h>
Willy Tarreau63963c62007-05-13 21:29:55 +020012#include <common/memory.h>
Willy Tarreaubaaee002006-06-26 02:48:02 +020013
14#include <types/task.h>
15
16typedef struct appsessions {
17 char *sessid;
18 char *serverid;
Willy Tarreau0c303ee2008-07-07 00:09:58 +020019 int expire; /* next expiration time for this application session (in tick) */
Willy Tarreaubaaee002006-06-26 02:48:02 +020020 unsigned long int request_count;
Willy Tarreau51041c72007-09-09 21:56:53 +020021 struct list hash_list;
Willy Tarreaubaaee002006-06-26 02:48:02 +020022} appsess;
23
Willy Tarreau63963c62007-05-13 21:29:55 +020024extern struct pool_head *pool2_appsess;
Willy Tarreaubaaee002006-06-26 02:48:02 +020025
26struct app_pool {
Willy Tarreau63963c62007-05-13 21:29:55 +020027 struct pool_head *sessid;
28 struct pool_head *serverid;
Willy Tarreaubaaee002006-06-26 02:48:02 +020029};
30
31extern struct app_pool apools;
32extern int have_appsession;
33
34
35/* Callback for hash_lookup */
36int match_str(const void *key1, const void *key2);
37
38/* Callback for destroy */
Willy Tarreau51041c72007-09-09 21:56:53 +020039void destroy(appsess *data);
Willy Tarreaubaaee002006-06-26 02:48:02 +020040
Willy Tarreaubaaee002006-06-26 02:48:02 +020041int appsession_task_init(void);
42int appsession_init(void);
43void appsession_cleanup(void);
44
Willy Tarreau2dd0d472006-06-29 17:53:05 +020045#endif /* _COMMON_APPSESS_H */
Willy Tarreaubaaee002006-06-26 02:48:02 +020046
47/*
48 * Local variables:
49 * c-indent-level: 8
50 * c-basic-offset: 8
51 * End:
52 */