liblttng-ctl: use lttng_payload for serialize/create_from_buffer
[lttng-tools.git] / include / lttng / trigger / trigger-internal.h
CommitLineData
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
17struct lttng_payload;
18struct lttng_payload_view;
19
a58c490f
JG
20struct lttng_trigger {
21 struct lttng_condition *condition;
22 struct lttng_action *action;
23};
24
25struct 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
32LTTNG_HIDDEN
c0a66c84 33ssize_t lttng_trigger_create_from_payload(struct lttng_payload_view *view,
a58c490f
JG
34 struct lttng_trigger **trigger);
35
36LTTNG_HIDDEN
3647288f 37int lttng_trigger_serialize(struct lttng_trigger *trigger,
c0a66c84 38 struct lttng_payload *payload);
a58c490f 39
9b63a4aa
JG
40LTTNG_HIDDEN
41const struct lttng_condition *lttng_trigger_get_const_condition(
42 const struct lttng_trigger *trigger);
43
44LTTNG_HIDDEN
45const struct lttng_action *lttng_trigger_get_const_action(
46 const struct lttng_trigger *trigger);
47
a58c490f
JG
48LTTNG_HIDDEN
49bool lttng_trigger_validate(struct lttng_trigger *trigger);
50
51#endif /* LTTNG_TRIGGER_INTERNAL_H */
This page took 0.029572 seconds and 4 git commands to generate.