X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=src%2Fguestfs_protocol.x;h=7f982693e0d39e72f700dda8d7916164a49c9577;hb=6397feeb74af9c750b0430bc88f0855b1f7f1d28;hp=d77bb5fedab72b91d8991bf8552c89f8744fe2bc;hpb=1765330e07a48dc6f7bdef7007f69ebe606fa731;p=libguestfs.git diff --git a/src/guestfs_protocol.x b/src/guestfs_protocol.x index d77bb5f..7f98269 100644 --- a/src/guestfs_protocol.x +++ b/src/guestfs_protocol.x @@ -475,6 +475,39 @@ struct guestfs_blockdev_rereadpt_args { string device<>; }; +struct guestfs_upload_args { + string remotefilename<>; +}; + +struct guestfs_download_args { + string remotefilename<>; +}; + +struct guestfs_checksum_args { + string csumtype<>; + string path<>; +}; + +struct guestfs_checksum_ret { + string checksum<>; +}; + +struct guestfs_tar_in_args { + string directory<>; +}; + +struct guestfs_tar_out_args { + string directory<>; +}; + +struct guestfs_tgz_in_args { + string directory<>; +}; + +struct guestfs_tgz_out_args { + string directory<>; +}; + enum guestfs_procedure { GUESTFS_PROC_MOUNT = 1, GUESTFS_PROC_SYNC = 2, @@ -541,14 +574,29 @@ enum guestfs_procedure { GUESTFS_PROC_BLOCKDEV_GETSIZE64 = 63, GUESTFS_PROC_BLOCKDEV_FLUSHBUFS = 64, GUESTFS_PROC_BLOCKDEV_REREADPT = 65, + GUESTFS_PROC_UPLOAD = 66, + GUESTFS_PROC_DOWNLOAD = 67, + GUESTFS_PROC_CHECKSUM = 68, + GUESTFS_PROC_TAR_IN = 69, + GUESTFS_PROC_TAR_OUT = 70, + GUESTFS_PROC_TGZ_IN = 71, + GUESTFS_PROC_TGZ_OUT = 72, GUESTFS_PROC_NR_PROCS }; const GUESTFS_MESSAGE_MAX = 4194304; +/* The communication protocol is now documented in the guestfs(3) + * manpage. + */ + const GUESTFS_PROGRAM = 0x2000F5F5; const GUESTFS_PROTOCOL_VERSION = 1; +/* These constants must be larger than any possible message length. */ +const GUESTFS_LAUNCH_FLAG = 0xf5f55ff5; +const GUESTFS_CANCEL_FLAG = 0xffffeeee; + enum guestfs_message_direction { GUESTFS_DIRECTION_CALL = 0, /* client -> daemon */ GUESTFS_DIRECTION_REPLY = 1 /* daemon -> client */ @@ -562,22 +610,9 @@ enum guestfs_message_status { const GUESTFS_ERROR_LEN = 256; struct guestfs_message_error { - string error; /* error message */ + string error_message; }; -/* For normal requests and replies (not involving any FileIn or - * FileOut parameters), the protocol is: - * - * For requests: - * total length (header + args, but not including length word itself) - * header - * guestfs_foo_args struct - * For replies: - * total length (as above) - * header - * guestfs_foo_ret struct - */ - struct guestfs_message_header { unsigned prog; /* GUESTFS_PROGRAM */ unsigned vers; /* GUESTFS_PROTOCOL_VERSION */ @@ -587,23 +622,6 @@ struct guestfs_message_header { guestfs_message_status status; }; -/* Chunked encoding used to transfer files, for FileIn and FileOut - * parameters. - * - * For requests which have >= 1 FileIn parameter: - * length of header + args (but not length word itself, and not chunks) - * header - * guestfs_foo_args struct - * sequence of chunks for FileIn param #0 - * sequence of chunks for FileIn param #1 etc - * - * For replies which have >= 1 FileOut parameter: - * length of header + ret (but not length word itself, and not chunks) - * header - * guestfs_foo_ret struct - * sequence of chunks for FileOut param #0 - * sequence of chunks for FileOut param #1 etc - */ const GUESTFS_MAX_CHUNK_SIZE = 8192; struct guestfs_chunk {