[Spice-devel] [PATCH 31/33] Allow to specify 'CHANNEL' as type

Frediano Ziglio fziglio at redhat.com
Wed Jul 1 10:10:23 PDT 2015


Type will be mapped to an enumerator containing all channel types.

Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 python_modules/dissector.py | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/python_modules/dissector.py b/python_modules/dissector.py
index 5b14b92..edb8533 100644
--- a/python_modules/dissector.py
+++ b/python_modules/dissector.py
@@ -245,11 +245,15 @@ def write_wireshark_field(writer, container, member, t, tree, size, encoding='EN
     # override type
     ws_type = get_member_t_attr('ws_type')
     if ws_type:
-        f_type = 'FT_%s' % ws_type
-        if f_type == 'FT_BOOLEAN':
-            vals = 'TFS(&tfs_set_notset)'
-        base = 'BASE_NONE'
-        vals = 'NULL'
+        if ws_type == 'CHANNEL':
+            base = 'BASE_DEC'
+            vals = 'VALS(channel_types_vs)'
+        else:
+            f_type = 'FT_%s' % ws_type
+            if f_type == 'FT_BOOLEAN':
+                vals = 'TFS(&tfs_set_notset)'
+            base = 'BASE_NONE'
+            vals = 'NULL'
 
     # override base
     ws_base = get_member_t_attr('ws_base')
-- 
2.1.0



More information about the Spice-devel mailing list