2 * Copyright (C) 2018 - Jérémie Galarneau <jeremie.galarneau@efficios.com>
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.
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
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
18 #ifndef LTTNG_LOCATION_H
19 #define LTTNG_LOCATION_H
27 enum lttng_trace_archive_location_type
{
28 LTTNG_TRACE_ARCHIVE_LOCATION_TYPE_UNKNOWN
= 0,
29 LTTNG_TRACE_ARCHIVE_LOCATION_TYPE_LOCAL
= 1,
30 LTTNG_TRACE_ARCHIVE_LOCATION_TYPE_RELAY
= 2,
33 enum lttng_trace_archive_location_status
{
34 LTTNG_TRACE_ARCHIVE_LOCATION_STATUS_OK
= 0,
35 LTTNG_TRACE_ARCHIVE_LOCATION_STATUS_INVALID
= -1,
36 LTTNG_TRACE_ARCHIVE_LOCATION_STATUS_ERROR
= -2,
39 enum lttng_trace_archive_location_relay_protocol_type
{
40 LTTNG_TRACE_ARCHIVE_LOCATION_RELAY_PROTOCOL_TYPE_TCP
= 0,
44 * Location of a trace archive.
46 struct lttng_trace_archive_location
;
49 * Get a trace archive location's type.
51 extern enum lttng_trace_archive_location_type
52 lttng_trace_archive_location_get_type(
53 const struct lttng_trace_archive_location
*location
);
56 * Get the absolute path of a local trace archive location.
58 * The trace archive location maintains ownership of the absolute_path.
60 extern enum lttng_trace_archive_location_status
61 lttng_trace_archive_location_local_get_absolute_path(
62 const struct lttng_trace_archive_location
*location
,
63 const char **absolute_path
);
66 * Get the host address of the relay daemon associated to this trace archive
67 * location. May be a hostname, IPv4, or IPv6 address.
69 * The trace archive location maintains ownership of relay_host.
71 extern enum lttng_trace_archive_location_status
72 lttng_trace_archive_location_relay_get_host(
73 const struct lttng_trace_archive_location
*location
,
74 const char **relay_host
);
77 * Get the control port of the relay daemon associated to this trace archive
80 extern enum lttng_trace_archive_location_status
81 lttng_trace_archive_location_relay_get_control_port(
82 const struct lttng_trace_archive_location
*location
,
83 uint16_t *control_port
);
86 * Get the data port of the relay daemon associated to this trace archive
89 extern enum lttng_trace_archive_location_status
90 lttng_trace_archive_location_relay_get_data_port(
91 const struct lttng_trace_archive_location
*location
,
95 * Get the protocol used to communicate with the relay daemon associated to this
96 * trace archive location.
98 extern enum lttng_trace_archive_location_status
99 lttng_trace_archive_location_relay_get_protocol_type(
100 const struct lttng_trace_archive_location
*location
,
101 enum lttng_trace_archive_location_relay_protocol_type
*protocol
);
104 * Get path relative to the relay daemon's current output path.
106 * The trace archive location maintains ownership of relative_path.
108 extern enum lttng_trace_archive_location_status
109 lttng_trace_archive_location_relay_get_relative_path(
110 const struct lttng_trace_archive_location
*location
,
111 const char **relative_path
);
117 #endif /* LTTNG_LOCATION_H */