2 Unix SMB/CIFS implementation.
4 endpoint server for the mgmt pipe
6 Copyright (C) Jelmer Vernooij 2006
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
23 #include "rpc_server/dcerpc_server.h"
24 #include "rpc_server/dcerpc_server_proto.h"
25 #include "librpc/gen_ndr/ndr_mgmt.h"
27 #define DCESRV_INTERFACE_MGMT_BIND(call, iface) \
28 dcesrv_interface_mgmt_bind(call, iface)
29 static NTSTATUS dcesrv_interface_mgmt_bind(struct dcesrv_call_state *dce_call,
30 const struct dcesrv_interface *iface)
32 return dcesrv_interface_bind_allow_connect(dce_call, iface);
38 static WERROR dcesrv_mgmt_inq_if_ids(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
39 struct mgmt_inq_if_ids *r)
41 const struct dcesrv_endpoint *ep = dce_call->conn->endpoint;
42 struct dcesrv_if_list *l;
43 struct rpc_if_id_vector_t *vector;
45 vector = *r->out.if_id_vector = talloc(mem_ctx, struct rpc_if_id_vector_t);
48 for (l = ep->interface_list; l; l = l->next) {
50 vector->if_id = talloc_realloc(mem_ctx, vector->if_id, struct ndr_syntax_id_p, vector->count);
51 vector->if_id[vector->count-1].id = &l->iface.syntax_id;
60 static WERROR dcesrv_mgmt_inq_stats(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
61 struct mgmt_inq_stats *r)
63 if (r->in.max_count != MGMT_STATS_ARRAY_MAX_SIZE)
64 return WERR_NOT_SUPPORTED;
66 r->out.statistics->count = r->in.max_count;
67 r->out.statistics->statistics = talloc_array(mem_ctx, uint32_t, r->in.max_count);
69 r->out.statistics->statistics[MGMT_STATS_CALLS_IN] = 0;
70 r->out.statistics->statistics[MGMT_STATS_CALLS_OUT] = 0;
71 r->out.statistics->statistics[MGMT_STATS_PKTS_IN] = 0;
72 r->out.statistics->statistics[MGMT_STATS_PKTS_OUT] = 0;
79 mgmt_is_server_listening
81 static uint32_t dcesrv_mgmt_is_server_listening(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
82 struct mgmt_is_server_listening *r)
90 mgmt_stop_server_listening
92 static WERROR dcesrv_mgmt_stop_server_listening(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
93 struct mgmt_stop_server_listening *r)
95 return WERR_ACCESS_DENIED;
102 static WERROR dcesrv_mgmt_inq_princ_name(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
103 struct mgmt_inq_princ_name *r)
105 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
109 /* include the generated boilerplate */
110 #include "librpc/gen_ndr/ndr_mgmt_s.c"
112 const struct dcesrv_interface dcesrv_get_mgmt_interface(void)
114 return dcesrv_mgmt_interface;