X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=daemon%2Fstubs.c;h=0e5b35134ae6db9b0c72ad8fc38716100b6c8f4e;hb=03ff42cb2e088b00c15023d456058cbcdc5d3c81;hp=f992bdf6c44f493e03e8e36df45de63aae6db96d;hpb=8c3b820c2b687345448e3d74a7101b07ff32688e;p=libguestfs.git diff --git a/daemon/stubs.c b/daemon/stubs.c index f992bdf..0e5b351 100644 --- a/daemon/stubs.c +++ b/daemon/stubs.c @@ -2284,6 +2284,119 @@ static void ping_daemon_stub (XDR *xdr_in) done: ; } +static void equal_stub (XDR *xdr_in) +{ + int r; + struct guestfs_equal_args args; + const char *file1; + const char *file2; + + memset (&args, 0, sizeof args); + + if (!xdr_guestfs_equal_args (xdr_in, &args)) { + reply_with_error ("%s: daemon failed to decode procedure arguments", "equal"); + return; + } + file1 = args.file1; + file2 = args.file2; + + r = do_equal (file1, file2); + if (r == -1) + /* do_equal has already called reply_with_error */ + goto done; + + struct guestfs_equal_ret ret; + ret.equality = r; + reply ((xdrproc_t) &xdr_guestfs_equal_ret, (char *) &ret); +done: + xdr_free ((xdrproc_t) xdr_guestfs_equal_args, (char *) &args); +} + +static void strings_stub (XDR *xdr_in) +{ + char **r; + struct guestfs_strings_args args; + const char *path; + + memset (&args, 0, sizeof args); + + if (!xdr_guestfs_strings_args (xdr_in, &args)) { + reply_with_error ("%s: daemon failed to decode procedure arguments", "strings"); + return; + } + path = args.path; + + r = do_strings (path); + if (r == NULL) + /* do_strings has already called reply_with_error */ + goto done; + + struct guestfs_strings_ret ret; + ret.stringsout.stringsout_len = count_strings (r); + ret.stringsout.stringsout_val = r; + reply ((xdrproc_t) &xdr_guestfs_strings_ret, (char *) &ret); + free_strings (r); +done: + xdr_free ((xdrproc_t) xdr_guestfs_strings_args, (char *) &args); +} + +static void strings_e_stub (XDR *xdr_in) +{ + char **r; + struct guestfs_strings_e_args args; + const char *encoding; + const char *path; + + memset (&args, 0, sizeof args); + + if (!xdr_guestfs_strings_e_args (xdr_in, &args)) { + reply_with_error ("%s: daemon failed to decode procedure arguments", "strings_e"); + return; + } + encoding = args.encoding; + path = args.path; + + r = do_strings_e (encoding, path); + if (r == NULL) + /* do_strings_e has already called reply_with_error */ + goto done; + + struct guestfs_strings_e_ret ret; + ret.stringsout.stringsout_len = count_strings (r); + ret.stringsout.stringsout_val = r; + reply ((xdrproc_t) &xdr_guestfs_strings_e_ret, (char *) &ret); + free_strings (r); +done: + xdr_free ((xdrproc_t) xdr_guestfs_strings_e_args, (char *) &args); +} + +static void hexdump_stub (XDR *xdr_in) +{ + char *r; + struct guestfs_hexdump_args args; + const char *path; + + memset (&args, 0, sizeof args); + + if (!xdr_guestfs_hexdump_args (xdr_in, &args)) { + reply_with_error ("%s: daemon failed to decode procedure arguments", "hexdump"); + return; + } + path = args.path; + + r = do_hexdump (path); + if (r == NULL) + /* do_hexdump has already called reply_with_error */ + goto done; + + struct guestfs_hexdump_ret ret; + ret.dump = r; + reply ((xdrproc_t) &xdr_guestfs_hexdump_ret, (char *) &ret); + free (r); +done: + xdr_free ((xdrproc_t) xdr_guestfs_hexdump_args, (char *) &args); +} + void dispatch_incoming_message (XDR *xdr_in) { switch (proc_nr) { @@ -2563,6 +2676,18 @@ void dispatch_incoming_message (XDR *xdr_in) case GUESTFS_PROC_PING_DAEMON: ping_daemon_stub (xdr_in); break; + case GUESTFS_PROC_EQUAL: + equal_stub (xdr_in); + break; + case GUESTFS_PROC_STRINGS: + strings_stub (xdr_in); + break; + case GUESTFS_PROC_STRINGS_E: + strings_e_stub (xdr_in); + break; + case GUESTFS_PROC_HEXDUMP: + hexdump_stub (xdr_in); + break; default: reply_with_error ("dispatch_incoming_message: unknown procedure number %d", proc_nr); }