pidl-wireshark: Handle the case when the DATA_TYPE is not a simple type
[samba.git] / 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;
                        }