svn commit: samba r26408 - in branches/SAMBA_4_0: . source/libcli
source/libcli/nbt source/libnet source/nbt_server
source/nbt_server/wins source/torture/nbt
jelmer at samba.org
jelmer at samba.org
Wed Dec 12 02:15:23 GMT 2007
Author: jelmer
Date: 2007-12-12 02:15:20 +0000 (Wed, 12 Dec 2007)
New Revision: 26408
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=26408
Log:
Remove use of global_loadparm.
Modified:
branches/SAMBA_4_0/
branches/SAMBA_4_0/source/libcli/finddcs.c
branches/SAMBA_4_0/source/libcli/nbt/libnbt.h
branches/SAMBA_4_0/source/libcli/nbt/namerefresh.c
branches/SAMBA_4_0/source/libcli/nbt/nameregister.c
branches/SAMBA_4_0/source/libcli/nbt/namerelease.c
branches/SAMBA_4_0/source/libcli/nbt/nbtsocket.c
branches/SAMBA_4_0/source/libnet/libnet_site.c
branches/SAMBA_4_0/source/libnet/libnet_site.h
branches/SAMBA_4_0/source/nbt_server/register.c
branches/SAMBA_4_0/source/nbt_server/wins/winsclient.c
branches/SAMBA_4_0/source/nbt_server/wins/winsserver.c
branches/SAMBA_4_0/source/nbt_server/wins/winsserver.h
branches/SAMBA_4_0/source/nbt_server/wins/winswack.c
branches/SAMBA_4_0/source/torture/nbt/wins.c
branches/SAMBA_4_0/source/torture/nbt/winsbench.c
branches/SAMBA_4_0/source/torture/nbt/winsreplication.c
Changeset:
Property changes on: branches/SAMBA_4_0
___________________________________________________________________
Name: bzr:revision-info
...skipped...
Name: bzr:revision-id:v3-trunk0
...skipped...
Modified: branches/SAMBA_4_0/source/libcli/finddcs.c
===================================================================
--- branches/SAMBA_4_0/source/libcli/finddcs.c 2007-12-11 23:00:30 UTC (rev 26407)
+++ branches/SAMBA_4_0/source/libcli/finddcs.c 2007-12-12 02:15:20 UTC (rev 26408)
@@ -43,6 +43,7 @@
int num_dcs;
struct nbt_dc_name *dcs;
+ uint16_t nbt_port;
};
static void finddcs_name_resolved(struct composite_context *ctx);
@@ -82,6 +83,7 @@
state->ctx = c;
+ state->nbt_port = lp_nbt_port(global_loadparm);
state->my_netbios_name = talloc_strdup(state, my_netbios_name);
state->domain_name = talloc_strdup(state, domain_name);
if (composite_nomem(state->domain_name, c)) return c;
@@ -177,7 +179,7 @@
composite_done(state->ctx);
}
-/* The GetDC request might not be availible (such as occours when the
+/* The GetDC request might not be available (such as occours when the
* NBT server is down). Fallback to a node status. It is the best
* hope we have... */
static void fallback_node_status(struct finddcs_state *state)
@@ -189,7 +191,7 @@
state->node_status.in.name.type = NBT_NAME_CLIENT;
state->node_status.in.name.scope = NULL;
state->node_status.in.dest_addr = state->dcs[0].address;
- state->node_status.in.dest_port = lp_nbt_port(global_loadparm);
+ state->node_status.in.dest_port = state->nbt_port;
state->node_status.in.timeout = 1;
state->node_status.in.retries = 2;
Modified: branches/SAMBA_4_0/source/libcli/nbt/libnbt.h
===================================================================
--- branches/SAMBA_4_0/source/libcli/nbt/libnbt.h 2007-12-11 23:00:30 UTC (rev 26407)
+++ branches/SAMBA_4_0/source/libcli/nbt/libnbt.h 2007-12-12 02:15:20 UTC (rev 26408)
@@ -186,6 +186,7 @@
struct {
struct nbt_name name;
const char *dest_addr;
+ uint16_t dest_port;
const char *address;
uint16_t nb_flags;
uint32_t ttl;
@@ -199,6 +200,7 @@
struct {
struct nbt_name name;
const char **wins_servers;
+ uint16_t wins_port;
const char **addresses;
uint16_t nb_flags;
uint32_t ttl;
@@ -238,6 +240,7 @@
struct {
struct nbt_name name;
const char **wins_servers;
+ uint16_t wins_port;
const char **addresses;
uint16_t nb_flags;
uint32_t ttl;
@@ -254,6 +257,7 @@
struct {
struct nbt_name name;
const char *dest_addr;
+ uint16_t dest_port;
const char *address;
uint16_t nb_flags;
bool broadcast;
Modified: branches/SAMBA_4_0/source/libcli/nbt/namerefresh.c
===================================================================
--- branches/SAMBA_4_0/source/libcli/nbt/namerefresh.c 2007-12-11 23:00:30 UTC (rev 26407)
+++ branches/SAMBA_4_0/source/libcli/nbt/namerefresh.c 2007-12-12 02:15:20 UTC (rev 26408)
@@ -146,6 +146,7 @@
struct nbt_name_socket *nbtsock;
struct nbt_name_refresh *io;
const char **wins_servers;
+ uint16_t wins_port;
const char **addresses;
int address_idx;
struct nbt_name_request *req;
@@ -174,7 +175,7 @@
goto done;
}
state->io->in.dest_addr = state->wins_servers[0];
- state->io->in.dest_port = lp_nbt_port(global_loadparm);
+ state->io->in.dest_port = state->wins_port;
state->io->in.address = state->addresses[0];
state->req = nbt_name_refresh_send(state->nbtsock, state->io);
if (state->req == NULL) {
@@ -231,6 +232,7 @@
state->io = talloc(state, struct nbt_name_refresh);
if (state->io == NULL) goto failed;
+ state->wins_port = io->in.wins_port;
state->wins_servers = str_list_copy(state, io->in.wins_servers);
if (state->wins_servers == NULL ||
state->wins_servers[0] == NULL) goto failed;
@@ -241,7 +243,7 @@
state->io->in.name = io->in.name;
state->io->in.dest_addr = state->wins_servers[0];
- state->io->in.dest_port = lp_nbt_port(global_loadparm);
+ state->io->in.dest_port = state->wins_port;
state->io->in.address = io->in.addresses[0];
state->io->in.nb_flags = io->in.nb_flags;
state->io->in.broadcast = false;
Modified: branches/SAMBA_4_0/source/libcli/nbt/nameregister.c
===================================================================
--- branches/SAMBA_4_0/source/libcli/nbt/nameregister.c 2007-12-11 23:00:30 UTC (rev 26407)
+++ branches/SAMBA_4_0/source/libcli/nbt/nameregister.c 2007-12-12 02:15:20 UTC (rev 26408)
@@ -224,7 +224,7 @@
state->io->in.name = io->in.name;
state->io->in.dest_addr = io->in.dest_addr;
- state->io->in.dest_port = lp_nbt_port(global_loadparm);
+ state->io->in.dest_port = io->in.dest_port;
state->io->in.address = io->in.address;
state->io->in.nb_flags = io->in.nb_flags;
state->io->in.register_demand = false;
@@ -284,6 +284,7 @@
struct nbt_name_socket *nbtsock;
struct nbt_name_register *io;
const char **wins_servers;
+ uint16_t wins_port;
const char **addresses;
int address_idx;
struct nbt_name_request *req;
@@ -312,7 +313,7 @@
goto done;
}
state->io->in.dest_addr = state->wins_servers[0];
- state->io->in.dest_port = lp_nbt_port(global_loadparm);
+ state->io->in.dest_port = state->wins_port;
state->io->in.address = state->addresses[0];
state->req = nbt_name_register_send(state->nbtsock, state->io);
if (state->req == NULL) {
@@ -369,6 +370,7 @@
state->io = talloc(state, struct nbt_name_register);
if (state->io == NULL) goto failed;
+ state->wins_port = lp_nbt_port(global_loadparm);
state->wins_servers = str_list_copy(state, io->in.wins_servers);
if (state->wins_servers == NULL ||
state->wins_servers[0] == NULL) goto failed;
@@ -379,7 +381,7 @@
state->io->in.name = io->in.name;
state->io->in.dest_addr = state->wins_servers[0];
- state->io->in.dest_port = lp_nbt_port(global_loadparm);
+ state->io->in.dest_port = state->wins_port;
state->io->in.address = io->in.addresses[0];
state->io->in.nb_flags = io->in.nb_flags;
state->io->in.broadcast = false;
Modified: branches/SAMBA_4_0/source/libcli/nbt/namerelease.c
===================================================================
--- branches/SAMBA_4_0/source/libcli/nbt/namerelease.c 2007-12-11 23:00:30 UTC (rev 26407)
+++ branches/SAMBA_4_0/source/libcli/nbt/namerelease.c 2007-12-12 02:15:20 UTC (rev 26408)
@@ -67,7 +67,7 @@
talloc_strdup(packet->additional, io->in.address);
dest = socket_address_from_strings(packet, nbtsock->sock->backend_name,
- io->in.dest_addr, lp_nbt_port(global_loadparm));
+ io->in.dest_addr, io->in.dest_port);
if (dest == NULL) goto failed;
req = nbt_name_request_send(nbtsock, dest, packet,
io->in.timeout, io->in.retries, false);
Modified: branches/SAMBA_4_0/source/libcli/nbt/nbtsocket.c
===================================================================
--- branches/SAMBA_4_0/source/libcli/nbt/nbtsocket.c 2007-12-11 23:00:30 UTC (rev 26407)
+++ branches/SAMBA_4_0/source/libcli/nbt/nbtsocket.c 2007-12-12 02:15:20 UTC (rev 26408)
@@ -150,7 +150,7 @@
-/*
+/**
handle recv events on a nbt name socket
*/
static void nbt_name_socket_recv(struct nbt_name_socket *nbtsock)
Modified: branches/SAMBA_4_0/source/libnet/libnet_site.c
===================================================================
--- branches/SAMBA_4_0/source/libnet/libnet_site.c 2007-12-11 23:00:30 UTC (rev 26407)
+++ branches/SAMBA_4_0/source/libnet/libnet_site.c 2007-12-12 02:15:20 UTC (rev 26408)
@@ -51,7 +51,7 @@
/* Resolve the site name. */
ZERO_STRUCT(search);
search.in.dest_address = r->in.dest_address;
- search.in.dest_port = lp_cldap_port(global_loadparm);
+ search.in.dest_port = r->in.cldap_port;
search.in.acct_control = -1;
search.in.version = 6;
@@ -158,6 +158,7 @@
r->in.dest_address = dest_addr;
r->in.netbios_name = libnet_r->in.netbios_name;
r->in.domain_dn_str = libnet_r->out.domain_dn_str;
+ r->in.cldap_port = lp_cldap_port(global_loadparm);
status = libnet_FindSite(tmp_ctx, r);
if (!NT_STATUS_IS_OK(status)) {
Modified: branches/SAMBA_4_0/source/libnet/libnet_site.h
===================================================================
--- branches/SAMBA_4_0/source/libnet/libnet_site.h 2007-12-11 23:00:30 UTC (rev 26407)
+++ branches/SAMBA_4_0/source/libnet/libnet_site.h 2007-12-12 02:15:20 UTC (rev 26408)
@@ -22,6 +22,7 @@
const char *dest_address;
const char *netbios_name;
const char *domain_dn_str;
+ uint16_t cldap_port;
} in;
struct {
Modified: branches/SAMBA_4_0/source/nbt_server/register.c
===================================================================
--- branches/SAMBA_4_0/source/nbt_server/register.c 2007-12-11 23:00:30 UTC (rev 26407)
+++ branches/SAMBA_4_0/source/nbt_server/register.c 2007-12-12 02:15:20 UTC (rev 26408)
@@ -211,6 +211,7 @@
/* setup a broadcast name registration request */
io.in.name = iname->name;
io.in.dest_addr = iface->bcast_address;
+ io.in.dest_port = lp_nbt_port(iface->nbtsrv->task->lp_ctx);
io.in.address = iface->ip_address;
io.in.nb_flags = nb_flags;
io.in.ttl = iname->ttl;
Modified: branches/SAMBA_4_0/source/nbt_server/wins/winsclient.c
===================================================================
--- branches/SAMBA_4_0/source/nbt_server/wins/winsclient.c 2007-12-11 23:00:30 UTC (rev 26407)
+++ branches/SAMBA_4_0/source/nbt_server/wins/winsclient.c 2007-12-12 02:15:20 UTC (rev 26408)
@@ -141,6 +141,7 @@
/* setup a wins name refresh request */
io.in.name = iname->name;
io.in.wins_servers = str_list_make(tmp_ctx, iname->wins_server, NULL);
+ io.in.wins_port = lp_nbt_port(iface->nbtsrv->task->lp_ctx);
io.in.addresses = nbtd_address_list(iface, tmp_ctx);
io.in.nb_flags = iname->nb_flags;
io.in.ttl = iname->ttl;
Modified: branches/SAMBA_4_0/source/nbt_server/wins/winsserver.c
===================================================================
--- branches/SAMBA_4_0/source/nbt_server/wins/winsserver.c 2007-12-11 23:00:30 UTC (rev 26407)
+++ branches/SAMBA_4_0/source/nbt_server/wins/winsserver.c 2007-12-12 02:15:20 UTC (rev 26408)
@@ -378,6 +378,7 @@
if (talloc_reference(s, src) == NULL) goto failed;
s->io.in.nbtd_server = iface->nbtsrv;
+ s->io.in.nbtd_port = lp_nbt_port(iface->nbtsrv->task->lp_ctx);
s->io.in.event_ctx = iface->nbtsrv->task->event_ctx;
s->io.in.name = rec->name;
s->io.in.num_addresses = winsdb_addr_list_length(rec->addresses);
Modified: branches/SAMBA_4_0/source/nbt_server/wins/winsserver.h
===================================================================
--- branches/SAMBA_4_0/source/nbt_server/wins/winsserver.h 2007-12-11 23:00:30 UTC (rev 26407)
+++ branches/SAMBA_4_0/source/nbt_server/wins/winsserver.h 2007-12-12 02:15:20 UTC (rev 26408)
@@ -51,6 +51,7 @@
struct wins_challenge_io {
struct {
struct nbtd_server *nbtd_server;
+ uint16_t nbt_port;
struct event_context *event_ctx;
struct nbt_name *name;
uint32_t num_addresses;
Modified: branches/SAMBA_4_0/source/nbt_server/wins/winswack.c
===================================================================
--- branches/SAMBA_4_0/source/nbt_server/wins/winswack.c 2007-12-11 23:00:30 UTC (rev 26407)
+++ branches/SAMBA_4_0/source/nbt_server/wins/winswack.c 2007-12-12 02:15:20 UTC (rev 26408)
@@ -47,7 +47,7 @@
if (state->current_address < state->io->in.num_addresses) {
struct nbtd_interface *iface;
- state->query.in.dest_port = lp_nbt_port(global_loadparm);
+ state->query.in.dest_port = state->io->in.nbt_port;
state->query.in.dest_addr = state->io->in.addresses[state->current_address];
iface = nbtd_find_request_iface(state->io->in.nbtd_server, state->query.in.dest_addr, true);
@@ -105,7 +105,7 @@
/* setup a name query to the first address */
state->query.in.name = *state->io->in.name;
- state->query.in.dest_port = lp_nbt_port(global_loadparm);
+ state->query.in.dest_port = state->io->in.nbt_port;
state->query.in.dest_addr = state->io->in.addresses[state->current_address];
state->query.in.broadcast = false;
state->query.in.wins_lookup = true;
@@ -162,6 +162,7 @@
if (state->current_address < state->io->in.num_addresses) {
struct nbtd_interface *iface;
+ state->release.in.dest_port = lp_nbt_port(global_loadparm);
state->release.in.dest_addr = state->io->in.addresses[state->current_address];
state->release.in.address = state->release.in.dest_addr;
state->release.in.timeout = (state->addresses_left > 1 ? 2 : 1);
@@ -221,6 +222,7 @@
* with 2 retries
*/
state->release.in.name = *state->io->in.name;
+ state->release.in.dest_port = lp_nbt_port(global_loadparm);
state->release.in.dest_addr = state->io->in.addresses[state->current_address];
state->release.in.address = state->release.in.dest_addr;
state->release.in.broadcast = false;
@@ -303,6 +305,7 @@
s->req = req;
s->io.in.nbtd_server = nbtd_server;
+ s->io.in.nbt_port = lp_nbt_port(global_loadparm);
s->io.in.event_ctx = msg->ev;
s->io.in.name = &req->in.name;
s->io.in.num_addresses = req->in.num_addrs;
Modified: branches/SAMBA_4_0/source/torture/nbt/wins.c
===================================================================
--- branches/SAMBA_4_0/source/torture/nbt/wins.c 2007-12-11 23:00:30 UTC (rev 26407)
+++ branches/SAMBA_4_0/source/torture/nbt/wins.c 2007-12-12 02:15:20 UTC (rev 26408)
@@ -80,6 +80,7 @@
torture_comment(tctx, "release the name\n");
release.in.name = *name;
+ release.in.dest_port = lp_nbt_port(tctx->lp_ctx);
release.in.dest_addr = address;
release.in.address = myaddress;
release.in.nb_flags = nb_flags;
@@ -165,6 +166,7 @@
torture_comment(tctx, "refresh the name\n");
refresh.in.name = *name;
+ refresh.in.wins_port = lp_nbt_port(tctx->lp_ctx);
refresh.in.wins_servers = str_list_make(tctx, address, NULL);
refresh.in.addresses = str_list_make(tctx, myaddress, NULL);
refresh.in.nb_flags = nb_flags;
Modified: branches/SAMBA_4_0/source/torture/nbt/winsbench.c
===================================================================
--- branches/SAMBA_4_0/source/torture/nbt/winsbench.c 2007-12-11 23:00:30 UTC (rev 26407)
+++ branches/SAMBA_4_0/source/torture/nbt/winsbench.c 2007-12-12 02:15:20 UTC (rev 26408)
@@ -87,7 +87,7 @@
io.in.name = generate_name(tmp_ctx, idx);
io.in.dest_addr = state->wins_server;
- io.in.dest_port = lp_nbt_port(global_loadparm);
+ io.in.dest_port = state->wins_port;
io.in.address = state->my_ip;
io.in.nb_flags = NBT_NODE_H;
io.in.register_demand = false;
@@ -139,6 +139,7 @@
istate->state = state;
io.in.name = generate_name(tmp_ctx, idx);
+ io.in.dest_port = lp_nbt_port(global_loadparm);
io.in.dest_addr = state->wins_server;
io.in.address = state->my_ip;
io.in.nb_flags = NBT_NODE_H;
Modified: branches/SAMBA_4_0/source/torture/nbt/winsreplication.c
===================================================================
--- branches/SAMBA_4_0/source/torture/nbt/winsreplication.c 2007-12-11 23:00:30 UTC (rev 26407)
+++ branches/SAMBA_4_0/source/torture/nbt/winsreplication.c 2007-12-12 02:15:20 UTC (rev 26408)
@@ -6562,6 +6562,7 @@
/* release the record */
release->in.name = records[i].name;
+ release->in.dest_port = lp_nbt_port(tctx->lp_ctx);
release->in.dest_addr = ctx->address;
release->in.address = records[i].wins.ips[0].ip;
release->in.nb_flags = records[i].wins.nb_flags;
@@ -6616,6 +6617,7 @@
} else {
release->in.name = records[i].name;
release->in.dest_addr = ctx->address;
+ release->in.dest_port = lp_nbt_port(tctx->lp_ctx);
release->in.address = records[i].wins.ips[0].ip;
release->in.nb_flags = records[i].wins.nb_flags;
release->in.broadcast = false;
@@ -9368,6 +9370,7 @@
release->in.name = records[i].name;
release->in.dest_addr = ctx->address;
+ release->in.dest_port = lp_nbt_port(tctx->lp_ctx);
release->in.address = records[i].wins.ips[j].ip;
release->in.nb_flags = records[i].wins.nb_flags;
release->in.broadcast = false;
More information about the samba-cvs
mailing list