ctdb-server: Remove duplicate logic
[samba4-gss.git] / source3 / rpc_server / rpcd_mdssvc.c
blobc872aa6bd83c8f9907bc4b9d3458c402eea2c2d9
1 /*
2 * Unix SMB/CIFS implementation.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, see <http://www.gnu.org/licenses/>.
18 #include "includes.h"
19 #include "source3/locking/proto.h"
20 #include "rpc_worker.h"
21 #include "librpc/gen_ndr/ndr_mdssvc.h"
22 #include "librpc/gen_ndr/ndr_mdssvc_scompat.h"
24 static size_t mdssvc_interfaces(
25 const struct ndr_interface_table ***pifaces,
26 void *private_data)
28 static const struct ndr_interface_table *ifaces[] = {
29 &ndr_table_mdssvc,
32 *pifaces = ifaces;
33 return ARRAY_SIZE(ifaces);
36 static NTSTATUS mdssvc_servers(
37 struct dcesrv_context *dce_ctx,
38 const struct dcesrv_endpoint_server ***_ep_servers,
39 size_t *_num_ep_servers,
40 void *private_data)
42 static const struct dcesrv_endpoint_server *ep_servers[1] = { NULL };
43 bool ok;
45 lp_load_with_shares(get_dyn_CONFIGFILE());
47 ok = posix_locking_init(false);
48 if (!ok) {
49 DBG_ERR("posix_locking_init() failed\n");
50 return NT_STATUS_INTERNAL_ERROR;
53 ep_servers[0] = mdssvc_get_ep_server();
55 *_ep_servers = ep_servers;
56 *_num_ep_servers = ARRAY_SIZE(ep_servers);
57 return NT_STATUS_OK;
60 int main(int argc, const char *argv[])
62 return rpc_worker_main(
63 argc,
64 argv,
65 "rpcd_mdssvc",
67 60,
68 mdssvc_interfaces,
69 mdssvc_servers,
70 NULL);