diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2007-12-10 18:41:19 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2007-12-21 05:49:12 +0100 |
commit | 5f4842cf65ce64bfdf577cd549565da20ca818cf (patch) | |
tree | 65f9cb14c5910e70bc0fb64f45c7ffa5e382692f /source4/libnet | |
parent | eba25f5d1897fbe61e8d7c623fcacb647629bf07 (diff) | |
download | samba-5f4842cf65ce64bfdf577cd549565da20ca818cf.tar.gz samba-5f4842cf65ce64bfdf577cd549565da20ca818cf.tar.xz 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.c | 3 | ||||
-rw-r--r-- | source4/libnet/libnet.h | 2 | ||||
-rw-r--r-- | source4/libnet/libnet_lookup.c | 12 | ||||
-rw-r--r-- | source4/libnet/libnet_lookup.h | 2 | ||||
-rw-r--r-- | source4/libnet/libnet_site.c | 2 |
5 files changed, 11 insertions, 10 deletions
diff --git a/source4/libnet/libnet.c b/source4/libnet/libnet.c index 5c483a757c6..d1605bc17d4 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 4f3acc60109..71ee8ef8e4d 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 fcb24601e4e..b8c6609d8e3 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 69cc0b5ade2..189ae58b394 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 9351aef6346..08cedf0d957 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); |