cff4504a7d71e3b656bce857d6307125a338ff94
[lttng-tools.git] / include / lttng / trigger / trigger-internal.h
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_TRIGGER_INTERNAL_H
9 #define LTTNG_TRIGGER_INTERNAL_H
10
11 #include <lttng/trigger/trigger.h>
12 #include <common/macros.h>
13 #include <common/buffer-view.h>
14 #include <common/dynamic-buffer.h>
15 #include <stdint.h>
16 #include <stdbool.h>
17 #include <sys/types.h>
18
19 struct lttng_trigger {
20 struct lttng_condition *condition;
21 struct lttng_action *action;
22 };
23
24 struct lttng_trigger_comm {
25 /* length excludes its own length. */
26 uint32_t length;
27 /* A condition and action object follow. */
28 char payload[];
29 } LTTNG_PACKED;
30
31 LTTNG_HIDDEN
32 ssize_t lttng_trigger_create_from_buffer(const struct lttng_buffer_view *view,
33 struct lttng_trigger **trigger);
34
35 LTTNG_HIDDEN
36 int lttng_trigger_serialize(struct lttng_trigger *trigger,
37 struct lttng_dynamic_buffer *buf);
38
39 LTTNG_HIDDEN
40 const struct lttng_condition *lttng_trigger_get_const_condition(
41 const struct lttng_trigger *trigger);
42
43 LTTNG_HIDDEN
44 const struct lttng_action *lttng_trigger_get_const_action(
45 const struct lttng_trigger *trigger);
46
47 LTTNG_HIDDEN
48 bool lttng_trigger_validate(struct lttng_trigger *trigger);
49
50 #endif /* LTTNG_TRIGGER_INTERNAL_H */
This page took 0.042475 seconds and 4 git commands to generate.