Commit | Line | Data |
---|---|---|
a58c490f | 1 | /* |
ab5be9fa | 2 | * Copyright (C) 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com> |
a58c490f | 3 | * |
ab5be9fa | 4 | * SPDX-License-Identifier: LGPL-2.1-only |
a58c490f | 5 | * |
a58c490f JG |
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> | |
a58c490f JG |
13 | #include <stdint.h> |
14 | #include <stdbool.h> | |
72756a3f | 15 | #include <sys/types.h> |
a58c490f | 16 | |
c0a66c84 JG |
17 | struct lttng_payload; |
18 | struct lttng_payload_view; | |
19 | ||
a58c490f JG |
20 | struct lttng_trigger { |
21 | struct lttng_condition *condition; | |
22 | struct lttng_action *action; | |
23 | }; | |
24 | ||
25 | struct lttng_trigger_comm { | |
26 | /* length excludes its own length. */ | |
27 | uint32_t length; | |
28 | /* A condition and action object follow. */ | |
29 | char payload[]; | |
30 | } LTTNG_PACKED; | |
31 | ||
32 | LTTNG_HIDDEN | |
c0a66c84 | 33 | ssize_t lttng_trigger_create_from_payload(struct lttng_payload_view *view, |
a58c490f JG |
34 | struct lttng_trigger **trigger); |
35 | ||
36 | LTTNG_HIDDEN | |
3647288f | 37 | int lttng_trigger_serialize(struct lttng_trigger *trigger, |
c0a66c84 | 38 | struct lttng_payload *payload); |
a58c490f | 39 | |
9b63a4aa JG |
40 | LTTNG_HIDDEN |
41 | const struct lttng_condition *lttng_trigger_get_const_condition( | |
42 | const struct lttng_trigger *trigger); | |
43 | ||
44 | LTTNG_HIDDEN | |
45 | const struct lttng_action *lttng_trigger_get_const_action( | |
46 | const struct lttng_trigger *trigger); | |
47 | ||
a58c490f JG |
48 | LTTNG_HIDDEN |
49 | bool lttng_trigger_validate(struct lttng_trigger *trigger); | |
50 | ||
51 | #endif /* LTTNG_TRIGGER_INTERNAL_H */ |