Fix: honor base path for network URIs
[lttng-tools.git] / include / lttng / session-descriptor-internal.h
CommitLineData
b178f53e
JG
1/*
2 * Copyright (C) 2019 - Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 *
4 * This library is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License, version 2.1 only,
6 * as published by the Free Software Foundation.
7 *
8 * This library is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
11 * for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this library; if not, write to the Free Software Foundation,
15 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16 */
17
18#ifndef LTTNG_SESSION_DESCRIPTOR_INTERNAL_H
19#define LTTNG_SESSION_DESCRIPTOR_INTERNAL_H
20
21#include <lttng/session-descriptor.h>
22#include <lttng/lttng-error.h>
23#include <common/uri.h>
24#include <common/dynamic-buffer.h>
25#include <common/buffer-view.h>
26#include <stdbool.h>
27
28/* Note that these enums are used as part of the lttnctl protocol. */
29enum lttng_session_descriptor_type {
30 LTTNG_SESSION_DESCRIPTOR_TYPE_UNKNOWN = -1,
31 /*
32 * The output type determines whether this is a no-output, local,
33 * or networked tracing session.
34 */
35 LTTNG_SESSION_DESCRIPTOR_TYPE_REGULAR = 1,
36 LTTNG_SESSION_DESCRIPTOR_TYPE_SNAPSHOT = 2,
37 LTTNG_SESSION_DESCRIPTOR_TYPE_LIVE = 3,
38};
39
40enum lttng_session_descriptor_output_type {
41 LTTNG_SESSION_DESCRIPTOR_OUTPUT_TYPE_NONE = 0,
42 LTTNG_SESSION_DESCRIPTOR_OUTPUT_TYPE_LOCAL = 1,
43 LTTNG_SESSION_DESCRIPTOR_OUTPUT_TYPE_NETWORK = 2,
44};
45
46LTTNG_HIDDEN
47ssize_t lttng_session_descriptor_create_from_buffer(
48 const struct lttng_buffer_view *view,
49 struct lttng_session_descriptor **descriptor);
50
51LTTNG_HIDDEN
52int lttng_session_descriptor_serialize(
53 const struct lttng_session_descriptor *descriptor,
54 struct lttng_dynamic_buffer *buffer);
55
56LTTNG_HIDDEN
57enum lttng_session_descriptor_type
58lttng_session_descriptor_get_type(
59 const struct lttng_session_descriptor *descriptor);
60
61LTTNG_HIDDEN
62enum lttng_session_descriptor_output_type
63lttng_session_descriptor_get_output_type(
64 const struct lttng_session_descriptor *descriptor);
65
66LTTNG_HIDDEN
67void lttng_session_descriptor_get_local_output_uri(
68 const struct lttng_session_descriptor *descriptor,
69 struct lttng_uri *local_uri);
70
71LTTNG_HIDDEN
72void lttng_session_descriptor_get_network_output_uris(
73 const struct lttng_session_descriptor *descriptor,
74 struct lttng_uri *control,
75 struct lttng_uri *data);
76
77LTTNG_HIDDEN
78unsigned long long
79lttng_session_descriptor_live_get_timer_interval(
80 const struct lttng_session_descriptor *descriptor);
81
82LTTNG_HIDDEN
83enum lttng_session_descriptor_status
84lttng_session_descriptor_get_session_name(
85 const struct lttng_session_descriptor *descriptor,
86 const char **name);
87
88LTTNG_HIDDEN
89int lttng_session_descriptor_set_session_name(
90 struct lttng_session_descriptor *descriptor,
91 const char *name);
92
93LTTNG_HIDDEN
94bool lttng_session_descriptor_is_output_destination_initialized(
95 const struct lttng_session_descriptor *descriptor);
96
97LTTNG_HIDDEN
98bool lttng_session_descriptor_has_output_directory(
99 const struct lttng_session_descriptor *descriptor);
100
101LTTNG_HIDDEN
102enum lttng_error_code lttng_session_descriptor_set_default_output(
103 struct lttng_session_descriptor *descriptor,
104 time_t *session_creation_time,
105 const char *absolute_home_path);
106
107LTTNG_HIDDEN
108int lttng_session_descriptor_assign(
109 struct lttng_session_descriptor *dst_descriptor,
110 const struct lttng_session_descriptor *src_descriptor);
111
6fa5fe7c
MD
112LTTNG_HIDDEN
113int lttng_session_descriptor_get_base_path(struct lttng_session_descriptor *dst,
114 const char **base_path);
115
b178f53e 116#endif /* LTTNG_SESSION_DESCRIPTOR_INTERNAL_H */
This page took 0.048848 seconds and 4 git commands to generate.