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>
31 #define RELAYD_VERSION_COMM_MAJOR VERSION_MAJOR
32 #define RELAYD_VERSION_COMM_MINOR VERSION_MINOR
35 * lttng-relayd communication header.
37 struct lttcomm_relayd_hdr
{
38 /* Circuit ID not used for now so always ignored */
40 uint64_t data_size
; /* data size following this header */
41 uint32_t cmd
; /* enum lttcomm_relayd_command */
42 uint32_t cmd_version
; /* command version */
46 * lttng-relayd data header.
48 struct lttcomm_relayd_data_hdr
{
49 /* Circuit ID not used for now so always ignored */
51 uint64_t stream_id
; /* Stream ID known by the relayd */
52 uint64_t net_seq_num
; /* Network sequence number, per stream. */
53 uint32_t data_size
; /* data size following this header */
54 uint32_t padding_size
; /* Size of 0 padding the data */
58 * Reply from a create session command.
60 struct lttcomm_relayd_status_session
{
66 * Used to add a stream on the relay daemon.
68 struct lttcomm_relayd_add_stream
{
69 char channel_name
[DEFAULT_STREAM_NAME_LEN
];
70 char pathname
[PATH_MAX
];
74 * Used to add a stream on the relay daemon.
75 * Protocol version 2.2
77 struct lttcomm_relayd_add_stream_2_2
{
78 char channel_name
[DEFAULT_STREAM_NAME_LEN
];
79 char pathname
[PATH_MAX
];
80 uint64_t tracefile_size
;
81 uint64_t tracefile_count
;
85 * Answer from an add stream command.
87 struct lttcomm_relayd_status_stream
{
93 * Used to return command code for command not needing special data.
95 struct lttcomm_relayd_generic_reply
{
100 * Used to update synchronization information.
102 struct lttcomm_relayd_update_sync_info
{
103 /* TODO: fill the structure. Feature not implemented yet */
109 struct lttcomm_relayd_version
{
115 * Metadata payload used when metadata command is sent.
117 struct lttcomm_relayd_metadata_payload
{
119 uint32_t padding_size
;
124 * Used to indicate that a specific stream id can now be closed.
126 struct lttcomm_relayd_close_stream
{
128 uint64_t last_net_seq_num
; /* sequence number of last packet */
132 * Used to test if for a given stream id the data is pending on the relayd side
135 struct lttcomm_relayd_data_pending
{
137 uint64_t last_net_seq_num
; /* Sequence number of the last packet */
140 struct lttcomm_relayd_begin_data_pending
{
144 struct lttcomm_relayd_end_data_pending
{
148 struct lttcomm_relayd_quiescent_control
{
152 #endif /* _RELAYD_COMM */