summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2011-05-05 16:39:23 +0200
committerMarc-André Lureau <marcandre.lureau@gmail.com>2012-03-20 15:31:30 +0100
commit617b0adac30e01b81709dc6047f42fc8e0ea915e (patch)
treed72f512bc18cbe7d7b084e186706de1f8756218b
parentca57afda341a1187a9c367e5be71744979dd7a86 (diff)
downloadspice-protocol-617b0adac30e01b81709dc6047f42fc8e0ea915e.tar.gz
spice-protocol-617b0adac30e01b81709dc6047f42fc8e0ea915e.tar.xz
spice-protocol-617b0adac30e01b81709dc6047f42fc8e0ea915e.zip
add smartcard bits to spice.proto
-rw-r--r--spice.proto77
1 files changed, 73 insertions, 4 deletions
diff --git a/spice.proto b/spice.proto
index ae27c8d..de238c7 100644
--- a/spice.proto
+++ b/spice.proto
@@ -1116,11 +1116,80 @@ channel TunnelChannel : BaseChannel {
} @ctype(SpiceMsgcTunnelSocketTokens) socket_token;
};
+enum32 vsc_message_type {
+ Init = 1,
+ Error,
+ ReaderAdd,
+ ReaderRemove,
+ ATR,
+ CardRemove,
+ APDU,
+ Flush,
+ FlushComplete
+} @prefix(VSC_);
+
+struct VscMessageHeader {
+ vsc_message_type type;
+ uint32 reader_id;
+ uint32 length;
+} @ctype(VSCMsgHeader);
+
+struct VscMessageError {
+ uint32 code;
+} @ctype(VSCMsgError);
+
+struct VscMessageAPDU {
+ uint8 data[];
+} @ctype(VSCMsgAPDU);
+
+struct VscMessageATR {
+ uint8 data[];
+} @ctype(VSCMsgATR);
+
+struct VscMessageReaderAdd {
+ int8 *reader_name[] @zero_terminated @nonnull @end @nomarshal;
+} @ctype(VSCMsgReaderAdd);
+
channel SmartcardChannel : BaseChannel {
-server:
- Data data = 101;
-client:
- Data data = 101;
+ server:
+ message {
+ vsc_message_type type;
+ uint32 reader_id;
+ uint32 length;
+ uint8 data[] @end;
+ } @ctype(SpiceMsgSmartcard) msg = 101;
+
+ client:
+ message {
+ VscMessageHeader header;
+ switch (header.type) {
+ case ReaderAdd:
+ VscMessageReaderAdd add;
+ case ATR:
+ case APDU:
+ VscMessageATR atr_data;
+ case Error:
+ VscMessageError error;
+ } u @anon;
+ } @ctype(SpiceMsgcSmartcard) msg = 101;
+
+ message {
+ vsc_message_type type;
+ uint32 reader_id;
+ uint32 length;
+ } @ctype(VSCMsgHeader) header = 101;
+
+ message {
+ uint32 code;
+ } @ctype(VSCMsgError) error = 101;
+
+ message {
+ uint8 data[];
+ } @ctype(VSCMsgATR) atr = 101;
+
+ message {
+ int8 reader_name[] @zero_terminated @nonnull;
+ } @ctype(VSCMsgReaderAdd) reader_add = 101;
};
channel SpicevmcChannel : BaseChannel {