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.
5 * Copyright (C) 2009 Red Hat Inc.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program 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
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 #include <rpc/types.h>
25 #include "../src/guestfs_protocol.h"
28 static void mount_stub (XDR *xdr_in)
31 struct guestfs_mount_args args;
33 const char *mountpoint;
35 memset (&args, 0, sizeof args);
37 if (!xdr_guestfs_mount_args (xdr_in, &args)) {
38 reply_with_error ("mount: daemon failed to decode procedure arguments");
42 mountpoint = args.mountpoint;
44 r = do_mount (device, mountpoint);
46 /* do_mount has already called reply_with_error, so just return */
52 static void sync_stub (XDR *xdr_in)
58 /* do_sync has already called reply_with_error, so just return */
64 static void touch_stub (XDR *xdr_in)
67 struct guestfs_touch_args args;
70 memset (&args, 0, sizeof args);
72 if (!xdr_guestfs_touch_args (xdr_in, &args)) {
73 reply_with_error ("touch: daemon failed to decode procedure arguments");
80 /* do_touch has already called reply_with_error, so just return */
86 static void cat_stub (XDR *xdr_in)
89 struct guestfs_cat_args args;
92 memset (&args, 0, sizeof args);
94 if (!xdr_guestfs_cat_args (xdr_in, &args)) {
95 reply_with_error ("cat: daemon failed to decode procedure arguments");
102 /* do_cat has already called reply_with_error, so just return */
105 struct guestfs_cat_ret ret;
107 reply ((xdrproc_t) &xdr_guestfs_cat_ret, (char *) &ret);
111 static void ll_stub (XDR *xdr_in)
114 struct guestfs_ll_args args;
115 const char *directory;
117 memset (&args, 0, sizeof args);
119 if (!xdr_guestfs_ll_args (xdr_in, &args)) {
120 reply_with_error ("ll: daemon failed to decode procedure arguments");
123 directory = args.directory;
125 r = do_ll (directory);
127 /* do_ll has already called reply_with_error, so just return */
130 struct guestfs_ll_ret ret;
132 reply ((xdrproc_t) &xdr_guestfs_ll_ret, (char *) &ret);
136 static void ls_stub (XDR *xdr_in)
139 struct guestfs_ls_args args;
140 const char *directory;
142 memset (&args, 0, sizeof args);
144 if (!xdr_guestfs_ls_args (xdr_in, &args)) {
145 reply_with_error ("ls: daemon failed to decode procedure arguments");
148 directory = args.directory;
150 r = do_ls (directory);
152 /* do_ls has already called reply_with_error, so just return */
155 struct guestfs_ls_ret ret;
156 ret.listing.listing_len = count_strings (r);
157 ret.listing.listing_val = r;
158 reply ((xdrproc_t) &xdr_guestfs_ls_ret, (char *) &ret);
162 static void list_devices_stub (XDR *xdr_in)
166 r = do_list_devices ();
168 /* do_list_devices has already called reply_with_error, so just return */
171 struct guestfs_list_devices_ret ret;
172 ret.devices.devices_len = count_strings (r);
173 ret.devices.devices_val = r;
174 reply ((xdrproc_t) &xdr_guestfs_list_devices_ret, (char *) &ret);
178 static void list_partitions_stub (XDR *xdr_in)
182 r = do_list_partitions ();
184 /* do_list_partitions has already called reply_with_error, so just return */
187 struct guestfs_list_partitions_ret ret;
188 ret.partitions.partitions_len = count_strings (r);
189 ret.partitions.partitions_val = r;
190 reply ((xdrproc_t) &xdr_guestfs_list_partitions_ret, (char *) &ret);
194 void dispatch_incoming_message (XDR *xdr_in)
197 case GUESTFS_PROC_MOUNT:
200 case GUESTFS_PROC_SYNC:
203 case GUESTFS_PROC_TOUCH:
206 case GUESTFS_PROC_CAT:
209 case GUESTFS_PROC_LL:
212 case GUESTFS_PROC_LS:
215 case GUESTFS_PROC_LIST_DEVICES:
216 list_devices_stub (xdr_in);
218 case GUESTFS_PROC_LIST_PARTITIONS:
219 list_partitions_stub (xdr_in);
222 reply_with_error ("dispatch_incoming_message: unknown procedure number %d", proc_nr);