/* Editor Settings: expandtabs and use 4 spaces for indentation
 * ex: set softtabstop=4 tabstop=8 expandtab shiftwidth=4: *
 */

/*
 * 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:
 *
 *        krb5pac.h
 *
 * Abstract:
 *
 *        Remote Procedure Call (RPC) Client Interface
 *
 *        Kerberos 5 PAC library
 *
 * Authors: Kyle Stemen (kstemen@likewise.com)
 */

#ifndef _RPC_KRB5PAC_H_H
#define _RPC_KRB5PAC_H_H

LW_BEGIN_EXTERN_C


typedef struct _LW_PAC_LOGON_INFO
{
    NetrSamInfo3 info3;
    PSID res_group_dom_sid;
    RID_WITH_ATTRIBUTE_ARRAY res_groups;
} LW_PAC_LOGON_INFO, *PLW_PAC_LOGON_INFO;


#ifndef _DCE_IDL_

NTSTATUS
DecodePacLogonInfo(
    IN PVOID pBuffer,
    IN size_t sBufferLen,
    OUT LW_PAC_LOGON_INFO** ppLogonInfo
    );


NTSTATUS
EncodePacLogonInfo(
    IN LW_PAC_LOGON_INFO* pLogonInfo,
    OUT PDWORD pdwEncodedSize,
    OUT PVOID* ppEncodedBuffer
    );


VOID
FreePacLogonInfo(
    LW_PAC_LOGON_INFO* pInfo
    );


VOID
FreeUnicodeStringContents(
    PUNICODE_STRING  pStr
    );


VOID
FreeRidWithAttributeArrayContents(
    PRID_WITH_ATTRIBUTE_ARRAY  pArr
    );


VOID
FreeNetrSamBaseInfoContents(
    NetrSamBaseInfo *pBase
    );


VOID
FreeSidAttrArray(
    NetrSidAttr *pSids,
    size_t sCount
    );


VOID
FreeNetrSamInfo3Contents(
    NetrSamInfo3 *pInfo
    );


#endif /* _DCE_IDL_ */

LW_END_EXTERN_C

#endif /* _RPC_KRB5PAC_H_H */

/*
local variables:
mode: c
c-basic-offset: 4
indent-tabs-mode: nil
tab-width: 4
end:
*/
