WHY??? pidl-wireshark: clean case name as they can have no valid char for variable...
authorMatthieu Patou <mat@matws.net>
Sat, 26 Oct 2013 08:12:05 +0000 (01:12 -0700)
committerStefan Metzmacher <metze@samba.org>
Mon, 4 Nov 2013 11:19:30 +0000 (12:19 +0100)
For instance:
[case(1|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16))]16drsuapi_DsGetNCChangesMSZIPCtr1
mszip1;

Signed-off-by: Matthieu Patou <mat@matws.net>
WHY
drsuapi_dissect_element_DsGetNCChangesCompressedCtr_val1DRSUAPI_COMPRESSION_TYPE_MSZIP16_mszip1
instead of the simple
drsuapi_dissect_element_DsGetNCChangesCompressedCtr_mszip1
we had before?

pidl/lib/Parse/Pidl/Wireshark/NDR.pm

index 8740f154ebae759dfedd5111a49eb2aab59922a8..216efc7b462b9b157c5eca9b1c730968c00ddd53 100644 (file)
@@ -758,7 +758,10 @@ sub Union($$$$)
        foreach (@{$e->{ELEMENTS}}) {
                $res.="\n\t\t$_->{CASE}:\n";
                if ($_->{TYPE} ne "EMPTY") {
-                       $res.="\t\t\t".$self->Element($_, $name, $ifname, undef)."\n";
+                       my $case_name = $_->{CASE};
+                       $case_name =~ s/case //;
+                       $case_name =~ tr/|)(<//d;
+                       $res.="\t\t\t".$self->Element($_, "${name}_val${case_name}", $ifname, undef)."\n";
                }
                $res.="\t\tbreak;\n";
        }