svn commit: samba r23245 - in branches/SAMBA_3_0_26/source: . include rpc_server

jerry at samba.org jerry at samba.org
Wed May 30 19:53:14 GMT 2007


Author: jerry
Date: 2007-05-30 19:53:11 +0000 (Wed, 30 May 2007)
New Revision: 23245

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

Log:
convert the echo_AddOne() rpc call to use the generated stub
Modified:
   branches/SAMBA_3_0_26/source/Makefile.in
   branches/SAMBA_3_0_26/source/include/includes.h
   branches/SAMBA_3_0_26/source/include/rpc_client.h
   branches/SAMBA_3_0_26/source/include/smb.h
   branches/SAMBA_3_0_26/source/rpc_server/srv_echo.c
   branches/SAMBA_3_0_26/source/rpc_server/srv_echo_nt.c


Changeset:
Modified: branches/SAMBA_3_0_26/source/Makefile.in
===================================================================
--- branches/SAMBA_3_0_26/source/Makefile.in	2007-05-30 19:47:35 UTC (rev 23244)
+++ branches/SAMBA_3_0_26/source/Makefile.in	2007-05-30 19:53:11 UTC (rev 23245)
@@ -230,7 +230,7 @@
 RPCCLIENT_NDR_OBJ = rpc_client/ndr.o
 
 LIBNDR_GEN_OBJ = librpc/gen_ndr/ndr_wkssvc.o librpc/gen_ndr/ndr_notify.o \
-		 librpc/gen_ndr/ndr_lsa.o
+		 librpc/gen_ndr/ndr_lsa.o librpc/gen_ndr/ndr_echo.o
 
 RPC_PARSE_OBJ0 = rpc_parse/parse_prs.o rpc_parse/parse_misc.o
 
@@ -334,6 +334,7 @@
 	       rpc_client/cli_shutdown.o rpc_client/cli_dfs.o rpc_client/cli_echo.o
 
 LIBMSRPC_GEN_OBJ = librpc/gen_ndr/cli_wkssvc.o librpc/gen_ndr/cli_lsa.o \
+		   librpc/gen_ndr/cli_echo.o \
 		   $(LIBNDR_GEN_OBJ) $(RPCCLIENT_NDR_OBJ)
 
 REGOBJS_OBJ = registry/reg_objects.o
@@ -375,7 +376,7 @@
 RPC_PIPE_OBJ = rpc_server/srv_pipe_hnd.o \
                rpc_server/srv_pipe.o rpc_server/srv_lsa_hnd.o
 
-RPC_ECHO_OBJ = rpc_server/srv_echo.o rpc_server/srv_echo_nt.o
+RPC_ECHO_OBJ = rpc_server/srv_echo.o rpc_server/srv_echo_nt.o librpc/gen_ndr/srv_echo.o
 
 RPC_SERVER_OBJ = @RPC_STATIC@ $(RPC_PIPE_OBJ)
 

Modified: branches/SAMBA_3_0_26/source/include/includes.h
===================================================================
--- branches/SAMBA_3_0_26/source/include/includes.h	2007-05-30 19:47:35 UTC (rev 23244)
+++ branches/SAMBA_3_0_26/source/include/includes.h	2007-05-30 19:53:11 UTC (rev 23245)
@@ -692,6 +692,7 @@
 #include "rpc_shutdown.h"
 #include "rpc_perfcount.h"
 #include "rpc_perfcount_defs.h"
+#include "librpc/gen_ndr/echo.h"
 #include "librpc/gen_ndr/notify.h"
 #include "nt_printing.h"
 #include "idmap.h"

Modified: branches/SAMBA_3_0_26/source/include/rpc_client.h
===================================================================
--- branches/SAMBA_3_0_26/source/include/rpc_client.h	2007-05-30 19:47:35 UTC (rev 23244)
+++ branches/SAMBA_3_0_26/source/include/rpc_client.h	2007-05-30 19:53:11 UTC (rev 23245)
@@ -23,6 +23,7 @@
 
 /* autogenerated client stubs */
 
+#include "librpc/gen_ndr/cli_echo.h"
 #include "librpc/gen_ndr/cli_lsa.h"
 #include "librpc/gen_ndr/cli_wkssvc.h"
 

Modified: branches/SAMBA_3_0_26/source/include/smb.h
===================================================================
--- branches/SAMBA_3_0_26/source/include/smb.h	2007-05-30 19:47:35 UTC (rev 23244)
+++ branches/SAMBA_3_0_26/source/include/smb.h	2007-05-30 19:53:11 UTC (rev 23245)
@@ -201,6 +201,7 @@
 #define PI_WINREG		6
 #define PI_SPOOLSS		7
 #define PI_NETDFS		8
+#define PI_RPCECHO 		9
 #define PI_ECHO 		9
 #define PI_SHUTDOWN		10
 #define PI_SVCCTL		11

Modified: branches/SAMBA_3_0_26/source/rpc_server/srv_echo.c
===================================================================
--- branches/SAMBA_3_0_26/source/rpc_server/srv_echo.c	2007-05-30 19:47:35 UTC (rev 23244)
+++ branches/SAMBA_3_0_26/source/rpc_server/srv_echo.c	2007-05-30 19:53:11 UTC (rev 23245)
@@ -28,28 +28,28 @@
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_RPC_SRV
 
-static BOOL api_add_one(pipes_struct *p)
+static BOOL proxy_echo_call(pipes_struct *p, uint8 opnum)
 {
-	ECHO_Q_ADD_ONE q_u;
-	ECHO_R_ADD_ONE r_u;
+	struct api_struct *fns;
+	int n_fns;
 
-	prs_struct *data = &p->in_data.data;
-	prs_struct *rdata = &p->out_data.rdata;
+	rpcecho_get_pipe_fns(&fns, &n_fns);
 
-	ZERO_STRUCT(q_u);
-	ZERO_STRUCT(r_u);
-	
-	if(!echo_io_q_add_one("", &q_u, data, 0))
+	if (opnum >= n_fns)
 		return False;
-	
-	_echo_add_one(p, &q_u, &r_u);
-	
-	if(!echo_io_r_add_one("", &r_u, rdata, 0))
-		return False;
 
-	return True;
+	if (fns[opnum].opnum != opnum) {
+		smb_panic("ECHO function table not sorted\n");
+	}
+
+	return fns[opnum].fn(p);
 }
 
+static BOOL api_add_one(pipes_struct *p)
+{
+	return proxy_echo_call( p, DCERPC_ECHO_ADDONE );
+}
+
 static BOOL api_echo_data(pipes_struct *p)
 {
 	ECHO_Q_ECHO_DATA q_u;

Modified: branches/SAMBA_3_0_26/source/rpc_server/srv_echo_nt.c
===================================================================
--- branches/SAMBA_3_0_26/source/rpc_server/srv_echo_nt.c	2007-05-30 19:47:35 UTC (rev 23244)
+++ branches/SAMBA_3_0_26/source/rpc_server/srv_echo_nt.c	2007-05-30 19:53:11 UTC (rev 23245)
@@ -30,11 +30,11 @@
 
 /* Add one to the input and return it */
 
-void _echo_add_one(pipes_struct *p, ECHO_Q_ADD_ONE *q_u, ECHO_R_ADD_ONE *r_u)
+void _echo_AddOne(pipes_struct *p, struct echo_AddOne *r )
 {
 	DEBUG(10, ("_echo_add_one\n"));
 
-	r_u->response = q_u->request + 1;
+	*r->out.out_data = r->in.in_data + 1;	
 }
 
 /* Echo back an array of data */
@@ -85,4 +85,58 @@
 		r_u->data[i] = i & 0xff;
 }
 
+void _echo_EchoData(pipes_struct *p, struct echo_EchoData *r)
+{
+	p->rng_fault_state = True;
+	return;
+}
+
+void _echo_SinkData(pipes_struct *p, struct echo_SinkData *r)
+{
+	p->rng_fault_state = True;
+	return;
+}
+
+void _echo_SourceData(pipes_struct *p, struct echo_SourceData *r)
+{
+	p->rng_fault_state = True;
+	return;
+}
+
+void _echo_TestCall(pipes_struct *p, struct echo_TestCall *r)
+{
+	p->rng_fault_state = True;
+	return;
+}
+
+NTSTATUS _echo_TestCall2(pipes_struct *p, struct echo_TestCall2 *r)
+{
+	p->rng_fault_state = True;
+	return NT_STATUS_OK;
+}
+
+uint32 _echo_TestSleep(pipes_struct *p, struct echo_TestSleep *r)
+{
+	p->rng_fault_state = True;
+	return 0;
+}
+
+void _echo_TestEnum(pipes_struct *p, struct echo_TestEnum *r)
+{
+	p->rng_fault_state = True;
+	return;
+}
+
+void _echo_TestSurrounding(pipes_struct *p, struct echo_TestSurrounding *r)
+{
+	p->rng_fault_state = True;
+	return;
+}
+
+uint16 _echo_TestDoublePointer(pipes_struct *p, struct echo_TestDoublePointer *r)
+{
+	p->rng_fault_state = True;
+	return 0;
+}
+
 #endif /* DEVELOPER */



More information about the samba-cvs mailing list