svn commit: samba r20251 - in branches/SAMBA_4_0/source: libnet librpc/idl torture/rpc

metze at samba.org metze at samba.org
Tue Dec 19 13:38:43 GMT 2006


Author: metze
Date: 2006-12-19 13:38:42 +0000 (Tue, 19 Dec 2006)
New Revision: 20251

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=20251

Log:
I found out that the oid-prefix to uint32-id-prefix mapping is transferred
in replication replies, but I don't know the exact encoding.

for example the oids are transferred as:

2.5.4			=> uint8_t v[] = { 0x55, 0x04 };
2.5.5			=> uint8_t v[] = { 0x55, 0x05 };
2.5.6			=> uint8_t v[] = { 0x55, 0x06 };
2.5.18			=> uint8_t v[] = { 0x55, 0x12 };
2.5.20			=> uint8_t v[] = { 0x55, 0x14 };
2.5.21			=> uint8_t v[] = { 0x55, 0x15 };
1.2.840.113556.1.2	=> uint8_t v[] = { 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x14, 0x01, 0x02 };
1.2.840.113556.1.3	=> uint8_t v[] = { 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x14, 0x01, 0x03 };
1.2.840.113556.1.4	=> uint8_t v[] = { 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x14, 0x01, 0x04 };
1.2.840.113556.1.5	=> uint8_t v[] = { 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x14, 0x01, 0x05 };
1.2.840.113556.1.5.7000	=> uint8_t v[] = { 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x14, 0x01, 0x05, 0xb6, 0x58 };
1.2.840.113549.1.9	=> uint8_t v[] = { 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09 };
2.16.840.1.113730.3	=> uint8_t v[] = { 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x03 };
2.16.840.1.113730.3.1	=> uint8_t v[] = { 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x03, 0x01 };
2.16.840.1.113730.3.2	=> uint8_t v[] = { 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x03, 0x02 };
0.9.2342.19200300.100.1	=> uint8_t v[] = { 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01 };
0.9.2342.19200300.100.4	=> uint8_t v[] = { 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x04 };
1.3.6.1.4.1.250.1	=> uint8_t v[] = { 0x2b, 0x06, 0x01, 0x04, 0x01, 0x81, 0x7a, 0x01 };
1.3.6.1.4.1.1466.101.119=> uint8_t v[] = { 0x2b, 0x06, 0x01, 0x04, 0x01, 0x8b, 0x3a, 0x65, 0x77 };

if someone knows how the encoding works, please tell me:-)
I assume some ASN.1 encoding...

metze
Modified:
   branches/SAMBA_4_0/source/libnet/libnet_become_dc.c
   branches/SAMBA_4_0/source/librpc/idl/drsuapi.idl
   branches/SAMBA_4_0/source/torture/rpc/drsuapi.c
   branches/SAMBA_4_0/source/torture/rpc/dssync.c


Changeset:
Modified: branches/SAMBA_4_0/source/libnet/libnet_become_dc.c
===================================================================
--- branches/SAMBA_4_0/source/libnet/libnet_become_dc.c	2006-12-19 00:48:39 UTC (rev 20250)
+++ branches/SAMBA_4_0/source/libnet/libnet_become_dc.c	2006-12-19 13:38:42 UTC (rev 20251)
@@ -1589,8 +1589,8 @@
 		r->in.req.req8.h1			= 0;
 		r->in.req.req8.unique_ptr1		= 0;
 		r->in.req.req8.unique_ptr2		= 0;
-		r->in.req.req8.ctr12.count		= 0;
-		r->in.req.req8.ctr12.array		= NULL;
+		r->in.req.req8.mapping_ctr.num_mappings	= 0;
+		r->in.req.req8.mapping_ctr.mappings	= NULL;
 	} else {
 		r->in.level				= 5;
 		r->in.req.req5.destination_dsa_guid	= partition->destination_dsa_guid;

Modified: branches/SAMBA_4_0/source/librpc/idl/drsuapi.idl
===================================================================
--- branches/SAMBA_4_0/source/librpc/idl/drsuapi.idl	2006-12-19 00:48:39 UTC (rev 20250)
+++ branches/SAMBA_4_0/source/librpc/idl/drsuapi.idl	2006-12-19 13:38:42 UTC (rev 20251)
@@ -241,61 +241,9 @@
 		hyper h1;
 	} drsuapi_DsGetNCChangesRequest5;
 
-	typedef [flag(NDR_PAHEX)] struct {
-		[range(0,10000)] uint32 length;
-		[size_is(length)] uint8 *byte_array;
-	} drsuapi_DsGetNCChangesRequest_Ctr14;
-
-	typedef struct {
-		uint32 unknown1;
-		drsuapi_DsGetNCChangesRequest_Ctr14 data;
-	} drsuapi_DsGetNCChangesRequest_Ctr13;
-
-	typedef struct {
-		[range(0,0x100000)] uint32 count;
-		[size_is(count)] drsuapi_DsGetNCChangesRequest_Ctr13 *array;
-	} drsuapi_DsGetNCChangesRequest_Ctr12;
-
-	typedef struct {
-		GUID destination_dsa_guid;
-		GUID source_dsa_invocation_id; /* the 'invocationId' field of the CN=NTDS Settings object */
-		[ref] drsuapi_DsReplicaObjectIdentifier *naming_context;
-		drsuapi_DsReplicaHighWaterMark highwatermark;
-		drsuapi_DsReplicaCoursorCtrEx *uptodateness_vector;
-		drsuapi_DsReplicaNeighbourFlags replica_flags;
-		uint32 max_object_count; /* w2k3 uses min(133,max(100,max_object_count)) */
-		uint32 max_ndr_size; /* w2k3 seems to ignore this */
-		uint32 unknown4;
-		hyper h1;
-		uint32 unique_ptr1;
-		uint32 unique_ptr2;
-		drsuapi_DsGetNCChangesRequest_Ctr12 ctr12;
-	} drsuapi_DsGetNCChangesRequest8;
-
-	typedef [switch_type(int32)] union {
-		[case(5)] drsuapi_DsGetNCChangesRequest5 req5;
-		[case(8)] drsuapi_DsGetNCChangesRequest8 req8;
-	} drsuapi_DsGetNCChangesRequest;
-
-	typedef [public] struct {
-		GUID source_dsa_invocation_id; /* the 'invocationId' field of the CN=NTDS Settings object */
-		hyper highest_usn;  /* updated after a full replication cycle */
-		NTTIME last_sync_success;
-	} drsuapi_DsReplicaCoursor2;
-
-	typedef struct {
-		uint32 u1;
-		uint32 u2;
-		[range(0,0x100000)] uint32 count;
-		uint32 u3;
-		[size_is(count)] drsuapi_DsReplicaCoursor2 coursors[];
-	} drsuapi_DsReplicaCoursor2CtrEx;
-
 	/*
-	 * In DRSUAPI the objectClasses and attributes
-	 * are identified by uint32 values, but in the schema
-	 * they are identified by the governsID (objectClasses)
-	 * and attributeID (attributes)
+	 * In DRSUAPI all attributes with syntax 2.5.5.2
+	 * are identified by uint32 values
 	 *
 	 * the following table shows the mapping used between the two representations
 	 * e.g. - objectClass 'nTDSDSA' has governsID: 1.2.840.113556.1.5.7000.47
@@ -306,6 +254,9 @@
 	 *      - the mapping table gives a UINT32-prefix: 0x00170000
 	 *      - and the UINT32-ID is 0x0017002F = 0x00170000 | 0x2F
 	 *
+	 * This prefix mapping table is replied in the drsuapi_DsReplicaOIDMapping_Ctr
+	 * array. The following are the default mappings of w2k3
+	 *
 	 * OID-prefix			=> UINT32-Id prefix
 	 *
 	 * 2.5.4.*			=> 0x00000000 (standard attributes RFC2256 core.schema)
@@ -334,7 +285,10 @@
 	 *		   struct drsuapi_DsObjectIdentifier3
 	 *
 	 * 2.5.5.2	=> OID-string
-	 *		=> mayContain, mustContain... also have this syntax but have string values
+	 *		=> all values are represented as uint32 values in drsuapi
+	 *		=> governsID, attributeID and attributeSyntax returned as OID-Strings in LDAP
+	 *		=> mayContain, mustContain and all other attributes with 2.5.5.2 syntax
+	 *		   are returned as attribute names
 	 *
 	 * 2.5.5.4	=> String(Teletex) case-insensitive string with teletex charset
 	 *
@@ -371,7 +325,21 @@
 	 *
 	 * 2.5.5.17	=> dom_sid
 	 */
+	typedef [flag(NDR_PAHEX)] struct {
+		[range(0,10000)] uint32 length;
+		[size_is(length)] uint8 *data;
+	} drsuapi_DsReplicaOID;
 
+	typedef struct {
+		uint32 id_prefix;
+		drsuapi_DsReplicaOID oid;
+	} drsuapi_DsReplicaOIDMapping;
+
+	typedef struct {
+		[range(0,0x100000)] uint32 num_mappings;
+		[size_is(num_mappings)] drsuapi_DsReplicaOIDMapping *mappings;
+	} drsuapi_DsReplicaOIDMapping_Ctr;
+
 	typedef [flag(NDR_PAHEX),v1_enum] enum {
 		DRSUAPI_OBJECTCLASS_top			= 0x00010000,
 		DRSUAPI_OBJECTCLASS_classSchema		= 0x0003000d,
@@ -430,6 +398,41 @@
 		DRSUAPI_ATTRIBUTE_msDS_hasMasterNCs		= 0x0009072c
 	} drsuapi_DsAttributeId;
 
+	typedef struct {
+		GUID destination_dsa_guid;
+		GUID source_dsa_invocation_id; /* the 'invocationId' field of the CN=NTDS Settings object */
+		[ref] drsuapi_DsReplicaObjectIdentifier *naming_context;
+		drsuapi_DsReplicaHighWaterMark highwatermark;
+		drsuapi_DsReplicaCoursorCtrEx *uptodateness_vector;
+		drsuapi_DsReplicaNeighbourFlags replica_flags;
+		uint32 max_object_count; /* w2k3 uses min(133,max(100,max_object_count)) */
+		uint32 max_ndr_size; /* w2k3 seems to ignore this */
+		uint32 unknown4;
+		hyper h1;
+		uint32 unique_ptr1;
+		uint32 unique_ptr2;
+		drsuapi_DsReplicaOIDMapping_Ctr mapping_ctr;
+	} drsuapi_DsGetNCChangesRequest8;
+
+	typedef [switch_type(int32)] union {
+		[case(5)] drsuapi_DsGetNCChangesRequest5 req5;
+		[case(8)] drsuapi_DsGetNCChangesRequest8 req8;
+	} drsuapi_DsGetNCChangesRequest;
+
+	typedef [public] struct {
+		GUID source_dsa_invocation_id; /* the 'invocationId' field of the CN=NTDS Settings object */
+		hyper highest_usn;  /* updated after a full replication cycle */
+		NTTIME last_sync_success;
+	} drsuapi_DsReplicaCoursor2;
+
+	typedef struct {
+		uint32 u1;
+		uint32 u2;
+		[range(0,0x100000)] uint32 count;
+		uint32 u3;
+		[size_is(count)] drsuapi_DsReplicaCoursor2 coursors[];
+	} drsuapi_DsReplicaCoursor2CtrEx;
+
 	/* Generic DATA_BLOB values */
 	typedef struct {
 		[range(0,10485760)] uint32 length;
@@ -639,7 +642,7 @@
 		drsuapi_DsReplicaHighWaterMark old_highwatermark;
 		drsuapi_DsReplicaHighWaterMark new_highwatermark;
 		drsuapi_DsReplicaCoursorCtrEx *uptodateness_vector;
-		drsuapi_DsGetNCChangesRequest_Ctr12 ctr12;
+		drsuapi_DsReplicaOIDMapping_Ctr mapping_ctr;
 		uint32 total_object_count;
 		uint32 object_count;
 		/* this +55 is sometimes +56, so I don't know where this comes from... --metze */
@@ -667,7 +670,7 @@
 		drsuapi_DsReplicaHighWaterMark old_highwatermark;
 		drsuapi_DsReplicaHighWaterMark new_highwatermark;
 		drsuapi_DsReplicaCoursor2CtrEx *uptodateness_vector;
-		drsuapi_DsGetNCChangesRequest_Ctr12 ctr12;
+		drsuapi_DsReplicaOIDMapping_Ctr mapping_ctr;
 		uint32 total_object_count;
 		uint32 object_count;
 		/* this +55 is sometimes +56, so I don't know where this comes from... --metze */

Modified: branches/SAMBA_4_0/source/torture/rpc/drsuapi.c
===================================================================
--- branches/SAMBA_4_0/source/torture/rpc/drsuapi.c	2006-12-19 00:48:39 UTC (rev 20250)
+++ branches/SAMBA_4_0/source/torture/rpc/drsuapi.c	2006-12-19 13:38:42 UTC (rev 20251)
@@ -599,8 +599,8 @@
 			r.in.req.req8.h1				= 0;
 			r.in.req.req8.unique_ptr1			= 0;
 			r.in.req.req8.unique_ptr2			= 0;
-			r.in.req.req8.ctr12.count			= 0;
-			r.in.req.req8.ctr12.array			= NULL;
+			r.in.req.req8.mapping_ctr.num_mappings		= 0;
+			r.in.req.req8.mapping_ctr.mappings		= NULL;
 
 			break;
 		}

Modified: branches/SAMBA_4_0/source/torture/rpc/dssync.c
===================================================================
--- branches/SAMBA_4_0/source/torture/rpc/dssync.c	2006-12-19 00:48:39 UTC (rev 20250)
+++ branches/SAMBA_4_0/source/torture/rpc/dssync.c	2006-12-19 13:38:42 UTC (rev 20251)
@@ -477,8 +477,8 @@
 			r.in.req.req8.h1				= 0;
 			r.in.req.req8.unique_ptr1			= 0;
 			r.in.req.req8.unique_ptr2			= 0;
-			r.in.req.req8.ctr12.count			= 0;
-			r.in.req.req8.ctr12.array			= NULL;
+			r.in.req.req8.mapping_ctr.num_mappings		= 0;
+			r.in.req.req8.mapping_ctr.mappings		= NULL;
 
 			break;
 		}



More information about the samba-cvs mailing list