Coverity warning: sessiond: uncaught exception in main
[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
4bd69c5f 11#include <lttng/lttng-export.h>
28f23191 12
434131e4
JG
13#include <stdint.h>
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
19enum 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
25enum 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
31enum 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 */
38struct lttng_trace_archive_location;
39
40/*
41 * Get a trace archive location's type.
42 */
4bd69c5f 43LTTNG_EXPORT extern enum lttng_trace_archive_location_type
28f23191 44lttng_trace_archive_location_get_type(const struct lttng_trace_archive_location *location);
434131e4
JG
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 51LTTNG_EXPORT extern enum lttng_trace_archive_location_status
434131e4 52lttng_trace_archive_location_local_get_absolute_path(
28f23191 53 const struct lttng_trace_archive_location *location, const char **absolute_path);
434131e4
JG
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 */
4bd69c5f 61LTTNG_EXPORT extern enum lttng_trace_archive_location_status
28f23191
JG
62lttng_trace_archive_location_relay_get_host(const struct lttng_trace_archive_location *location,
63 const char **relay_host);
434131e4
JG
64
65/*
66 * Get the control port of the relay daemon associated to this trace archive
67 * location.
68 */
4bd69c5f 69LTTNG_EXPORT extern enum lttng_trace_archive_location_status
434131e4 70lttng_trace_archive_location_relay_get_control_port(
28f23191 71 const struct lttng_trace_archive_location *location, uint16_t *control_port);
434131e4
JG
72
73/*
74 * Get the data port of the relay daemon associated to this trace archive
75 * location.
76 */
4bd69c5f 77LTTNG_EXPORT extern enum lttng_trace_archive_location_status
434131e4 78lttng_trace_archive_location_relay_get_data_port(
28f23191 79 const struct lttng_trace_archive_location *location, uint16_t *data_port);
434131e4
JG
80
81/*
82 * Get the protocol used to communicate with the relay daemon associated to this
83 * trace archive location.
84 */
4bd69c5f 85LTTNG_EXPORT extern enum lttng_trace_archive_location_status
434131e4 86lttng_trace_archive_location_relay_get_protocol_type(
28f23191
JG
87 const struct lttng_trace_archive_location *location,
88 enum lttng_trace_archive_location_relay_protocol_type *protocol);
434131e4
JG
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 */
4bd69c5f 95LTTNG_EXPORT extern enum lttng_trace_archive_location_status
434131e4 96lttng_trace_archive_location_relay_get_relative_path(
28f23191 97 const struct lttng_trace_archive_location *location, const char **relative_path);
434131e4
JG
98
99#ifdef __cplusplus
100}
101#endif
102
103#endif /* LTTNG_LOCATION_H */
This page took 0.064646 seconds and 4 git commands to generate.