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; | |
7f4d5b07 | 12 | struct lttng_rate_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 | * | |
7f4d5b07 | 26 | * The default rate policy for a notify action is a "every 1" rate policy. |
1c2c1c05 | 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 | 33 | /* |
7f4d5b07 | 34 | * Set the rate policy of a notify action. |
1c2c1c05 JR |
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 | */ | |
7f4d5b07 | 40 | extern enum lttng_action_status lttng_action_notify_set_rate_policy( |
1c2c1c05 | 41 | struct lttng_action *action, |
7f4d5b07 | 42 | const struct lttng_rate_policy *policy); |
1c2c1c05 JR |
43 | |
44 | /* | |
7f4d5b07 | 45 | * Get the rate policy of a notify action. |
1c2c1c05 JR |
46 | * |
47 | * Returns LTTNG_ACTION_STATUS_OK on success, | |
48 | * LTTNG_ACTION_STATUS_INVALID if invalid parameters are passed. | |
49 | */ | |
7f4d5b07 | 50 | extern enum lttng_action_status lttng_action_notify_get_rate_policy( |
1c2c1c05 | 51 | const struct lttng_action *action, |
7f4d5b07 | 52 | const struct lttng_rate_policy **policy); |
1c2c1c05 | 53 | |
a58c490f JG |
54 | #ifdef __cplusplus |
55 | } | |
56 | #endif | |
57 | ||
58 | #endif /* LTTNG_ACTION_NOTIFY_H */ |