summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2005-05-22 10:23:01 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:16:58 -0500
commit2b7fe67f4d02f861c9a4bfe823e648f0a995e613 (patch)
tree969cd8c1c004517303dc25629ecaf0227c45bfbe /source4/torture
parentffbeabef646987f02b98cd1f781d3c2a614b3d24 (diff)
downloadsamba-2b7fe67f4d02f861c9a4bfe823e648f0a995e613.tar.gz
samba-2b7fe67f4d02f861c9a4bfe823e648f0a995e613.tar.bz2
samba-2b7fe67f4d02f861c9a4bfe823e648f0a995e613.zip
r6933: Add a couple of helper functions for creating nbt names.
(This used to be commit b896daf11c3efb1b3ca939575da9dab82b395777)
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/ldap/cldapbench.c4
-rw-r--r--source4/torture/nbt/dgram.c13
-rw-r--r--source4/torture/nbt/query.c4
-rw-r--r--source4/torture/nbt/register.c4
-rw-r--r--source4/torture/nbt/wins.c4
-rw-r--r--source4/torture/nbt/winsbench.c4
-rw-r--r--source4/torture/nbt/winsreplication.c4
-rw-r--r--source4/torture/rpc/xplogin.c4
-rw-r--r--source4/torture/torture.c4
9 files changed, 11 insertions, 34 deletions
diff --git a/source4/torture/ldap/cldapbench.c b/source4/torture/ldap/cldapbench.c
index 8eaddc78f9..0a021dacce 100644
--- a/source4/torture/ldap/cldapbench.c
+++ b/source4/torture/ldap/cldapbench.c
@@ -108,9 +108,7 @@ BOOL torture_bench_cldap(void)
NTSTATUS status;
BOOL ret = True;
- name.name = lp_parm_string(-1, "torture", "host");
- name.type = NBT_NAME_SERVER;
- name.scope = NULL;
+ make_nbt_name_server(&name, lp_parm_string(-1, "torture", "host"));
/* do an initial name resolution to find its IP */
status = resolve_name(&name, mem_ctx, &address);
diff --git a/source4/torture/nbt/dgram.c b/source4/torture/nbt/dgram.c
index 5726e68471..d5fa014ce1 100644
--- a/source4/torture/nbt/dgram.c
+++ b/source4/torture/nbt/dgram.c
@@ -92,9 +92,7 @@ static BOOL nbt_test_netlogon(TALLOC_CTX *mem_ctx,
logon.req.pdc.lmnt_token = 0xFFFF;
logon.req.pdc.lm20_token = 0xFFFF;
- myname.name = TEST_NAME;
- myname.type = NBT_NAME_CLIENT;
- myname.scope = NULL;
+ make_nbt_name_client(&myname, TEST_NAME);
status = dgram_mailslot_netlogon_send(dgmsock, &name, address,
0, &myname, &logon);
@@ -154,9 +152,7 @@ static BOOL nbt_test_netlogon2(TALLOC_CTX *mem_ctx,
logon.req.pdc2.lmnt_token = 0xFFFF;
logon.req.pdc2.lm20_token = 0xFFFF;
- myname.name = TEST_NAME;
- myname.type = NBT_NAME_CLIENT;
- myname.scope = NULL;
+ make_nbt_name_client(&myname, TEST_NAME);
status = dgram_mailslot_netlogon_send(dgmsock, &name, address,
0, &myname, &logon);
@@ -257,10 +253,7 @@ static BOOL nbt_test_ntlogon(TALLOC_CTX *mem_ctx,
logon.req.logon.lmnt_token = 0xFFFF;
logon.req.logon.lm20_token = 0xFFFF;
-
- myname.name = TEST_NAME;
- myname.type = NBT_NAME_CLIENT;
- myname.scope = NULL;
+ make_nbt_name_client(&myname, TEST_NAME);
status = dgram_mailslot_ntlogon_send(dgmsock, &name, address,
0, &myname, &logon);
diff --git a/source4/torture/nbt/query.c b/source4/torture/nbt/query.c
index a9141f4431..3764596f3f 100644
--- a/source4/torture/nbt/query.c
+++ b/source4/torture/nbt/query.c
@@ -110,9 +110,7 @@ BOOL torture_bench_nbt(void)
NTSTATUS status;
BOOL ret = True;
- name.name = lp_parm_string(-1, "torture", "host");
- name.type = NBT_NAME_SERVER;
- name.scope = NULL;
+ make_nbt_name_server(&name, lp_parm_string(-1, "torture", "host"));
/* do an initial name resolution to find its IP */
status = resolve_name(&name, mem_ctx, &address);
diff --git a/source4/torture/nbt/register.c b/source4/torture/nbt/register.c
index e9b98663a5..463783e1c9 100644
--- a/source4/torture/nbt/register.c
+++ b/source4/torture/nbt/register.c
@@ -160,9 +160,7 @@ BOOL torture_nbt_register(void)
NTSTATUS status;
BOOL ret = True;
- name.name = strupper_talloc(mem_ctx, lp_parm_string(-1, "torture", "host"));
- name.type = NBT_NAME_SERVER;
- name.scope = NULL;
+ make_nbt_name_server(&name, strupper_talloc(mem_ctx, lp_parm_string(-1, "torture", "host")));
/* do an initial name resolution to find its IP */
status = resolve_name(&name, mem_ctx, &address);
diff --git a/source4/torture/nbt/wins.c b/source4/torture/nbt/wins.c
index f92a23f732..b099f48476 100644
--- a/source4/torture/nbt/wins.c
+++ b/source4/torture/nbt/wins.c
@@ -345,9 +345,7 @@ BOOL torture_nbt_wins(void)
NTSTATUS status;
BOOL ret = True;
- name.name = lp_parm_string(-1, "torture", "host");
- name.type = NBT_NAME_SERVER;
- name.scope = NULL;
+ make_nbt_name_server(&name, lp_parm_string(-1, "torture", "host"));
/* do an initial name resolution to find its IP */
status = resolve_name(&name, mem_ctx, &address);
diff --git a/source4/torture/nbt/winsbench.c b/source4/torture/nbt/winsbench.c
index 54f730ce84..76763d3bf0 100644
--- a/source4/torture/nbt/winsbench.c
+++ b/source4/torture/nbt/winsbench.c
@@ -276,9 +276,7 @@ BOOL torture_bench_wins(void)
NTSTATUS status;
BOOL ret = True;
- name.name = lp_parm_string(-1, "torture", "host");
- name.type = NBT_NAME_SERVER;
- name.scope = NULL;
+ make_nbt_name_server(&name, lp_parm_string(-1, "torture", "host"));
/* do an initial name resolution to find its IP */
status = resolve_name(&name, mem_ctx, &address);
diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c
index 5ba6003b78..4e91deb84a 100644
--- a/source4/torture/nbt/winsreplication.c
+++ b/source4/torture/nbt/winsreplication.c
@@ -124,9 +124,7 @@ BOOL torture_nbt_winsreplication(void)
NTSTATUS status;
BOOL ret = True;
- name.name = lp_parm_string(-1, "torture", "host");
- name.type = NBT_NAME_SERVER;
- name.scope = NULL;
+ make_nbt_name_server(&name, lp_parm_string(-1, "torture", "host"));
/* do an initial name resolution to find its IP */
status = resolve_name(&name, mem_ctx, &address);
diff --git a/source4/torture/rpc/xplogin.c b/source4/torture/rpc/xplogin.c
index d54dfdf310..235ac02e38 100644
--- a/source4/torture/rpc/xplogin.c
+++ b/source4/torture/rpc/xplogin.c
@@ -56,9 +56,7 @@ static NTSTATUS after_negprot(struct smbcli_transport **dst_transport,
struct nbt_name called;
/* send a NBT session request, if applicable */
- calling.name = my_name;
- calling.type = NBT_NAME_CLIENT;
- calling.scope = NULL;
+ make_nbt_name_client(&calling, my_name);
nbt_choose_called_name(transport, &called, dest_host, NBT_NAME_SERVER);
diff --git a/source4/torture/torture.c b/source4/torture/torture.c
index f5e52c5358..b7e2168319 100644
--- a/source4/torture/torture.c
+++ b/source4/torture/torture.c
@@ -49,9 +49,7 @@ static struct smbcli_state *open_nbt_connection(void)
struct smbcli_state *cli;
const char *host = lp_parm_string(-1, "torture", "host");
- calling.name = lp_netbios_name();
- calling.type = NBT_NAME_CLIENT;
- calling.scope = NULL;
+ make_nbt_name_client(&calling, lp_netbios_name());
nbt_choose_called_name(NULL, &called, host, NBT_NAME_SERVER);