2 * Copyright (C) 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
4 * SPDX-License-Identifier: LGPL-2.1-only
8 #ifndef LTTNG_LOCATION_INTERNAL_H
9 #define LTTNG_LOCATION_INTERNAL_H
11 #include <lttng/location.h>
12 #include <common/dynamic-buffer.h>
13 #include <common/buffer-view.h>
14 #include <common/macros.h>
15 #include <sys/types.h>
17 struct lttng_trace_archive_location
{
18 enum lttng_trace_archive_location_type type
;
25 enum lttng_trace_archive_location_relay_protocol_type protocol
;
27 uint16_t control
, data
;
34 struct lttng_trace_archive_location_comm
{
35 /* A value from enum lttng_trace_archive_location_type */
39 /* Includes the trailing \0. */
40 uint32_t absolute_path_len
;
43 /* Includes the trailing \0. */
44 uint32_t hostname_len
;
47 * enum lttng_trace_archive_location_relay_protocol_type.
51 uint16_t control
, data
;
53 /* Includes the trailing \0. */
54 uint32_t relative_path_len
;
58 * Payload is composed of:
59 * - LTTNG_TRACE_ARCHIVE_LOCATION_TYPE_LOCAL
60 * - absolute path, including \0
61 * - LTTNG_TRACE_ARCHIVE_LOCATION_TYPE_RELAY
62 * - hostname, including \0
63 * - relative path, including \0
70 struct lttng_trace_archive_location
*lttng_trace_archive_location_local_create(
74 struct lttng_trace_archive_location
*lttng_trace_archive_location_relay_create(
76 enum lttng_trace_archive_location_relay_protocol_type protocol
,
77 uint16_t control_port
, uint16_t data_port
,
78 const char *relative_path
);
81 ssize_t
lttng_trace_archive_location_create_from_buffer(
82 const struct lttng_buffer_view
*buffer
,
83 struct lttng_trace_archive_location
**location
);
86 ssize_t
lttng_trace_archive_location_serialize(
87 const struct lttng_trace_archive_location
*location
,
88 struct lttng_dynamic_buffer
*buffer
);
91 void lttng_trace_archive_location_destroy(
92 struct lttng_trace_archive_location
*location
);
94 #endif /* LTTNG_LOCATION_INTERNAL_H */