summaryrefslogtreecommitdiff
path: root/source4/libnet
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-12-10 18:41:19 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:49:12 +0100
commit5f4842cf65ce64bfdf577cd549565da20ca818cf (patch)
tree65f9cb14c5910e70bc0fb64f45c7ffa5e382692f /source4/libnet
parenteba25f5d1897fbe61e8d7c623fcacb647629bf07 (diff)
downloadsamba-5f4842cf65ce64bfdf577cd549565da20ca818cf.tar.gz
samba-5f4842cf65ce64bfdf577cd549565da20ca818cf.tar.bz2
samba-5f4842cf65ce64bfdf577cd549565da20ca818cf.zip
r26376: Add context for libcli_resolve.
(This used to be commit 459e1466a411d6f83b7372e248566e6e71c745fc)
Diffstat (limited to 'source4/libnet')
-rw-r--r--source4/libnet/libnet.c3
-rw-r--r--source4/libnet/libnet.h2
-rw-r--r--source4/libnet/libnet_lookup.c12
-rw-r--r--source4/libnet/libnet_lookup.h2
-rw-r--r--source4/libnet/libnet_site.c2
5 files changed, 11 insertions, 10 deletions
diff --git a/source4/libnet/libnet.c b/source4/libnet/libnet.c
index 5c483a757c..d1605bc17d 100644
--- a/source4/libnet/libnet.c
+++ b/source4/libnet/libnet.c
@@ -21,6 +21,7 @@
#include "libnet/libnet.h"
#include "lib/events/events.h"
#include "param/param.h"
+#include "libcli/resolve/resolve.h"
struct libnet_context *libnet_context_init(struct event_context *ev,
struct loadparm_context *lp_ctx)
@@ -45,7 +46,7 @@ struct libnet_context *libnet_context_init(struct event_context *ev,
ctx->lp_ctx = lp_ctx;
/* name resolution methods */
- ctx->name_res_methods = str_list_copy(ctx, lp_name_resolve_order(lp_ctx));
+ ctx->resolve_ctx = lp_resolve_context(lp_ctx);
/* connected services' params */
ZERO_STRUCT(ctx->samr);
diff --git a/source4/libnet/libnet.h b/source4/libnet/libnet.h
index 4f3acc6010..71ee8ef8e4 100644
--- a/source4/libnet/libnet.h
+++ b/source4/libnet/libnet.h
@@ -47,7 +47,7 @@ struct libnet_context {
} lsa;
/* name resolution methods */
- const char **name_res_methods;
+ struct resolve_context *resolve_ctx;
struct event_context *event_ctx;
diff --git a/source4/libnet/libnet_lookup.c b/source4/libnet/libnet_lookup.c
index fcb24601e4..b8c6609d8e 100644
--- a/source4/libnet/libnet_lookup.c
+++ b/source4/libnet/libnet_lookup.c
@@ -57,7 +57,7 @@ struct composite_context *libnet_Lookup_send(struct libnet_context *ctx,
struct composite_context *c;
struct lookup_state *s;
struct composite_context *cresolve_req;
- const char** methods;
+ struct resolve_context *resolve_ctx;
/* allocate context and state structures */
c = composite_create(ctx, ctx->event_ctx);
@@ -81,14 +81,14 @@ struct composite_context *libnet_Lookup_send(struct libnet_context *ctx,
s->hostname.scope = NULL;
/* name resolution methods */
- if (io->in.methods) {
- methods = io->in.methods;
+ if (io->in.resolve_ctx) {
+ resolve_ctx = io->in.resolve_ctx;
} else {
- methods = ctx->name_res_methods;
+ resolve_ctx = ctx->resolve_ctx;
}
/* send resolve request */
- cresolve_req = resolve_name_send(&s->hostname, c->event_ctx, methods);
+ cresolve_req = resolve_name_send(resolve_ctx, &s->hostname, c->event_ctx);
if (composite_nomem(cresolve_req, c)) return c;
composite_continue(c, cresolve_req, continue_name_resolved, c);
@@ -196,7 +196,7 @@ struct composite_context* libnet_LookupDCs_send(struct libnet_context *ctx,
c = finddcs_send(mem_ctx, lp_netbios_name(ctx->lp_ctx),
io->in.domain_name, io->in.name_type,
- NULL, ctx->name_res_methods, ctx->event_ctx, msg_ctx);
+ NULL, ctx->resolve_ctx, ctx->event_ctx, msg_ctx);
return c;
}
diff --git a/source4/libnet/libnet_lookup.h b/source4/libnet/libnet_lookup.h
index 69cc0b5ade..189ae58b39 100644
--- a/source4/libnet/libnet_lookup.h
+++ b/source4/libnet/libnet_lookup.h
@@ -22,7 +22,7 @@ struct libnet_Lookup {
struct {
const char *hostname;
int type;
- const char **methods;
+ struct resolve_context *resolve_ctx;
} in;
struct {
const char **address;
diff --git a/source4/libnet/libnet_site.c b/source4/libnet/libnet_site.c
index 9351aef634..08cedf0d95 100644
--- a/source4/libnet/libnet_site.c
+++ b/source4/libnet/libnet_site.c
@@ -147,7 +147,7 @@ NTSTATUS libnet_JoinSite(struct ldb_context *remote_ldb,
}
make_nbt_name_client(&name, libnet_r->out.samr_binding->host);
- status = resolve_name(&name, r, &dest_addr, NULL, lp_name_resolve_order(global_loadparm));
+ status = resolve_name(lp_resolve_context(global_loadparm), &name, r, &dest_addr, NULL);
if (!NT_STATUS_IS_OK(status)) {
libnet_r->out.error_string = NULL;
talloc_free(tmp_ctx);