>From 5dd5b37588b20356312a56d907f560fcea49f946 Mon Sep 17 00:00:00 2001 From: Matthieu Patou Date: Sat, 26 Oct 2013 17:14:17 -0700 Subject: [PATCH 10/13] pidl-wireshark: if the element is used as a switch store the value We might need this value later on Signed-off-by: Matthieu Patou --- pidl/lib/Parse/Pidl/Wireshark/NDR.pm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pidl/lib/Parse/Pidl/Wireshark/NDR.pm b/pidl/lib/Parse/Pidl/Wireshark/NDR.pm index 83ab3ef..92a3806 100644 --- a/pidl/lib/Parse/Pidl/Wireshark/NDR.pm +++ b/pidl/lib/Parse/Pidl/Wireshark/NDR.pm @@ -363,6 +363,14 @@ sub ElementLevel($$$$$$$$) $self->{conformance}->{imports}->{"$pn.$e->{NAME}"}->{USED} = 1; } elsif (defined($self->{conformance}->{types}->{$l->{DATA_TYPE}})) { + my $var = $e->{NAME}; + my $iswitch = 0; + my $tref = $e->{ORIGINAL}->{PARENT}->{ELEMENTS}; + foreach my $oe (@$tref) { + if ($oe->{PROPERTIES} && $oe->{PROPERTIES}->{switch_is} && $oe->{PROPERTIES}->{switch_is} eq $var) { + $iswitch = 1; + } + } my $ref_e = int($e); if (grep /$ref_e/,@{$self->{block_display}}) { $call = "proto_tree_add_bytes(tree, \@HF\@, tvb, offset, length, tvb_get_ptr(tvb, offset,length)); offset += length;"; -- 1.8.1.2