Thierry FOURNIER | 4834bc7 | 2015-06-06 19:29:07 +0200 | [diff] [blame] | 1 | #ifndef _TYPES_VARS_H |
| 2 | #define _TYPES_VARS_H |
| 3 | |
Willy Tarreau | 853b297 | 2020-05-27 18:01:47 +0200 | [diff] [blame] | 4 | #include <haproxy/list-t.h> |
Christopher Faulet | e95f2c3 | 2017-07-24 16:30:34 +0200 | [diff] [blame] | 5 | #include <common/hathreads.h> |
Thierry FOURNIER | 4834bc7 | 2015-06-06 19:29:07 +0200 | [diff] [blame] | 6 | |
| 7 | #include <types/sample.h> |
| 8 | |
| 9 | enum vars_scope { |
| 10 | SCOPE_SESS = 0, |
| 11 | SCOPE_TXN, |
| 12 | SCOPE_REQ, |
| 13 | SCOPE_RES, |
Christopher Faulet | ff2613e | 2016-11-09 11:36:17 +0100 | [diff] [blame] | 14 | SCOPE_PROC, |
Gaetan Rivet | 13a5043 | 2020-02-21 18:13:44 +0100 | [diff] [blame] | 15 | SCOPE_CHECK, |
Thierry FOURNIER | 4834bc7 | 2015-06-06 19:29:07 +0200 | [diff] [blame] | 16 | }; |
| 17 | |
| 18 | struct vars { |
| 19 | struct list head; |
| 20 | enum vars_scope scope; |
| 21 | unsigned int size; |
Christopher Faulet | 9dcf9b6 | 2017-11-13 10:34:01 +0100 | [diff] [blame] | 22 | __decl_hathreads(HA_RWLOCK_T rwlock); |
Thierry FOURNIER | 4834bc7 | 2015-06-06 19:29:07 +0200 | [diff] [blame] | 23 | }; |
| 24 | |
| 25 | /* This struct describes a variable. */ |
| 26 | struct var_desc { |
| 27 | const char *name; /* Contains the normalized variable name. */ |
| 28 | enum vars_scope scope; |
| 29 | }; |
| 30 | |
| 31 | struct var { |
| 32 | struct list l; /* Used for chaining vars. */ |
| 33 | const char *name; /* Contains the variable name. */ |
Thierry FOURNIER | 12ba0c2 | 2015-08-14 00:02:11 +0200 | [diff] [blame] | 34 | struct sample_data data; /* data storage. */ |
Thierry FOURNIER | 4834bc7 | 2015-06-06 19:29:07 +0200 | [diff] [blame] | 35 | }; |
| 36 | |
| 37 | #endif |