summaryrefslogtreecommitdiff
path: root/source4/nbt_server
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2009-02-05 16:39:28 +0100
committerJelmer Vernooij <jelmer@samba.org>2009-02-05 16:39:28 +0100
commit6d139ca4680abcbda5110f2f0886aa038ff62088 (patch)
tree7d61db40fb058bcbf08ccd8e0dadc365b819371b /source4/nbt_server
parent4a9b3052caeb8bb144803b49dcfae82395172bc3 (diff)
parentafa960cbbcd609123d710c301e7a9a070c1fed70 (diff)
downloadsamba-6d139ca4680abcbda5110f2f0886aa038ff62088.tar.gz
samba-6d139ca4680abcbda5110f2f0886aa038ff62088.tar.bz2
samba-6d139ca4680abcbda5110f2f0886aa038ff62088.zip
Merge branch 'master' of ssh://git.samba.org/data/git/samba
Conflicts: librpc/ndr.pc.in
Diffstat (limited to 'source4/nbt_server')
-rw-r--r--source4/nbt_server/config.mk2
-rw-r--r--source4/nbt_server/dgram/netlogon.c2
-rw-r--r--source4/nbt_server/dgram/ntlogon.c2
-rw-r--r--source4/nbt_server/irpc.c7
-rw-r--r--source4/nbt_server/wins/wins_ldb.c27
-rw-r--r--source4/nbt_server/wins/winsdb.c2
-rw-r--r--source4/nbt_server/wins/winswack.c4
7 files changed, 24 insertions, 22 deletions
diff --git a/source4/nbt_server/config.mk b/source4/nbt_server/config.mk
index b6db2090d2..afd9242188 100644
--- a/source4/nbt_server/config.mk
+++ b/source4/nbt_server/config.mk
@@ -18,7 +18,7 @@ $(eval $(call proto_header_template,$(nbt_serversrcdir)/wins/winsdb_proto.h,$(WI
SUBSYSTEM = LIBLDB
INIT_FUNCTION = LDB_MODULE(wins_ldb)
PRIVATE_DEPENDENCIES = \
- LIBNETIF LIBSAMBA-HOSTCONFIG LIBSAMBA-UTIL
+ LIBLDB LIBNETIF LIBSAMBA-HOSTCONFIG LIBSAMBA-UTIL
# End MODULE ldb_wins_ldb
#######################
diff --git a/source4/nbt_server/dgram/netlogon.c b/source4/nbt_server/dgram/netlogon.c
index a3a7552f6a..e5c82280e3 100644
--- a/source4/nbt_server/dgram/netlogon.c
+++ b/source4/nbt_server/dgram/netlogon.c
@@ -161,7 +161,7 @@ void nbtd_mailslot_netlogon_handler(struct dgram_mailslot_handler *dgmslot,
{
NTSTATUS status = NT_STATUS_NO_MEMORY;
struct nbtd_interface *iface =
- talloc_get_type(dgmslot->private, struct nbtd_interface);
+ talloc_get_type(dgmslot->private_data, struct nbtd_interface);
struct nbt_netlogon_packet *netlogon =
talloc(dgmslot, struct nbt_netlogon_packet);
struct nbtd_iface_name *iname;
diff --git a/source4/nbt_server/dgram/ntlogon.c b/source4/nbt_server/dgram/ntlogon.c
index 352be34489..87e76e08ee 100644
--- a/source4/nbt_server/dgram/ntlogon.c
+++ b/source4/nbt_server/dgram/ntlogon.c
@@ -76,7 +76,7 @@ void nbtd_mailslot_ntlogon_handler(struct dgram_mailslot_handler *dgmslot,
{
NTSTATUS status = NT_STATUS_NO_MEMORY;
struct nbtd_interface *iface =
- talloc_get_type(dgmslot->private, struct nbtd_interface);
+ talloc_get_type(dgmslot->private_data, struct nbtd_interface);
struct nbt_ntlogon_packet *ntlogon =
talloc(dgmslot, struct nbt_ntlogon_packet);
struct nbtd_iface_name *iname;
diff --git a/source4/nbt_server/irpc.c b/source4/nbt_server/irpc.c
index fc61372ead..951f1d296a 100644
--- a/source4/nbt_server/irpc.c
+++ b/source4/nbt_server/irpc.c
@@ -36,7 +36,8 @@
static NTSTATUS nbtd_information(struct irpc_message *msg,
struct nbtd_information *r)
{
- struct nbtd_server *server = talloc_get_type(msg->private, struct nbtd_server);
+ struct nbtd_server *server = talloc_get_type(msg->private_data,
+ struct nbtd_server);
switch (r->in.level) {
case NBTD_INFO_STATISTICS:
@@ -64,7 +65,7 @@ static void getdc_recv_netlogon_reply(struct dgram_mailslot_handler *dgmslot,
struct socket_address *src)
{
struct getdc_state *s =
- talloc_get_type(dgmslot->private, struct getdc_state);
+ talloc_get_type(dgmslot->private_data, struct getdc_state);
const char *p;
struct nbt_netlogon_response netlogon;
NTSTATUS status;
@@ -111,7 +112,7 @@ static NTSTATUS nbtd_getdcname(struct irpc_message *msg,
struct nbtd_getdcname *req)
{
struct nbtd_server *server =
- talloc_get_type(msg->private, struct nbtd_server);
+ talloc_get_type(msg->private_data, struct nbtd_server);
struct nbtd_interface *iface = nbtd_find_request_iface(server, req->in.ip_address, true);
struct getdc_state *s;
struct nbt_netlogon_packet p;
diff --git a/source4/nbt_server/wins/wins_ldb.c b/source4/nbt_server/wins/wins_ldb.c
index 557c0f1dc6..93382d7ddc 100644
--- a/source4/nbt_server/wins/wins_ldb.c
+++ b/source4/nbt_server/wins/wins_ldb.c
@@ -28,18 +28,18 @@
*/
#include "includes.h"
+#include "lib/events/events.h"
#include "nbt_server/nbt_server.h"
#include "nbt_server/wins/winsdb.h"
-#include "lib/ldb/include/ldb.h"
-#include "lib/ldb/include/ldb_errors.h"
-#include "lib/ldb/include/ldb_private.h"
+#include "lib/ldb/include/ldb_module.h"
#include "system/network.h"
#include "lib/socket/netif.h"
#include "param/param.h"
static int wins_ldb_verify(struct ldb_module *module, struct ldb_request *req)
{
- struct winsdb_handle *h = talloc_get_type(ldb_get_opaque(module->ldb, "winsdb_handle"),
+ struct ldb_context *ldb = ldb_module_get_ctx(module);
+ struct winsdb_handle *h = talloc_get_type(ldb_get_opaque(ldb, "winsdb_handle"),
struct winsdb_handle);
const struct ldb_message *msg;
@@ -62,7 +62,7 @@ static int wins_ldb_verify(struct ldb_module *module, struct ldb_request *req)
}
if (!h) {
- ldb_debug_set(module->ldb, LDB_DEBUG_FATAL, "%s", "WINS_LDB: INTERNAL ERROR: no winsdb_handle present!");
+ ldb_debug_set(ldb, LDB_DEBUG_FATAL, "%s", "WINS_LDB: INTERNAL ERROR: no winsdb_handle present!");
return LDB_ERR_OTHER;
}
@@ -73,39 +73,40 @@ static int wins_ldb_verify(struct ldb_module *module, struct ldb_request *req)
return ldb_next_request(module, req);
case WINSDB_HANDLE_CALLER_ADMIN:
- ldb_debug(module->ldb, LDB_DEBUG_WARNING, "%s\n", "WINS_LDB: TODO verify add/modify for WINSDB_HANDLE_CALLER_ADMIN");
+ ldb_debug(ldb, LDB_DEBUG_WARNING, "%s\n", "WINS_LDB: TODO verify add/modify for WINSDB_HANDLE_CALLER_ADMIN");
return ldb_next_request(module, req);
}
return LDB_ERR_OTHER;
}
-static int wins_ldb_init(struct ldb_module *ctx)
+static int wins_ldb_init(struct ldb_module *module)
{
+ struct ldb_context *ldb = ldb_module_get_ctx(module);
struct winsdb_handle *h;
const char *owner;
- struct loadparm_context *lp_ctx = ldb_get_opaque(ctx->ldb, "loadparm");
+ struct loadparm_context *lp_ctx = ldb_get_opaque(ldb, "loadparm");
- ctx->private_data = NULL;
+ ldb_module_set_private(module, NULL);
owner = lp_parm_string(lp_ctx, NULL, "winsdb", "local_owner");
if (!owner) {
struct interface *ifaces;
- load_interfaces(ctx, lp_interfaces(lp_ctx), &ifaces);
+ load_interfaces(module, lp_interfaces(lp_ctx), &ifaces);
owner = iface_n_ip(ifaces, 0);
if (!owner) {
owner = "0.0.0.0";
}
}
- h = talloc_zero(ctx, struct winsdb_handle);
+ h = talloc_zero(module, struct winsdb_handle);
if (!h) goto failed;
- h->ldb = ctx->ldb;
+ h->ldb = ldb;
h->caller = WINSDB_HANDLE_CALLER_ADMIN;
h->local_owner = talloc_strdup(h, owner);
if (!h->local_owner) goto failed;
- return ldb_set_opaque(ctx->ldb, "winsdb_handle", h);
+ return ldb_set_opaque(ldb, "winsdb_handle", h);
failed:
talloc_free(h);
diff --git a/source4/nbt_server/wins/winsdb.c b/source4/nbt_server/wins/winsdb.c
index bf9b8c442a..5c3efe2b83 100644
--- a/source4/nbt_server/wins/winsdb.c
+++ b/source4/nbt_server/wins/winsdb.c
@@ -168,7 +168,7 @@ static struct ldb_dn *winsdb_dn(TALLOC_CTX *mem_ctx, struct ldb_context *ldb,
return dn;
}
-static NTSTATUS winsdb_nbt_name(TALLOC_CTX *mem_ctx, const struct ldb_dn *dn, struct nbt_name **_name)
+static NTSTATUS winsdb_nbt_name(TALLOC_CTX *mem_ctx, struct ldb_dn *dn, struct nbt_name **_name)
{
NTSTATUS status;
struct nbt_name *name;
diff --git a/source4/nbt_server/wins/winswack.c b/source4/nbt_server/wins/winswack.c
index c499889f9e..c53fa1d069 100644
--- a/source4/nbt_server/wins/winswack.c
+++ b/source4/nbt_server/wins/winswack.c
@@ -295,7 +295,7 @@ NTSTATUS nbtd_proxy_wins_challenge(struct irpc_message *msg,
struct nbtd_proxy_wins_challenge *req)
{
struct nbtd_server *nbtd_server =
- talloc_get_type(msg->private, struct nbtd_server);
+ talloc_get_type(msg->private_data, struct nbtd_server);
struct proxy_wins_challenge_state *s;
uint32_t i;
@@ -355,7 +355,7 @@ NTSTATUS nbtd_proxy_wins_release_demand(struct irpc_message *msg,
struct nbtd_proxy_wins_release_demand *req)
{
struct nbtd_server *nbtd_server =
- talloc_get_type(msg->private, struct nbtd_server);
+ talloc_get_type(msg->private_data, struct nbtd_server);
struct proxy_wins_release_demand_state *s;
uint32_t i;