summaryrefslogtreecommitdiff
path: root/python_modules/demarshal.py
diff options
context:
space:
mode:
authorMarc-Andre Lureau <marcandre.lureau@gmail.com>2015-12-22 16:08:08 +0100
committerMarc-André Lureau <marcandre.lureau@redhat.com>2016-03-10 16:01:42 +0100
commitc5ed374a328b054846fd34536270f3f11392af69 (patch)
treef168d96093d5c92b6dabb7f7e526bcd356c0690f /python_modules/demarshal.py
parent1cd26b87c10870ea9bfb65b4640d2e318b45aafb (diff)
protocol: learn to describe fd passing in messages
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> (cherry-picked from spice-protocol commit 267391c8fd7c90c067b3e4845ff0227a2580e2e2) Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Diffstat (limited to 'python_modules/demarshal.py')
-rw-r--r--python_modules/demarshal.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/python_modules/demarshal.py b/python_modules/demarshal.py
index 209eafc..2252f37 100644
--- a/python_modules/demarshal.py
+++ b/python_modules/demarshal.py
@@ -72,6 +72,10 @@ def write_parser_helpers(writer):
writer.statement("return val")
writer.end_block()
+ writer.function("SPICE_GNUC_UNUSED consume_fd", "int", "uint8_t **ptr", True)
+ writer.statement("return -1")
+ writer.end_block()
+
writer.newline()
writer.statement("typedef struct PointerInfo PointerInfo")
writer.statement("typedef void (*message_destructor_t)(uint8_t *message)")