summaryrefslogtreecommitdiff
path: root/source4/rpc_server
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-01-16 14:44:23 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:43:37 -0500
commit615895332a73ad372bcb5918190cbfff6ba83e05 (patch)
tree2fb83d0261a06e4f154602cc5efc5e074594b8c8 /source4/rpc_server
parent97467edea3cb54994a18896f88dae4c843e6ff7e (diff)
downloadsamba-615895332a73ad372bcb5918190cbfff6ba83e05.tar.gz
samba-615895332a73ad372bcb5918190cbfff6ba83e05.tar.bz2
samba-615895332a73ad372bcb5918190cbfff6ba83e05.zip
r20830: merge mgmt work
(This used to be commit 3cc299dbbe278936281f8e7071e6de8ec1bb219c)
Diffstat (limited to 'source4/rpc_server')
-rw-r--r--source4/rpc_server/config.mk12
-rw-r--r--source4/rpc_server/dcerpc_server.c13
-rw-r--r--source4/rpc_server/dcesrv_mgmt.c (renamed from source4/rpc_server/mgmt/dcesrv_mgmt.c)33
3 files changed, 42 insertions, 16 deletions
diff --git a/source4/rpc_server/config.mk b/source4/rpc_server/config.mk
index cc676f9fd5..2f1428d10c 100644
--- a/source4/rpc_server/config.mk
+++ b/source4/rpc_server/config.mk
@@ -35,17 +35,6 @@ PUBLIC_DEPENDENCIES = NDR_EPMAPPER
################################################
################################################
-# Start MODULE dcerpc_mgmt
-[MODULE::dcerpc_mgmt]
-INIT_FUNCTION = dcerpc_server_mgmt_init
-SUBSYSTEM = dcerpc_server
-OBJ_FILES = \
- mgmt/dcesrv_mgmt.o
-PUBLIC_DEPENDENCIES = NDR_MGMT
-# End MODULE dcerpc_mgmt
-################################################
-
-################################################
# Start MODULE dcerpc_remote
[MODULE::dcerpc_remote]
INIT_FUNCTION = dcerpc_server_remote_init
@@ -197,6 +186,7 @@ OBJ_FILES = \
dcerpc_server.o \
dcerpc_sock.o \
dcesrv_auth.o \
+ dcesrv_mgmt.o \
handles.o
PUBLIC_DEPENDENCIES = \
LIBCLI_AUTH \
diff --git a/source4/rpc_server/dcerpc_server.c b/source4/rpc_server/dcerpc_server.c
index 6233a2e088..6af4be9cc1 100644
--- a/source4/rpc_server/dcerpc_server.c
+++ b/source4/rpc_server/dcerpc_server.c
@@ -35,6 +35,8 @@
#include "libcli/security/security.h"
#include "build.h"
+extern const struct dcesrv_interface dcesrv_mgmt_interface;
+
/*
see if two endpoints match
*/
@@ -178,6 +180,17 @@ _PUBLIC_ NTSTATUS dcesrv_interface_register(struct dcesrv_context *dce_ctx,
ZERO_STRUCTP(ep);
ep->ep_description = talloc_reference(ep, binding);
add_ep = True;
+
+ /* add mgmt interface */
+ ifl = talloc(dce_ctx, struct dcesrv_if_list);
+ if (!ifl) {
+ return NT_STATUS_NO_MEMORY;
+ }
+
+ memcpy(&(ifl->iface), &dcesrv_mgmt_interface,
+ sizeof(struct dcesrv_interface));
+
+ DLIST_ADD(ep->interface_list, ifl);
}
/* see if the interface is already registered on te endpoint */
diff --git a/source4/rpc_server/mgmt/dcesrv_mgmt.c b/source4/rpc_server/dcesrv_mgmt.c
index 2996b7675e..1656050b59 100644
--- a/source4/rpc_server/mgmt/dcesrv_mgmt.c
+++ b/source4/rpc_server/dcesrv_mgmt.c
@@ -31,7 +31,19 @@
static WERROR mgmt_inq_if_ids(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
struct mgmt_inq_if_ids *r)
{
- DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
+ const struct dcesrv_endpoint *ep = dce_call->conn->endpoint;
+ struct dcesrv_if_list *l;
+ struct rpc_if_id_vector_t *vector;
+
+ vector = *r->out.if_id_vector = talloc(mem_ctx, struct rpc_if_id_vector_t);
+ vector->count = 0;
+ vector->if_id = NULL;
+ for (l = ep->interface_list; l; l = l->next) {
+ vector->count++;
+ vector->if_id = talloc_realloc(mem_ctx, vector->if_id, struct dcerpc_syntax_id_p, vector->count);
+ vector->if_id[vector->count-1].id = &l->iface.syntax_id;
+ }
+ return WERR_OK;
}
@@ -41,7 +53,18 @@ static WERROR mgmt_inq_if_ids(struct dcesrv_call_state *dce_call, TALLOC_CTX *me
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;
}
@@ -51,8 +74,8 @@ static WERROR mgmt_inq_stats(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem
static uint32_t mgmt_is_server_listening(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
struct mgmt_is_server_listening *r)
{
- *r->out.status = 1;
- return 0;
+ *r->out.status = 0;
+ return 1;
}
@@ -62,7 +85,7 @@ static uint32_t mgmt_is_server_listening(struct dcesrv_call_state *dce_call, TAL
static WERROR mgmt_stop_server_listening(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
struct mgmt_stop_server_listening *r)
{
- DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
+ return WERR_ACCESS_DENIED;
}