Initial import of the new binary lttng-relayd
[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>
28
29/*
30 * lttng-relayd communication header.
31 */
32struct lttcomm_relayd_hdr {
33 /* Circuit ID not used for now so always ignored */
34 uint64_t circuit_id;
35 uint64_t data_size; /* data size following this header */
36 uint32_t cmd; /* enum lttcomm_sessiond_command */
37 uint32_t cmd_version; /* command version */
38} __attribute__ ((__packed__));
39
40/*
41 * lttng-relayd data header.
42 */
43struct lttcomm_relayd_data_hdr {
44 /* Circuit ID not used for now so always ignored */
45 uint64_t circuit_id;
46 uint64_t stream_id; /* Stream ID known by the relayd */
47 uint64_t net_seq_num; /* Network seq. number for UDP. */
48 uint32_t data_size; /* data size following this header */
49} __attribute__ ((__packed__));
50
51#if 0
52/*
53 * Used to create a session between the relay and the sessiond.
54 */
55struct lttcomm_relayd_create_session {
56 char hostname[LTTNG_MAX_DNNAME];
57 char session_name[NAME_MAX];
58};
59#endif
60
61/*
62 * Used to add a stream on the relay daemon.
63 */
64struct lttcomm_relayd_add_stream {
65 char channel_name[LTTNG_SYMBOL_NAME_LEN];
66 char pathname[PATH_MAX];
67} __attribute__ ((__packed__));
68
69/*
70 * Answer from an add stream command.
71 */
72struct lttcomm_relayd_status_stream {
73 uint64_t handle;
74 uint32_t ret_code;
75} __attribute__ ((__packed__));
76
77/*
78 * Used to return command code for command not needing special data.
79 */
80struct lttcomm_relayd_generic_reply {
81 uint32_t ret_code;
82} __attribute__ ((__packed__));
83
84/*
85 * Used to update synchronization information.
86 */
87struct lttcomm_relayd_update_sync_info {
88 /* TODO: fill the structure */
89} __attribute__ ((__packed__));
90
91/*
92 * Version command.
93 */
94struct lttcomm_relayd_version {
95 uint32_t major;
96 uint32_t minor;
97} __attribute__ ((__packed__));
98
99/*
100 * Metadata payload used when metadata command is sent.
101 */
102struct lttcomm_relayd_metadata_payload {
103 uint64_t stream_id;
104 char payload[];
105} __attribute__ ((__packed__));
106
107#endif /* _RELAYD_COMM */
This page took 0.027389 seconds and 5 git commands to generate.