summaryrefslogtreecommitdiffstats
path: root/python_modules/spice_parser.py
Commit message (Collapse)AuthorAgeFilesLines
* Remove codegenMarc-André Lureau2016-03-101-163/+0
| | | | | | | | Codegen generates code specific to spice-common submodule. It's not meant as a generic protocol header or specification. See discussion and commits about spice-common codegen re-import. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
* protocol: learn to describe fd passing in messagesMarc-Andre Lureau2016-01-141-1/+2
| | | | | | | | | | | | | | | | | Add a new type, "unix_fd", used to describe file descriptor sharing via socket ancillary data (these messages are local only). The marshaller/demarshaller can't serialize this in memory (consume_fd implementation is empty), so it is the responsability of the marshaller user to handle sending and receiving the handles, which are appended at the end of the message with an extra stream byte (because some Unix requires sending at least a byte with ancillary data). Even if there is no fd to send (or if the fd is invalid etc), the receiver side expects an extra byte anyway. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
* codegen: Remove duplicate variable initializationFrediano Ziglio2015-07-231-1/+0
| | | | Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
* codegen: Import six module before first useFrediano Ziglio2015-07-231-1/+2
| | | | | | | The module is used in the initial try/except so make sure it is already imported. Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
* Make spice_codegen.py work on both Python 2 and 3Alexander Wauck2015-04-011-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | This is a new version of my previous patch that does not include six.py. It's still kind of big, but at least it's all spice-common changes now. There are also a few other fixes that Christophe brought to my attention. Note that six now needs to be installed on the system (python-six on Fedora and Debian, six on PyPI). This *should* be enough to make spice_codegen.py work on both Python 2 and Python 3. The major changes are as follows: * cStringIO.StringIO -> io.StringIO * str vs. unicode updates (io.StringIO doesn't like str) * integer division * foo.has_key(bar) -> bar in foo * import internal_thing -> from . import internal_thing * removed from __future__ import with_statement (might break Python 2.5?) * changed some lambdas to list comprehensions (done by 2to3) * cast some_dict.keys() to list where needed (e.g. for sorting) * use normal type names with isinstance instead of types.WhateverType Signed-off-by: Alexander Wauck <awauck@codeweavers.com>
* allow attributes on channel elements in .proto filesChristophe Fergeau2012-03-201-1/+1
| | | | | | We want to be able to add an @ifdef annotation to optional messages For example, we want to compile in the smartcard messages only if libcacard is available
* Remove trailing blank linesDaniel P. Berrange2012-03-201-1/+0
| | | | Remove any blank lines at the end of all source files
* add check for pyparsingChristophe Fergeau2012-03-201-3/+8
| | | | | | Check both in configure.ac (after checking if we need to rebuild the marshalling files) and in the python script using pyparsing (for people modifying .proto files in tarballs)
* python: remove c-ism trailing ;Marc-André Lureau2012-03-201-1/+1
|
* Don't send CursorHeader if cursor_flags is NONEAlexander Larsson2012-03-201-1/+1
|
* Properly parse QXLImage to the new-world SpiceImageGerd Hoffmann2012-03-201-1/+1
| | | | | SpiceImage now replaces RedImage and has all image types in it. All image data are now chunked (and as such not copied when demarshalling).
* Store SpicePath segment count rather than sizeAlexander Larsson2012-03-201-1/+1
| | | | | | | | | | | | | | | | | | | Internally and in the network protocol (for the new version) we now store the actual number of segments rather than the size of the full segments array in bytes. This change consists of multiple changes to handle this: * Make the qxl parser calculate num_segments * Make the canvas stroke code handle the new SpicePath layout. * Fix up is_equal_path in red_worker.c for the new layout * replace multiple calls to spice_marshall_PathSegment with a single spice_marshall_Path call * Make the byte_size() array size handling do the conversion from network size to number of elements when marshalling/demarshalling. * Update the current spice protocol to send the segment count rather than the size * Update the old spice protocol to use the new byte_size functionallity to calculate the size sent and the number of elements recieved
* Initial import of spice protocol description and demarshall generatorAlexander Larsson2012-03-201-0/+157
The "spice.proto" file describes in detail the networking prototcol that spice uses and spice_codegen.py can parse this and generate demarshallers for such network messages.