summaryrefslogtreecommitdiff
path: root/source4/librpc
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-11-24 03:21:49 +0000
committerAndrew Tridgell <tridge@samba.org>2003-11-24 03:21:49 +0000
commite4773b184cd6ccf1e46ec151afbfd9fb9ad3ede8 (patch)
tree980d9a236b4800aa018d7cc3a2b615919b69f7f5 /source4/librpc
parentc7fd83d0b280810f16f7ef99ba58efb007f93920 (diff)
downloadsamba-e4773b184cd6ccf1e46ec151afbfd9fb9ad3ede8.tar.gz
samba-e4773b184cd6ccf1e46ec151afbfd9fb9ad3ede8.tar.bz2
samba-e4773b184cd6ccf1e46ec151afbfd9fb9ad3ede8.zip
added tests for the remaining calls on the rpc management interface
(This used to be commit 00f9b0e12061c175334f96805ca8333f28f74d91)
Diffstat (limited to 'source4/librpc')
-rw-r--r--source4/librpc/idl/mgmt.idl20
-rw-r--r--source4/librpc/ndr/ndr_basic.c32
-rw-r--r--source4/librpc/rpc/dcerpc.c35
3 files changed, 51 insertions, 36 deletions
diff --git a/source4/librpc/idl/mgmt.idl b/source4/librpc/idl/mgmt.idl
index 94439bdea3..2bc752da3d 100644
--- a/source4/librpc/idl/mgmt.idl
+++ b/source4/librpc/idl/mgmt.idl
@@ -32,12 +32,26 @@ interface mgmt
/***********************/
/* Function 0x01 */
+
+ const int mgmt_stats_calls_in = 0;
+ const int mgmt_stats_calls_out = 1;
+ const int mgmt_stats_pkts_in = 2;
+ const int mgmt_stats_pkts_out = 3;
+ const int mgmt_stats_array_max_size = 4;
+
+ typedef struct {
+ uint32 count;
+ [size_is(count)] uint32 statistics[*];
+ } mgmt_statistics;
+
void mgmt_inq_stats (
- [in, out] unsigned32 *count,
- [out, size_is(*count)] unsigned32 *statistics,
- [out] error_status_t *status
+ [in] uint32 max_count,
+ [in] uint32 unknown,
+ [out] mgmt_statistics statistics,
+ [out] error_status_t status
);
+
/***********************/
/* Function 0x02 */
boolean32 mgmt_is_server_listening (
diff --git a/source4/librpc/ndr/ndr_basic.c b/source4/librpc/ndr/ndr_basic.c
index 5f59899133..a45771ef28 100644
--- a/source4/librpc/ndr/ndr_basic.c
+++ b/source4/librpc/ndr/ndr_basic.c
@@ -730,6 +730,38 @@ void ndr_print_array_uint8(struct ndr_print *ndr, const char *name,
ndr->depth--;
}
+/*
+ build a GUID from a string
+*/
+NTSTATUS GUID_from_string(const char *s, struct GUID *guid)
+{
+ uint32 time_low;
+ uint32 time_mid, time_hi_and_version;
+ uint32 clock_seq_hi_and_reserved;
+ uint32 clock_seq_low;
+ uint32 node[6];
+ int i;
+
+ if (11 != sscanf(s, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
+ &time_low, &time_mid, &time_hi_and_version,
+ &clock_seq_hi_and_reserved, &clock_seq_low,
+ &node[0], &node[1], &node[2], &node[3], &node[4], &node[5])) {
+ return NT_STATUS_INVALID_PARAMETER;
+ }
+
+ SIVAL(guid->info, 0, time_low);
+ SSVAL(guid->info, 4, time_mid);
+ SSVAL(guid->info, 6, time_hi_and_version);
+ SCVAL(guid->info, 8, clock_seq_hi_and_reserved);
+ SCVAL(guid->info, 9, clock_seq_low);
+ for (i=0;i<6;i++) {
+ SCVAL(guid->info, 10 + i, node[i]);
+ }
+
+ return NT_STATUS_OK;
+}
+
+
const char *GUID_string(TALLOC_CTX *mem_ctx, const struct GUID *guid)
{
return talloc_asprintf(mem_ctx,
diff --git a/source4/librpc/rpc/dcerpc.c b/source4/librpc/rpc/dcerpc.c
index 6322123279..276b3c9ef4 100644
--- a/source4/librpc/rpc/dcerpc.c
+++ b/source4/librpc/rpc/dcerpc.c
@@ -60,37 +60,6 @@ void dcerpc_pipe_close(struct dcerpc_pipe *p)
}
-/*
- build a GUID from a string
-*/
-static NTSTATUS guid_from_string(const char *s, struct GUID *guid)
-{
- uint32 time_low;
- uint32 time_mid, time_hi_and_version;
- uint32 clock_seq_hi_and_reserved;
- uint32 clock_seq_low;
- uint32 node[6];
- int i;
-
- if (11 != sscanf(s, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
- &time_low, &time_mid, &time_hi_and_version,
- &clock_seq_hi_and_reserved, &clock_seq_low,
- &node[0], &node[1], &node[2], &node[3], &node[4], &node[5])) {
- return NT_STATUS_INVALID_PARAMETER;
- }
-
- SIVAL(guid->info, 0, time_low);
- SSVAL(guid->info, 4, time_mid);
- SSVAL(guid->info, 6, time_hi_and_version);
- SCVAL(guid->info, 8, clock_seq_hi_and_reserved);
- SCVAL(guid->info, 9, clock_seq_low);
- for (i=0;i<6;i++) {
- SCVAL(guid->info, 10 + i, node[i]);
- }
-
- return NT_STATUS_OK;
-}
-
/*
parse a data blob into a dcerpc_packet structure. This handles both
input and output packets
@@ -232,7 +201,7 @@ NTSTATUS dcerpc_bind_byuuid(struct dcerpc_pipe *p,
struct dcerpc_syntax_id transfer_syntax;
NTSTATUS status;
- status = guid_from_string(uuid, &syntax.uuid);
+ status = GUID_from_string(uuid, &syntax.uuid);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(2,("Invalid uuid string in dcerpc_bind_byuuid\n"));
return status;
@@ -240,7 +209,7 @@ NTSTATUS dcerpc_bind_byuuid(struct dcerpc_pipe *p,
syntax.major_version = version;
syntax.minor_version = 0;
- status = guid_from_string("8a885d04-1ceb-11c9-9fe8-08002b104860",
+ status = GUID_from_string("8a885d04-1ceb-11c9-9fe8-08002b104860",
&transfer_syntax.uuid);
if (!NT_STATUS_IS_OK(status)) {
return status;