Implement list-devices and list-partitions.
[libguestfs.git] / src / guestfs_protocol.x
1 /* libguestfs generated file
2  * WARNING: THIS FILE IS GENERATED BY 'src/generator.ml'.
3  * ANY CHANGES YOU MAKE TO THIS FILE WILL BE LOST.
4  *
5  * Copyright (C) 2009 Red Hat Inc.
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21
22 typedef string str<>;
23
24 /* guestfs_mount */
25
26 struct guestfs_mount_args {
27   string device<>;
28   string mountpoint<>;
29 };
30
31 /* guestfs_sync */
32
33 /* guestfs_touch */
34
35 struct guestfs_touch_args {
36   string path<>;
37 };
38
39 /* guestfs_cat */
40
41 struct guestfs_cat_args {
42   string path<>;
43 };
44
45 struct guestfs_cat_ret {
46   string content<>;
47 };
48
49 /* guestfs_ll */
50
51 struct guestfs_ll_args {
52   string directory<>;
53 };
54
55 struct guestfs_ll_ret {
56   string listing<>;
57 };
58
59 /* guestfs_ls */
60
61 struct guestfs_ls_args {
62   string directory<>;
63 };
64
65 struct guestfs_ls_ret {
66   str listing<>;
67 };
68
69 /* guestfs_list_devices */
70
71 struct guestfs_list_devices_ret {
72   str devices<>;
73 };
74
75 /* guestfs_list_partitions */
76
77 struct guestfs_list_partitions_ret {
78   str partitions<>;
79 };
80
81 enum guestfs_procedure {
82   GUESTFS_PROC_MOUNT = 1,
83   GUESTFS_PROC_SYNC = 2,
84   GUESTFS_PROC_TOUCH = 3,
85   GUESTFS_PROC_CAT = 4,
86   GUESTFS_PROC_LL = 5,
87   GUESTFS_PROC_LS = 6,
88   GUESTFS_PROC_LIST_DEVICES = 7,
89   GUESTFS_PROC_LIST_PARTITIONS = 8,
90   GUESTFS_PROC_dummy
91 };
92
93 const GUESTFS_MESSAGE_MAX = 4194304;
94
95 const GUESTFS_PROGRAM = 0x2000F5F5;
96 const GUESTFS_PROTOCOL_VERSION = 1;
97
98 enum guestfs_message_direction {
99   GUESTFS_DIRECTION_CALL = 0,        /* client -> daemon */
100   GUESTFS_DIRECTION_REPLY = 1        /* daemon -> client */
101 };
102
103 enum guestfs_message_status {
104   GUESTFS_STATUS_OK = 0,
105   GUESTFS_STATUS_ERROR = 1
106 };
107
108 const GUESTFS_ERROR_LEN = 256;
109
110 struct guestfs_message_error {
111   string error<GUESTFS_ERROR_LEN>;   /* error message */
112 };
113
114 struct guestfs_message_header {
115   unsigned prog;                     /* GUESTFS_PROGRAM */
116   unsigned vers;                     /* GUESTFS_PROTOCOL_VERSION */
117   guestfs_procedure proc;            /* GUESTFS_PROC_x */
118   guestfs_message_direction direction;
119   unsigned serial;                   /* message serial number */
120   guestfs_message_status status;
121 };