e684a963397c410d3de084abc12614b5258a5046
[lttng-tools.git] / include / lttng / notification / channel-internal.h
1 /*
2 * Copyright (C) 2017 - Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 *
4 * This library is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License, version 2.1 only,
6 * as published by the Free Software Foundation.
7 *
8 * This library is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
11 * for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this library; if not, write to the Free Software Foundation,
15 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16 */
17
18 #ifndef LTTNG_NOTIFICATION_CHANNEL_INTERNAL_H
19 #define LTTNG_NOTIFICATION_CHANNEL_INTERNAL_H
20
21 #include <lttng/notification/channel.h>
22 #include <common/macros.h>
23 #include <stdint.h>
24 #include <stdbool.h>
25
26 enum lttng_notification_channel_message_type {
27 LTTNG_NOTIFICATION_CHANNEL_MESSAGE_TYPE_SUBSCRIBE = 0,
28 LTTNG_NOTIFICATION_CHANNEL_MESSAGE_TYPE_UNSUBSCRIBE = 1,
29 LTTNG_NOTIFICATION_CHANNEL_MESSAGE_TYPE_COMMAND_REPLY = 2,
30 LTTNG_NOTIFICATION_CHANNEL_MESSAGE_TYPE_NOTIFICATION = 3,
31 };
32
33 struct lttng_notification_channel_message {
34 /* enum lttng_notification_channel_message_type */
35 int8_t type;
36 /* size of the payload following this field */
37 uint32_t size;
38 char payload[];
39 } LTTNG_PACKED;
40
41 struct lttng_notification_channel_command_reply {
42 /* enum lttng_notification_channel_status */
43 int8_t status;
44 } LTTNG_PACKED;
45
46 struct lttng_notification_channel {
47 /* FIXME Add mutex to protect the socket from concurrent uses. */
48 int socket;
49 };
50
51 #endif /* LTTNG_NOTIFICATION_CHANNEL_INTERNAL_H */
This page took 0.039426 seconds and 5 git commands to generate.