blob: d8ec71c61b9394d93dd74c2e45f08905ea8c2499 [file] [log] [blame]
Thierry FOURNIER4834bc72015-06-06 19:29:07 +02001#ifndef _TYPES_VARS_H
2#define _TYPES_VARS_H
3
Willy Tarreau853b2972020-05-27 18:01:47 +02004#include <haproxy/list-t.h>
Willy Tarreau3f567e42020-05-28 15:29:19 +02005#include <haproxy/thread.h>
Thierry FOURNIER4834bc72015-06-06 19:29:07 +02006
Willy Tarreaue6ce10b2020-06-04 15:33:47 +02007#include <haproxy/sample-t.h>
Thierry FOURNIER4834bc72015-06-06 19:29:07 +02008
9enum vars_scope {
10 SCOPE_SESS = 0,
11 SCOPE_TXN,
12 SCOPE_REQ,
13 SCOPE_RES,
Christopher Fauletff2613e2016-11-09 11:36:17 +010014 SCOPE_PROC,
Gaetan Rivet13a50432020-02-21 18:13:44 +010015 SCOPE_CHECK,
Thierry FOURNIER4834bc72015-06-06 19:29:07 +020016};
17
18struct vars {
19 struct list head;
20 enum vars_scope scope;
21 unsigned int size;
Willy Tarreauaf613e82020-06-05 08:40:51 +020022 __decl_thread(HA_RWLOCK_T rwlock);
Thierry FOURNIER4834bc72015-06-06 19:29:07 +020023};
24
25/* This struct describes a variable. */
26struct var_desc {
27 const char *name; /* Contains the normalized variable name. */
28 enum vars_scope scope;
29};
30
31struct var {
32 struct list l; /* Used for chaining vars. */
33 const char *name; /* Contains the variable name. */
Thierry FOURNIER12ba0c22015-08-14 00:02:11 +020034 struct sample_data data; /* data storage. */
Thierry FOURNIER4834bc72015-06-06 19:29:07 +020035};
36
37#endif