diff options
author | etxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7> | 2005-08-11 20:14:41 +0000 |
---|---|---|
committer | etxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7> | 2005-08-11 20:14:41 +0000 |
commit | db190f066375a217d04eb522547f03b8ba14bd98 (patch) | |
tree | 48ce96447a0c4c9db2252eb28dc3aec8b4823eee /ethereal_gen.py | |
parent | 75f784cc52a237e49980dee586e217d857e4f949 (diff) |
From W. Borgert:
three trivial corrections for the GIOP dissector:
- allow filtering GIOP exceptions, e.g. "giop.replystatus = 2"
or "giop.exceptionid matches MyError", older patch at
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=314835
- show IDLs sequence<octet> more compact, not one line per
octet, older patch at
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=314836
- decode _is_a requests and replies, older patch at
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=314871
With a change to not create a malformed packet in the "stub data".
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15295 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'ethereal_gen.py')
-rw-r--r-- | ethereal_gen.py | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/ethereal_gen.py b/ethereal_gen.py index a8684a9f46..a698bf5127 100644 --- a/ethereal_gen.py +++ b/ethereal_gen.py @@ -1001,6 +1001,9 @@ class ethereal_gen_C: self.get_CDR_struct(type,pn) elif pt == idltype.tk_TypeCode: # will I ever get here ? self.get_CDR_TypeCode(pn) + elif pt == idltype.tk_sequence and \ + type.unalias().seqType().kind() == idltype.tk_octet: + self.get_CDR_sequence_octet(type,pn) elif pt == idltype.tk_sequence: self.get_CDR_sequence(type,pn) elif pt == idltype.tk_objref: @@ -1417,6 +1420,17 @@ class ethereal_gen_C: self.st.out(self.template_get_CDR_sequence_loop_end) + # + # Generate code to access a sequence of octet + # + + def get_CDR_sequence_octet(self,type, pn): + self.st.out(self.template_get_CDR_sequence_length, seqname=pn) + self.st.out(self.template_get_CDR_sequence_octet, seqname=pn) + self.addvar(self.c_i_lim + pn + ";") + self.addvar("gchar * binary_seq_" + pn + ";") + self.addvar("gchar * text_seq_" + pn + ";") + # # Generate code to access arrays, @@ -2085,7 +2099,18 @@ for (i_@seqname@=0; i_@seqname@ < u_octet4_loop_@seqname@; i_@seqname@++) { } """ - + template_get_CDR_sequence_octet = """\ +if (u_octet4_loop_@seqname@ > 0 and tree) { + get_CDR_octet_seq(tvb, &binary_seq_@seqname@, offset, + u_octet4_loop_@seqname@); + text_seq_@seqname@ = make_printable_string(binary_seq_@seqname@, + u_octet4_loop_@seqname@); + proto_tree_add_text(tree, tvb, *offset - u_octet4_loop_@seqname@, + u_octet4_loop_@seqname@, \"@seqname@: %s\", text_seq_@seqname@); + g_free(binary_seq_@seqname@); + g_free(text_seq_@seqname@); +} +""" template_get_CDR_array_start = """\ for (i_@aname@=0; i_@aname@ < @aval@; i_@aname@++) { |