pidl-wireshark: Do not add the signature of the dissector if it was manually defined
authorMatthieu Patou <mat@matws.net>
Sun, 27 Oct 2013 00:37:30 +0000 (17:37 -0700)
committerStefan Metzmacher <metze@samba.org>
Mon, 4 Nov 2013 11:19:28 +0000 (12:19 +0100)
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 <mat@matws.net>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
pidl/lib/Parse/Pidl/Wireshark/NDR.pm

index 503ce66598c1c19344a776fb702d1a2fe1a3d4ff..9f34d1e5be566b59cd191eb0230caf192a754e20 100644 (file)
@@ -492,6 +492,7 @@ sub Element($$$$$)
                        $param = "*$param";
                }
                next if ($_->{TYPE} eq "SWITCH");
+               my $tmp = "${dissectorname}${add}";
                my $additionalparam = "";
 
                my $ref_e = int($e);
@@ -499,7 +500,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)");