summaryrefslogtreecommitdiff
path: root/source4/torture/libnet
diff options
context:
space:
mode:
authorRafal Szczesniak <mimir@samba.org>2005-07-02 14:37:21 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:19:06 -0500
commit12d4893c28b19a26f2d8dae835a5774a5150be6e (patch)
tree85a57550053fe2ff007012844708abe86f85dfbf /source4/torture/libnet
parentc2e76c4648641e24991986baa18a0e67bd0b6c9d (diff)
downloadsamba-12d4893c28b19a26f2d8dae835a5774a5150be6e.tar.gz
samba-12d4893c28b19a26f2d8dae835a5774a5150be6e.tar.bz2
samba-12d4893c28b19a26f2d8dae835a5774a5150be6e.zip
r8080: Use libnet_context where using libnet_Lookup functions now.
rafal (This used to be commit 1815a6af06aa791bfecb4aee8742701975d35318)
Diffstat (limited to 'source4/torture/libnet')
-rw-r--r--source4/torture/libnet/libnet_lookup.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/source4/torture/libnet/libnet_lookup.c b/source4/torture/libnet/libnet_lookup.c
index eae270fe4b..42baacc1cb 100644
--- a/source4/torture/libnet/libnet_lookup.c
+++ b/source4/torture/libnet/libnet_lookup.c
@@ -20,6 +20,7 @@
*/
#include "includes.h"
+#include "lib/cmdline/popt_common.h"
#include "libnet/libnet.h"
#include "libnet/composite.h"
#include "libcli/composite/monitor.h"
@@ -30,17 +31,21 @@ BOOL torture_lookup(void)
{
NTSTATUS status;
TALLOC_CTX *mem_ctx;
+ struct libnet_context *ctx;
struct libnet_Lookup lookup;
const char address[16];
mem_ctx = talloc_init("test_lookup");
+ ctx = libnet_context_init(NULL);
+ ctx->cred = cmdline_credentials;
+
lookup.in.hostname = lp_netbios_name();
lookup.in.methods = lp_name_resolve_order();
lookup.in.type = NBT_NAME_CLIENT;
- lookup.out.address = (const char**)&address;
+ lookup.out.address = &address;
- status = libnet_Lookup(mem_ctx, &lookup);
+ status = libnet_Lookup(ctx, mem_ctx, &lookup);
if (!NT_STATUS_IS_OK(status)) {
printf("Couldn't lookup name %s: %s\n", lookup.in.hostname, nt_errstr(status));
@@ -55,16 +60,20 @@ BOOL torture_lookup_host(void)
{
NTSTATUS status;
TALLOC_CTX *mem_ctx;
+ struct libnet_context *ctx;
struct libnet_Lookup lookup;
const char address[16];
mem_ctx = talloc_init("test_lookup_host");
+ ctx = libnet_context_init(NULL);
+ ctx->cred = cmdline_credentials;
+
lookup.in.hostname = lp_netbios_name();
lookup.in.methods = lp_name_resolve_order();
- lookup.out.address = (const char**)&address;
+ lookup.out.address = &address;
- status = libnet_LookupHost(mem_ctx, &lookup);
+ status = libnet_LookupHost(ctx, mem_ctx, &lookup);
if (!NT_STATUS_IS_OK(status)) {
printf("Couldn't lookup host %s: %s\n", lookup.in.hostname, nt_errstr(status));
@@ -79,16 +88,20 @@ BOOL torture_lookup_pdc(void)
{
NTSTATUS status;
TALLOC_CTX *mem_ctx;
+ struct libnet_context *ctx;
struct libnet_Lookup lookup;
const char address[16];
mem_ctx = talloc_init("test_lookup_pdc");
+ ctx = libnet_context_init(NULL);
+ ctx->cred = cmdline_credentials;
+
lookup.in.hostname = lp_workgroup();
lookup.in.methods = lp_name_resolve_order();
- lookup.out.address = (const char**)&address;
+ lookup.out.address = &address;
- status = libnet_LookupPdc(mem_ctx, &lookup);
+ status = libnet_LookupPdc(ctx, mem_ctx, &lookup);
if (!NT_STATUS_IS_OK(status)) {
printf("Couldn't lookup pdc %s: %s\n", lookup.in.hostname, nt_errstr(status));