blob: 46872986b4a8a64a755b68b5793920d5f71fdc2e [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 Tarreau63963c62007-05-13 21:29:55 +020013#include <common/memory.h>
Willy Tarreaubaaee002006-06-26 02:48:02 +020014
15#include <types/task.h>
16
17typedef struct appsessions {
18 char *sessid;
19 char *serverid;
20 struct timeval expire; /* next expiration time for this application session */
21 unsigned long int request_count;
22} 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 */
39void destroy(void *data);
40
41#if defined(DEBUG_HASH)
42static void print_table(const CHTbl *htbl);
43#endif
44
Willy Tarreaud825eef2007-05-12 22:35:00 +020045void appsession_refresh(struct task *t, struct timeval *next);
Willy Tarreaubaaee002006-06-26 02:48:02 +020046int appsession_task_init(void);
47int appsession_init(void);
48void appsession_cleanup(void);
49
Willy Tarreau2dd0d472006-06-29 17:53:05 +020050#endif /* _COMMON_APPSESS_H */
Willy Tarreaubaaee002006-06-26 02:48:02 +020051
52/*
53 * Local variables:
54 * c-indent-level: 8
55 * c-basic-offset: 8
56 * End:
57 */