lttng-ctl: add capture descriptor feature to event rule condition API
[lttng-tools.git] / include / lttng / condition / condition-internal.h
... / ...
CommitLineData
1/*
2 * Copyright (C) 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 *
4 * SPDX-License-Identifier: LGPL-2.1-only
5 *
6 */
7
8#ifndef LTTNG_CONDITION_INTERNAL_H
9#define LTTNG_CONDITION_INTERNAL_H
10
11#include <lttng/condition/condition.h>
12#include <common/macros.h>
13#include <common/payload-view.h>
14#include <common/payload.h>
15#include <stdbool.h>
16#include <urcu/list.h>
17#include <urcu/ref.h>
18#include <stdint.h>
19#include <sys/types.h>
20
21typedef void (*condition_destroy_cb)(struct lttng_condition *condition);
22typedef bool (*condition_validate_cb)(const struct lttng_condition *condition);
23typedef int (*condition_serialize_cb)(
24 const struct lttng_condition *condition,
25 struct lttng_payload *payload);
26typedef bool (*condition_equal_cb)(const struct lttng_condition *a,
27 const struct lttng_condition *b);
28typedef ssize_t (*condition_create_from_payload_cb)(
29 struct lttng_payload_view *view,
30 struct lttng_condition **condition);
31
32struct lttng_condition {
33 /* Reference counting is only exposed to internal users. */
34 struct urcu_ref ref;
35 enum lttng_condition_type type;
36 condition_validate_cb validate;
37 condition_serialize_cb serialize;
38 condition_equal_cb equal;
39 condition_destroy_cb destroy;
40};
41
42struct lttng_condition_comm {
43 /* enum lttng_condition_type */
44 int8_t condition_type;
45 char payload[];
46};
47
48LTTNG_HIDDEN
49void lttng_condition_get(struct lttng_condition *condition);
50
51LTTNG_HIDDEN
52void lttng_condition_put(struct lttng_condition *condition);
53
54LTTNG_HIDDEN
55void lttng_condition_init(struct lttng_condition *condition,
56 enum lttng_condition_type type);
57
58LTTNG_HIDDEN
59bool lttng_condition_validate(const struct lttng_condition *condition);
60
61LTTNG_HIDDEN
62ssize_t lttng_condition_create_from_payload(
63 struct lttng_payload_view *view,
64 struct lttng_condition **condition);
65
66LTTNG_HIDDEN
67int lttng_condition_serialize(const struct lttng_condition *condition,
68 struct lttng_payload *payload);
69
70LTTNG_HIDDEN
71bool lttng_condition_is_equal(const struct lttng_condition *a,
72 const struct lttng_condition *b);
73
74LTTNG_HIDDEN
75const char *lttng_condition_type_str(enum lttng_condition_type type);
76
77#endif /* LTTNG_CONDITION_INTERNAL_H */
This page took 0.028216 seconds and 4 git commands to generate.