Commit | Line | Data |
---|---|---|
683d081a JR |
1 | /* |
2 | * Copyright (C) 2019 Jonathan Rajotte <jonathan.rajotte-julien@efficios.com> | |
3 | * | |
4 | * SPDX-License-Identifier: LGPL-2.1-only | |
5 | * | |
6 | */ | |
7 | ||
8 | #ifndef LTTNG_CONDITION_EVENT_RULE_INTERNAL_H | |
9 | #define LTTNG_CONDITION_EVENT_RULE_INTERNAL_H | |
10 | ||
11 | #include <lttng/condition/condition-internal.h> | |
12 | #include <common/buffer-view.h> | |
13 | #include <common/macros.h> | |
14 | #include <lttng/condition/evaluation-internal.h> | |
15 | ||
16 | struct lttng_condition_event_rule { | |
17 | struct lttng_condition parent; | |
18 | struct lttng_event_rule *rule; | |
19 | }; | |
20 | ||
21 | struct lttng_condition_event_rule_comm { | |
22 | /* length excludes the header's length. */ | |
23 | uint32_t event_rule_length; | |
24 | /* Event rule follows. */ | |
25 | char payload[]; | |
26 | } LTTNG_PACKED; | |
27 | ||
28 | struct lttng_evaluation_event_rule { | |
29 | struct lttng_evaluation parent; | |
30 | char *name; | |
31 | }; | |
32 | ||
33 | struct lttng_evaluation_event_rule_comm { | |
34 | /* Includes the null terminator. */ | |
35 | uint32_t trigger_name_length; | |
36 | /* Trigger name. */ | |
37 | char payload[]; | |
38 | } LTTNG_PACKED; | |
39 | ||
40 | ||
41 | LTTNG_HIDDEN | |
42 | ssize_t lttng_condition_event_rule_create_from_payload( | |
43 | struct lttng_payload_view *view, | |
44 | struct lttng_condition **condition); | |
45 | ||
46 | LTTNG_HIDDEN | |
47 | enum lttng_condition_status | |
48 | lttng_condition_event_rule_borrow_rule_mutable( | |
49 | const struct lttng_condition *condition, | |
50 | struct lttng_event_rule **rule); | |
51 | ||
52 | LTTNG_HIDDEN | |
53 | struct lttng_evaluation *lttng_evaluation_event_rule_create( | |
54 | const char* trigger_name); | |
55 | ||
56 | LTTNG_HIDDEN | |
57 | ssize_t lttng_evaluation_event_rule_create_from_payload( | |
58 | struct lttng_payload_view *view, | |
59 | struct lttng_evaluation **_evaluation); | |
60 | ||
61 | #endif /* LTTNG_CONDITION_EVENT_RULE_INTERNAL_H */ |