From cbe9ae1234d03bd0f79444676f05cc871b143e71 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 14 Oct 2005 12:48:20 +0000 Subject: r11023: r10310@SERNOX: metze | 2005-09-19 11:21:39 +0200 - open the winsdb in the wrepl server - add dummy function for setup the replication partners metze (This used to be commit da3d18e4545da3bd1841ffc31f253e533f7ea016) --- source4/wrepl_server/wrepl_server.c | 41 ++++++++++++++++++++++++++++++++----- source4/wrepl_server/wrepl_server.h | 3 +++ 2 files changed, 39 insertions(+), 5 deletions(-) (limited to 'source4/wrepl_server') diff --git a/source4/wrepl_server/wrepl_server.c b/source4/wrepl_server/wrepl_server.c index 63fb6cd902..c0b5e3c08d 100644 --- a/source4/wrepl_server/wrepl_server.c +++ b/source4/wrepl_server/wrepl_server.c @@ -257,6 +257,27 @@ static const struct stream_server_ops wreplsrv_stream_ops = { .send_handler = wreplsrv_send, }; +/* + open winsdb +*/ +static NTSTATUS wreplsrv_open_winsdb(struct wreplsrv_service *service) +{ + service->wins_db = winsdb_connect(service); + if (!service->wins_db) { + return NT_STATUS_INTERNAL_DB_ERROR; + } + + return NT_STATUS_OK; +} + +/* + setup our replication partners +*/ +static NTSTATUS wreplsrv_setup_partners(struct wreplsrv_service *service) +{ + return NT_STATUS_OK; +} + /* startup the wrepl port 42 server sockets */ @@ -326,8 +347,22 @@ static void wreplsrv_task_init(struct task_server *task) task->private = service; /* - * TODO: setup up all partners, and open the winsdb + * setup up all partners, and open the winsdb */ + status = wreplsrv_open_winsdb(service); + if (!NT_STATUS_IS_OK(status)) { + task_server_terminate(task, "wreplsrv_task_init: wreplsrv_open_winsdb() failed"); + return; + } + + /* + * setup timed events for each partner we want to pull from + */ + status = wreplsrv_setup_partners(service); + if (!NT_STATUS_IS_OK(status)) { + task_server_terminate(task, "wreplsrv_task_init: wreplsrv_setup_partners() failed"); + return; + } /* * setup listen sockets, so we can anwser requests from our partners, @@ -339,10 +374,6 @@ static void wreplsrv_task_init(struct task_server *task) return; } - /* - * TODO: setup timed events for each partner we want to pull from - */ - irpc_add_name(task->msg_ctx, "wrepl_server"); } diff --git a/source4/wrepl_server/wrepl_server.h b/source4/wrepl_server/wrepl_server.h index bbf4a4b98f..ce694d159c 100644 --- a/source4/wrepl_server/wrepl_server.h +++ b/source4/wrepl_server/wrepl_server.h @@ -104,6 +104,9 @@ struct wreplsrv_service { /* the whole wrepl service is in one task */ struct task_server *task; + /* the winsdb handle */ + struct ldb_context *wins_db; + /* all incoming connections */ struct wreplsrv_in_connection *in_connections; -- cgit