$Id: database_documentation.xml 4145 2009-05-12 16:29:28Z nrueff $
Copyright © 2009 Mandriva
Revision History | ||
---|---|---|
Revision 1.3.0 | 2009-11-20 | NR |
First version |
Abstract
The Imaging binary / GUI protocol
The protocol is hand-made, based on the exchange of tokens.
To simplify :
The GUI listen (in our case: 127.0.0.1 on TCP port 7001)
the CLI issues a token (ie a command ID and command arguments)
GUI issues an ACK.
From a network point of view, a token consists in :
a UI32 (little endian) giving the token length,
a string the length previously announced.
In short, encoding "à la Pascal".
Similarly, an order is made of :
a token (command id)
a ui32 (little endian) giving the number of command arguments,
as many tokens as advertised.
Example of exchange from the interface point of view (a token is symbolized by ||) :
RECEIVED : |init_backup| RECEIVED : |/dev/hda1|/home/LRS/noiraude_2007-07-05_18:19:44/P1|192,712|84,706|/home/nicolas/Devs/GhostKiller/lrs-bin/revobin/image_e2fs| SEND : |OK| RECEIVED : |refresh_backup_progress| RECEIVED : |0| SEND : |OK| RECEIVED : |refresh_backup_progress| RECEIVED : |818176| RECEIVED : |close| SEND : |OK|
![]() | |
Undocumented arguments are not used in our case. |
The binary signals the beginning of a backup to the interface. The arguments given are, in that order :
the source, i.e. the partition (Linux-compliant: /dev/hda4, /dev/sdc1, etc ...),
the target, i.e. the file (and the folder) containing the backup (/home/LRS/P1, /net/LRS/tftpboot/imgs/test/P3, etc ...),
the partition size (512 bytes blocks),
the used space (512 bytes blocks),
the name of the binary used to backup.
The binary signals the beginning of a restoration to the interface. The arguments given are, in that order :
the source, i.e. the file (and the folder) containing the backup (/home/LRS/P1, /net/LRS/tftpboot/imgs/test/P3, etc ...),
the target, i.e. the partition (Linux-compliant: /dev/hda4, /dev/sdc1, etc ...),
the amount of data to restore (512 bytes blocks).
The binary tells the interface it changes from backup file. The arguments:
the source,
the target.
The binary gives the interface its progression. The arguments:
The progression (in bytes since the beginning of the image).
The binary tells the interface it will stop its execution (and the communication). No argument.
The binary reports an error to the interface. Two arguments:
the error title,
the error description.
The binary reports an write error (while backuping) to the interface. No argument.
The binary reports a zlib error (while restoring). Argument:
The ZLib error message.