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_ACTION_NOTIFY_H | |
9 | #define LTTNG_ACTION_NOTIFY_H | |
10 | ||
11 | struct lttng_action; | |
1c2c1c05 | 12 | struct lttng_firing_policy; |
a58c490f JG |
13 | |
14 | #ifdef __cplusplus | |
15 | extern "C" { | |
16 | #endif | |
17 | ||
a109f1c6 JG |
18 | /* |
19 | * Create a newly allocated notification action object. | |
20 | * | |
21 | * A "notify" action will emit a notification to all clients which have an | |
22 | * open notification channel. In order to receive this notification, clients | |
23 | * must have subscribed to a condition equivalent to the one paired to this | |
24 | * notify action in a trigger. | |
25 | * | |
1c2c1c05 JR |
26 | * The default firing policy for a notify action is a "every 1" firing policy. |
27 | * | |
a109f1c6 JG |
28 | * Returns a new action on success, NULL on failure. This action must be |
29 | * destroyed using lttng_action_destroy(). | |
30 | */ | |
a58c490f JG |
31 | extern struct lttng_action *lttng_action_notify_create(void); |
32 | ||
1c2c1c05 JR |
33 | /* |
34 | * Set the firing policy of a notify action. | |
35 | * | |
36 | * Returns LTTNG_ACTION_STATUS_OK on success, | |
37 | * LTTNG_ACTION_STATUS_ERROR on internal error, | |
38 | * LTTNG_ACTION_STATUS_INVALID if invalid parameters are passed. | |
39 | */ | |
40 | extern enum lttng_action_status lttng_action_notify_set_firing_policy( | |
41 | struct lttng_action *action, | |
42 | const struct lttng_firing_policy *policy); | |
43 | ||
44 | /* | |
45 | * Get the firing policy of a notify action. | |
46 | * | |
47 | * Returns LTTNG_ACTION_STATUS_OK on success, | |
48 | * LTTNG_ACTION_STATUS_INVALID if invalid parameters are passed. | |
49 | */ | |
50 | extern enum lttng_action_status lttng_action_notify_get_firing_policy( | |
51 | const struct lttng_action *action, | |
52 | const struct lttng_firing_policy **policy); | |
53 | ||
a58c490f JG |
54 | #ifdef __cplusplus |
55 | } | |
56 | #endif | |
57 | ||
58 | #endif /* LTTNG_ACTION_NOTIFY_H */ |