admin_protocol.x 3.4 KB
Newer Older
M
Martin Kletzander 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
/* -*- 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>
 */

25 26
%#include "virxdrdefs.h"

M
Martin Kletzander 已提交
27 28 29 30 31 32
/*----- 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.
 */
M
Martin Kletzander 已提交
33
const ADMIN_STRING_MAX = 4194304;
M
Martin Kletzander 已提交
34

35 36 37
/* Upper limit on list of servers */
const ADMIN_SERVER_LIST_MAX = 16384;

M
Martin Kletzander 已提交
38
/* A long string, which may NOT be NULL. */
M
Martin Kletzander 已提交
39
typedef string admin_nonnull_string<ADMIN_STRING_MAX>;
M
Martin Kletzander 已提交
40 41 42 43

/* A long string, which may be NULL. */
typedef admin_nonnull_string *admin_string;

44 45 46 47 48
/* A server which may NOT be NULL */
struct admin_nonnull_server {
    admin_nonnull_string name;
};

M
Martin Kletzander 已提交
49
/*----- Protocol. -----*/
50
struct admin_connect_open_args {
M
Martin Kletzander 已提交
51 52 53
    unsigned int flags;
};

54
struct admin_connect_get_lib_version_ret {
55 56 57
    unsigned hyper libVer;
};

58 59 60 61 62
struct admin_connect_list_servers_args {
    unsigned int need_results;
    unsigned int flags;
};

63
struct admin_connect_list_servers_ret { /* insert@1 */
64 65 66 67
    admin_nonnull_server servers<ADMIN_SERVER_LIST_MAX>;
    unsigned int ret;
};

68 69 70 71 72 73 74 75 76
struct admin_connect_lookup_server_args {
    admin_nonnull_string name;
    unsigned int flags;
};

struct admin_connect_lookup_server_ret {
    admin_nonnull_server srv;
};

M
Martin Kletzander 已提交
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
/* 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.
     */
    /**
100
     * @generate: none
M
Martin Kletzander 已提交
101
     */
102
    ADMIN_PROC_CONNECT_OPEN = 1,
M
Martin Kletzander 已提交
103 104

    /**
105
     * @generate: none
M
Martin Kletzander 已提交
106
     */
107
    ADMIN_PROC_CONNECT_CLOSE = 2,
108 109 110 111

    /**
     * @generate: both
     */
112 113 114
    ADMIN_PROC_CONNECT_GET_LIB_VERSION = 3,

    /**
115
      * @generate: both
116
      */
117 118 119 120 121 122
    ADMIN_PROC_CONNECT_LIST_SERVERS = 4,

    /**
      * @generate: both
      */
    ADMIN_PROC_CONNECT_LOOKUP_SERVER = 5
M
Martin Kletzander 已提交
123
};