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
11 #include <lttng/lttng-export.h>
18 enum lttng_trace_archive_location_type
{
19 LTTNG_TRACE_ARCHIVE_LOCATION_TYPE_UNKNOWN
= 0,
20 LTTNG_TRACE_ARCHIVE_LOCATION_TYPE_LOCAL
= 1,
21 LTTNG_TRACE_ARCHIVE_LOCATION_TYPE_RELAY
= 2,
24 enum lttng_trace_archive_location_status
{
25 LTTNG_TRACE_ARCHIVE_LOCATION_STATUS_OK
= 0,
26 LTTNG_TRACE_ARCHIVE_LOCATION_STATUS_INVALID
= -1,
27 LTTNG_TRACE_ARCHIVE_LOCATION_STATUS_ERROR
= -2,
30 enum lttng_trace_archive_location_relay_protocol_type
{
31 LTTNG_TRACE_ARCHIVE_LOCATION_RELAY_PROTOCOL_TYPE_TCP
= 0,
35 * Location of a trace archive.
37 struct lttng_trace_archive_location
;
40 * Get a trace archive location's type.
42 LTTNG_EXPORT
extern enum lttng_trace_archive_location_type
43 lttng_trace_archive_location_get_type(
44 const struct lttng_trace_archive_location
*location
);
47 * Get the absolute path of a local trace archive location.
49 * The trace archive location maintains ownership of the absolute_path.
51 LTTNG_EXPORT
extern enum lttng_trace_archive_location_status
52 lttng_trace_archive_location_local_get_absolute_path(
53 const struct lttng_trace_archive_location
*location
,
54 const char **absolute_path
);
57 * Get the host address of the relay daemon associated to this trace archive
58 * location. May be a hostname, IPv4, or IPv6 address.
60 * The trace archive location maintains ownership of relay_host.
62 LTTNG_EXPORT
extern enum lttng_trace_archive_location_status
63 lttng_trace_archive_location_relay_get_host(
64 const struct lttng_trace_archive_location
*location
,
65 const char **relay_host
);
68 * Get the control port of the relay daemon associated to this trace archive
71 LTTNG_EXPORT
extern enum lttng_trace_archive_location_status
72 lttng_trace_archive_location_relay_get_control_port(
73 const struct lttng_trace_archive_location
*location
,
74 uint16_t *control_port
);
77 * Get the data port of the relay daemon associated to this trace archive
80 LTTNG_EXPORT
extern enum lttng_trace_archive_location_status
81 lttng_trace_archive_location_relay_get_data_port(
82 const struct lttng_trace_archive_location
*location
,
86 * Get the protocol used to communicate with the relay daemon associated to this
87 * trace archive location.
89 LTTNG_EXPORT
extern enum lttng_trace_archive_location_status
90 lttng_trace_archive_location_relay_get_protocol_type(
91 const struct lttng_trace_archive_location
*location
,
92 enum lttng_trace_archive_location_relay_protocol_type
*protocol
);
95 * Get path relative to the relay daemon's current output path.
97 * The trace archive location maintains ownership of relative_path.
99 LTTNG_EXPORT
extern enum lttng_trace_archive_location_status
100 lttng_trace_archive_location_relay_get_relative_path(
101 const struct lttng_trace_archive_location
*location
,
102 const char **relative_path
);
108 #endif /* LTTNG_LOCATION_H */