summaryrefslogtreecommitdiff
path: root/source4/wrepl_server
diff options
context:
space:
mode:
Diffstat (limited to 'source4/wrepl_server')
-rw-r--r--source4/wrepl_server/wrepl_server.c41
-rw-r--r--source4/wrepl_server/wrepl_server.h3
2 files changed, 39 insertions, 5 deletions
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
@@ -258,6 +258,27 @@ static const struct stream_server_ops wreplsrv_stream_ops = {
};
/*
+ 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
*/
static NTSTATUS wreplsrv_setup_sockets(struct wreplsrv_service *service)
@@ -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;