summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-01-02 16:14:08 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:49:36 -0500
commit40b9d4f62d10d1de8cd45eaa9e74d4749c827c02 (patch)
tree66a4598038dcfb3e778f357b19189d6988f9a7d0 /source4
parent6d16a217d36d9487d03359bed06799985c059f96 (diff)
downloadsamba-40b9d4f62d10d1de8cd45eaa9e74d4749c827c02.tar.gz
samba-40b9d4f62d10d1de8cd45eaa9e74d4749c827c02.tar.bz2
samba-40b9d4f62d10d1de8cd45eaa9e74d4749c827c02.zip
r12674: make use of the winsdb functions
metze (This used to be commit 9a7da608e2099ea1d037b6985358649a6e35a714)
Diffstat (limited to 'source4')
-rw-r--r--source4/wrepl_server/wrepl_out_push.c3
-rw-r--r--source4/wrepl_server/wrepl_server.c53
2 files changed, 3 insertions, 53 deletions
diff --git a/source4/wrepl_server/wrepl_out_push.c b/source4/wrepl_server/wrepl_out_push.c
index 82e6031564..d227a31346 100644
--- a/source4/wrepl_server/wrepl_out_push.c
+++ b/source4/wrepl_server/wrepl_out_push.c
@@ -25,6 +25,7 @@
#include "wrepl_server/wrepl_server.h"
#include "libcli/composite/composite.h"
#include "wrepl_server/wrepl_out_helpers.h"
+#include "nbt_server/wins/winsdb.h"
static void wreplsrv_out_partner_push(struct wreplsrv_partner *partner, BOOL propagate);
@@ -123,7 +124,7 @@ NTSTATUS wreplsrv_out_push_run(struct wreplsrv_service *service)
uint64_t seqnumber;
uint32_t change_count;
- seqnumber = wreplsrv_local_db_seqnumber(service);
+ seqnumber = winsdb_get_seqnumber(service->wins_db);
for (partner = service->partners; partner; partner = partner->next) {
/* if it's not a push partner, go to the next partner */
diff --git a/source4/wrepl_server/wrepl_server.c b/source4/wrepl_server/wrepl_server.c
index 018b137d7e..e9dbd3b872 100644
--- a/source4/wrepl_server/wrepl_server.c
+++ b/source4/wrepl_server/wrepl_server.c
@@ -171,58 +171,7 @@ BOOL wreplsrv_is_our_address(struct wreplsrv_service *service, const char *addre
uint64_t wreplsrv_local_max_version(struct wreplsrv_service *service)
{
- int ret;
- struct ldb_context *ldb = service->wins_db->ldb;
- struct ldb_dn *dn;
- struct ldb_result *res = NULL;
- TALLOC_CTX *tmp_ctx = talloc_new(service);
- uint64_t maxVersion = 0;
-
- dn = ldb_dn_explode(tmp_ctx, "CN=VERSION");
- if (!dn) goto failed;
-
- /* find the record in the WINS database */
- ret = ldb_search(ldb, dn, LDB_SCOPE_BASE,
- NULL, NULL, &res);
- if (ret != LDB_SUCCESS) goto failed;
- talloc_steal(tmp_ctx, res);
- if (res->count > 1) goto failed;
-
- if (res->count == 1) {
- maxVersion = ldb_msg_find_uint64(res->msgs[0], "maxVersion", 0);
- }
-
-failed:
- talloc_free(tmp_ctx);
- return maxVersion;
-}
-
-uint64_t wreplsrv_local_db_seqnumber(struct wreplsrv_service *service)
-{
- int ret;
- struct ldb_context *ldb = service->wins_db->ldb;
- struct ldb_dn *dn;
- struct ldb_result *res = NULL;
- TALLOC_CTX *tmp_ctx = talloc_new(service);
- uint64_t seqnumber = 0;
-
- dn = ldb_dn_explode(tmp_ctx, "@BASEINFO");
- if (!dn) goto failed;
-
- /* find the record in the WINS database */
- ret = ldb_search(ldb, dn, LDB_SCOPE_BASE,
- NULL, NULL, &res);
- if (ret != LDB_SUCCESS) goto failed;
- talloc_steal(tmp_ctx, res);
- if (res->count > 1) goto failed;
-
- if (res->count == 1) {
- seqnumber = ldb_msg_find_uint64(res->msgs[0], "sequenceNumber", 0);
- }
-
-failed:
- talloc_free(tmp_ctx);
- return seqnumber;
+ return winsdb_get_maxVersion(service->wins_db);
}
NTSTATUS wreplsrv_fill_wrepl_table(struct wreplsrv_service *service,