src.ctf.lttng-live: use `_APPEND_CAUSE` variants of logging macros
[babeltrace.git] / src / plugins / ctf / lttng-live / viewer-connection.h
CommitLineData
7cdc2bab
MD
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
969c1d8a 26#include <stdbool.h>
7cdc2bab
MD
27#include <stdio.h>
28#include <glib.h>
29
85e7137b 30#include "common/macros.h"
57952005 31#include "compat/socket.h"
7cdc2bab 32
1c0ceb65
PP
33/*
34 * FIXME: This is an internal Babeltrace library header; it is not meant
35 * to be generic as it is now. Make sure this included code does not
36 * log because it won't find our local log level.
37 */
38#define BT_OBJECT_DONT_LOG
57952005 39#include "lib/object.h"
7cdc2bab
MD
40
41#define LTTNG_DEFAULT_NETWORK_VIEWER_PORT 5344
42
43#define LTTNG_LIVE_MAJOR 2
44#define LTTNG_LIVE_MINOR 4
45
4c66436f
MD
46struct lttng_live_component;
47
bb18709b 48struct live_viewer_connection {
7b891201 49 bt_object obj;
1c0ceb65 50 bt_logging_level log_level;
5278d5ba 51 bt_self_component *self_comp;
f6e2a9d2 52 bt_self_component_class *self_comp_class;
7cdc2bab 53
7cdc2bab
MD
54 GString *url;
55
94b828f3
MD
56 GString *relay_hostname;
57 GString *target_hostname;
58 GString *session_name;
59
a2147eb2 60 BT_SOCKET control_sock;
7cdc2bab
MD
61 int port;
62
63 int32_t major;
64 int32_t minor;
4c66436f 65
bb18709b
FD
66 bool in_query;
67 struct lttng_live_msg_iter *lttng_live_msg_iter;
7cdc2bab
MD
68};
69
70struct packet_index_time {
bb18709b
FD
71 uint64_t timestamp_begin;
72 uint64_t timestamp_end;
7cdc2bab
MD
73};
74
75struct packet_index {
76 off_t offset; /* offset of the packet in the file, in bytes */
77 int64_t data_offset; /* offset of data within the packet, in bits */
78 uint64_t packet_size; /* packet size, in bits */
79 uint64_t content_size; /* content size, in bits */
80 uint64_t events_discarded;
81 uint64_t events_discarded_len; /* length of the field, in bits */
82 struct packet_index_time ts_cycles; /* timestamp in cycles */
83 struct packet_index_time ts_real; /* realtime timestamp */
84 /* CTF_INDEX 1.0 limit */
85 uint64_t stream_instance_id; /* ID of the channel instance */
86 uint64_t packet_seq_num; /* packet sequence number */
87};
88
bb18709b
FD
89struct live_viewer_connection * live_viewer_connection_create(
90 const char *url, bool in_query,
ca06281d 91 struct lttng_live_msg_iter *lttng_live_msg_iter,
f6e2a9d2
FD
92 bt_self_component *self_comp,
93 bt_self_component_class *self_comp_class,
ca06281d 94 bt_logging_level log_level);
7cdc2bab 95
bb18709b
FD
96void live_viewer_connection_destroy(
97 struct live_viewer_connection *conn);
7cdc2bab 98
fb25b9e3 99bt_component_class_query_method_status live_viewer_connection_list_sessions(
bb18709b
FD
100 struct live_viewer_connection *viewer_connection,
101 const bt_value **user_result);
7cdc2bab
MD
102
103#endif /* LTTNG_LIVE_VIEWER_CONNECTION_H */
This page took 0.054504 seconds and 4 git commands to generate.