[SCM] Samba Shared Repository - branch master updated

Stefan Metzmacher metze at samba.org
Fri Jul 12 11:09:01 UTC 2024


The branch, master has been updated
       via  e450ff685b5 pidl: Wireshark: Another C99 type conversion
       via  9870457e962 pidl: Wireshark: Don't assign hash undef, assign it an empty array
       via  5b12d3d2e7d pidl: Wireshark: Remove init of proto variables
       via  00f57728742 pidl: Wireshark: Convert the pidl dissector generation code to C99 types
       via  e60c5b881d9 pidl: Wireshark: Update test for removal of ett initialization
       via  2f5a388dd10 pidl: Wireshark: Const-ify dcerpc_sub_dissector structures.
       via  5a5e68c2747 pidl: Wireshark: Don't initialise static hf and ett variables.
       via  f2ed371e1cc pidl: Wireshark: Remove init of proto variables
       via  c3ca2a6575b pidl: Update Wireshark generated DRSUAPI code
      from  3a21b7d9a4e .gitlab-ci-main.yml: Add safe.directory '*'

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit e450ff685b57849470aecdab5397a1a8ea5d19d2
Author: John Thacker <johnthacker at gmail.com>
Date:   Wed Jul 3 08:03:41 2024 -0400

    pidl: Wireshark: Another C99 type conversion
    
    Pick up change from Wireshark:
    
        commit bdb719f846f9d8f7800b9f50dadfde5e7f7a89e1
        Author: John Thacker <johnthacker at gmail.com>
        Date:   Sun Jun 23 08:15:45 2024 -0400
    
            pidl: Another C99 type conversion
    
            Change an automated sizeof() call in the pidl dissector generation from
            prefixing a "g" to getting the actual C type.
    
            Ping #19116
    
    Signed-off-by: John Thacker <johnthacker at gmail.com>
    Reviewed-by: Jo Sutton <josutton at catalyst.net.nz>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    
    Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
    Autobuild-Date(master): Fri Jul 12 11:08:03 UTC 2024 on atb-devel-224

commit 9870457e962b2ce2da590777aa4f58269361b95b
Author: John Thacker <johnthacker at gmail.com>
Date:   Wed Jul 3 08:00:59 2024 -0400

    pidl: Wireshark: Don't assign hash undef, assign it an empty array
    
    Pick up change from Wireshark:
    
        commit ade6577f109e2bf741909226254b758e79a816f1
        Author: John Thacker <johnthacker at gmail.com>
        Date:   Fri Jun 21 20:27:51 2024 -0400
    
            pidl: Don't assign hash undef, assign it an empty array
    
            Perl works, but complains if warnings are on, if a hash is
            initialized to undef instead of to empty. Upstream Samba turned on
            warnings in the next commit to catch things like this.
    
    Signed-off-by: John Thacker <johnthacker at gmail.com>
    Reviewed-by: Jo Sutton <josutton at catalyst.net.nz>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

commit 5b12d3d2e7d82bc07c1c1c96229ed0cd71a6a967
Author: John Thacker <johnthacker at gmail.com>
Date:   Wed Jul 3 07:58:04 2024 -0400

    pidl: Wireshark: Remove init of proto variables
    
    Pick up change from Wireshark:
    
        commit 10b046cbdd110dbae8f4cab048e5954bf6955402
        Author: John Thacker <johnthacker at gmail.com>
        Date:   Sat Jun 22 20:31:40 2024 -0400
    
            pidl: Remove init of proto variables
    
            Remove initialization of proto variables from pidl generated dissectors
            and regenerate.
            Follow up to 2a9bc63325c99653c5da873c273430add3b5e9dd
    
    Signed-off-by: John Thacker <johnthacker at gmail.com>
    Reviewed-by: Jo Sutton <josutton at catalyst.net.nz>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

commit 00f5772874265d0cd8535cd60a76e6117ce715b5
Author: John Thacker <johnthacker at gmail.com>
Date:   Wed Jul 3 07:56:42 2024 -0400

    pidl: Wireshark: Convert the pidl dissector generation code to C99 types
    
    Pick up change from Wireshark:
    
        commit 4df8d2884ddfe72a03d0b322c10ae515a8366ea4
        Author: John Thacker <johnthacker at gmail.com>
        Date:   Sat Jun 22 11:21:47 2024 -0400
    
            pidl: Convert the pidl dissector generation code to C99 types
    
            Switch the Wireshark.pm pidl dissector generation code to using C99
            types, and regenerated the dcerpc pidl dissectors.
    
            Ping #19116
    
    Signed-off-by: John Thacker <johnthacker at gmail.com>
    Reviewed-by: Jo Sutton <josutton at catalyst.net.nz>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

commit e60c5b881d95d7b6073abc87d42ecba52778f192
Author: John Thacker <johnthacker at gmail.com>
Date:   Wed Jul 3 07:54:40 2024 -0400

    pidl: Wireshark: Update test for removal of ett initialization
    
    Pick up change from Wireshark:
    
        commit 6e4c81b324e9b1752ce6bc253a09355512b5b387
        Author: John Thacker <johnthacker at gmail.com>
        Date:   Sat Jun 22 11:10:48 2024 -0400
    
            pidl: Update test for removal of ett initialization
    
            Also remove trailing whitespace
    
    Signed-off-by: John Thacker <johnthacker at gmail.com>
    Reviewed-by: Jo Sutton <josutton at catalyst.net.nz>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

commit 2f5a388dd105f43d69b730f05be1b1b109c87212
Author: John Thacker <johnthacker at gmail.com>
Date:   Wed Jul 3 07:52:42 2024 -0400

    pidl: Wireshark: Const-ify dcerpc_sub_dissector structures.
    
    Pick up change from Wireshark:
    
        commit 8a2a42241fd148ce735e776a6a1e6b49b64d215e
        Author: Darius Davis <darius-wireshark at free-range.com.au>
        Date:   Sun May 19 17:39:38 2024 +1000
    
            Const-ify dcerpc_sub_dissector structures.
    
            This moves about 56 kBytes of data from a read-write data section to read-only.
    
            The various dissectors were _not_ regenerated for this commit.  Instead, this
            commit was produced using the following command:
    
               find * -type f -exec sed -i -e 's/\(["'\'']\|^\)static dcerpc_sub_dissector/\1static const dcerpc_sub_dissector/' \{\} \;
    
            This updates the generator script and its test, as well as making an identical
            change to all of the dissectors, regardless of whether or not those dissectors
            were produced by the generator script.
    
    Signed-off-by: John Thacker <johnthacker at gmail.com>
    Reviewed-by: Jo Sutton <josutton at catalyst.net.nz>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

commit 5a5e68c274739c9f05833b881e6dc21fc3829f74
Author: John Thacker <johnthacker at gmail.com>
Date:   Wed Jul 3 07:50:55 2024 -0400

    pidl: Wireshark: Don't initialise static hf and ett variables.
    
    Pick up change from Wireshark:
    
        commit 9ca6eff53db29cad7dfc7e57fba4d68e9c838ab5
        Author: Anders Broman <a.broman58 at gmail.com>
        Date:   Thu May 2 14:14:29 2024 +0200
    
            PIDL: Don't initialise static hf and ett variables.
    
    Signed-off-by: John Thacker <johnthacker at gmail.com>
    Reviewed-by: Jo Sutton <josutton at catalyst.net.nz>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

commit f2ed371e1cc0115f9e8f1794220ffa36f2c51c61
Author: John Thacker <johnthacker at gmail.com>
Date:   Wed Jul 3 07:49:15 2024 -0400

    pidl: Wireshark: Remove init of proto variables
    
    Pick up change from Wireshark as it applies to PIDL:
    
        commit 2a9bc63325c99653c5da873c273430add3b5e9dd
        Author: Stig Bjørlykke <stig at bjorlykke.org>
        Date:   Mon Nov 20 08:16:40 2023 +0100
    
            Remove init of proto variables
    
            Remove init of proto, header field, expert info and subtree variables.
            This will reduces the binary size by approximate 1266320 bytes due to
            using .bss to zero-initialize the fields.
    
            The conversion is done using the tools/convert-proto-init.py script
    
    Signed-off-by: John Thacker <johnthacker at gmail.com>
    Reviewed-by: Jo Sutton <josutton at catalyst.net.nz>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

commit c3ca2a6575bdb7444b0de5716f5c50ba69489168
Author: John Thacker <johnthacker at gmail.com>
Date:   Wed Jul 3 07:42:26 2024 -0400

    pidl: Update Wireshark generated DRSUAPI code
    
    Picked from Wireshark:
    
        commit b1249b0be4badc44cbbb30ff414d32d1b884a668
        Author: hidd3ncod3s Sec <hidd3ncod3s at gmail.com>
        Date:   Tue Aug 15 04:29:08 2023 +0000
    
            DCERPC: Update DRSUAPI support
    
    Signed-off-by: John Thacker <johnthacker at gmail.com>
    Reviewed-by: Jo Sutton <josutton at catalyst.net.nz>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 pidl/lib/Parse/Pidl/Wireshark/NDR.pm | 67 +++++++++++++++++-------------------
 pidl/tests/wireshark-ndr.pl          | 48 +++++++++++++-------------
 2 files changed, 55 insertions(+), 60 deletions(-)


Changeset truncated at 500 lines:

diff --git a/pidl/lib/Parse/Pidl/Wireshark/NDR.pm b/pidl/lib/Parse/Pidl/Wireshark/NDR.pm
index 44d81dbabe2..3d8b74bab45 100644
--- a/pidl/lib/Parse/Pidl/Wireshark/NDR.pm
+++ b/pidl/lib/Parse/Pidl/Wireshark/NDR.pm
@@ -23,7 +23,7 @@ use Exporter;
 use strict;
 use warnings;
 use Parse::Pidl qw(error warning);
-use Parse::Pidl::Typelist qw(getType);
+use Parse::Pidl::Typelist qw(getType mapScalarType);
 use Parse::Pidl::Util qw(has_property property_matches make_str);
 use Parse::Pidl::NDR qw(ContainsString GetNextLevel);
 use Parse::Pidl::Dump qw(DumpType DumpFunction);
@@ -152,7 +152,7 @@ sub Enum($$$$)
 	}
 
 	$self->pidl_hdr("extern const value_string $valsstring\[];");
-	$self->pidl_hdr("int $dissectorname(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_, int hf_index _U_, g$e->{BASE_TYPE} *param _U_);");
+	$self->pidl_hdr("int $dissectorname(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_, int hf_index _U_, g$e->{BASE_TYPE} *param _U_);");
 
 	$self->pidl_def("const value_string ".$valsstring."[] = {");
 	foreach (@{$e->{ELEMENTS}}) {
@@ -165,7 +165,7 @@ sub Enum($$$$)
 
 	$self->pidl_fn_start($dissectorname);
 	$self->pidl_code("int");
-	$self->pidl_code("$dissectorname(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_, int hf_index _U_, g$e->{BASE_TYPE} *param _U_)");
+	$self->pidl_code("$dissectorname(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_, int hf_index _U_, g$e->{BASE_TYPE} *param _U_)");
 	$self->pidl_code("{");
 	$self->indent;
 	$self->pidl_code("g$e->{BASE_TYPE} parameter=0;");
@@ -206,11 +206,11 @@ sub Bitmap($$$$)
 
 	$self->register_ett("ett_$ifname\_$name");
 
-	$self->pidl_hdr("int $dissectorname(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_);");
+	$self->pidl_hdr("int $dissectorname(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_, int hf_index _U_, uint32_t param _U_);");
 
 	$self->pidl_fn_start($dissectorname);
 	$self->pidl_code("int");
-	$self->pidl_code("$dissectorname(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, dcerpc_info* di _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)");
+	$self->pidl_code("$dissectorname(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_, int hf_index _U_, uint32_t param _U_)");
 	$self->pidl_code("{");
 	$self->indent;
 	foreach (@{$e->{ELEMENTS}}) {
@@ -336,9 +336,10 @@ sub ElementLevel($$$$$$$$)
 				$self->pidl_code("offset = dissect_ndr_u" . $type . "array(tvb, offset, pinfo, tree, di, drep, $myname\_);");
 			} else {
 				my $nl = GetNextLevel($e,$l);
+				my $nl_ctype = mapScalarType($nl->{DATA_TYPE});
 				$self->pidl_code("char *data;");
 				$self->pidl_code("");
-				$self->pidl_code("offset = dissect_ndr_$type" . "string(tvb, offset, pinfo, tree, di, drep, sizeof(g$nl->{DATA_TYPE}), $hf, FALSE, &data);");
+				$self->pidl_code("offset = dissect_ndr_$type" . "string(tvb, offset, pinfo, tree, di, drep, sizeof($nl_ctype), $hf, false, &data);");
 				$self->pidl_code("proto_item_append_text(tree, \": %s\", data);");
 			}
 		}
@@ -351,10 +352,10 @@ sub ElementLevel($$$$$$$$)
 
 			if (property_matches($e, "flag", ".*LIBNDR_FLAG_STR_SIZE4.*") and property_matches($e, "flag", ".*LIBNDR_FLAG_STR_LEN4.*")) {
 				$self->pidl_code("char *data;\n");
-				$self->pidl_code("offset = dissect_ndr_cvstring(tvb, offset, pinfo, tree, di, drep, $bs, $hf, FALSE, &data);");
+				$self->pidl_code("offset = dissect_ndr_cvstring(tvb, offset, pinfo, tree, di, drep, $bs, $hf, false, &data);");
 				$self->pidl_code("proto_item_append_text(tree, \": %s\", data);");
 			} elsif (property_matches($e, "flag", ".*LIBNDR_FLAG_STR_SIZE4.*")) {
-				$self->pidl_code("offset = dissect_ndr_vstring(tvb, offset, pinfo, tree, di, drep, $bs, $hf, FALSE, NULL);");
+				$self->pidl_code("offset = dissect_ndr_vstring(tvb, offset, pinfo, tree, di, drep, $bs, $hf, false, NULL);");
 			} elsif (property_matches($e, "flag", ".*STR_NULLTERM.*")) {
 				if ($bs == 2) {
 					$self->pidl_code("offset = dissect_null_term_wstring(tvb, offset, pinfo, tree, drep, $hf , 0);")
@@ -421,7 +422,7 @@ sub ElementLevel($$$$$$$$)
 		# continue to dissect handmarshalled stuff with pidl
 		$self->pidl_code("di->call_data->flags &= ~DCERPC_IS_NDR64;");
 
-		$self->pidl_code("subtvb = tvb_new_subset_length_caplen(tvb, offset, (const gint)size, -1);");
+		$self->pidl_code("subtvb = tvb_new_subset_length_caplen(tvb, offset, (const int)size, -1);");
 		if ($param ne 0) {
 			$self->pidl_code("$myname\_(subtvb, 0, pinfo, tree, di, drep, $param);");
 		} else {
@@ -553,10 +554,10 @@ sub Element($$$$$$)
 		}
 		next if ($_->{TYPE} eq "SWITCH");
 		next if (defined($self->{conformance}->{noemit}->{"$dissectorname$add"}));
-		$self->pidl_def("static int $dissectorname$add(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_$moreparam);");
+		$self->pidl_def("static int $dissectorname$add(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *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_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_$moreparam)");
+		$self->pidl_code("$dissectorname$add(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_$moreparam)");
 		$self->pidl_code("{");
 		$self->indent;
 
@@ -584,7 +585,7 @@ sub Function($$$)
 	my %dissectornames;
 
 	foreach (@{$fn->{ELEMENTS}}) {
-	    $dissectornames{$_->{NAME}} = $self->Element($_, $fn->{NAME}, $ifname, undef, undef) if not defined($dissectornames{$_->{NAME}});
+	    $dissectornames{$_->{NAME}} = $self->Element($_, $fn->{NAME}, $ifname, undef, ()) if not defined($dissectornames{$_->{NAME}});
 	}
 
 	my $fn_name = $_->{NAME};
@@ -593,7 +594,7 @@ sub Function($$$)
 	$self->PrintIdl(DumpFunction($fn->{ORIGINAL}));
 	$self->pidl_fn_start("$ifname\_dissect\_$fn_name\_response");
 	$self->pidl_code("static int");
-	$self->pidl_code("$ifname\_dissect\_${fn_name}_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)");
+	$self->pidl_code("$ifname\_dissect\_${fn_name}_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)");
 	$self->pidl_code("{");
 	$self->indent;
 	if ( not defined($fn->{RETURN_TYPE})) {
@@ -662,7 +663,7 @@ sub Function($$$)
 
 	$self->pidl_fn_start("$ifname\_dissect\_$fn_name\_request");
 	$self->pidl_code("static int");
-	$self->pidl_code("$ifname\_dissect\_${fn_name}_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)");
+	$self->pidl_code("$ifname\_dissect\_${fn_name}_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)");
 	$self->pidl_code("{");
 	$self->indent;
 	$self->pidl_code("di->dcerpc_procedure_name=\"${fn_name}\";");
@@ -734,11 +735,11 @@ sub Struct($$$$)
 		$doalign = 0;
 	}
 
-	$self->pidl_hdr("int $dissectorname(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, dcerpc_info* di _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_);");
+	$self->pidl_hdr("int $dissectorname(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_, int hf_index _U_, uint32_t param _U_);");
 
 	$self->pidl_fn_start($dissectorname);
 	$self->pidl_code("int");
-	$self->pidl_code("$dissectorname(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, dcerpc_info* di _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)");
+	$self->pidl_code("$dissectorname(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_, int hf_index _U_, uint32_t param _U_)");
 	$self->pidl_code("{");
 	$self->indent;
 	$self->pidl_code($_) foreach (@$vars);
@@ -747,7 +748,7 @@ sub Struct($$$$)
 		$self->pidl_code("proto_tree *tree = NULL;");
 	}
 	if (defined($doalign) and $doalign == 0) {
-		$self->pidl_code("gboolean oldalign = di->no_align;");
+		$self->pidl_code("bool oldalign = di->no_align;");
 	}
 	$self->pidl_code("int old_offset;");
 	$self->pidl_code("");
@@ -757,7 +758,7 @@ sub Struct($$$$)
 			$self->pidl_code("ALIGN_TO_$e->{ALIGN}_BYTES;");
 		}
 		if ($doalign == 0) {
-			$self->pidl_code("di->no_align = TRUE;");
+			$self->pidl_code("di->no_align = true;");
 		}
 		$self->pidl_code("");
 	}
@@ -814,7 +815,7 @@ sub Union($$$$)
 	foreach (@{$e->{ELEMENTS}}) {
 		$res.="\n\t\t$_->{CASE}:\n";
 		if ($_->{TYPE} ne "EMPTY") {
-			$res.="\t\t\t".$self->Element($_, $name, $ifname, undef, undef)."\n";
+			$res.="\t\t\t".$self->Element($_, $name, $ifname, undef, ())."\n";
 		}
 		$res.="\t\tbreak;\n";
 	}
@@ -829,7 +830,7 @@ sub Union($$$$)
 
 	$self->pidl_fn_start($dissectorname);
 	$self->pidl_code("static int");
-	$self->pidl_code("$dissectorname(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, dcerpc_info* di _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)");
+	$self->pidl_code("$dissectorname(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_, int hf_index _U_, uint32_t param _U_)");
 	$self->pidl_code("{");
 	$self->indent;
 	$self->pidl_code("proto_item *item = NULL;");
@@ -1009,7 +1010,7 @@ sub ProcessInterface($$)
 	$self->pidl_hdr("#define $define");
 	$self->pidl_hdr("");
 
-	$self->pidl_def("static gint proto_dcerpc_$x->{NAME} = -1;");
+	$self->pidl_def("static int proto_dcerpc_$x->{NAME};");
 	$self->register_ett("ett_dcerpc_$x->{NAME}");
 	$self->register_hf_field("hf_$x->{NAME}_opnum", "Operation", "$x->{NAME}.opnum", "FT_UINT16", "BASE_DEC", "NULL", 0, "");
 
@@ -1034,7 +1035,7 @@ sub ProcessInterface($$)
 
 		my $maj = 0x0000FFFF & $x->{VERSION};
 		$maj =~ s/\.(.*)$//g;
-		$self->pidl_def("static guint16 ver_dcerpc_$x->{NAME} = $maj;");
+		$self->pidl_def("static uint16_t ver_dcerpc_$x->{NAME} = $maj;");
 		$self->pidl_def("");
 	}
 
@@ -1117,16 +1118,10 @@ sub Initialize($$)
 	$self->register_type("NTTIME_hyper", "offset = dissect_ndr_nt_NTTIME(tvb, offset, pinfo, tree, di, drep, \@HF\@);","FT_ABSOLUTE_TIME", "ABSOLUTE_TIME_LOCAL", 0, "NULL", 4);
 	$self->register_type("time_t", "offset = dissect_ndr_time_t(tvb, offset, pinfo,tree, di, drep, \@HF\@, NULL);","FT_ABSOLUTE_TIME", "ABSOLUTE_TIME_LOCAL", 0, "NULL", 4);
 	$self->register_type("NTTIME_1sec", "offset = dissect_ndr_nt_NTTIME(tvb, offset, pinfo, tree, di, drep, \@HF\@);", "FT_ABSOLUTE_TIME", "ABSOLUTE_TIME_LOCAL", 0, "NULL", 4);
-	$self->register_type("dom_sid28", "
-		di->hf_index = \@HF\@;
-
-		offset = dissect_ndr_nt_SID28(tvb, offset, pinfo, tree, di, drep);
-	", "FT_STRING", "BASE_NONE", 0, "NULL", 4);
-	$self->register_type("SID", "
-		di->hf_index = \@HF\@;
-
-		offset = dissect_ndr_nt_SID_with_options(tvb, offset, pinfo, tree, di, drep, param);
-	","FT_STRING", "BASE_NONE", 0, "NULL", 4);
+	$self->register_type("dom_sid28",
+		"offset = dissect_ndr_nt_SID28(tvb, offset, pinfo, tree, di, drep, \@HF\@);", "FT_STRING", "BASE_NONE", 0, "NULL", 4);
+	$self->register_type("SID",
+		"offset = dissect_ndr_nt_SID_with_options(tvb, offset, pinfo, tree, di, drep, param, \@HF\@);","FT_STRING", "BASE_NONE", 0, "NULL", 4);
 	$self->register_type("WERROR",
 		"offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, di, drep, \@HF\@, \@PARAM\@);","FT_UINT32", "BASE_DEC", 0, "VALS(WERR_errors)", 4);
 	$self->register_type("NTSTATUS",
@@ -1224,7 +1219,7 @@ sub register_ett($$)
 sub DumpEttList
 {
 	my ($ett) = @_;
-	my $res = "\tstatic gint *ett[] = {\n";
+	my $res = "\tstatic int *ett[] = {\n";
 	foreach (@$ett) {
 		$res .= "\t\t&$_,\n";
 	}
@@ -1237,7 +1232,7 @@ sub DumpEttDeclaration
 	my ($ett) = @_;
 	my $res = "\n/* Ett declarations */\n";
 	foreach (@$ett) {
-		$res .= "static gint $_ = -1;\n";
+		$res .= "static int $_;\n";
 	}
 
 	return "$res\n";
@@ -1303,7 +1298,7 @@ sub DumpHfDeclaration($)
 
 	foreach (sort(keys %{$self->{conformance}->{header_fields}}))
 	{
-		$res .= "static gint $_ = -1;\n";
+		$res .= "static int $_;\n";
 	}
 
 	return "$res\n";
@@ -1346,7 +1341,7 @@ sub DumpFunctionTable($)
 {
 	my $if = shift;
 
-	my $res = "static dcerpc_sub_dissector $if->{NAME}\_dissectors[] = {\n";
+	my $res = "static const dcerpc_sub_dissector $if->{NAME}\_dissectors[] = {\n";
 	foreach (@{$if->{FUNCTIONS}}) {
 		my $fn_name = $_->{NAME};
 		$fn_name =~ s/^$if->{NAME}_//;
diff --git a/pidl/tests/wireshark-ndr.pl b/pidl/tests/wireshark-ndr.pl
index 229315b0a90..0edb0ec2668 100755
--- a/pidl/tests/wireshark-ndr.pl
+++ b/pidl/tests/wireshark-ndr.pl
@@ -45,7 +45,7 @@ is($x->{res}->{code}, 'void proto_reg_handoff_dcerpc_bla(void)
 is($x->{hf_used}->{hf_bla_opnum}, 1);
 
 $x->{conformance} = {};
-is("hf_bla_idx", 
+is("hf_bla_idx",
 	$x->register_hf_field("hf_bla_idx", "bla", "my.filter", "FT_UINT32", "BASE_HEX", "NULL", 0xF, undef));
 is_deeply($x->{conformance}, {
 		header_fields => {
@@ -68,7 +68,7 @@ $x->{conformance} = { fielddescription => { hf_bla_idx => { DESCRIPTION => "Some
 is("hf_bla_idx",
 	$x->register_hf_field("hf_bla_idx", "bla", "my.filter", "FT_UINT32", "BASE_HEX", "NULL", 0xF, undef));
 is_deeply($x->{conformance}, {
-		fielddescription => { 
+		fielddescription => {
 			hf_bla_idx => {
 				DESCRIPTION => "Some Description",
 				USED => 1
@@ -91,10 +91,10 @@ is_deeply($x->{conformance}, {
 
 $x->{conformance} = { fielddescription => { hf_bla_idx => { DESCRIPTION => "Some Description" }}};
 is("hf_bla_idx",
-	$x->register_hf_field("hf_bla_idx", "bla", "my.filter", "FT_UINT32", "BASE_HEX", "NULL", 0xF, 
+	$x->register_hf_field("hf_bla_idx", "bla", "my.filter", "FT_UINT32", "BASE_HEX", "NULL", 0xF,
 		"Actual Description"));
 is_deeply($x->{conformance}, {
-		fielddescription => { 
+		fielddescription => {
 			hf_bla_idx => { DESCRIPTION => "Some Description" }
 		},
 		header_fields => {
@@ -120,14 +120,14 @@ is_deeply($x->{conformance}, {
 		hf_renames => { hf_bla_idx => { USED => 1, NEWNAME => "hf_bloe_idx" } } });
 
 $x->{hf_used} = { hf_bla => 1 };
-test_warnings("", sub { 
+test_warnings("", sub {
 		$x->CheckUsed({ header_fields => { foo => { INDEX => "hf_bla" }}})});
 
 $x->{hf_used} = { };
-test_warnings("hf field `hf_bla' not used\n", sub { 
+test_warnings("hf field `hf_bla' not used\n", sub {
 		$x->CheckUsed({ header_fields => { foo => { INDEX => "hf_bla" }}})});
 
-test_warnings("hf field `hf_id' not used\n", 
+test_warnings("hf field `hf_id' not used\n",
 	sub { $x->CheckUsed({
 	hf_renames => {
 		hf_id => {
@@ -171,7 +171,7 @@ test_warnings("nofile:1: type never used\n",
 	types => {
 		bla => {
 			USED => 0,
-			POS => { FILE => "nofile", LINE => 1 } 
+			POS => { FILE => "nofile", LINE => 1 }
 		}
 	}
 }); } );
@@ -191,39 +191,39 @@ is($x->{res}->{hdr}, "#include \"packet-dcerpc-bla.h\"\n\n");
 
 $x = new Parse::Pidl::Wireshark::NDR();
 $x->ProcessImport("\"bla.idl\"", "\"foo.idl\"");
-is($x->{res}->{hdr}, "#include \"packet-dcerpc-bla.h\"\n" . 
+is($x->{res}->{hdr}, "#include \"packet-dcerpc-bla.h\"\n" .
               "#include \"packet-dcerpc-foo.h\"\n\n");
 
 $x = new Parse::Pidl::Wireshark::NDR();
 $x->ProcessInclude("foo.h", "bla.h", "bar.h");
-is($x->{res}->{hdr}, "#include \"foo.h\"\n" . 
-	          "#include \"bla.h\"\n" . 
+is($x->{res}->{hdr}, "#include \"foo.h\"\n" .
+	          "#include \"bla.h\"\n" .
 			  "#include \"bar.h\"\n\n");
-	
+
 $x->{conformance} = {types => { bla => "brainslug" } };
 is("brainslug", $x->find_type("bla"));
 
-is(DumpEttList(["ett_t1", "ett_bla"]), 
-	"\tstatic gint *ett[] = {\n" . 
+is(DumpEttList(["ett_t1", "ett_bla"]),
+	"\tstatic int *ett[] = {\n" .
 	"\t\t&ett_t1,\n" .
 	"\t\t&ett_bla,\n" .
 	"\t};\n");
 
-is(DumpEttList(), "\tstatic gint *ett[] = {\n\t};\n");
-is(DumpEttList(["bla"]), "\tstatic gint *ett[] = {\n\t\t&bla,\n\t};\n");
+is(DumpEttList(), "\tstatic int *ett[] = {\n\t};\n");
+is(DumpEttList(["bla"]), "\tstatic int *ett[] = {\n\t\t&bla,\n\t};\n");
 
-is(DumpEttDeclaration(["void", "zoid"]), 
-	"\n/* Ett declarations */\n" . 
-	"static gint void = -1;\n" .
-	"static gint zoid = -1;\n" .
+is(DumpEttDeclaration(["void", "zoid"]),
+	"\n/* Ett declarations */\n" .
+	"static int void;\n" .
+	"static int zoid;\n" .
 	"\n");
 
 is(DumpEttDeclaration(), "\n/* Ett declarations */\n\n");
 
 $x->{conformance} = {
 	header_fields => {
-		hf_bla => { INDEX => "hf_bla", NAME => "Bla", FILTER => "bla.field", FT_TYPE => "FT_UINT32", BASE_TYPE => "BASE_DEC", VALSSTRING => "NULL", MASK => 0xFF, BLURB => "NULL" } 
-	} 
+		hf_bla => { INDEX => "hf_bla", NAME => "Bla", FILTER => "bla.field", FT_TYPE => "FT_UINT32", BASE_TYPE => "BASE_DEC", VALSSTRING => "NULL", MASK => 0xFF, BLURB => "NULL" }
+	}
 };
 
 is($x->DumpHfList(), "\tstatic hf_register_info hf[] = {
@@ -234,14 +234,14 @@ is($x->DumpHfList(), "\tstatic hf_register_info hf[] = {
 
 is($x->DumpHfDeclaration(), "
 /* Header field declarations */
-static gint hf_bla = -1;
+static int hf_bla;
 
 ");
 
 is(DumpFunctionTable({
 			NAME => "someif",
 			FUNCTIONS => [ { NAME => "fn1", OPNUM => 3 }, { NAME => "someif_fn2", OPNUM => 2 } ] }),
-'static dcerpc_sub_dissector someif_dissectors[] = {
+'static const dcerpc_sub_dissector someif_dissectors[] = {
 	{ 3, "fn1",
 	   someif_dissect_fn1_request, someif_dissect_fn1_response},
 	{ 2, "fn2",


-- 
Samba Shared Repository



More information about the samba-cvs mailing list