summaryrefslogtreecommitdiff
path: root/src/admin
diff options
context:
space:
mode:
authorMartin Kletzander <mkletzan@redhat.com>2015-04-15 16:13:22 +0200
committerMartin Kletzander <mkletzan@redhat.com>2015-06-16 13:46:20 +0200
commit8c8bed02aff6b206ca0e65fbba56631c7722a5f0 (patch)
tree8085bf5e03d7d464a3c1d33dc7230e4ff58e6cc9 /src/admin
parent87c26879432fa7f966b2dca413747cd538850206 (diff)
downloadlibvirt-8c8bed02aff6b206ca0e65fbba56631c7722a5f0.tar.gz
Add admin protocol
For now there are only CONNECT_OPEN and CONNECT_CLOSE procedures. Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Diffstat (limited to 'src/admin')
-rw-r--r--src/admin/admin_protocol.x77
1 files changed, 77 insertions, 0 deletions
diff --git a/src/admin/admin_protocol.x b/src/admin/admin_protocol.x
new file mode 100644
index 0000000000..1a2e94ee86
--- /dev/null
+++ b/src/admin/admin_protocol.x
@@ -0,0 +1,77 @@
+/* -*- c -*-
+ * admin_protocol.x: private protocol for communicating between
+ * remote_internal driver and libvirtd. This protocol is
+ * internal and may change at any time.
+ *
+ * Copyright (C) 2014-2015 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * 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, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Author: Martin Kletzander <mkletzan@redhat.com>
+ */
+
+%#include "remote_protocol.h"
+
+/*----- Data types. -----*/
+
+/* Length of long, but not unbounded, strings.
+ * This is an arbitrary limit designed to stop the decoder from trying
+ * to allocate unbounded amounts of memory when fed with a bad message.
+ */
+const REMOTE_STRING_MAX = 4194304;
+
+/* A long string, which may NOT be NULL. */
+typedef string admin_nonnull_string<REMOTE_STRING_MAX>;
+
+/* A long string, which may be NULL. */
+typedef admin_nonnull_string *admin_string;
+
+/*----- Protocol. -----*/
+struct admin_connect_open_args {
+ unsigned int flags;
+};
+
+/* Define the program number, protocol version and procedure numbers here. */
+const ADMIN_PROGRAM = 0x06900690;
+const ADMIN_PROTOCOL_VERSION = 1;
+
+enum admin_procedure {
+ /* Each function must be preceded by a comment providing one or
+ * more annotations:
+ *
+ * - @generate: none|client|server|both
+ *
+ * Whether to generate the dispatch stubs for the server
+ * and/or client code.
+ *
+ * - @readstream: paramnumber
+ * - @writestream: paramnumber
+ *
+ * The @readstream or @writestream annotations let daemon and src/remote
+ * create a stream. The direction is defined from the src/remote point
+ * of view. A readstream transfers data from daemon to src/remote. The
+ * <paramnumber> specifies at which offset the stream parameter is inserted
+ * in the function parameter list.
+ */
+ /**
+ * @generate: client
+ */
+ ADMIN_PROC_CONNECT_OPEN = 1,
+
+ /**
+ * @generate: client
+ */
+ ADMIN_PROC_CONNECT_CLOSE = 2
+};