diff options
author | Christophe Fergeau <cfergeau@redhat.com> | 2011-05-05 16:39:23 +0200 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@gmail.com> | 2012-03-20 15:31:30 +0100 |
commit | 7f86151f18ae59376401085066e19fdd244dae18 (patch) | |
tree | b19c06c1a630cc6a9e6def4483a27d73fc3a8b68 | |
parent | 69aecfc1bc4a957d6fa0edec5d65f7e0ed4cb0ad (diff) |
add smartcard bits to spice.proto
-rw-r--r-- | spice.proto | 77 |
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 { |