blob: 550cc8917143418bef6ab99e780fbd38332c6f67 [file] [log] [blame]
Miroslav Zagorac70230c62020-12-09 16:54:31 +01001/***
2 * Copyright 2020 HAProxy Technologies
3 *
4 * This file is part of the HAProxy OpenTracing filter.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 */
20#ifndef _OPENTRACING_VARS_H_
21#define _OPENTRACING_VARS_H_
22
23#define FLT_OT_VARS_SCOPE "txn"
Miroslav Zagorac52c2ec32022-03-10 00:03:24 +010024#define FLT_OT_VAR_CTX_SIZE int8_t
Miroslav Zagorac70230c62020-12-09 16:54:31 +010025#define FLT_OT_VAR_CHAR_DASH 'D'
26#define FLT_OT_VAR_CHAR_SPACE 'S'
27
Miroslav Zagorac52c2ec32022-03-10 00:03:24 +010028struct flt_ot_ctx {
29 char value[BUFSIZ];
30 int value_len;
31};
32
33typedef int (*flt_ot_ctx_loop_cb)(struct sample *, size_t, const char *, const char *, const char *, FLT_OT_VAR_CTX_SIZE, char **, void *);
34
Miroslav Zagorac70230c62020-12-09 16:54:31 +010035
36#ifndef DEBUG_OT
37# define flt_ot_vars_dump(...) while (0)
38#else
39void flt_ot_vars_dump(struct stream *s);
40#endif
41int flt_ot_var_register(const char *scope, const char *prefix, const char *name, char **err);
42int flt_ot_var_set(struct stream *s, const char *scope, const char *prefix, const char *name, const char *value, uint opt, char **err);
Miroslav Zagorac70230c62020-12-09 16:54:31 +010043int flt_ot_vars_unset(struct stream *s, const char *scope, const char *prefix, uint opt, char **err);
Miroslav Zagorac70230c62020-12-09 16:54:31 +010044struct otc_text_map *flt_ot_vars_get(struct stream *s, const char *scope, const char *prefix, uint opt, char **err);
45
46#endif /* _OPENTRACING_VARS_H_ */
47
48/*
49 * Local variables:
50 * c-indent-level: 8
51 * c-basic-offset: 8
52 * End:
53 *
54 * vi: noexpandtab shiftwidth=8 tabstop=8
55 */