Fix: relayd and sessiond: dispatch thread exit is shared across threads
[lttng-tools.git] / src / bin / lttng-relayd / lttng-relayd.h
CommitLineData
b8aa1682
JD
1/*
2 * Copyright (C) 2012 - Julien Desfossez <jdesfossez@efficios.com>
3 * David Goulet <dgoulet@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
7717e361
MD
19#ifndef LTTNG_RELAYD_H
20#define LTTNG_RELAYD_H
b8aa1682
JD
21
22#define _LGPL_SOURCE
23#include <urcu.h>
24#include <urcu/wfqueue.h>
25
26/*
27 * Queue used to enqueue relay requests
28 */
29struct relay_cmd_queue {
b8aa1682 30 struct cds_wfq_queue queue;
7717e361 31 int32_t futex;
b8aa1682
JD
32};
33
34enum connection_type {
35 RELAY_DATA,
36 RELAY_CONTROL,
37};
38
39/*
40 * Represents a session for the relay point of view
41 */
42struct relay_session {
43 uint64_t id;
44 struct lttcomm_sock *sock;
45 unsigned int version_check_done:1;
46};
47
48/*
49 * Represents a stream in the relay
50 */
51struct relay_stream {
52 uint64_t stream_handle;
b8aa1682 53 uint64_t seq;
7717e361 54 struct lttng_ht_node_ulong stream_n;
b8aa1682 55 struct relay_session *session;
7717e361 56 int fd;
b8aa1682
JD
57};
58
59/*
60 * Internal structure to map a socket with the corresponding session.
61 * A hashtable indexed on the socket FD is used for the lookups.
62 */
63struct relay_command {
64 struct lttcomm_sock *sock;
7717e361 65 struct relay_session *session;
b8aa1682
JD
66 struct cds_wfq_node node;
67 struct lttng_ht_node_ulong sock_n;
68 enum connection_type type;
b8aa1682
JD
69};
70
7717e361 71#endif /* LTTNG_RELAYD_H */
This page took 0.024949 seconds and 4 git commands to generate.