kernel: Add token field to `struct lttng_kernel_event`
[lttng-tools.git] / include / lttng / location.h
CommitLineData
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
11#include <stdint.h>
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17enum 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,
21};
22
23enum 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,
27};
28
29enum lttng_trace_archive_location_relay_protocol_type {
30 LTTNG_TRACE_ARCHIVE_LOCATION_RELAY_PROTOCOL_TYPE_TCP = 0,
31};
32
33/*
34 * Location of a trace archive.
35 */
36struct lttng_trace_archive_location;
37
38/*
39 * Get a trace archive location's type.
40 */
41extern enum lttng_trace_archive_location_type
42lttng_trace_archive_location_get_type(
43 const struct lttng_trace_archive_location *location);
44
45/*
46 * Get the absolute path of a local trace archive location.
47 *
48 * The trace archive location maintains ownership of the absolute_path.
49 */
50extern enum lttng_trace_archive_location_status
51lttng_trace_archive_location_local_get_absolute_path(
52 const struct lttng_trace_archive_location *location,
53 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 */
61extern enum lttng_trace_archive_location_status
62lttng_trace_archive_location_relay_get_host(
63 const struct lttng_trace_archive_location *location,
64 const char **relay_host);
65
66/*
67 * Get the control port of the relay daemon associated to this trace archive
68 * location.
69 */
70extern enum lttng_trace_archive_location_status
71lttng_trace_archive_location_relay_get_control_port(
72 const struct lttng_trace_archive_location *location,
73 uint16_t *control_port);
74
75/*
76 * Get the data port of the relay daemon associated to this trace archive
77 * location.
78 */
79extern enum lttng_trace_archive_location_status
80lttng_trace_archive_location_relay_get_data_port(
81 const struct lttng_trace_archive_location *location,
82 uint16_t *data_port);
83
84/*
85 * Get the protocol used to communicate with the relay daemon associated to this
86 * trace archive location.
87 */
88extern enum lttng_trace_archive_location_status
89lttng_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);
92
93/*
94 * Get path relative to the relay daemon's current output path.
95 *
96 * The trace archive location maintains ownership of relative_path.
97 */
98extern enum lttng_trace_archive_location_status
99lttng_trace_archive_location_relay_get_relative_path(
100 const struct lttng_trace_archive_location *location,
101 const char **relative_path);
102
103#ifdef __cplusplus
104}
105#endif
106
107#endif /* LTTNG_LOCATION_H */
This page took 0.030453 seconds and 4 git commands to generate.