------------------------------------------------------------
revno: 11213
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Jelmer Vernooij <[EMAIL PROTECTED]>
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:[EMAIL PROTECTED]
  source/torture/rpc/mgmt.c      svn-v2:[EMAIL PROTECTED]
=== 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;
 }

Reply via email to