From 5b9f1b01ba6880ead4662bb66988bcdf5bf2aa82 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 4 Nov 2006 21:53:00 +0000 Subject: r19559: Fix handling of types where the name isn't prefixed by the interface name. Based on patch by Julien Kerihuel. (This used to be commit 466e9c12a5f9bd2f7bf00c710bd9a537b48e7864) --- source4/pidl/lib/Parse/Pidl/Wireshark/NDR.pm | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'source4') diff --git a/source4/pidl/lib/Parse/Pidl/Wireshark/NDR.pm b/source4/pidl/lib/Parse/Pidl/Wireshark/NDR.pm index e211a896ad..5af7c02032 100644 --- a/source4/pidl/lib/Parse/Pidl/Wireshark/NDR.pm +++ b/source4/pidl/lib/Parse/Pidl/Wireshark/NDR.pm @@ -256,9 +256,9 @@ sub Bitmap($$$) register_type($name, "offset = $dissectorname(tvb, offset, pinfo, tree, drep, \@HF\@, \@PARAM\@);", "FT_UINT$size", "BASE_HEX", "0", "NULL", $size/8); } -sub ElementLevel($$$$$) +sub ElementLevel($$$$$$) { - my ($e,$l,$hf,$myname,$pn) = @_; + my ($e,$l,$hf,$myname,$pn,$ifname) = @_; my $param = 0; @@ -327,10 +327,7 @@ sub ElementLevel($$$$$) $call= $conformance->{types}->{$l->{DATA_TYPE}}->{DISSECTOR_NAME}; $conformance->{types}->{$l->{DATA_TYPE}}->{USED} = 1; } else { - if ($l->{DATA_TYPE} =~ /^([a-z]+)\_(.*)$/) - { - pidl_code "offset = $1_dissect_struct_$2(tvb,offset,pinfo,tree,drep,$hf,$param);"; - } + pidl_code "offset = $ifname\_dissect_struct_" . $l->{DATA_TYPE} . "(tvb,offset,pinfo,tree,drep,$hf,$param);"; return; } @@ -402,7 +399,7 @@ sub Element($$$) pidl_code "{"; indent; - ElementLevel($e,$_,$hf,$dissectorname.$add,$pn); + ElementLevel($e,$_,$hf,$dissectorname.$add,$pn,$ifname); pidl_code ""; pidl_code "return offset;"; -- cgit