a1ea16f23a60cd75cf2f09b61e8eee8e28395c7d
[lttng-tools.git] / include / lttng / location.h
1 /*
2 * Copyright (C) 2018 Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 *
4 * SPDX-License-Identifier: LGPL-2.1-only
5 *
6 */
7
8 #ifndef LTTNG_LOCATION_H
9 #define LTTNG_LOCATION_H
10
11 #include <lttng/lttng-export.h>
12
13 #include <stdint.h>
14
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18
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,
23 };
24
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,
29 };
30
31 enum lttng_trace_archive_location_relay_protocol_type {
32 LTTNG_TRACE_ARCHIVE_LOCATION_RELAY_PROTOCOL_TYPE_TCP = 0,
33 };
34
35 /*
36 * Location of a trace archive.
37 */
38 struct lttng_trace_archive_location;
39
40 /*
41 * Get a trace archive location's type.
42 */
43 LTTNG_EXPORT extern enum lttng_trace_archive_location_type
44 lttng_trace_archive_location_get_type(const struct lttng_trace_archive_location *location);
45
46 /*
47 * Get the absolute path of a local trace archive location.
48 *
49 * The trace archive location maintains ownership of the absolute_path.
50 */
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);
54
55 /*
56 * Get the host address of the relay daemon associated to this trace archive
57 * location. May be a hostname, IPv4, or IPv6 address.
58 *
59 * The trace archive location maintains ownership of relay_host.
60 */
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);
64
65 /*
66 * Get the control port of the relay daemon associated to this trace archive
67 * location.
68 */
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);
72
73 /*
74 * Get the data port of the relay daemon associated to this trace archive
75 * location.
76 */
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);
80
81 /*
82 * Get the protocol used to communicate with the relay daemon associated to this
83 * trace archive location.
84 */
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);
89
90 /*
91 * Get path relative to the relay daemon's current output path.
92 *
93 * The trace archive location maintains ownership of relative_path.
94 */
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);
98
99 #ifdef __cplusplus
100 }
101 #endif
102
103 #endif /* LTTNG_LOCATION_H */
This page took 0.031946 seconds and 4 git commands to generate.