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>
19 enum lttng_trace_archive_location_type
{
20 LTTNG_TRACE_ARCHIVE_LOCATION_TYPE_UNKNOWN
= 0,
21 LTTNG_TRACE_ARCHIVE_LOCATION_TYPE_LOCAL
= 1,
22 LTTNG_TRACE_ARCHIVE_LOCATION_TYPE_RELAY
= 2,
25 enum lttng_trace_archive_location_status
{
26 LTTNG_TRACE_ARCHIVE_LOCATION_STATUS_OK
= 0,
27 LTTNG_TRACE_ARCHIVE_LOCATION_STATUS_INVALID
= -1,
28 LTTNG_TRACE_ARCHIVE_LOCATION_STATUS_ERROR
= -2,
31 enum lttng_trace_archive_location_relay_protocol_type
{
32 LTTNG_TRACE_ARCHIVE_LOCATION_RELAY_PROTOCOL_TYPE_TCP
= 0,
36 * Location of a trace archive.
38 struct lttng_trace_archive_location
;
41 * Get a trace archive location's type.
43 LTTNG_EXPORT
extern enum lttng_trace_archive_location_type
44 lttng_trace_archive_location_get_type(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
, 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 LTTNG_EXPORT
extern enum lttng_trace_archive_location_status
62 lttng_trace_archive_location_relay_get_host(const struct lttng_trace_archive_location
*location
,
63 const char **relay_host
);
66 * Get the control port of the relay daemon associated to this trace archive
69 LTTNG_EXPORT
extern enum lttng_trace_archive_location_status
70 lttng_trace_archive_location_relay_get_control_port(
71 const struct lttng_trace_archive_location
*location
, uint16_t *control_port
);
74 * Get the data port of the relay daemon associated to this trace archive
77 LTTNG_EXPORT
extern enum lttng_trace_archive_location_status
78 lttng_trace_archive_location_relay_get_data_port(
79 const struct lttng_trace_archive_location
*location
, uint16_t *data_port
);
82 * Get the protocol used to communicate with the relay daemon associated to this
83 * trace archive location.
85 LTTNG_EXPORT
extern enum lttng_trace_archive_location_status
86 lttng_trace_archive_location_relay_get_protocol_type(
87 const struct lttng_trace_archive_location
*location
,
88 enum lttng_trace_archive_location_relay_protocol_type
*protocol
);
91 * Get path relative to the relay daemon's current output path.
93 * The trace archive location maintains ownership of relative_path.
95 LTTNG_EXPORT
extern enum lttng_trace_archive_location_status
96 lttng_trace_archive_location_relay_get_relative_path(
97 const struct lttng_trace_archive_location
*location
, const char **relative_path
);
103 #endif /* LTTNG_LOCATION_H */