dsgetdc.c revision b3700b074e637f8c6991b70754c88a2cfffb246b
/*
* This file and its contents are supplied under the terms of the
* Common Development and Distribution License ("CDDL"), version 1.0.
* You may only use this file in accordance with the terms of version
* 1.0 of the CDDL.
*
* A full copy of the text of the CDDL should have accompanied this
* source. A copy of the CDDL is also available via the Internet at
*/
/*
* Copyright 2014 Nexenta Systems, Inc. All rights reserved.
*/
/*
* MS-compatible Directory Server Discovery API, DsGetDC...()
*/
#include <stdlib.h>
#include <string.h>
#include <smb/ntstatus.h>
#include "dsgetdc.h"
#include "ads_priv.h"
#include <assert.h>
#define DSGETDC_VALID_FLAGS ( \
DS_PDC_REQUIRED | \
DS_IP_REQUIRED | \
DS_KDC_REQUIRED | \
DS_AVOID_SELF | \
DS_IS_FLAT_NAME | \
DS_IS_DNS_NAME | \
/*
* The Windows version of this would return a single allocation,
* where any strings pointed to in the returned structure would be
* stored in space following the top-level returned structure.
* This allows NetApiBufferFree() to be the same as free().
*
* However, we don't have an easy way to do that right now, so
* the dcinfo returned here will be free'd with DsFreeDcInfo().
*/
_DsGetDcName(const char *ComputerName,
{
/*
* Later check for over constrained optional args here,
* and return (ERROR_INVALID_PARAMETER);
*/
if (Flags & ~DSGETDC_VALID_FLAGS)
return (ERROR_INVALID_FLAGS);
/*
* Call the ADS deamon.
*/
return (RPC_S_NOT_LISTENING);
if (DomainGuid != NULL)
sizeof (args.DomainGuid));
if (clstat != RPC_SUCCESS)
return (RPC_S_CALL_FAILED);
return (ERROR_NOT_ENOUGH_MEMORY);
/*
* We have taken pains to make these two the same.
* DOMAIN_CONTROLLER_INFO / struct adspriv_dcinfo
*/
/* LINTED E_TRUE_LOGICAL_EXPR */
/*
* NB: Do NOT xdr_free the result, because we're
* returning a copy of it to the caller.
*/
return (0);
}
int
DsGetDcName(const char *ComputerName,
{
int rc;
switch (status) {
case 0:
rc = 0;
break;
case NT_STATUS_NO_SUCH_DOMAIN: /* Specified domain unknown */
case NT_STATUS_CANT_WAIT: /* or gave up waiting. */
case NT_STATUS_INVALID_SERVER_STATE: /* not in domain mode. */
break;
default:
break;
}
return (rc);
}
void
{
}
}