#include "libcli/libcli.h"
#include "libcli/resolve/resolve.h"
#include "libcli/finddcs.h"
-#include "param/param.h"
struct finddcs_state {
struct composite_context *ctx;
struct composite_context *finddcs_send(TALLOC_CTX *mem_ctx,
const char *my_netbios_name,
+ uint16_t nbt_port,
const char *domain_name,
int name_type,
struct dom_sid *domain_sid,
state->ctx = c;
- state->nbt_port = lp_nbt_port(global_loadparm);
+ state->nbt_port = nbt_port;
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;
NTSTATUS finddcs(TALLOC_CTX *mem_ctx,
const char *my_netbios_name,
+ uint16_t nbt_port,
const char *domain_name, int name_type,
struct dom_sid *domain_sid,
struct resolve_context *resolve_ctx,
{
struct composite_context *c = finddcs_send(mem_ctx,
my_netbios_name,
+ nbt_port,
domain_name, name_type,
domain_sid, resolve_ctx,
event_ctx, msg_ctx);
struct messaging_context *msg_ctx =
messaging_client_init(mem_ctx, lp_messaging_path(mem_ctx, ctx->lp_ctx), ctx->event_ctx);
- c = finddcs_send(mem_ctx, lp_netbios_name(ctx->lp_ctx),
+ c = finddcs_send(mem_ctx, lp_netbios_name(ctx->lp_ctx), lp_nbt_port(ctx->lp_ctx),
io->in.domain_name, io->in.name_type,
NULL, ctx->resolve_ctx, ctx->event_ctx, msg_ctx);
return c;
if (dom_sid == NULL) goto failed;
ctx = finddcs_send(mem_ctx, lp_netbios_name(service->task->lp_ctx),
+ lp_nbt_port(service->task->lp_ctx),
domain_name, NBT_NAME_LOGON,
dom_sid,
lp_resolve_context(service->task->lp_ctx),