summaryrefslogtreecommitdiff
path: root/source4/libcli/resolve
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-02-21 17:17:37 +0100
committerJelmer Vernooij <jelmer@samba.org>2008-02-21 17:17:37 +0100
commitc38c2765d1059b33f044a42c6555f3d10d339911 (patch)
treea97496f0b1cf0294900dfcad47675eef1b8f4ec8 /source4/libcli/resolve
parentd63321a41e5e7d39a8a4e79a980cf92b1da7dfc0 (diff)
downloadsamba-c38c2765d1059b33f044a42c6555f3d10d339911.tar.gz
samba-c38c2765d1059b33f044a42c6555f3d10d339911.tar.bz2
samba-c38c2765d1059b33f044a42c6555f3d10d339911.zip
Remove yet more uses of global_loadparm.
(This used to be commit e01c1e87c0fe9709df7eb5b863f7ce85564174cd)
Diffstat (limited to 'source4/libcli/resolve')
-rw-r--r--source4/libcli/resolve/bcast.c10
-rw-r--r--source4/libcli/resolve/nbtlist.c5
-rw-r--r--source4/libcli/resolve/wins.c10
3 files changed, 18 insertions, 7 deletions
diff --git a/source4/libcli/resolve/bcast.c b/source4/libcli/resolve/bcast.c
index c8d4ab2df3..2e2eb05397 100644
--- a/source4/libcli/resolve/bcast.c
+++ b/source4/libcli/resolve/bcast.c
@@ -29,6 +29,7 @@
struct resolve_bcast_data {
struct interface *ifaces;
uint16_t nbt_port;
+ int nbt_timeout;
};
/**
@@ -62,7 +63,7 @@ struct composite_context *resolve_name_bcast_send(TALLOC_CTX *mem_ctx,
}
address_list[count] = NULL;
- c = resolve_name_nbtlist_send(mem_ctx, event_ctx, name, address_list, data->ifaces, data->nbt_port, true, false);
+ c = resolve_name_nbtlist_send(mem_ctx, event_ctx, name, address_list, data->ifaces, data->nbt_port, data->nbt_timeout, true, false);
talloc_free(address_list);
return c;
@@ -84,22 +85,25 @@ NTSTATUS resolve_name_bcast(struct nbt_name *name,
TALLOC_CTX *mem_ctx,
struct interface *ifaces,
uint16_t nbt_port,
+ int nbt_timeout,
const char **reply_addr)
{
struct resolve_bcast_data *data = talloc(mem_ctx, struct resolve_bcast_data);
struct composite_context *c;
data->ifaces = talloc_reference(data, ifaces);
data->nbt_port = nbt_port;
+ data->nbt_timeout = nbt_timeout;
c = resolve_name_bcast_send(mem_ctx, NULL, data, name);
return resolve_name_bcast_recv(c, mem_ctx, reply_addr);
}
-bool resolve_context_add_bcast_method(struct resolve_context *ctx, struct interface *ifaces, uint16_t nbt_port)
+bool resolve_context_add_bcast_method(struct resolve_context *ctx, struct interface *ifaces, uint16_t nbt_port, int nbt_timeout)
{
struct resolve_bcast_data *data = talloc(ctx, struct resolve_bcast_data);
data->ifaces = ifaces;
data->nbt_port = nbt_port;
+ data->nbt_timeout = nbt_timeout;
return resolve_context_add_method(ctx, resolve_name_bcast_send, resolve_name_bcast_recv, data);
}
@@ -107,5 +111,5 @@ bool resolve_context_add_bcast_method_lp(struct resolve_context *ctx, struct loa
{
struct interface *ifaces;
load_interfaces(ctx, lp_interfaces(lp_ctx), &ifaces);
- return resolve_context_add_bcast_method(ctx, ifaces, lp_nbt_port(lp_ctx));
+ return resolve_context_add_bcast_method(ctx, ifaces, lp_nbt_port(lp_ctx), lp_parm_int(lp_ctx, NULL, "nbt", "timeout", 1));
}
diff --git a/source4/libcli/resolve/nbtlist.c b/source4/libcli/resolve/nbtlist.c
index e1452c09d2..34578e953a 100644
--- a/source4/libcli/resolve/nbtlist.c
+++ b/source4/libcli/resolve/nbtlist.c
@@ -102,6 +102,7 @@ struct composite_context *resolve_name_nbtlist_send(TALLOC_CTX *mem_ctx,
const char **address_list,
struct interface *ifaces,
uint16_t nbt_port,
+ int nbt_timeout,
bool broadcast,
bool wins_lookup)
{
@@ -161,7 +162,7 @@ struct composite_context *resolve_name_nbtlist_send(TALLOC_CTX *mem_ctx,
state->io_queries[i].in.broadcast = broadcast;
state->io_queries[i].in.wins_lookup = wins_lookup;
- state->io_queries[i].in.timeout = lp_parm_int(global_loadparm, NULL, "nbt", "timeout", 1);
+ state->io_queries[i].in.timeout = nbt_timeout;
state->io_queries[i].in.retries = 2;
state->queries[i] = nbt_name_query_send(state->nbtsock, &state->io_queries[i]);
@@ -201,12 +202,14 @@ NTSTATUS resolve_name_nbtlist(struct nbt_name *name,
const char **address_list,
struct interface *ifaces,
uint16_t nbt_port,
+ int nbt_timeout,
bool broadcast, bool wins_lookup,
const char **reply_addr)
{
struct composite_context *c = resolve_name_nbtlist_send(mem_ctx, NULL,
name, address_list,
ifaces, nbt_port,
+ nbt_timeout,
broadcast, wins_lookup);
return resolve_name_nbtlist_recv(c, mem_ctx, reply_addr);
}
diff --git a/source4/libcli/resolve/wins.c b/source4/libcli/resolve/wins.c
index 78624ad81a..3ec180f332 100644
--- a/source4/libcli/resolve/wins.c
+++ b/source4/libcli/resolve/wins.c
@@ -29,6 +29,7 @@ struct resolve_wins_data {
const char **address_list;
struct interface *ifaces;
uint16_t nbt_port;
+ int nbt_timeout;
};
/**
@@ -42,7 +43,7 @@ struct composite_context *resolve_name_wins_send(
{
struct resolve_wins_data *wins_data = talloc_get_type(userdata, struct resolve_wins_data);
if (wins_data->address_list == NULL) return NULL;
- return resolve_name_nbtlist_send(mem_ctx, event_ctx, name, wins_data->address_list, wins_data->ifaces, wins_data->nbt_port, false, true);
+ return resolve_name_nbtlist_send(mem_ctx, event_ctx, name, wins_data->address_list, wins_data->ifaces, wins_data->nbt_port, wins_data->nbt_timeout, false, true);
}
/*
@@ -62,6 +63,7 @@ NTSTATUS resolve_name_wins(struct nbt_name *name,
const char **address_list,
struct interface *ifaces,
uint16_t nbt_port,
+ int nbt_timeout,
const char **reply_addr)
{
struct composite_context *c;
@@ -69,16 +71,18 @@ NTSTATUS resolve_name_wins(struct nbt_name *name,
wins_data->address_list = address_list;
wins_data->ifaces = ifaces;
wins_data->nbt_port = nbt_port;
+ wins_data->nbt_timeout = nbt_timeout;
c = resolve_name_wins_send(mem_ctx, NULL, wins_data, name);
return resolve_name_wins_recv(c, mem_ctx, reply_addr);
}
-bool resolve_context_add_wins_method(struct resolve_context *ctx, const char **address_list, struct interface *ifaces, uint16_t nbt_port)
+bool resolve_context_add_wins_method(struct resolve_context *ctx, const char **address_list, struct interface *ifaces, uint16_t nbt_port, int nbt_timeout)
{
struct resolve_wins_data *wins_data = talloc(ctx, struct resolve_wins_data);
wins_data->address_list = str_list_copy(wins_data, address_list);
wins_data->ifaces = talloc_reference(wins_data, ifaces);
wins_data->nbt_port = nbt_port;
+ wins_data->nbt_timeout = nbt_timeout;
return resolve_context_add_method(ctx, resolve_name_wins_send, resolve_name_wins_recv,
wins_data);
}
@@ -87,5 +91,5 @@ bool resolve_context_add_wins_method_lp(struct resolve_context *ctx, struct load
{
struct interface *ifaces;
load_interfaces(ctx, lp_interfaces(lp_ctx), &ifaces);
- return resolve_context_add_wins_method(ctx, lp_wins_server_list(lp_ctx), ifaces, lp_nbt_port(lp_ctx));
+ return resolve_context_add_wins_method(ctx, lp_wins_server_list(lp_ctx), ifaces, lp_nbt_port(lp_ctx), lp_parm_int(lp_ctx, NULL, "nbt", "timeout", 1));
}