/*
- * Copyright (C) 2017 - Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ * Copyright (C) 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
*
- * This library is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License, version 2.1 only,
- * as published by the Free Software Foundation.
+ * SPDX-License-Identifier: LGPL-2.1-only
*
- * This library is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef LTTNG_NOTIFICATION_CHANNEL_INTERNAL_H
#include <lttng/notification/channel.h>
#include <common/macros.h>
-#include <common/dynamic-buffer.h>
+#include <common/payload.h>
#include <stdint.h>
#include <stdbool.h>
#include <pthread.h>
#include <urcu/list.h>
+/*
+ * Protocol version change log:
+ * - v1.0
+ * - Initial implementation of the notification channel protocol,
+ * - Supported conditions are LOW/HIGH buffer usage conditions,
+ * - v1.1
+ * - New condition type "LTTNG_CONDITION_TYPE_SESSION_CONSUMED_SIZE" added,
+ * - New condition type "LTTNG_CONDITION_TYPE_SESSION_ROTATION_ONGOING" added,
+ * - New condition type "LTTNG_CONDITION_TYPE_SESSION_ROTATION_COMPLETED" added,
+ */
#define LTTNG_NOTIFICATION_CHANNEL_VERSION_MAJOR 1
-#define LTTNG_NOTIFICATION_CHANNEL_VERSION_MINOR 0
+#define LTTNG_NOTIFICATION_CHANNEL_VERSION_MINOR 1
enum lttng_notification_channel_message_type {
LTTNG_NOTIFICATION_CHANNEL_MESSAGE_TYPE_UNKNOWN = -1,
int8_t type;
/* Size of the payload following this field. */
uint32_t size;
+ /* Number of FDs sent. */
+ uint32_t fds;
char payload[];
} LTTNG_PACKED;
};
/*
- * The notification channel protocol is bidirectional and accomodates
+ * The notification channel protocol is bidirectional and accommodates
* synchronous and asynchronous communication modes:
*
* - Synchronous: commands emitted by the client to which a reply is expected
* (e.g. subscribing/unsubscribing to conditions),
* - Asynchronous: notifications which are sent by the lttng_endpoint to the
- * client as one of the subscribed condition has occured.
+ * client as one of the subscribed condition has occurred.
*
* The nature of this hybrid communication mode means that asynchronous messages
* (e.g. notifications) may be interleaved between synchronous messages (e.g. a
/* List of struct pending_notification. */
struct cds_list_head list;
} pending_notifications;
- struct lttng_dynamic_buffer reception_buffer;
+ struct lttng_payload reception_payload;
/* Sessiond notification protocol version. */
struct {
bool set;