Exemplo n.º 1
0
static bool test_wbc_resolve_winsbyip(struct torture_context *tctx)
{
    const char *ip;
    const char *host;
    struct nbt_name nbt_name;
    char *name;
    wbcErr ret;
    NTSTATUS status;

    host = torture_setting_string(tctx, "host", NULL);

    torture_comment(tctx, "test-WinsByIp: host='%s'\n", host);

    make_nbt_name_server(&nbt_name, host);

    status = resolve_name_ex(lpcfg_resolve_context(tctx->lp_ctx),
                             0, 0, &nbt_name, tctx, &ip, tctx->ev);
    torture_assert_ntstatus_ok(tctx, status,
                               talloc_asprintf(tctx,"Failed to resolve %s: %s",
                                       nbt_name.name, nt_errstr(status)));

    torture_comment(tctx, "test-WinsByIp: ip='%s'\n", ip);

    ret = wbcResolveWinsByIP(ip, &name);

    torture_assert_wbc_ok(tctx, ret, "wbcResolveWinsByIP for %s failed", ip);

    wbcFreeMemory(name);

    return true;
}
Exemplo n.º 2
0
Arquivo: wins.c Projeto: encukou/samba
static char *lookup_byaddr_backend(const char *ip)
{
	wbcErr result;
	char *name = NULL;

	result = wbcResolveWinsByIP(ip, &name);
	if (result != WBC_ERR_SUCCESS) {
		return NULL;
	}

	return name;
}
Exemplo n.º 3
0
static bool test_wbc_resolve_winsbyip(struct torture_context *tctx)
{
	const char *ip;
	char *name;
	wbcErr ret;

	ip = torture_setting_string(tctx, "host", NULL);

	ret = wbcResolveWinsByIP(ip, &name);

	torture_assert_wbc_ok(tctx, ret, "wbcResolveWinsByIP failed");

	wbcFreeMemory(name);

	return true;
}
Exemplo n.º 4
0
static bool wbinfo_wins_byip(const char *ip)
{
	wbcErr wbc_status = WBC_ERR_UNKNOWN_FAILURE;
	char *name = NULL;

	wbc_status = wbcResolveWinsByIP(ip, &name);
	if (!WBC_ERROR_IS_OK(wbc_status)) {
		return false;
	}

	/* Display response */

	d_printf("%s\n", name);

	wbcFreeMemory(name);

	return true;
}