pidl-wireshark: Handle the case when the DATA_TYPE is not a simple type
authorMatthieu Patou <mat@matws.net>
Tue, 23 Sep 2014 08:28:40 +0000 (01:28 -0700)
committerStefan Metzmacher <metze@samba.org>
Thu, 9 Oct 2014 20:06:46 +0000 (22:06 +0200)
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Change-Id: If78f241333c1372c60c7d00211c1e6aeb22c9719
Signed-off-by: Matthieu Patou <mat@matws.net>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
pidl/lib/Parse/Pidl/Wireshark/NDR.pm

index 5cfcf5cdc8d0da6d33d0a642ef729a5f7512f2dd..d9abe6a6d47823d3a69eb330d354d228275789a8 100644 (file)
@@ -348,7 +348,14 @@ sub ElementLevel($$$$$$$$)
                                $call= $self->{conformance}->{types}->{$l->{DATA_TYPE}}->{DISSECTOR_NAME};
                                $self->{conformance}->{types}->{$l->{DATA_TYPE}}->{USED} = 1;
                        } else {
-                               $self->pidl_code("offset = $ifname\_dissect_struct_" . $l->{DATA_TYPE} . "(tvb,offset,pinfo,tree,drep,$hf,$param);");
+                               my $t;
+                               if (ref($l->{DATA_TYPE}) eq "HASH" ) {
+                                       $t = "$l->{DATA_TYPE}->{TYPE}_$l->{DATA_TYPE}->{NAME}";
+                               } else {
+                                       $t = $l->{DATA_TYPE};
+                               }
+
+                               $self->pidl_code("offset = $ifname\_dissect_struct_" . $t . "(tvb,offset,pinfo,tree,drep,$hf,$param);");
 
                                return;
                        }