#ifndef _SECURITY_DYNAMICDLDBLIST_H_
#define _SECURITY_DYNAMICDLDBLIST_H_
#include <security_cdsa_client/DLDBList.h>
#include <security_cdsa_client/cssmclient.h>
namespace Security
{
namespace KeychainCore
{
class DynamicDLDBList
{
public:
DynamicDLDBList();
~DynamicDLDBList();
const vector<DLDbIdentifier> &searchList();
protected:
Mutex mMutex;
bool _add(const Guid &guid, uint32 subserviceID, CSSM_SERVICE_TYPE subserviceType);
bool _add(const DLDbIdentifier &);
bool _remove(const Guid &guid, uint32 subserviceID, CSSM_SERVICE_TYPE subserviceType);
bool _remove(const DLDbIdentifier &);
bool _load();
DLDbIdentifier dlDbIdentifier(const Guid &guid, uint32 subserviceID,
CSSM_SERVICE_TYPE subserviceType);
void callback(const Guid &guid, uint32 subserviceID,
CSSM_SERVICE_TYPE subserviceType, CSSM_MODULE_EVENT eventType);
private:
static CSSM_RETURN appNotifyCallback(const CSSM_GUID *guid, void *context,
uint32 subserviceId, CSSM_SERVICE_TYPE subserviceType, CSSM_MODULE_EVENT eventType);
vector<CssmClient::Module> mModules;
typedef vector<DLDbIdentifier> SearchList;
SearchList mSearchList;
bool mSearchListSet;
};
}
}
#endif