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

jelmer at samba.org jelmer at samba.org
Sun Oct 31 01:21:16 GMT 2004


Author: jelmer
Date: 2004-10-31 01:21:14 +0000 (Sun, 31 Oct 2004)
New Revision: 3397

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

Log:
Fix IDL for ComplexPing and SimplePing, including tests

Modified:
   branches/SAMBA_4_0/source/librpc/idl/oxidresolver.idl
   branches/SAMBA_4_0/source/torture/rpc/oxidresolve.c


Changeset:
Modified: branches/SAMBA_4_0/source/librpc/idl/oxidresolver.idl
===================================================================
--- branches/SAMBA_4_0/source/librpc/idl/oxidresolver.idl	2004-10-30 23:35:34 UTC (rev 3396)
+++ branches/SAMBA_4_0/source/librpc/idl/oxidresolver.idl	2004-10-31 01:21:14 UTC (rev 3397)
@@ -54,7 +54,7 @@
 	/* whole set can subsequently be pinged using SimplePing, */
 	/* thus reducing network traffic. */
 	[idempotent] WERROR ComplexPing (
-		[in, out] SETID *pSetId, /* In of 0 on first call for new set. */
+		[in, out, ref] SETID *SetId, /* In of 0 on first call for new set. */
 		 [in] uint16 SequenceNum,
 		 [in] uint16 cAddToSet,
 		 [in] uint16 cDelFromSet,
@@ -62,7 +62,7 @@
 		 [in, size_is(cAddToSet)] OID AddToSet[],
 		/*remove these OIDs from the set */
 		 [in, size_is(cDelFromSet)] OID DelFromSet[],
-		[out] uint16 *pPingBackoffFactor/* 2^factor = multipler */
+		[out] uint16 pPingBackoffFactor/* 2^factor = multipler */
 			 );
 
 	/* In some cases the client maybe unsure that a particular */
@@ -75,7 +75,8 @@
 	/* Method to get the protocol sequences, string bindings, */
 	/* RemoteUnknown IPID and COM version for an object server */
 	/* given its OXID. Supported by DCOM */
-	/* version 5.2 and above. */
+	/* version 5.2 and above. Looks like that means 
+	 * Windows 2003/XP and above */
 	[idempotent] WERROR ResolveOxid2 (
 											  [in] OXID *pOxid,
 											  [in] uint16 cRequestedProtseqs,

Modified: branches/SAMBA_4_0/source/torture/rpc/oxidresolve.c
===================================================================
--- branches/SAMBA_4_0/source/torture/rpc/oxidresolve.c	2004-10-30 23:35:34 UTC (rev 3396)
+++ branches/SAMBA_4_0/source/torture/rpc/oxidresolve.c	2004-10-31 01:21:14 UTC (rev 3397)
@@ -21,13 +21,12 @@
 
 #include "includes.h"
 
-static int test_SimplePing(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
+static int test_SimplePing(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, HYPER_T setid)
 {
 	struct SimplePing r;
 	NTSTATUS status;
-	HYPER_T h = 10;
 
-	r.in.SetId = &h;
+	r.in.SetId = &setid;
 
 	status = dcerpc_SimplePing(p, mem_ctx, &r);
 	if(NT_STATUS_IS_ERR(status)) {
@@ -43,6 +42,34 @@
 	return 1;
 }
 
+static int test_ComplexPing(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, HYPER_T *setid)
+{
+	struct ComplexPing r;
+	NTSTATUS status;
+
+	*setid = 0;
+	ZERO_STRUCT(r.in);
+
+	r.in.SequenceNum = 0;
+	r.in.SetId = setid;
+	r.out.SetId = setid;
+
+	status = dcerpc_ComplexPing(p, mem_ctx, &r);
+	if(NT_STATUS_IS_ERR(status)) {
+		fprintf(stderr, "ComplexPing: %s\n", nt_errstr(status));
+		return 0;
+	}
+
+	if(!W_ERROR_IS_OK(r.out.result)) {
+		fprintf(stderr, "ComplexPing: %s\n", win_errstr(r.out.result));
+		return 0;
+	}
+
+	
+
+	return 1;
+}
+
 static int test_ServerAlive(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
 {
 	struct ServerAlive r;
@@ -88,6 +115,7 @@
        struct dcerpc_pipe *p;
 	TALLOC_CTX *mem_ctx;
 	BOOL ret = True;
+	HYPER_T setid;
 
 	mem_ctx = talloc_init("torture_rpc_oxidresolve");
 
@@ -100,12 +128,15 @@
 		return False;
 	}
 
-	if(!test_SimplePing(p, mem_ctx))
+	if(!test_ServerAlive(p, mem_ctx))
 		ret = False;
 
-	if(!test_ServerAlive(p, mem_ctx))
+	if(!test_ComplexPing(p, mem_ctx, &setid))
 		ret = False;
 
+	if(!test_SimplePing(p, mem_ctx, setid))
+		ret = False;
+
 	if(!test_ServerAlive2(p, mem_ctx))
 		ret = False;
 



More information about the samba-cvs mailing list