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

Submitted by Frediano Ziglio on July 1, 2015, 5:10 p.m.

Details

Message ID 1435770625-1631-32-git-send-email-fziglio@redhat.com
State New
Headers show

Not browsing as part of any series.

Commit Message

Frediano Ziglio July 1, 2015, 5:10 p.m.
Type will be mapped to an enumerator containing all channel types.

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

Patch hide | download patch | download mbox

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')