>From 9cfebb7b656912529d8cbce3f75745cf0b25cade Mon Sep 17 00:00:00 2001 From: Matthieu Patou Date: Sat, 26 Oct 2013 17:37:30 -0700 Subject: [PATCH 06/11] pidl-wireshark: Do not add the signature of the dissector if it was manually defined The signature can be different and as manual dissectors are at the top of the file they will be defined before being used Signed-off-by: Matthieu Patou --- pidl/lib/Parse/Pidl/Wireshark/NDR.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pidl/lib/Parse/Pidl/Wireshark/NDR.pm b/pidl/lib/Parse/Pidl/Wireshark/NDR.pm index dfa9d59..696241d 100644 --- a/pidl/lib/Parse/Pidl/Wireshark/NDR.pm +++ b/pidl/lib/Parse/Pidl/Wireshark/NDR.pm @@ -485,6 +485,7 @@ sub Element($$$$$) $param = "*$param"; } next if ($_->{TYPE} eq "SWITCH"); + my $tmp = "${dissectorname}${add}"; my $additionalparam = ""; my $ref_e = int($e); @@ -492,7 +493,9 @@ sub Element($$$$$) $additionalparam = "int length _U_,"; $self->change_hf_field_type("hf_$ifname\_$pn\_$e->{NAME}", "FT_BYTES", "BASE_NONE"); } - $self->pidl_def("static int $dissectorname$add(tvbuff_t *tvb _U_, int offset _U_,$additionalparam packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_$moreparam);"); + if (not defined ($self->{conformance}->{manual}->{$tmp})) { + $self->pidl_def("static int $dissectorname$add(tvbuff_t *tvb _U_, int offset _U_,$additionalparam packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_$moreparam);"); + } $self->pidl_fn_start("$dissectorname$add"); $self->pidl_code("static int"); $self->pidl_code("$dissectorname$add(tvbuff_t *tvb _U_, int offset _U_,$additionalparam packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_$moreparam)"); -- 1.8.1.2