Commit | Line | Data |
---|---|---|
434131e4 | 1 | /* |
ab5be9fa | 2 | * Copyright (C) 2018 Jérémie Galarneau <jeremie.galarneau@efficios.com> |
434131e4 | 3 | * |
ab5be9fa | 4 | * SPDX-License-Identifier: LGPL-2.1-only |
434131e4 | 5 | * |
434131e4 JG |
6 | */ |
7 | ||
8 | #ifndef LTTNG_LOCATION_H | |
9 | #define LTTNG_LOCATION_H | |
10 | ||
4bd69c5f | 11 | #include <lttng/lttng-export.h> |
434131e4 JG |
12 | #include <stdint.h> |
13 | ||
14 | #ifdef __cplusplus | |
15 | extern "C" { | |
16 | #endif | |
17 | ||
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, | |
22 | }; | |
23 | ||
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, | |
28 | }; | |
29 | ||
30 | enum lttng_trace_archive_location_relay_protocol_type { | |
31 | LTTNG_TRACE_ARCHIVE_LOCATION_RELAY_PROTOCOL_TYPE_TCP = 0, | |
32 | }; | |
33 | ||
34 | /* | |
35 | * Location of a trace archive. | |
36 | */ | |
37 | struct lttng_trace_archive_location; | |
38 | ||
39 | /* | |
40 | * Get a trace archive location's type. | |
41 | */ | |
4bd69c5f | 42 | LTTNG_EXPORT extern enum lttng_trace_archive_location_type |
434131e4 JG |
43 | lttng_trace_archive_location_get_type( |
44 | 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 | */ | |
4bd69c5f | 51 | LTTNG_EXPORT extern enum lttng_trace_archive_location_status |
434131e4 JG |
52 | lttng_trace_archive_location_local_get_absolute_path( |
53 | const struct lttng_trace_archive_location *location, | |
54 | const char **absolute_path); | |
55 | ||
56 | /* | |
57 | * Get the host address of the relay daemon associated to this trace archive | |
58 | * location. May be a hostname, IPv4, or IPv6 address. | |
59 | * | |
60 | * The trace archive location maintains ownership of relay_host. | |
61 | */ | |
4bd69c5f | 62 | LTTNG_EXPORT extern enum lttng_trace_archive_location_status |
434131e4 JG |
63 | lttng_trace_archive_location_relay_get_host( |
64 | const struct lttng_trace_archive_location *location, | |
65 | const char **relay_host); | |
66 | ||
67 | /* | |
68 | * Get the control port of the relay daemon associated to this trace archive | |
69 | * location. | |
70 | */ | |
4bd69c5f | 71 | LTTNG_EXPORT extern enum lttng_trace_archive_location_status |
434131e4 JG |
72 | lttng_trace_archive_location_relay_get_control_port( |
73 | const struct lttng_trace_archive_location *location, | |
74 | uint16_t *control_port); | |
75 | ||
76 | /* | |
77 | * Get the data port of the relay daemon associated to this trace archive | |
78 | * location. | |
79 | */ | |
4bd69c5f | 80 | LTTNG_EXPORT extern enum lttng_trace_archive_location_status |
434131e4 JG |
81 | lttng_trace_archive_location_relay_get_data_port( |
82 | const struct lttng_trace_archive_location *location, | |
83 | uint16_t *data_port); | |
84 | ||
85 | /* | |
86 | * Get the protocol used to communicate with the relay daemon associated to this | |
87 | * trace archive location. | |
88 | */ | |
4bd69c5f | 89 | LTTNG_EXPORT extern enum lttng_trace_archive_location_status |
434131e4 JG |
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); | |
93 | ||
94 | /* | |
95 | * Get path relative to the relay daemon's current output path. | |
96 | * | |
97 | * The trace archive location maintains ownership of relative_path. | |
98 | */ | |
4bd69c5f | 99 | LTTNG_EXPORT extern enum lttng_trace_archive_location_status |
434131e4 JG |
100 | lttng_trace_archive_location_relay_get_relative_path( |
101 | const struct lttng_trace_archive_location *location, | |
102 | const char **relative_path); | |
103 | ||
104 | #ifdef __cplusplus | |
105 | } | |
106 | #endif | |
107 | ||
108 | #endif /* LTTNG_LOCATION_H */ |