HT support for keys with two uint64_t
[lttng-tools.git] / src / common / sessiond-comm / relayd.h
CommitLineData
b8aa1682
JD
1/*
2 * Copyright (C) 2012 - David Goulet <dgoulet@efficios.com>
3 * Julien Desfossez <julien.desfossez@efficios.com>
4 *
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.
8 *
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
12 * more details.
13 *
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.
17 */
18
19#ifndef _RELAYD_COMM
20#define _RELAYD_COMM
21
22#define _GNU_SOURCE
23
24#include <limits.h>
25#include <stdint.h>
26
27#include <lttng/lttng.h>
ce2a9e76 28#include <common/defaults.h>
6947778e 29#include <config.h>
b8aa1682 30
6947778e
MD
31#define RELAYD_VERSION_COMM_MAJOR VERSION_MAJOR
32#define RELAYD_VERSION_COMM_MINOR VERSION_MINOR
0a6b5085 33
b8aa1682
JD
34/*
35 * lttng-relayd communication header.
36 */
37struct lttcomm_relayd_hdr {
38 /* Circuit ID not used for now so always ignored */
39 uint64_t circuit_id;
40 uint64_t data_size; /* data size following this header */
7c9534d6 41 uint32_t cmd; /* enum lttcomm_relayd_command */
b8aa1682 42 uint32_t cmd_version; /* command version */
a9e87764 43} LTTNG_PACKED;
b8aa1682
JD
44
45/*
46 * lttng-relayd data header.
47 */
48struct lttcomm_relayd_data_hdr {
49 /* Circuit ID not used for now so always ignored */
50 uint64_t circuit_id;
51 uint64_t stream_id; /* Stream ID known by the relayd */
173af62f 52 uint64_t net_seq_num; /* Network sequence number, per stream. */
b8aa1682 53 uint32_t data_size; /* data size following this header */
1d4dfdef 54 uint32_t padding_size; /* Size of 0 padding the data */
a9e87764 55} LTTNG_PACKED;
b8aa1682 56
c5b6f4f0
DG
57/*
58 * Reply from a create session command.
59 */
60struct lttcomm_relayd_status_session {
61 uint64_t session_id;
62 uint32_t ret_code;
a9e87764 63} LTTNG_PACKED;
c5b6f4f0 64
b8aa1682
JD
65/*
66 * Used to add a stream on the relay daemon.
67 */
68struct lttcomm_relayd_add_stream {
ce2a9e76 69 char channel_name[DEFAULT_STREAM_NAME_LEN];
b8aa1682 70 char pathname[PATH_MAX];
a9e87764 71} LTTNG_PACKED;
b8aa1682 72
0f907de1
JD
73/*
74 * Used to add a stream on the relay daemon.
75 * Protocol version 2.2
76 */
77struct 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;
82} LTTNG_PACKED;
83
b8aa1682
JD
84/*
85 * Answer from an add stream command.
86 */
87struct lttcomm_relayd_status_stream {
88 uint64_t handle;
89 uint32_t ret_code;
a9e87764 90} LTTNG_PACKED;
b8aa1682
JD
91
92/*
93 * Used to return command code for command not needing special data.
94 */
95struct lttcomm_relayd_generic_reply {
96 uint32_t ret_code;
a9e87764 97} LTTNG_PACKED;
b8aa1682
JD
98
99/*
100 * Used to update synchronization information.
101 */
102struct lttcomm_relayd_update_sync_info {
173af62f 103 /* TODO: fill the structure. Feature not implemented yet */
a9e87764 104} LTTNG_PACKED;
b8aa1682
JD
105
106/*
107 * Version command.
108 */
109struct lttcomm_relayd_version {
110 uint32_t major;
111 uint32_t minor;
a9e87764 112} LTTNG_PACKED;
b8aa1682
JD
113
114/*
115 * Metadata payload used when metadata command is sent.
116 */
117struct lttcomm_relayd_metadata_payload {
118 uint64_t stream_id;
1d4dfdef 119 uint32_t padding_size;
b8aa1682 120 char payload[];
a9e87764 121} LTTNG_PACKED;
b8aa1682 122
173af62f
DG
123/*
124 * Used to indicate that a specific stream id can now be closed.
125 */
126struct lttcomm_relayd_close_stream {
127 uint64_t stream_id;
128 uint64_t last_net_seq_num; /* sequence number of last packet */
a9e87764 129} LTTNG_PACKED;
173af62f 130
c8f59ee5 131/*
6d805429
DG
132 * Used to test if for a given stream id the data is pending on the relayd side
133 * for reading.
c8f59ee5 134 */
6d805429 135struct lttcomm_relayd_data_pending {
c8f59ee5
DG
136 uint64_t stream_id;
137 uint64_t last_net_seq_num; /* Sequence number of the last packet */
a9e87764 138} LTTNG_PACKED;
c8f59ee5 139
f7079f67
DG
140struct lttcomm_relayd_begin_data_pending {
141 uint64_t session_id;
a9e87764 142} LTTNG_PACKED;
f7079f67
DG
143
144struct lttcomm_relayd_end_data_pending {
145 uint64_t session_id;
a9e87764 146} LTTNG_PACKED;
f7079f67 147
ad7051c0
DG
148struct lttcomm_relayd_quiescent_control {
149 uint64_t stream_id;
150} LTTNG_PACKED;
151
b8aa1682 152#endif /* _RELAYD_COMM */
This page took 0.049648 seconds and 4 git commands to generate.