X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=daemon%2Fstubs.c;h=54fa8e00643887dacb8285a6361cd7434107b547;hp=81c5b7243d115b5f6498f79740e89db280bc8180;hb=d134143b55ecb5f7e6f74318acbf04f9e1370af6;hpb=55bf8fd622e9f84364b505db6591ace3ec2b5447 diff --git a/daemon/stubs.c b/daemon/stubs.c index 81c5b72..54fa8e0 100644 --- a/daemon/stubs.c +++ b/daemon/stubs.c @@ -22,7 +22,7 @@ #include #include #include "daemon.h" -#include "../src/guest_protocol.h" +#include "../src/guestfs_protocol.h" #include "actions.h" static void mount_stub (XDR *xdr_in) @@ -32,6 +32,8 @@ static void mount_stub (XDR *xdr_in) const char *device; const char *mountpoint; + memset (&args, 0, sizeof args); + if (!xdr_guestfs_mount_args (xdr_in, &args)) { reply_with_error ("mount: daemon failed to decode procedure arguments"); return; @@ -65,6 +67,8 @@ static void touch_stub (XDR *xdr_in) struct guestfs_touch_args args; const char *path; + memset (&args, 0, sizeof args); + if (!xdr_guestfs_touch_args (xdr_in, &args)) { reply_with_error ("touch: daemon failed to decode procedure arguments"); return; @@ -79,3 +83,19 @@ static void touch_stub (XDR *xdr_in) reply (NULL, NULL); } +void dispatch_incoming_message (XDR *xdr_in) +{ + switch (proc_nr) { + case GUESTFS_PROC_MOUNT: + mount_stub (xdr_in); + break; + case GUESTFS_PROC_SYNC: + sync_stub (xdr_in); + break; + case GUESTFS_PROC_TOUCH: + touch_stub (xdr_in); + break; + default: + reply_with_error ("dispatch_incoming_message: unknown procedure number %d", proc_nr); + } +}