Rev 11213: Add stub inq_if_stats implementation. in file:///home/jelmer/bzr.samba/4.0-mgmt/

Jelmer Vernooij jelmer at samba.org
Tue Jan 16 13:36:36 GMT 2007


------------------------------------------------------------
revno: 11213
revision-id: jelmer at samba.org-20070116133625-lv5c7ur8vcpnogxk
parent: jelmer at samba.org-20070116132625-20m48ecr6l8ekg48
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 4.0-mgmt
timestamp: Tue 2007-01-16 14:36:25 +0100
message:
  Add stub inq_if_stats implementation.
modified:
  source/rpc_server/dcesrv_mgmt.c svn-v2:20785 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2frpc_server%2fmgmt%2fdcesrv_mgmt.c
  source/torture/rpc/mgmt.c      svn-v2:6 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2ftorture%2frpc%2fmgmt.c
=== modified file 'source/rpc_server/dcesrv_mgmt.c'
--- a/source/rpc_server/dcesrv_mgmt.c	2007-01-16 13:26:25 +0000
+++ b/source/rpc_server/dcesrv_mgmt.c	2007-01-16 13:36:25 +0000
@@ -53,7 +53,18 @@
 static WERROR mgmt_inq_stats(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
 		       struct mgmt_inq_stats *r)
 {
-	DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
+	if (r->in.max_count != MGMT_STATS_ARRAY_MAX_SIZE)
+		return WERR_NOT_SUPPORTED;
+
+	r->out.statistics->count = r->in.max_count;
+	r->out.statistics->statistics = talloc_array(mem_ctx, uint32_t, r->in.max_count);
+	/* FIXME */
+	r->out.statistics->statistics[MGMT_STATS_CALLS_IN] = 0;
+	r->out.statistics->statistics[MGMT_STATS_CALLS_OUT] = 0;
+	r->out.statistics->statistics[MGMT_STATS_PKTS_IN] = 0;
+	r->out.statistics->statistics[MGMT_STATS_PKTS_OUT] = 0;
+
+	return WERR_OK;
 }
 
 

=== modified file 'source/torture/rpc/mgmt.c'
--- a/source/torture/rpc/mgmt.c	2007-01-16 13:26:25 +0000
+++ b/source/torture/rpc/mgmt.c	2007-01-16 13:36:25 +0000
@@ -73,9 +73,11 @@
 {
 	NTSTATUS status;
 	struct mgmt_inq_stats r;
+	struct mgmt_statistics statistics;
 
 	r.in.max_count = MGMT_STATS_ARRAY_MAX_SIZE;
 	r.in.unknown = 0;
+	r.out.statistics = &statistics;
 
 	status = dcerpc_mgmt_inq_stats(p, mem_ctx, &r);
 	if (!NT_STATUS_IS_OK(status)) {
@@ -83,16 +85,16 @@
 		return False;
 	}
 
-	if (r.out.statistics->count != MGMT_STATS_ARRAY_MAX_SIZE) {
-		printf("Unexpected array size %d\n", r.out.statistics->count);
+	if (statistics.count != MGMT_STATS_ARRAY_MAX_SIZE) {
+		printf("Unexpected array size %d\n", statistics.count);
 		return False;
 	}
 
 	printf("\tcalls_in %6d  calls_out %6d\n\tpkts_in  %6d  pkts_out  %6d\n",
-	       r.out.statistics->statistics[MGMT_STATS_CALLS_IN],
-	       r.out.statistics->statistics[MGMT_STATS_CALLS_OUT],
-	       r.out.statistics->statistics[MGMT_STATS_PKTS_IN],
-	       r.out.statistics->statistics[MGMT_STATS_PKTS_OUT]);
+	       statistics.statistics[MGMT_STATS_CALLS_IN],
+	       statistics.statistics[MGMT_STATS_CALLS_OUT],
+	       statistics.statistics[MGMT_STATS_PKTS_IN],
+	       statistics.statistics[MGMT_STATS_PKTS_OUT]);
 
 	return True;
 }



More information about the samba-cvs mailing list