summaryrefslogtreecommitdiff
path: root/source4/wrepl_server
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2005-10-14 12:48:20 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:42:16 -0500
commitcbe9ae1234d03bd0f79444676f05cc871b143e71 (patch)
treec6c992e778f8860afb0354005377293cda5c7ca3 /source4/wrepl_server
parentbab5662021721794c4ac9abe3373d50a2b96b1d5 (diff)
downloadsamba-cbe9ae1234d03bd0f79444676f05cc871b143e71.tar.gz
samba-cbe9ae1234d03bd0f79444676f05cc871b143e71.tar.bz2
samba-cbe9ae1234d03bd0f79444676f05cc871b143e71.zip
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)
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;