blob: e77396cfbc14eff49dd7ff7f5b3333b1dfdb4525 [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;
19 struct timeval expire; /* next expiration time for this application session */
20 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 Tarreaud825eef2007-05-12 22:35:00 +020041void appsession_refresh(struct task *t, struct timeval *next);
Willy Tarreaubaaee002006-06-26 02:48:02 +020042int appsession_task_init(void);
43int appsession_init(void);
44void appsession_cleanup(void);
45
Willy Tarreau2dd0d472006-06-29 17:53:05 +020046#endif /* _COMMON_APPSESS_H */
Willy Tarreaubaaee002006-06-26 02:48:02 +020047
48/*
49 * Local variables:
50 * c-indent-level: 8
51 * c-basic-offset: 8
52 * End:
53 */