2 * Copyright (C) 2018 Jérémie Galarneau <jeremie.galarneau@efficios.com>
4 * SPDX-License-Identifier: LGPL-2.1-only
8 #ifndef LTTNG_LOCATION_H
9 #define LTTNG_LOCATION_H
17 enum lttng_trace_archive_location_type
{
18 LTTNG_TRACE_ARCHIVE_LOCATION_TYPE_UNKNOWN
= 0,
19 LTTNG_TRACE_ARCHIVE_LOCATION_TYPE_LOCAL
= 1,
20 LTTNG_TRACE_ARCHIVE_LOCATION_TYPE_RELAY
= 2,
23 enum lttng_trace_archive_location_status
{
24 LTTNG_TRACE_ARCHIVE_LOCATION_STATUS_OK
= 0,
25 LTTNG_TRACE_ARCHIVE_LOCATION_STATUS_INVALID
= -1,
26 LTTNG_TRACE_ARCHIVE_LOCATION_STATUS_ERROR
= -2,
29 enum lttng_trace_archive_location_relay_protocol_type
{
30 LTTNG_TRACE_ARCHIVE_LOCATION_RELAY_PROTOCOL_TYPE_TCP
= 0,
34 * Location of a trace archive.
36 struct lttng_trace_archive_location
;
39 * Get a trace archive location's type.
41 extern enum lttng_trace_archive_location_type
42 lttng_trace_archive_location_get_type(
43 const struct lttng_trace_archive_location
*location
);
46 * Get the absolute path of a local trace archive location.
48 * The trace archive location maintains ownership of the absolute_path.
50 extern enum lttng_trace_archive_location_status
51 lttng_trace_archive_location_local_get_absolute_path(
52 const struct lttng_trace_archive_location
*location
,
53 const char **absolute_path
);
56 * Get the host address of the relay daemon associated to this trace archive
57 * location. May be a hostname, IPv4, or IPv6 address.
59 * The trace archive location maintains ownership of relay_host.
61 extern enum lttng_trace_archive_location_status
62 lttng_trace_archive_location_relay_get_host(
63 const struct lttng_trace_archive_location
*location
,
64 const char **relay_host
);
67 * Get the control port of the relay daemon associated to this trace archive
70 extern enum lttng_trace_archive_location_status
71 lttng_trace_archive_location_relay_get_control_port(
72 const struct lttng_trace_archive_location
*location
,
73 uint16_t *control_port
);
76 * Get the data port of the relay daemon associated to this trace archive
79 extern enum lttng_trace_archive_location_status
80 lttng_trace_archive_location_relay_get_data_port(
81 const struct lttng_trace_archive_location
*location
,
85 * Get the protocol used to communicate with the relay daemon associated to this
86 * trace archive location.
88 extern enum lttng_trace_archive_location_status
89 lttng_trace_archive_location_relay_get_protocol_type(
90 const struct lttng_trace_archive_location
*location
,
91 enum lttng_trace_archive_location_relay_protocol_type
*protocol
);
94 * Get path relative to the relay daemon's current output path.
96 * The trace archive location maintains ownership of relative_path.
98 extern enum lttng_trace_archive_location_status
99 lttng_trace_archive_location_relay_get_relative_path(
100 const struct lttng_trace_archive_location
*location
,
101 const char **relative_path
);
107 #endif /* LTTNG_LOCATION_H */