/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4 -*-
 * ex: set softtabstop=4 tabstop=8 expandtab shiftwidth=4: *
 * Editor Settings: expandtabs and use 4 spaces for indentation */

/*
 * Copyright Likewise Software
 * All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2.1 of the license, or (at
 * your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser
 * General Public License for more details.  You should have received a copy
 * of the GNU Lesser General Public License along with this program.  If
 * not, see <http://www.gnu.org/licenses/>.
 *
 * LIKEWISE SOFTWARE MAKES THIS SOFTWARE AVAILABLE UNDER OTHER LICENSING
 * TERMS AS WELL.  IF YOU HAVE ENTERED INTO A SEPARATE LICENSE AGREEMENT
 * WITH LIKEWISE SOFTWARE, THEN YOU MAY ELECT TO USE THE SOFTWARE UNDER THE
 * TERMS OF THAT SOFTWARE LICENSE AGREEMENT INSTEAD OF THE TERMS OF THE GNU
 * LESSER GENERAL PUBLIC LICENSE, NOTWITHSTANDING THE ABOVE NOTICE.  IF YOU
 * HAVE QUESTIONS, OR WISH TO REQUEST A COPY OF THE ALTERNATE LICENSING
 * TERMS OFFERED BY LIKEWISE SOFTWARE, PLEASE CONTACT LIKEWISE SOFTWARE AT
 * license@likewisesoftware.com
 */



/*
 * Copyright (C) Likewise Software. All rights reserved.
 *
 * Module Name:
 *
 *        local.h
 *
 * Abstract:
 *
 *        Likewise Security and Authentication Subsystem (LSASS) Client API
 *
 * Authors: Rafal Szczesniak (rafal@likewise.com)
 *
 */
#ifndef __LSACLIENT_LOCAL_H__
#define __LSACLIENT_LOCAL_H__

/**
 * @file lsa/local.h
 * @brief LSASS Local Provider Public Client API
 */

#include <lsa/lsa.h>

/**
 * @defgroup local Local Provider client API
 * @brief Local Provider client API
 * @ingroup client
 *
 * This module provides functions to communicate with the lsass
 * local provider.
 */

/*@{*/

/**
 * @brief Set machine SID
 *
 * Sets the SID which identifies this machine in the local account database.
 * @note This is @e not the same as the SID of the machine account in AD.
 *
 * @param[in] hLsaConnection a server connection handle
 * @param[in] pszSid the new machine SID
 * @retval ERROR_SUCCESS success
 * @retval ... error
 */
LW_DWORD
LsaLocalSetMachineSid(
    LW_IN LW_HANDLE hLsaConnection,
    LW_IN LW_PCSTR  pszSid
    );

/**
 * @brief Get current machine SID
 *
 * Gets the current SID which identifies this machine in the local account database.
 * The result should be freed with LwFreeMemory().
 * @note This is @e not the same as the SID of the machine account in AD.
 *
 * @param[in] hLsaConnection a server connection handle
 * @param[out] ppszSid set to the machine SID
 * @retval ERROR_SUCCESS success
 * @retval ... error
 */
LW_DWORD
LsaLocalGetMachineSid(
    LW_IN LW_HANDLE hLsaConnection,
    LW_IN LW_PSTR  *ppszSid
    );

/**
 * @brief Set machine name
 *
 * Sets the machine name in the local account database.  Note that this
 * need not be the same as the hostname according to @c hostname command.
 *
 * @param[in] hLsaConnection a server connection handle
 * @param[in] pszMachineName the new machine name
 * @retval ERROR_SUCCESS success
 * @retval ... error
 */
LW_DWORD
LsaLocalSetMachineName(
    LW_IN LW_HANDLE hLsaConnection,
    LW_IN LW_PCSTR  pszMachineName
    );

/**
 * @brief Get machine name
 *
 * Gets the machine name in the local account database.  Note that this
 * need not be the same as the hostname according to @c hostname command.
 * The result should be freed with #LwFreeMemory().
 *
 * @param[in] hLsaConnection a server connection handle
 * @param[out] ppszMachineName set to the machine name
 * @retval ERROR_SUCCESS success
 * @retval ... error
 */
LW_DWORD
LsaLocalGetMachineName(
    LW_IN LW_HANDLE hLsaConnection,
    LW_IN LW_PSTR  *ppszMachineName
    );

/*@}*/

#endif /* __LSACLIENT_LOCAL_H__ */
