action-executor: evaluated object credentials are optional
[lttng-tools.git] / src / bin / lttng-sessiond / notification-thread-commands.h
CommitLineData
ab0ee2ca 1/*
ab5be9fa 2 * Copyright (C) 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
ab0ee2ca 3 *
ab5be9fa 4 * SPDX-License-Identifier: GPL-2.0-only
ab0ee2ca 5 *
ab0ee2ca
JG
6 */
7
8#ifndef NOTIFICATION_THREAD_COMMANDS_H
9#define NOTIFICATION_THREAD_COMMANDS_H
10
11#include <lttng/domain.h>
12#include <lttng/lttng-error.h>
13#include <urcu/rculfhash.h>
14#include "notification-thread.h"
8abe313a
JG
15#include "notification-thread-internal.h"
16#include "notification-thread-events.h"
8ada111f 17#include <common/waiter.h>
0ab399e0 18#include <stdbool.h>
ab0ee2ca
JG
19
20struct notification_thread_data;
21struct lttng_trigger;
22
23enum notification_thread_command_type {
24 NOTIFICATION_COMMAND_TYPE_REGISTER_TRIGGER,
25 NOTIFICATION_COMMAND_TYPE_UNREGISTER_TRIGGER,
26 NOTIFICATION_COMMAND_TYPE_ADD_CHANNEL,
27 NOTIFICATION_COMMAND_TYPE_REMOVE_CHANNEL,
731c1b12
JG
28 NOTIFICATION_COMMAND_TYPE_SESSION_ROTATION_ONGOING,
29 NOTIFICATION_COMMAND_TYPE_SESSION_ROTATION_COMPLETED,
ab0ee2ca 30 NOTIFICATION_COMMAND_TYPE_QUIT,
f2b3ef9f 31 NOTIFICATION_COMMAND_TYPE_CLIENT_COMMUNICATION_UPDATE,
ab0ee2ca
JG
32};
33
ab0ee2ca
JG
34struct notification_thread_command {
35 struct cds_list_head cmd_list_node;
36
37 enum notification_thread_command_type type;
38 union {
39 /* Register/Unregister trigger. */
40 struct lttng_trigger *trigger;
41 /* Add channel. */
8abe313a
JG
42 struct {
43 struct {
44 const char *name;
45 uid_t uid;
46 gid_t gid;
47 } session;
48 struct {
49 const char *name;
50 enum lttng_domain_type domain;
51 uint64_t key;
52 uint64_t capacity;
53 } channel;
54 } add_channel;
ab0ee2ca
JG
55 /* Remove channel. */
56 struct {
57 uint64_t key;
58 enum lttng_domain_type domain;
59 } remove_channel;
731c1b12
JG
60 struct {
61 const char *session_name;
62 uid_t uid;
63 gid_t gid;
64 uint64_t trace_archive_chunk_id;
65 struct lttng_trace_archive_location *location;
66 } session_rotation;
f2b3ef9f
JG
67 /* Client communication update. */
68 struct {
69 notification_client_id id;
70 enum client_transmission_status status;
71 } client_communication_update;
72
ab0ee2ca
JG
73 } parameters;
74
8ada111f
JG
75 /* lttng_waiter on which to wait for command reply (optional). */
76 struct lttng_waiter reply_waiter;
ab0ee2ca 77 enum lttng_error_code reply_code;
0ab399e0 78 bool is_async;
ab0ee2ca
JG
79};
80
81enum lttng_error_code notification_thread_command_register_trigger(
82 struct notification_thread_handle *handle,
83 struct lttng_trigger *trigger);
84
85enum lttng_error_code notification_thread_command_unregister_trigger(
86 struct notification_thread_handle *handle,
87 struct lttng_trigger *trigger);
88
89enum lttng_error_code notification_thread_command_add_channel(
90 struct notification_thread_handle *handle,
731c1b12 91 char *session_name, uid_t session_uid, gid_t session_gid,
ab0ee2ca
JG
92 char *channel_name, uint64_t key,
93 enum lttng_domain_type domain, uint64_t capacity);
94
95enum lttng_error_code notification_thread_command_remove_channel(
96 struct notification_thread_handle *handle,
97 uint64_t key, enum lttng_domain_type domain);
98
731c1b12
JG
99enum lttng_error_code notification_thread_command_session_rotation_ongoing(
100 struct notification_thread_handle *handle,
101 const char *session_name, uid_t session_uid, gid_t session_gid,
102 uint64_t trace_archive_chunk_id);
103
104/* Ownership of location is transferred. */
105enum lttng_error_code notification_thread_command_session_rotation_completed(
106 struct notification_thread_handle *handle,
107 const char *session_name, uid_t session_uid, gid_t session_gid,
108 uint64_t trace_archive_chunk_id,
109 struct lttng_trace_archive_location *location);
110
ab0ee2ca
JG
111void notification_thread_command_quit(
112 struct notification_thread_handle *handle);
113
114#endif /* NOTIFICATION_THREAD_COMMANDS_H */
This page took 0.038847 seconds and 4 git commands to generate.