2 * Copyright (C) 2012 - David Goulet <dgoulet@efficios.com>
3 * Julien Desfossez <julien.desfossez@efficios.com>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License, version 2 only,
7 * as published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27 #include <lttng/lttng.h>
28 #include <common/defaults.h>
29 #include <common/index/ctf-index.h>
32 #define RELAYD_VERSION_COMM_MAJOR VERSION_MAJOR
33 #define RELAYD_VERSION_COMM_MINOR VERSION_MINOR
36 * lttng-relayd communication header.
38 struct lttcomm_relayd_hdr
{
39 /* Circuit ID not used for now so always ignored */
41 uint64_t data_size
; /* data size following this header */
42 uint32_t cmd
; /* enum lttcomm_relayd_command */
43 uint32_t cmd_version
; /* command version */
47 * lttng-relayd data header.
49 struct lttcomm_relayd_data_hdr
{
50 /* Circuit ID not used for now so always ignored */
52 uint64_t stream_id
; /* Stream ID known by the relayd */
53 uint64_t net_seq_num
; /* Network sequence number, per stream. */
54 uint32_t data_size
; /* data size following this header */
55 uint32_t padding_size
; /* Size of 0 padding the data */
59 * Reply from a create session command.
61 struct lttcomm_relayd_status_session
{
67 * Used to add a stream on the relay daemon.
69 struct lttcomm_relayd_add_stream
{
70 char channel_name
[DEFAULT_STREAM_NAME_LEN
];
71 char pathname
[PATH_MAX
];
75 * Used to add a stream on the relay daemon.
76 * Protocol version 2.2
78 struct lttcomm_relayd_add_stream_2_2
{
79 char channel_name
[DEFAULT_STREAM_NAME_LEN
];
80 char pathname
[PATH_MAX
];
81 uint64_t tracefile_size
;
82 uint64_t tracefile_count
;
86 * Answer from an add stream command.
88 struct lttcomm_relayd_status_stream
{
94 * Used to return command code for command not needing special data.
96 struct lttcomm_relayd_generic_reply
{
101 * Used to update synchronization information.
103 struct lttcomm_relayd_update_sync_info
{
104 /* TODO: fill the structure. Feature not implemented yet */
110 struct lttcomm_relayd_version
{
116 * Metadata payload used when metadata command is sent.
118 struct lttcomm_relayd_metadata_payload
{
120 uint32_t padding_size
;
125 * Used to indicate that a specific stream id can now be closed.
127 struct lttcomm_relayd_close_stream
{
129 uint64_t last_net_seq_num
; /* sequence number of last packet */
133 * Used to test if for a given stream id the data is pending on the relayd side
136 struct lttcomm_relayd_data_pending
{
138 uint64_t last_net_seq_num
; /* Sequence number of the last packet */
141 struct lttcomm_relayd_begin_data_pending
{
145 struct lttcomm_relayd_end_data_pending
{
149 struct lttcomm_relayd_quiescent_control
{
156 struct lttcomm_relayd_index
{
157 uint64_t relay_stream_id
;
158 uint64_t net_seq_num
;
159 uint64_t packet_size
;
160 uint64_t content_size
;
161 uint64_t timestamp_begin
;
162 uint64_t timestamp_end
;
163 uint64_t events_discarded
;
168 * Create session in 2.4 adds additionnal parameters for live reading.
170 struct lttcomm_relayd_create_session_2_4
{
171 char session_name
[LTTNG_NAME_MAX
];
172 char hostname
[HOST_NAME_MAX
];
177 #endif /* _RELAYD_COMM */