diff options
author | Diederik de Groot <ddegroot@talon.nl> | 2015-09-13 12:26:23 +0200 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2015-09-13 19:24:00 +0000 |
commit | cf49f71c59b4b418ae04e4b70cac63f7f0b902ed (patch) | |
tree | 9a40a6037876c97a90b10b09d089d868b07b0e42 /tools/parse_xml2skinny_dissector.py | |
parent | f2c5dee77c877e854460788c9f29342d4adb5499 (diff) | |
download | wireshark-cf49f71c59b4b418ae04e4b70cac63f7f0b902ed.tar.gz |
dissector-skinny: Update skinny dissector to fix ServerRes Message
ServerRes message does not follow other message when it comes to
provinding the list of ip-addresses. The type of ip-address (IPv4
or IPv6 does not depend on the protocol version but the length of
the message.
Fix: ipv4 address displayed as ip-address
Change-Id: Ie16f81c9482b30a80da37b9327b09e933d7808f8
Reviewed-on: https://code.wireshark.org/review/10513
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'tools/parse_xml2skinny_dissector.py')
-rwxr-xr-x | tools/parse_xml2skinny_dissector.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/parse_xml2skinny_dissector.py b/tools/parse_xml2skinny_dissector.py index c1b3ae5c8a..dedbf22ddf 100755 --- a/tools/parse_xml2skinny_dissector.py +++ b/tools/parse_xml2skinny_dissector.py @@ -174,6 +174,11 @@ def xml2obj(src): ret += self.indent_out("{\n") self.incr_indent() for fields in self.fields: + if fields.size_lt: + if self.basemessage.declared is None or "hdr_data_length" not in self.basemessage.declared: + ret += self.indent_out("guint32 hdr_data_length = tvb_get_letohl(ptvcursor_tvbuff(cursor), 0);\n") + self.basemessage.declared.append("hdr_data_length") + declarations += 1 if fields.size_gt: if self.basemessage.declared is None or "hdr_data_length" not in self.basemessage.declared: ret += self.indent_out("guint32 hdr_data_length = tvb_get_letohl(ptvcursor_tvbuff(cursor), 0);\n") @@ -232,6 +237,10 @@ def xml2obj(src): ret += 'hdr_version <= V%s_MSG_TYPE) {\n' %self.endversion self.incr_indent() + if self.size_lt: + ret += self.indent_out('if (hdr_data_length < %s) {\n' %self.size_lt) + self.incr_indent() + if self.size_gt: ret += self.indent_out('if (hdr_data_length > %s) {\n' %self.size_gt) self.incr_indent() @@ -240,6 +249,10 @@ def xml2obj(src): for field in self._children: ret += '%s' %(field.dissect()) + if self.size_lt: + self.decr_indent() + ret += self.indent_out('}\n') + if self.size_gt: self.decr_indent() ret += self.indent_out('}\n') |