summaryrefslogtreecommitdiffstats
path: root/source/torture
diff options
context:
space:
mode:
authorRafal Szczesniak <mimir@samba.org>2006-07-09 12:57:40 +0000
committerRafal Szczesniak <mimir@samba.org>2006-07-09 12:57:40 +0000
commite7f99837c4e58580b83a67e389e72efc1415cfa9 (patch)
tree37ae321732753d933b0c90eb73be100b674262ef /source/torture
parentd567ab0005f9c058997a2378c481cb426700b3db (diff)
downloadsamba-e7f99837c4e58580b83a67e389e72efc1415cfa9.tar.gz
samba-e7f99837c4e58580b83a67e389e72efc1415cfa9.tar.xz
samba-e7f99837c4e58580b83a67e389e72efc1415cfa9.zip
r16896: Allow to use both binding and unc string to specify host name
being looked up. rafal
Diffstat (limited to 'source/torture')
-rw-r--r--source/torture/libnet/libnet_lookup.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/source/torture/libnet/libnet_lookup.c b/source/torture/libnet/libnet_lookup.c
index 5d347cd049a..12f3863afb2 100644
--- a/source/torture/libnet/libnet_lookup.c
+++ b/source/torture/libnet/libnet_lookup.c
@@ -23,6 +23,7 @@
#include "lib/cmdline/popt_common.h"
#include "libnet/libnet.h"
#include "librpc/gen_ndr/nbt.h"
+#include "librpc/rpc/dcerpc.h"
#include "torture/torture.h"
@@ -33,6 +34,8 @@ BOOL torture_lookup(struct torture_context *torture)
TALLOC_CTX *mem_ctx;
struct libnet_context *ctx;
struct libnet_Lookup lookup;
+ struct dcerpc_binding *bind;
+ const char *bindstr;
const char *address;
mem_ctx = talloc_init("test_lookup");
@@ -43,6 +46,14 @@ BOOL torture_lookup(struct torture_context *torture)
address = talloc_array(ctx, const char, 16);
lookup.in.hostname = lp_parm_string(-1, "torture", "host");
+ if (lookup.in.hostname == NULL) {
+ bindstr = lp_parm_string(-1, "torture", "binding");
+ status = dcerpc_parse_binding(mem_ctx, bindstr, &bind);
+ if (NT_STATUS_IS_OK(status)) {
+ lookup.in.hostname = bind->host;
+ }
+ }
+
lookup.in.type = NBT_NAME_CLIENT;
lookup.in.methods = NULL;
lookup.out.address = &address;
@@ -70,6 +81,8 @@ BOOL torture_lookup_host(struct torture_context *torture)
TALLOC_CTX *mem_ctx;
struct libnet_context *ctx;
struct libnet_Lookup lookup;
+ struct dcerpc_binding *bind;
+ const char *bindstr;
const char *address;
mem_ctx = talloc_init("test_lookup_host");
@@ -80,6 +93,14 @@ BOOL torture_lookup_host(struct torture_context *torture)
address = talloc_array(mem_ctx, const char, 16);
lookup.in.hostname = lp_parm_string(-1, "torture", "host");
+ if (lookup.in.hostname == NULL) {
+ bindstr = lp_parm_string(-1, "torture", "binding");
+ status = dcerpc_parse_binding(mem_ctx, bindstr, &bind);
+ if (NT_STATUS_IS_OK(status)) {
+ lookup.in.hostname = bind->host;
+ }
+ }
+
lookup.in.methods = NULL;
lookup.out.address = &address;