trigger: internal: add credentials information
[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>
3da864a9 12#include <common/credentials.h>
a58c490f 13#include <common/macros.h>
3da864a9 14#include <common/optional.h>
a58c490f
JG
15#include <stdint.h>
16#include <stdbool.h>
72756a3f 17#include <sys/types.h>
a58c490f 18
c0a66c84
JG
19struct lttng_payload;
20struct lttng_payload_view;
21
a58c490f
JG
22struct lttng_trigger {
23 struct lttng_condition *condition;
24 struct lttng_action *action;
3da864a9 25 LTTNG_OPTIONAL(struct lttng_credentials) creds;
a58c490f
JG
26};
27
28struct lttng_trigger_comm {
29 /* length excludes its own length. */
30 uint32_t length;
31 /* A condition and action object follow. */
32 char payload[];
33} LTTNG_PACKED;
34
35LTTNG_HIDDEN
c0a66c84 36ssize_t lttng_trigger_create_from_payload(struct lttng_payload_view *view,
a58c490f
JG
37 struct lttng_trigger **trigger);
38
39LTTNG_HIDDEN
3647288f 40int lttng_trigger_serialize(struct lttng_trigger *trigger,
c0a66c84 41 struct lttng_payload *payload);
a58c490f 42
9b63a4aa
JG
43LTTNG_HIDDEN
44const struct lttng_condition *lttng_trigger_get_const_condition(
45 const struct lttng_trigger *trigger);
46
47LTTNG_HIDDEN
48const struct lttng_action *lttng_trigger_get_const_action(
49 const struct lttng_trigger *trigger);
50
a58c490f
JG
51LTTNG_HIDDEN
52bool lttng_trigger_validate(struct lttng_trigger *trigger);
53
3da864a9
JR
54LTTNG_HIDDEN
55const struct lttng_credentials *lttng_trigger_get_credentials(
56 const struct lttng_trigger *trigger);
57
58LTTNG_HIDDEN
59void lttng_trigger_set_credentials(
60 struct lttng_trigger *trigger,
61 const struct lttng_credentials *creds);
62
a58c490f 63#endif /* LTTNG_TRIGGER_INTERNAL_H */
This page took 0.04547 seconds and 4 git commands to generate.