#ifndef __Mbrd_Cache_h__
#define __Mbrd_Cache_h__ 1
#include <stdint.h>
#include <stdbool.h>
#include "Mbrd_UserGroup.h"
typedef struct _MbrdCache MbrdCache;
#define kDefaultExpirationServer 1*60*60
#define kDefaultNegativeExpirationServer 30*60
#define kDefaultExpirationClient 4*60*60
#define kDefaultNegativeExpirationClient 2*60*60
#define kDefaultKernelExpiration 2*60
#define kDefaultMaximumRefresh 15*60
#define KAUTH_EXTLOOKUP_REFRESH_MEMBERSHIP (1 << 15)
#define kKernelRequest (1 << 31)
#define kNoNegativeEntry (1 << 30)
#define ID_TYPE_GUID -1
#define ID_TYPE_GROUPMEMBERS -2
#define ID_TYPE_GROUPMEMBERSHIP -3
#define ID_TYPE_NESTEDGROUPS -4
#define ID_TYPE_RID -5
#define ID_TYPE_GROUPRID -6
#define ID_TYPE_GROUPSID -7
__BEGIN_DECLS
MbrdCache* MbrdCache_Create( int32_t defaultExpiration, int32_t defaultNegativeExpiration, int32_t kernelExp, int32_t maxRefresh,
int32_t kerberosFallback );
#define MbrdCache_Retain(a) ((MbrdCache *) dsRetainObject(a, &a->fRefCount))
void MbrdCache_Release( MbrdCache *cache );
int32_t MbrdCache_GetDefaultExpiration( MbrdCache *cache );
UserGroup* MbrdCache_GetAndRetain( MbrdCache *cache, int recordType, int idType, const void *idValue, int32_t flags );
UserGroup *MbrdCache_AddOrUpdate( MbrdCache *cache, UserGroup *entry, uint32_t flags );
void MbrdCache_RefreshHashes( MbrdCache *cache, UserGroup *existing );
int MbrdCache_SetNodeAvailability( MbrdCache *cache, const char *nodeName, bool nodeAvailable );
void MbrdCache_Sweep( MbrdCache *cache );
void MbrdCache_NodeChangeOccurred( MbrdCache *cache );
void MbrdCache_ResetCache( MbrdCache *cache );
void MbrdCache_DumpState( MbrdCache *cache );
int32_t MbrdCache_TTL( MbrdCache *cache, UserGroup *entry, int32_t flags );
int32_t MbrdCache_KerberosFallback( MbrdCache *cache );
void ConvertSIDToString( char* string, ntsid_t* sid );
__END_DECLS
#endif