svn commit: samba r2968 - in branches/SAMBA_4_0/source: build/pidl librpc/idl librpc/ndr

tridge at samba.org tridge at samba.org
Thu Oct 14 09:07:42 GMT 2004


Author: tridge
Date: 2004-10-14 09:07:41 +0000 (Thu, 14 Oct 2004)
New Revision: 2968

WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source&rev=2968&nolog=1

Log:
fixed the byte order problem with the new RHS parsing on ncacn_ip_tcp

Modified:
   branches/SAMBA_4_0/source/build/pidl/parser.pm
   branches/SAMBA_4_0/source/librpc/idl/epmapper.idl
   branches/SAMBA_4_0/source/librpc/idl/idl_types.h
   branches/SAMBA_4_0/source/librpc/ndr/ndr.c


Changeset:
Modified: branches/SAMBA_4_0/source/build/pidl/parser.pm
===================================================================
--- branches/SAMBA_4_0/source/build/pidl/parser.pm	2004-10-14 07:33:49 UTC (rev 2967)
+++ branches/SAMBA_4_0/source/build/pidl/parser.pm	2004-10-14 09:07:41 UTC (rev 2968)
@@ -135,7 +135,7 @@
 	my $flags = util::has_property($e, "flag");
 	if (defined $flags) {
 		pidl "\t{ uint32_t _flags_save_$e->{TYPE} = ndr->flags;\n";
-		pidl "\tndr->flags |= $flags;\n";
+		pidl "\tndr_set_flags(&ndr->flags, $flags);\n";
 	}
 }
 

Modified: branches/SAMBA_4_0/source/librpc/idl/epmapper.idl
===================================================================
--- branches/SAMBA_4_0/source/librpc/idl/epmapper.idl	2004-10-14 07:33:49 UTC (rev 2967)
+++ branches/SAMBA_4_0/source/librpc/idl/epmapper.idl	2004-10-14 09:07:41 UTC (rev 2968)
@@ -149,7 +149,7 @@
 	typedef struct {
 	} epm_rhs_ncalrpc;
 
-	typedef [nodiscriminant] union {
+	typedef [flag(NDR_BIG_ENDIAN),nodiscriminant] union {
 		[case(EPM_PROTOCOL_DNET_NSP)] epm_rhs_dnet_nsp dnet_nsp;
 		[case(EPM_PROTOCOL_OSI_TP4)] epm_rhs_osi_tp4 osi_tp4;
 		[case(EPM_PROTOCOL_OSI_CLNS)] epm_rhs_osi_clns osi_clns;

Modified: branches/SAMBA_4_0/source/librpc/idl/idl_types.h
===================================================================
--- branches/SAMBA_4_0/source/librpc/idl/idl_types.h	2004-10-14 07:33:49 UTC (rev 2967)
+++ branches/SAMBA_4_0/source/librpc/idl/idl_types.h	2004-10-14 09:07:41 UTC (rev 2968)
@@ -66,6 +66,7 @@
 /* this flag is used to force a section of IDL as little endian. It is
    needed for the epmapper IDL, which is defined as always being LE */
 #define NDR_LITTLE_ENDIAN LIBNDR_FLAG_LITTLE_ENDIAN
+#define NDR_BIG_ENDIAN LIBNDR_FLAG_BIGENDIAN
 
 
 /*

Modified: branches/SAMBA_4_0/source/librpc/ndr/ndr.c
===================================================================
--- branches/SAMBA_4_0/source/librpc/ndr/ndr.c	2004-10-14 07:33:49 UTC (rev 2967)
+++ branches/SAMBA_4_0/source/librpc/ndr/ndr.c	2004-10-14 09:07:41 UTC (rev 2968)
@@ -350,6 +350,17 @@
 	talloc_free(ndr);
 }
 
+void ndr_set_flags(uint32_t *pflags, uint32_t new_flags)
+{
+	/* the big/little endian flags are inter-dependent */
+	if (new_flags & LIBNDR_FLAG_LITTLE_ENDIAN) {
+		(*pflags) &= ~LIBNDR_FLAG_BIGENDIAN;
+	}
+	if (new_flags & LIBNDR_FLAG_BIGENDIAN) {
+		(*pflags) &= ~LIBNDR_FLAG_LITTLE_ENDIAN;
+	}
+	(*pflags) |= new_flags;
+}
 
 static NTSTATUS ndr_map_error(enum ndr_err_code err)
 {



More information about the samba-cvs mailing list