-/*
+/*
Unix SMB/CIFS implementation.
WINS replication testing
Copyright (C) Andrew Tridgell 2005
Copyright (C) Stefan Metzmacher 2005
-
+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
torture_comment(tctx, "Test if we always get back the same assoc_ctx\n");
wrepl_socket = wrepl_socket_init(tctx, tctx->ev);
-
+
torture_comment(tctx, "Setup wrepl connections\n");
status = wrepl_connect(wrepl_socket, wrepl_best_ip(tctx->lp_ctx, address), address);
CHECK_STATUS(tctx, status, NT_STATUS_OK);
torture_comment(tctx, "Send 2nd start association request\n");
status = wrepl_associate(wrepl_socket, &associate);
torture_assert_ntstatus_ok(tctx, status, "2nd start association failed");
- torture_assert(tctx, associate.out.assoc_ctx == assoc_ctx1,
+ torture_assert(tctx, associate.out.assoc_ctx == assoc_ctx1,
"Different context returned");
torture_comment(tctx, "2nd association context: 0x%x\n", associate.out.assoc_ctx);
torture_comment(tctx, "Send 3rd start association request\n");
status = wrepl_associate(wrepl_socket, &associate);
- torture_assert(tctx, associate.out.assoc_ctx == assoc_ctx1,
+ torture_assert(tctx, associate.out.assoc_ctx == assoc_ctx1,
"Different context returned");
CHECK_STATUS(tctx, status, NT_STATUS_OK);
torture_comment(tctx, "3rd association context: 0x%x\n", associate.out.assoc_ctx);
torture_comment(tctx, "\tRAW_FLAGS: 0x%08X OWNER: %-15s\n",
name->raw_flags, name->owner);
for (i=0;i<name->num_addresses;i++) {
- torture_comment(tctx, "\tADDR: %-15s OWNER: %-15s\n",
+ torture_comment(tctx, "\tADDR: %-15s OWNER: %-15s\n",
name->addresses[i].address, name->addresses[i].owner);
}
}
torture_comment(tctx, "Test one pull replication cycle\n");
wrepl_socket = wrepl_socket_init(tctx, tctx->ev);
-
+
torture_comment(tctx, "Setup wrepl connections\n");
status = wrepl_connect(wrepl_socket, wrepl_best_ip(tctx->lp_ctx, address), address);
CHECK_STATUS(tctx, status, NT_STATUS_OK);
for (i=0;i<pull_table.out.num_partners;i++) {
struct wrepl_wins_owner *partner = &pull_table.out.partners[i];
torture_comment(tctx, "%s max_version=%6llu min_version=%6llu type=%d\n",
- partner->address,
- (long long)partner->max_version,
- (long long)partner->min_version,
+ partner->address,
+ (long long)partner->max_version,
+ (long long)partner->min_version,
partner->type);
pull_names.in.assoc_ctx = associate.out.assoc_ctx;
pull_names.in.partner = *partner;
-
+
status = wrepl_pull_names(wrepl_socket, tctx, &pull_names);
CHECK_STATUS(tctx, status, NT_STATUS_OK);
if (!ctx->nbtsock_srv2) return NULL;
/* Make a port 137 version of ctx->myaddr2 */
- nbt_srv_addr = socket_address_from_strings(tctx,
- ctx->nbtsock_srv->sock->backend_name,
- ctx->myaddr2->addr,
+ nbt_srv_addr = socket_address_from_strings(tctx,
+ ctx->nbtsock_srv->sock->backend_name,
+ ctx->myaddr2->addr,
lpcfg_nbt_port(tctx->lp_ctx));
if (!nbt_srv_addr) return NULL;
return ctx;
}
-static bool test_wrepl_update_one(struct torture_context *tctx,
+static bool test_wrepl_update_one(struct torture_context *tctx,
struct test_wrepl_conflict_conn *ctx,
const struct wrepl_wins_owner *owner,
const struct wrepl_wins_name *name)
return true;
}
-static bool test_wrepl_is_applied(struct torture_context *tctx,
+static bool test_wrepl_is_applied(struct torture_context *tctx,
struct test_wrepl_conflict_conn *ctx,
const struct wrepl_wins_owner *owner,
const struct wrepl_wins_name *name,
pull_names.in.assoc_ctx = ctx->pull_assoc;
pull_names.in.partner = *owner;
pull_names.in.partner.min_version = pull_names.in.partner.max_version;
-
+
status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
CHECK_STATUS(tctx, status, NT_STATUS_OK);
- torture_assert(tctx, pull_names.out.num_names == (expected?1:0),
+ torture_assert(tctx, pull_names.out.num_names == (expected?1:0),
talloc_asprintf(tctx, "Invalid number of records returned - expected %d got %d", expected, pull_names.out.num_names));
names = pull_names.out.names;
return true;
}
-static bool test_wrepl_mhomed_merged(struct torture_context *tctx,
+static bool test_wrepl_mhomed_merged(struct torture_context *tctx,
struct test_wrepl_conflict_conn *ctx,
const struct wrepl_wins_owner *owner1,
uint32_t num_ips1, const struct wrepl_ip *ips1,
num_ips--;
break;
}
- }
+ }
}
pull_names.in.assoc_ctx = ctx->pull_assoc;
CHECK_VALUE(tctx, names[0].num_addresses, num_ips);
for (i = 0; i < names[0].num_addresses; i++) {
- const char *addr = names[0].addresses[i].address;
+ const char *addr = names[0].addresses[i].address;
const char *owner = names[0].addresses[i].owner;
bool found = false;
return true;
}
-static bool test_wrepl_sgroup_merged(struct torture_context *tctx,
+static bool test_wrepl_sgroup_merged(struct torture_context *tctx,
struct test_wrepl_conflict_conn *ctx,
struct wrepl_wins_owner *merge_owner,
struct wrepl_wins_owner *owner1,
CHECK_STATUS(tctx, status, NT_STATUS_OK);
names = pull_names.out.names;
-
+
for (i = 0; i < pull_names.out.num_names; i++) {
if (names[i].name.type != name2->name->type) continue;
if (!names[i].name.name) continue;
CHECK_VALUE(tctx, name->num_addresses, num_ips);
for (i = 0; i < name->num_addresses; i++) {
- const char *addr = name->addresses[i].address;
+ const char *addr = name->addresses[i].address;
const char *owner = name->addresses[i].owner;
bool found = false;
return res;
}
-static bool test_conflict_same_owner(struct torture_context *tctx,
+static bool test_conflict_same_owner(struct torture_context *tctx,
struct test_wrepl_conflict_conn *ctx)
{
bool ret = true;
return ret;
}
-static bool test_conflict_different_owner(struct torture_context *tctx,
+static bool test_conflict_different_owner(struct torture_context *tctx,
struct test_wrepl_conflict_conn *ctx)
{
bool ret = true;
bool sgroup_cleanup;
} r1, r2;
} records[] = {
- /*
+ /*
* NOTE: the first record and the last applied one
* needs to be from the same owner,
* to not conflict in the next smbtorture run!!!
/*
* unique vs unique section
*/
- /*
+ /*
* unique,active vs. unique,active
* => should be replaced
*/
}
},
- /*
+ /*
* unique,active vs. unique,tombstone
* => should NOT be replaced
*/
}
},
- /*
+ /*
* unique,released vs. unique,active
* => should be replaced
*/
}
},
- /*
+ /*
* unique,released vs. unique,tombstone
* => should be replaced
*/
}
},
- /*
+ /*
* unique,tombstone vs. unique,active
* => should be replaced
*/
}
},
- /*
+ /*
* unique,tombstone vs. unique,tombstone
* => should be replaced
*/
/*
* unique vs normal groups section,
*/
- /*
+ /*
* unique,active vs. group,active
* => should be replaced
*/
}
},
- /*
+ /*
* unique,active vs. group,tombstone
* => should NOT be replaced
*/
}
},
- /*
+ /*
* unique,released vs. group,active
* => should be replaced
*/
}
},
- /*
+ /*
* unique,released vs. group,tombstone
* => should be replaced
*/
}
},
- /*
+ /*
* unique,tombstone vs. group,active
* => should be replaced
*/
}
},
- /*
+ /*
* unique,tombstone vs. group,tombstone
* => should be replaced
*/
/*
* unique vs special groups section,
*/
- /*
+ /*
* unique,active vs. sgroup,active
* => should NOT be replaced
*/
}
},
- /*
+ /*
* unique,active vs. sgroup,tombstone
* => should NOT be replaced
*/
}
},
- /*
+ /*
* unique,released vs. sgroup,active
* => should be replaced
*/
}
},
- /*
+ /*
* unique,released vs. sgroup,tombstone
* => should be replaced
*/
}
},
- /*
+ /*
* unique,tombstone vs. sgroup,active
* => should be replaced
*/
}
},
- /*
+ /*
* unique,tombstone vs. sgroup,tombstone
* => should be replaced
*/
/*
* unique vs multi homed section,
*/
- /*
+ /*
* unique,active vs. mhomed,active
* => should be replaced
*/
}
},
- /*
+ /*
* unique,active vs. mhomed,tombstone
* => should NOT be replaced
*/
}
},
- /*
+ /*
* unique,released vs. mhomed,active
* => should be replaced
*/
}
},
- /*
+ /*
* unique,released vs. mhomed,tombstone
* => should be replaced
*/
}
},
- /*
+ /*
* unique,tombstone vs. mhomed,active
* => should be replaced
*/
}
},
- /*
+ /*
* unique,tombstone vs. mhomed,tombstone
* => should be replaced
*/
/*
* normal groups vs unique section,
*/
- /*
+ /*
* group,active vs. unique,active
* => should NOT be replaced
*/
}
},
- /*
+ /*
* group,active vs. unique,tombstone
* => should NOT be replaced
*/
}
},
- /*
+ /*
* group,released vs. unique,active
* => should NOT be replaced
*/
}
},
- /*
+ /*
* group,released vs. unique,tombstone
* => should NOT be replaced
*/
}
},
- /*
+ /*
* group,tombstone vs. unique,active
* => should NOT be replaced
*/
}
},
- /*
+ /*
* group,tombstone vs. unique,tombstone
* => should NOT be replaced
*/
/*
* normal groups vs normal groups section,
*/
- /*
+ /*
* group,active vs. group,active
* => should NOT be replaced
*/
}
},
- /*
+ /*
* group,active vs. group,tombstone
* => should NOT be replaced
*/
}
},
- /*
+ /*
* group,released vs. group,active
* => should be replaced
*/
}
},
- /*
+ /*
* group,released vs. group,tombstone
* => should be replaced
*/
}
},
- /*
+ /*
* group,tombstone vs. group,active
* => should be replaced
*/
}
},
- /*
+ /*
* group,tombstone vs. group,tombstone
* => should be replaced
*/
/*
* normal groups vs special groups section,
*/
- /*
+ /*
* group,active vs. sgroup,active
* => should NOT be replaced
*/
}
},
- /*
+ /*
* group,active vs. sgroup,tombstone
* => should NOT be replaced
*/
}
},
- /*
+ /*
* group,released vs. sgroup,active
* => should be replaced
*/
}
},
- /*
+ /*
* group,released vs. sgroup,tombstone
* => should NOT be replaced
*/
}
},
- /*
+ /*
* group,tombstone vs. sgroup,active
* => should be replaced
*/
}
},
- /*
+ /*
* group,tombstone vs. sgroup,tombstone
* => should be replaced
*/
/*
* normal groups vs multi homed section,
*/
- /*
+ /*
* group,active vs. mhomed,active
* => should NOT be replaced
*/
}
},
- /*
+ /*
* group,active vs. mhomed,tombstone
* => should NOT be replaced
*/
}
},
- /*
+ /*
* group,released vs. mhomed,active
* => should NOT be replaced
*/
}
},
- /*
+ /*
* group,released vs. mhomed,tombstone
* => should NOT be replaced
*/
}
},
- /*
+ /*
* group,tombstone vs. mhomed,active
* => should be replaced
*/
}
},
- /*
+ /*
* group,tombstone vs. mhomed,tombstone
* => should be replaced
*/
/*
* special groups vs unique section,
*/
- /*
+ /*
* sgroup,active vs. unique,active
* => should NOT be replaced
*/
}
},
- /*
+ /*
* sgroup,active vs. unique,tombstone
* => should NOT be replaced
*/
}
},
- /*
+ /*
* sgroup,released vs. unique,active
* => should be replaced
*/
}
},
- /*
+ /*
* sgroup,released vs. unique,tombstone
* => should be replaced
*/
}
},
- /*
+ /*
* sgroup,tombstone vs. unique,active
* => should be replaced
*/
}
},
- /*
+ /*
* sgroup,tombstone vs. unique,tombstone
* => should be replaced
*/
/*
* special groups vs normal group section,
*/
- /*
+ /*
* sgroup,active vs. group,active
* => should NOT be replaced
*/
}
},
- /*
+ /*
* sgroup,active vs. group,tombstone
* => should NOT be replaced
*/
}
},
- /*
+ /*
* sgroup,released vs. group,active
* => should be replaced
*/
}
},
- /*
+ /*
* sgroup,released vs. group,tombstone
* => should be replaced
*/
}
},
- /*
+ /*
* sgroup,tombstone vs. group,active
* => should NOT be replaced
*/
}
},
- /*
+ /*
* sgroup,tombstone vs. group,tombstone
* => should NOT be replaced
*/
/*
* special groups (not active) vs special group section,
*/
- /*
+ /*
* sgroup,released vs. sgroup,active
* => should be replaced
*/
}
},
- /*
+ /*
* sgroup,released vs. sgroup,tombstone
* => should be replaced
*/
}
},
- /*
+ /*
* sgroup,tombstone vs. sgroup,active
* => should NOT be replaced
*/
}
},
- /*
+ /*
* sgroup,tombstone vs. sgroup,tombstone
* => should NOT be replaced
*/
/*
* special groups vs multi homed section,
*/
- /*
+ /*
* sgroup,active vs. mhomed,active
* => should NOT be replaced
*/
}
},
- /*
+ /*
* sgroup,active vs. mhomed,tombstone
* => should NOT be replaced
*/
}
},
- /*
+ /*
* sgroup,released vs. mhomed,active
* => should be replaced
*/
}
},
- /*
+ /*
* sgroup,released vs. mhomed,tombstone
* => should be replaced
*/
}
},
- /*
+ /*
* sgroup,tombstone vs. mhomed,active
* => should be replaced
*/
}
},
- /*
+ /*
* sgroup,tombstone vs. mhomed,tombstone
* => should be replaced
*/
/*
* multi homed vs. unique section,
*/
- /*
+ /*
* mhomed,active vs. unique,active
* => should be replaced
*/
}
},
- /*
+ /*
* mhomed,active vs. unique,tombstone
* => should NOT be replaced
*/
}
},
- /*
+ /*
* mhomed,released vs. unique,active
* => should be replaced
*/
}
},
- /*
+ /*
* mhomed,released vs. uinique,tombstone
* => should be replaced
*/
}
},
- /*
+ /*
* mhomed,tombstone vs. unique,active
* => should be replaced
*/
}
},
- /*
+ /*
* mhomed,tombstone vs. uinique,tombstone
* => should be replaced
*/
/*
* multi homed vs. normal group section,
*/
- /*
+ /*
* mhomed,active vs. group,active
* => should be replaced
*/
}
},
- /*
+ /*
* mhomed,active vs. group,tombstone
* => should NOT be replaced
*/
}
},
- /*
+ /*
* mhomed,released vs. group,active
* => should be replaced
*/
}
},
- /*
+ /*
* mhomed,released vs. group,tombstone
* => should be replaced
*/
}
},
- /*
+ /*
* mhomed,tombstone vs. group,active
* => should be replaced
*/
}
},
- /*
+ /*
* mhomed,tombstone vs. group,tombstone
* => should be replaced
*/
/*
* multi homed vs. special group section,
*/
- /*
+ /*
* mhomed,active vs. sgroup,active
* => should NOT be replaced
*/
}
},
- /*
+ /*
* mhomed,active vs. sgroup,tombstone
* => should NOT be replaced
*/
}
},
- /*
+ /*
* mhomed,released vs. sgroup,active
* => should be replaced
*/
}
},
- /*
+ /*
* mhomed,released vs. sgroup,tombstone
* => should be replaced
*/
}
},
- /*
+ /*
* mhomed,tombstone vs. sgroup,active
* => should be replaced
*/
}
},
- /*
+ /*
* mhomed,tombstone vs. sgroup,tombstone
* => should be replaced
*/
/*
* multi homed vs. mlti homed section,
*/
- /*
+ /*
* mhomed,active vs. mhomed,active
* => should be replaced
*/
}
},
- /*
+ /*
* mhomed,active vs. mhomed,tombstone
* => should NOT be replaced
*/
}
},
- /*
+ /*
* mhomed,released vs. mhomed,active
* => should be replaced
*/
}
},
- /*
+ /*
* mhomed,released vs. mhomed,tombstone
* => should be replaced
*/
}
},
- /*
+ /*
* mhomed,tombstone vs. mhomed,active
* => should be replaced
*/
}
},
- /*
+ /*
* mhomed,tombstone vs. mhomed,tombstone
* => should be replaced
*/
/*
* special group vs special group section,
*/
- /*
+ /*
* sgroup,active vs. sgroup,active same addresses
* => should be NOT replaced
*/
.sgroup_cleanup = true
}
},
- /*
+ /*
* sgroup,active vs. sgroup,active same addresses
* => should be NOT replaced
*/
.sgroup_cleanup = true
}
},
- /*
+ /*
* sgroup,active vs. sgroup,active subset addresses, special case...
* => should NOT be replaced
*/
.apply_expected = false,
}
},
- /*
+ /*
* sgroup,active vs. sgroup,active different addresses, but owner changed
* => should be replaced
*/
.sgroup_cleanup = true
}
},
- /*
+ /*
* sgroup,active vs. sgroup,active different addresses, but owner changed
* => should be replaced
*/
.sgroup_cleanup = true
}
},
- /*
+ /*
* sgroup,active vs. sgroup,active different addresses, but owner changed
* => should be replaced
*/
.sgroup_cleanup = true
}
},
- /*
+ /*
* sgroup,active vs. sgroup,active different addresses
* => should be merged
*/
.sgroup_cleanup = true,
}
},
- /*
+ /*
* sgroup,active vs. sgroup,active different addresses, special case...
* => should be merged
*/
.apply_expected = false,
}
},
- /*
+ /*
* sgroup,active vs. sgroup,active different addresses, special case...
* => should be merged
*/
.apply_expected = false,
}
},
- /*
+ /*
* sgroup,active vs. sgroup,active different addresses, special case...
* => should be merged
*/
.apply_expected = false,
}
},
- /*
+ /*
* sgroup,active vs. sgroup,active partly different addresses, special case...
* => should be merged
*/
.apply_expected = false,
}
},
- /*
+ /*
* sgroup,active vs. sgroup,active different addresses, special case...
* => should be merged
*/
.apply_expected = true,
}
},
- /*
+ /*
* sgroup,active vs. sgroup,active different addresses, special case...
* => should be merged
*/
}
},
- /*
+ /*
* sgroup,active vs. sgroup,tombstone different no addresses, special
* => should be replaced
*/
.apply_expected = true,
}
},
- /*
+ /*
* sgroup,active vs. sgroup,tombstone different addresses
* => should be replaced
*/
.apply_expected = true,
}
},
- /*
+ /*
* sgroup,active vs. sgroup,tombstone subset addresses
* => should be replaced
*/
.apply_expected = true,
}
},
- /*
+ /*
* sgroup,active vs. sgroup,active same addresses
* => should be replaced
*/
}
},
- /*
+ /*
* This should be the last record in this array,
* we need to make sure the we leave a tombstoned unique entry
* owned by OWNER_A
bool apply_expected;
} replica;
} records[] = {
-/*
+/*
* unique vs. unique section
*/
/*
.apply_expected = true
},
},
-/*
+/*
* unique vs. group section
*/
/*
.apply_expected = true
},
},
-/*
+/*
* unique vs. special group section
*/
/*
.apply_expected = true
},
},
-/*
+/*
* unique vs. multi homed section
*/
/*
.apply_expected = true
},
},
-/*
+/*
* group vs. unique section
*/
/*
.apply_expected = false
},
},
-/*
+/*
* group vs. group section
*/
/*
.apply_expected = true
},
},
-/*
+/*
* group vs. special group section
*/
/*
.apply_expected = false
},
},
-/*
+/*
* group vs. multi homed section
*/
/*
.apply_expected = false
},
},
-/*
+/*
* special group vs. unique section
*/
/*
.apply_expected = true
},
},
-/*
+/*
* special group vs. group section
*/
/*
.apply_expected = true
},
},
-/*
+/*
* special group vs. special group section
*/
/*
.apply_expected = true
},
},
-/*
+/*
* special group vs. multi homed section
*/
/*
.apply_expected = true
},
},
-/*
+/*
* multi homed vs. unique section
*/
/*
.apply_expected = true
},
},
-/*
+/*
* multi homed vs. group section
*/
/*
.apply_expected = true
},
},
-/*
+/*
* multi homed vs. special group section
*/
/*
.apply_expected = true
},
},
-/*
+/*
* multi homed vs. multi homed section
*/
/*
} replica;
};
-static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock,
- struct nbt_name_packet *req_packet,
+static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock,
+ struct nbt_name_packet *req_packet,
struct socket_address *src);
static bool test_conflict_owned_active_vs_replica(struct torture_context *tctx,
struct nbt_name_release *release = &release_;
uint32_t i;
struct test_conflict_owned_active_vs_replica_struct records[] = {
-/*
+/*
* unique vs. unique section
*/
/*
.apply_expected = false
},
},
-/*
+/*
* unique vs. group section
*/
/*
.apply_expected = false
},
},
-/*
+/*
* unique vs. special group section
*/
/*
.apply_expected = false
},
},
-/*
+/*
* unique vs. multi homed section
*/
/*
.apply_expected = false
},
},
-/*
+/*
* normal group vs. unique section
*/
/*
.apply_expected = false
},
},
-/*
+/*
* normal group vs. normal group section
*/
/*
.apply_expected = false
},
},
-/*
+/*
* normal group vs. special group section
*/
/*
.apply_expected = false
},
},
-/*
+/*
* normal group vs. multi homed section
*/
/*
.apply_expected = false
},
},
-/*
+/*
* special group vs. unique section
*/
/*
.apply_expected = false
},
},
-/*
+/*
* special group vs. normal group section
*/
/*
.apply_expected = false
},
},
-/*
+/*
* special group vs. multi homed section
*/
/*
.apply_expected = false
},
},
-/*
+/*
* multi homed vs. unique section
*/
/*
.apply_expected = false
},
},
-/*
+/*
* multi homed vs. normal group section
*/
/*
.apply_expected = false
},
},
-/*
+/*
* multi homed vs. special group section
*/
/*
.apply_expected = false
},
},
-/*
+/*
* multi homed vs. multi homed section
*/
/*
} \
} while (0)
-static void test_conflict_owned_active_vs_replica_handler_query(struct nbt_name_socket *nbtsock,
- struct nbt_name_packet *req_packet,
+static void test_conflict_owned_active_vs_replica_handler_query(struct nbt_name_socket *nbtsock,
+ struct nbt_name_packet *req_packet,
struct socket_address *src)
{
struct nbt_name *name;
struct nbt_name_packet *rep_packet;
- struct test_conflict_owned_active_vs_replica_struct *rec =
+ struct test_conflict_owned_active_vs_replica_struct *rec =
(struct test_conflict_owned_active_vs_replica_struct *)nbtsock->incoming.private_data;
_NBT_ASSERT(req_packet->qdcount, 1);
if (rec->defend.positive) {
uint32_t i, num_ips;
- const struct wrepl_ip *ips;
+ const struct wrepl_ip *ips;
if (rec->defend.num_ips > 0) {
num_ips = rec->defend.num_ips;
rep_packet->answers[0].rr_type = NBT_QTYPE_NETBIOS;
rep_packet->answers[0].rdata.netbios.length = num_ips*6;
- rep_packet->answers[0].rdata.netbios.addresses =
+ rep_packet->answers[0].rdata.netbios.addresses =
talloc_array(rep_packet->answers, struct nbt_rdata_address, num_ips);
if (rep_packet->answers[0].rdata.netbios.addresses == NULL) return;
for (i=0; i < num_ips; i++) {
- struct nbt_rdata_address *addr =
+ struct nbt_rdata_address *addr =
&rep_packet->answers[0].rdata.netbios.addresses[i];
addr->nb_flags = rec->wins.nb_flags;
addr->ipaddr = ips[i].ip;
}
- DEBUG(2,("Sending positive name query reply for %s to %s:%d\n",
+ DEBUG(2,("Sending positive name query reply for %s to %s:%d\n",
nbt_name_string(rep_packet, name), src->addr, src->port));
} else {
/* send a negative reply */
ZERO_STRUCT(rep_packet->answers[0].rdata);
- DEBUG(2,("Sending negative name query reply for %s to %s:%d\n",
+ DEBUG(2,("Sending negative name query reply for %s to %s:%d\n",
nbt_name_string(rep_packet, name), src->addr, src->port));
}
}
static void test_conflict_owned_active_vs_replica_handler_release(
- struct nbt_name_socket *nbtsock,
- struct nbt_name_packet *req_packet,
+ struct nbt_name_socket *nbtsock,
+ struct nbt_name_packet *req_packet,
struct socket_address *src)
{
struct nbt_name *name;
struct nbt_name_packet *rep_packet;
- struct test_conflict_owned_active_vs_replica_struct *rec =
+ struct test_conflict_owned_active_vs_replica_struct *rec =
(struct test_conflict_owned_active_vs_replica_struct *)nbtsock->incoming.private_data;
_NBT_ASSERT(req_packet->qdcount, 1);
rep_packet->answers[0].ttl = req_packet->additional[0].ttl;
rep_packet->answers[0].rdata = req_packet->additional[0].rdata;
- DEBUG(2,("Sending name release reply for %s to %s:%d\n",
+ DEBUG(2,("Sending name release reply for %s to %s:%d\n",
nbt_name_string(rep_packet, name), src->addr, src->port));
nbt_name_reply_send(nbtsock, src, rep_packet);
rec->defend.ret = true;
}
-static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock,
- struct nbt_name_packet *req_packet,
+static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock,
+ struct nbt_name_packet *req_packet,
struct socket_address *src)
{
- struct test_conflict_owned_active_vs_replica_struct *rec =
+ struct test_conflict_owned_active_vs_replica_struct *rec =
(struct test_conflict_owned_active_vs_replica_struct *)nbtsock->incoming.private_data;
struct nbt_name *name = &req_packet->questions[0].name;
struct test_wrepl_conflict_conn *ctx;
if (torture_setting_bool(tctx, "quick", false))
- torture_skip(tctx,
+ torture_skip(tctx,
"skip NBT-WINSREPLICATION-OWNED test in quick test mode\n");
if (!torture_nbt_get_name(tctx, &name, &address))
mem_ctx, "winsreplication");
struct torture_tcase *tcase;
- tcase = torture_suite_add_simple_test(suite, "assoc_ctx1",
+ tcase = torture_suite_add_simple_test(suite, "assoc_ctx1",
test_assoc_ctx1);
tcase->tests->dangerous = true;
torture_suite_add_simple_test(suite, "assoc_ctx2", test_assoc_ctx2);
-
+
torture_suite_add_simple_test(suite, "wins_replication",
test_wins_replication);