actions: introduce function typedef for creating actions from buffer
[lttng-tools.git] / include / lttng / session-descriptor-internal.h
CommitLineData
b178f53e 1/*
ab5be9fa 2 * Copyright (C) 2019 Jérémie Galarneau <jeremie.galarneau@efficios.com>
b178f53e 3 *
ab5be9fa 4 * SPDX-License-Identifier: LGPL-2.1-only
b178f53e 5 *
b178f53e
JG
6 */
7
8#ifndef LTTNG_SESSION_DESCRIPTOR_INTERNAL_H
9#define LTTNG_SESSION_DESCRIPTOR_INTERNAL_H
10
11#include <lttng/session-descriptor.h>
12#include <lttng/lttng-error.h>
13#include <common/uri.h>
14#include <common/dynamic-buffer.h>
15#include <common/buffer-view.h>
16#include <stdbool.h>
17
18/* Note that these enums are used as part of the lttnctl protocol. */
19enum lttng_session_descriptor_type {
20 LTTNG_SESSION_DESCRIPTOR_TYPE_UNKNOWN = -1,
21 /*
22 * The output type determines whether this is a no-output, local,
23 * or networked tracing session.
24 */
25 LTTNG_SESSION_DESCRIPTOR_TYPE_REGULAR = 1,
26 LTTNG_SESSION_DESCRIPTOR_TYPE_SNAPSHOT = 2,
27 LTTNG_SESSION_DESCRIPTOR_TYPE_LIVE = 3,
28};
29
30enum lttng_session_descriptor_output_type {
31 LTTNG_SESSION_DESCRIPTOR_OUTPUT_TYPE_NONE = 0,
32 LTTNG_SESSION_DESCRIPTOR_OUTPUT_TYPE_LOCAL = 1,
33 LTTNG_SESSION_DESCRIPTOR_OUTPUT_TYPE_NETWORK = 2,
34};
35
36LTTNG_HIDDEN
37ssize_t lttng_session_descriptor_create_from_buffer(
38 const struct lttng_buffer_view *view,
39 struct lttng_session_descriptor **descriptor);
40
41LTTNG_HIDDEN
42int lttng_session_descriptor_serialize(
43 const struct lttng_session_descriptor *descriptor,
44 struct lttng_dynamic_buffer *buffer);
45
46LTTNG_HIDDEN
47enum lttng_session_descriptor_type
48lttng_session_descriptor_get_type(
49 const struct lttng_session_descriptor *descriptor);
50
51LTTNG_HIDDEN
52enum lttng_session_descriptor_output_type
53lttng_session_descriptor_get_output_type(
54 const struct lttng_session_descriptor *descriptor);
55
56LTTNG_HIDDEN
57void lttng_session_descriptor_get_local_output_uri(
58 const struct lttng_session_descriptor *descriptor,
59 struct lttng_uri *local_uri);
60
61LTTNG_HIDDEN
62void lttng_session_descriptor_get_network_output_uris(
63 const struct lttng_session_descriptor *descriptor,
64 struct lttng_uri *control,
65 struct lttng_uri *data);
66
67LTTNG_HIDDEN
68unsigned long long
69lttng_session_descriptor_live_get_timer_interval(
70 const struct lttng_session_descriptor *descriptor);
71
72LTTNG_HIDDEN
73enum lttng_session_descriptor_status
74lttng_session_descriptor_get_session_name(
75 const struct lttng_session_descriptor *descriptor,
76 const char **name);
77
78LTTNG_HIDDEN
79int lttng_session_descriptor_set_session_name(
80 struct lttng_session_descriptor *descriptor,
81 const char *name);
82
83LTTNG_HIDDEN
84bool lttng_session_descriptor_is_output_destination_initialized(
85 const struct lttng_session_descriptor *descriptor);
86
87LTTNG_HIDDEN
88bool lttng_session_descriptor_has_output_directory(
89 const struct lttng_session_descriptor *descriptor);
90
91LTTNG_HIDDEN
92enum lttng_error_code lttng_session_descriptor_set_default_output(
93 struct lttng_session_descriptor *descriptor,
94 time_t *session_creation_time,
95 const char *absolute_home_path);
96
97LTTNG_HIDDEN
98int lttng_session_descriptor_assign(
99 struct lttng_session_descriptor *dst_descriptor,
100 const struct lttng_session_descriptor *src_descriptor);
101
102#endif /* LTTNG_SESSION_DESCRIPTOR_INTERNAL_H */
This page took 0.032117 seconds and 4 git commands to generate.