X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;ds=inline;f=src%2Fguestfs_protocol.c;h=69ea4ae938acf1c5242da7ed90e4e30e73318092;hb=b3cb0b04eb2d38ba32c160a83d8e3894b376907b;hp=37c74da49c9ef5c8c574ad36b300817bb9cb2046;hpb=da8ddb2745c3d53c36e3ad7f09836a4c27a4d3e6;p=libguestfs.git diff --git a/src/guestfs_protocol.c b/src/guestfs_protocol.c index 37c74da..69ea4ae 100644 --- a/src/guestfs_protocol.c +++ b/src/guestfs_protocol.c @@ -238,6 +238,31 @@ xdr_guestfs_int_statvfs (XDR *xdrs, guestfs_int_statvfs *objp) } bool_t +xdr_guestfs_int_dirent (XDR *xdrs, guestfs_int_dirent *objp) +{ + register int32_t *buf; + + if (!xdr_quad_t (xdrs, &objp->ino)) + return FALSE; + if (!xdr_char (xdrs, &objp->ftyp)) + return FALSE; + if (!xdr_string (xdrs, &objp->name, ~0)) + return FALSE; + return TRUE; +} + +bool_t +xdr_guestfs_int_dirent_list (XDR *xdrs, guestfs_int_dirent_list *objp) +{ + register int32_t *buf; + + if (!xdr_array (xdrs, (char **)&objp->guestfs_int_dirent_list_val, (u_int *) &objp->guestfs_int_dirent_list_len, ~0, + sizeof (guestfs_int_dirent), (xdrproc_t) xdr_guestfs_int_dirent)) + return FALSE; + return TRUE; +} + +bool_t xdr_guestfs_mount_args (XDR *xdrs, guestfs_mount_args *objp) { register int32_t *buf; @@ -2238,6 +2263,223 @@ xdr_guestfs_mkswap_U_args (XDR *xdrs, guestfs_mkswap_U_args *objp) } bool_t +xdr_guestfs_mknod_args (XDR *xdrs, guestfs_mknod_args *objp) +{ + register int32_t *buf; + + + if (xdrs->x_op == XDR_ENCODE) { + buf = XDR_INLINE (xdrs, 3 * BYTES_PER_XDR_UNIT); + if (buf == NULL) { + if (!xdr_int (xdrs, &objp->mode)) + return FALSE; + if (!xdr_int (xdrs, &objp->devmajor)) + return FALSE; + if (!xdr_int (xdrs, &objp->devminor)) + return FALSE; + + } else { + IXDR_PUT_LONG(buf, objp->mode); + IXDR_PUT_LONG(buf, objp->devmajor); + IXDR_PUT_LONG(buf, objp->devminor); + } + if (!xdr_string (xdrs, &objp->path, ~0)) + return FALSE; + return TRUE; + } else if (xdrs->x_op == XDR_DECODE) { + buf = XDR_INLINE (xdrs, 3 * BYTES_PER_XDR_UNIT); + if (buf == NULL) { + if (!xdr_int (xdrs, &objp->mode)) + return FALSE; + if (!xdr_int (xdrs, &objp->devmajor)) + return FALSE; + if (!xdr_int (xdrs, &objp->devminor)) + return FALSE; + + } else { + objp->mode = IXDR_GET_LONG(buf); + objp->devmajor = IXDR_GET_LONG(buf); + objp->devminor = IXDR_GET_LONG(buf); + } + if (!xdr_string (xdrs, &objp->path, ~0)) + return FALSE; + return TRUE; + } + + if (!xdr_int (xdrs, &objp->mode)) + return FALSE; + if (!xdr_int (xdrs, &objp->devmajor)) + return FALSE; + if (!xdr_int (xdrs, &objp->devminor)) + return FALSE; + if (!xdr_string (xdrs, &objp->path, ~0)) + return FALSE; + return TRUE; +} + +bool_t +xdr_guestfs_mkfifo_args (XDR *xdrs, guestfs_mkfifo_args *objp) +{ + register int32_t *buf; + + if (!xdr_int (xdrs, &objp->mode)) + return FALSE; + if (!xdr_string (xdrs, &objp->path, ~0)) + return FALSE; + return TRUE; +} + +bool_t +xdr_guestfs_mknod_b_args (XDR *xdrs, guestfs_mknod_b_args *objp) +{ + register int32_t *buf; + + + if (xdrs->x_op == XDR_ENCODE) { + buf = XDR_INLINE (xdrs, 3 * BYTES_PER_XDR_UNIT); + if (buf == NULL) { + if (!xdr_int (xdrs, &objp->mode)) + return FALSE; + if (!xdr_int (xdrs, &objp->devmajor)) + return FALSE; + if (!xdr_int (xdrs, &objp->devminor)) + return FALSE; + + } else { + IXDR_PUT_LONG(buf, objp->mode); + IXDR_PUT_LONG(buf, objp->devmajor); + IXDR_PUT_LONG(buf, objp->devminor); + } + if (!xdr_string (xdrs, &objp->path, ~0)) + return FALSE; + return TRUE; + } else if (xdrs->x_op == XDR_DECODE) { + buf = XDR_INLINE (xdrs, 3 * BYTES_PER_XDR_UNIT); + if (buf == NULL) { + if (!xdr_int (xdrs, &objp->mode)) + return FALSE; + if (!xdr_int (xdrs, &objp->devmajor)) + return FALSE; + if (!xdr_int (xdrs, &objp->devminor)) + return FALSE; + + } else { + objp->mode = IXDR_GET_LONG(buf); + objp->devmajor = IXDR_GET_LONG(buf); + objp->devminor = IXDR_GET_LONG(buf); + } + if (!xdr_string (xdrs, &objp->path, ~0)) + return FALSE; + return TRUE; + } + + if (!xdr_int (xdrs, &objp->mode)) + return FALSE; + if (!xdr_int (xdrs, &objp->devmajor)) + return FALSE; + if (!xdr_int (xdrs, &objp->devminor)) + return FALSE; + if (!xdr_string (xdrs, &objp->path, ~0)) + return FALSE; + return TRUE; +} + +bool_t +xdr_guestfs_mknod_c_args (XDR *xdrs, guestfs_mknod_c_args *objp) +{ + register int32_t *buf; + + + if (xdrs->x_op == XDR_ENCODE) { + buf = XDR_INLINE (xdrs, 3 * BYTES_PER_XDR_UNIT); + if (buf == NULL) { + if (!xdr_int (xdrs, &objp->mode)) + return FALSE; + if (!xdr_int (xdrs, &objp->devmajor)) + return FALSE; + if (!xdr_int (xdrs, &objp->devminor)) + return FALSE; + + } else { + IXDR_PUT_LONG(buf, objp->mode); + IXDR_PUT_LONG(buf, objp->devmajor); + IXDR_PUT_LONG(buf, objp->devminor); + } + if (!xdr_string (xdrs, &objp->path, ~0)) + return FALSE; + return TRUE; + } else if (xdrs->x_op == XDR_DECODE) { + buf = XDR_INLINE (xdrs, 3 * BYTES_PER_XDR_UNIT); + if (buf == NULL) { + if (!xdr_int (xdrs, &objp->mode)) + return FALSE; + if (!xdr_int (xdrs, &objp->devmajor)) + return FALSE; + if (!xdr_int (xdrs, &objp->devminor)) + return FALSE; + + } else { + objp->mode = IXDR_GET_LONG(buf); + objp->devmajor = IXDR_GET_LONG(buf); + objp->devminor = IXDR_GET_LONG(buf); + } + if (!xdr_string (xdrs, &objp->path, ~0)) + return FALSE; + return TRUE; + } + + if (!xdr_int (xdrs, &objp->mode)) + return FALSE; + if (!xdr_int (xdrs, &objp->devmajor)) + return FALSE; + if (!xdr_int (xdrs, &objp->devminor)) + return FALSE; + if (!xdr_string (xdrs, &objp->path, ~0)) + return FALSE; + return TRUE; +} + +bool_t +xdr_guestfs_umask_args (XDR *xdrs, guestfs_umask_args *objp) +{ + register int32_t *buf; + + if (!xdr_int (xdrs, &objp->mask)) + return FALSE; + return TRUE; +} + +bool_t +xdr_guestfs_umask_ret (XDR *xdrs, guestfs_umask_ret *objp) +{ + register int32_t *buf; + + if (!xdr_int (xdrs, &objp->oldmask)) + return FALSE; + return TRUE; +} + +bool_t +xdr_guestfs_readdir_args (XDR *xdrs, guestfs_readdir_args *objp) +{ + register int32_t *buf; + + if (!xdr_string (xdrs, &objp->dir, ~0)) + return FALSE; + return TRUE; +} + +bool_t +xdr_guestfs_readdir_ret (XDR *xdrs, guestfs_readdir_ret *objp) +{ + register int32_t *buf; + + if (!xdr_guestfs_int_dirent_list (xdrs, &objp->entries)) + return FALSE; + return TRUE; +} + +bool_t xdr_guestfs_procedure (XDR *xdrs, guestfs_procedure *objp) { register int32_t *buf;