Cleanup: src.ctf.lttng-live: add missing `#include <stdint.h>`
[babeltrace.git] / src / plugins / ctf / lttng-live / viewer-connection.h
1 #ifndef LTTNG_LIVE_VIEWER_CONNECTION_H
2 #define LTTNG_LIVE_VIEWER_CONNECTION_H
3
4 /*
5 * Copyright 2016 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal
9 * in the Software without restriction, including without limitation the rights
10 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 * copies of the Software, and to permit persons to whom the Software is
12 * furnished to do so, subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included in
15 * all copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 * SOFTWARE.
24 */
25
26 #include <stdbool.h>
27 #include <stdint.h>
28 #include <stdio.h>
29
30 #include <glib.h>
31
32 #include <babeltrace2/babeltrace.h>
33
34 #include "common/macros.h"
35 #include "compat/socket.h"
36
37 #define LTTNG_DEFAULT_NETWORK_VIEWER_PORT 5344
38
39 #define LTTNG_LIVE_MAJOR 2
40 #define LTTNG_LIVE_MINOR 4
41
42 struct lttng_live_component;
43
44 struct live_viewer_connection {
45 bt_logging_level log_level;
46 bt_self_component *self_comp;
47 bt_self_component_class *self_comp_class;
48
49 GString *url;
50
51 GString *relay_hostname;
52 GString *target_hostname;
53 GString *session_name;
54
55 BT_SOCKET control_sock;
56 int port;
57
58 int32_t major;
59 int32_t minor;
60
61 bool in_query;
62 struct lttng_live_msg_iter *lttng_live_msg_iter;
63 };
64
65 struct packet_index_time {
66 uint64_t timestamp_begin;
67 uint64_t timestamp_end;
68 };
69
70 struct packet_index {
71 off_t offset; /* offset of the packet in the file, in bytes */
72 int64_t data_offset; /* offset of data within the packet, in bits */
73 uint64_t packet_size; /* packet size, in bits */
74 uint64_t content_size; /* content size, in bits */
75 uint64_t events_discarded;
76 uint64_t events_discarded_len; /* length of the field, in bits */
77 struct packet_index_time ts_cycles; /* timestamp in cycles */
78 struct packet_index_time ts_real; /* realtime timestamp */
79 /* CTF_INDEX 1.0 limit */
80 uint64_t stream_instance_id; /* ID of the channel instance */
81 uint64_t packet_seq_num; /* packet sequence number */
82 };
83
84 struct live_viewer_connection * live_viewer_connection_create(
85 const char *url, bool in_query,
86 struct lttng_live_msg_iter *lttng_live_msg_iter,
87 bt_self_component *self_comp,
88 bt_self_component_class *self_comp_class,
89 bt_logging_level log_level);
90
91 void live_viewer_connection_destroy(
92 struct live_viewer_connection *conn);
93
94 bt_component_class_query_method_status live_viewer_connection_list_sessions(
95 struct live_viewer_connection *viewer_connection,
96 const bt_value **user_result);
97
98 #endif /* LTTNG_LIVE_VIEWER_CONNECTION_H */
This page took 0.030574 seconds and 4 git commands to generate.