#ifndef __SharedConsts_h__
#define __SharedConsts_h__ 1
#include <mach/message.h>
#include <bsm/audit.h>
#include <DirectoryServiceCore/PrivateTypes.h>
#define kDSStdAuthSetShadowHashSecure "dsAuthMethodStandard:dsAuthSetShadowHashSecure"
#define kDSStdAuthSetShadowHashWindows "dsAuthMethodStandard:dsAuthSetShadowHashWindows"
#define kDSStdRecordTypeDirectoryNodeInfo "dsRecTypeStandard:DirectoryNodeInfo"
#define kDSStdRecordTypeSearchNodeInfo "dsRecTypeStandard:SearchNodeInfo"
#define kDBLocalDefaultPath "/var/db/dslocal/nodes/Default"
typedef struct sDSTableEntry {
UInt32 fRefNum;
UInt32 fTimeStamp;
void *fData;
struct sDSTableEntry *fNext;
} sDSTableEntry;
typedef struct {
unsigned int msgt_name : 8,
msgt_size : 8,
msgt_number : 8,
msgt_translate : 8;
} mach_msg_type_t;
typedef struct sObject
{
UInt32 type;
UInt32 count;
UInt32 offset;
UInt32 used;
UInt32 length;
} sObject;
typedef struct sComData
{
mach_msg_header_t head;
mach_msg_type_t type;
UInt32 fDataSize;
UInt32 fDataLength;
UInt32 fMsgID;
UInt32 fPID;
UInt32 fPort;
UInt32 fIPAddress;
UInt32 fUID;
UInt32 fEffectiveUID;
uid_t fAuditUID;
gid_t fEffectiveGID;
gid_t fGID;
au_asid_t fAuditSID;
au_tid_t fTerminalID;
sObject obj[ 10 ];
char data[ 1 ];
} sComData;
typedef struct sComProxyData
{
mach_msg_header_t head;
mach_msg_type_t type;
UInt32 fDataSize;
UInt32 fDataLength;
UInt32 fMsgID;
UInt32 fPID;
UInt32 fPort;
UInt32 fIPAddress;
sObject obj[ 10 ];
char data[ 1 ];
} sComProxyData;
#ifdef __cplusplus
const UInt32 kMsgBlockSize = 1024 * 4; const UInt32 kObjSize = sizeof( sObject ) * 10; const UInt32 kIPCMsgLen = kMsgBlockSize;
const UInt32 kMaxFixedMsg = 16384;
const UInt32 kMaxFixedMsgData = kMaxFixedMsg - sizeof(sComData); const UInt32 kMaxMIGMsg = kMaxFixedMsg + 256; #else
#define kMsgBlockSize 1024 * 4
#define kObjSize sizeof(sObject) * 10
#define kIPCMsgLen kMsgBlockSize
#define kMaxFixedMsg 16384
#define kMaxFixedMsgData kMaxFixedMsg - sizeof(sComData)
#define kMaxMIGMsg 16384 + 256
#endif
typedef struct sIPCMsg
{
mach_msg_header_t fHeader;
UInt32 fMsgType;
UInt32 fCount;
UInt32 fOf;
UInt32 fMsgID;
UInt32 fPID;
UInt32 fPort;
sObject obj[ 10 ];
char fData[ kIPCMsgLen ];
mach_msg_audit_trailer_t fTail; } sIPCMsg;
typedef enum {
kResult = 4460, ktDirRef = 4461,
ktNodeRef = 4462,
ktRecRef = 4463,
ktAttrListRef = 4464,
ktAttrValueListRef = 4465,
ktDataBuff = 4466,
ktDataList = 4467,
ktDirPattMatch = 4468,
kAttrPattMatch = 4469,
kAttrMatch = 4470,
kMatchRecCount = 4471,
kNodeNamePatt = 4472,
ktAccessControlEntry = 4473,
ktAttrEntry = 4474,
ktAttrValueEntry = 4475,
kOpenRecBool = 4476,
kAttrInfoOnly = 4477,
kRecFlags = 4478,
kAttrFlags = 4479,
kRecEntryIndex = 4480,
kAttrInfoIndex = 4481,
kAttrValueIndex = 4482,
kAttrValueID = 4483,
kOutBuffLen = 4484,
kAuthStepDataLen = 4485,
kAuthOnlyBool = 4486,
kDirNodeName = 4487,
kAuthMethod = 4488,
kNodeInfoTypeList = 4489,
kRecNameList = 4490,
kRecTypeList = 4491,
kAttrTypeList = 4492,
kRecTypeBuff = 4493,
kRecNameBuff = 4494,
kAttrType = 4495,
kAttrTypeBuff = 4496,
kAttrValueBuff = 4497,
kNewAttrBuff = 4498,
kFirstAttrBuff = 4499,
kAttrBuff = 4501,
kAuthStepBuff = 4502,
kAuthResponseBuff = 4503,
kAttrTypeRequestList = 4504,
kCustomRequestCode = 4505,
kPluginName = 4506,
kNodeCount = 4507,
kNodeIndex = 4508,
kAttrInfoCount = 4509,
kAttrRecEntryCount = 4510,
ktRecordEntry = 4511,
kAuthStepDataResponse = 4512,
kContextData = 4513,
ktPidRef = 4514,
ktGenericRef = 4515,
kNodeChangeToken = 4516,
ktEffectiveUID = 4517,
ktUID = 4518,
kAttrMatches = 4519,
kAttrValueList = 4520,
ktNodeRefMap = 4521, kEnd = 0xFFFFFFFF
} eValueType;
enum eDSServerCalls {
kOpenDirService = 1,
kCloseDirService,
kGetDirNodeName,
kGetDirNodeCount,
kGetDirNodeChangeToken,
kGetDirNodeList,
kFindDirNodes,
kVerifyDirRefNum,
kCheckUserNameAndPassword,
kAddChildPIDToReference,
kOpenDirServiceProxy,
kOpenDirServiceLocal,
kDSServerCallsEnd
};
enum eDSPluginCalls {
kDSPlugInCallsBegin = 128,
kReleaseContinueData,
kOpenDirNode,
kCloseDirNode,
kGetDirNodeInfo,
kGetRecordList,
kGetRecordEntry,
kGetAttributeEntry,
kGetAttributeValue,
kOpenRecord,
kGetRecordReferenceInfo,
kGetRecordAttributeInfo,
kGetRecordAttributeValueByID,
kGetRecordAttributeValueByIndex,
kFlushRecord,
kCloseRecord,
kSetRecordName,
kSetRecordType,
kDeleteRecord,
kCreateRecord,
kCreateRecordAndOpen,
kAddAttribute,
kRemoveAttribute,
kAddAttributeValue,
kRemoveAttributeValue,
kSetAttributeValue,
kDoDirNodeAuth,
kDoAttributeValueSearch,
kDoAttributeValueSearchWithData,
kDoPlugInCustomCall,
kCloseAttributeList,
kCloseAttributeValueList,
kHandleNetworkTransition,
kServerRunLoop,
kDoDirNodeAuthOnRecordType,
kCheckNIAutoSwitch,
kGetRecordAttributeValueByValue,
kDoMultipleAttributeValueSearch,
kDoMultipleAttributeValueSearchWithData,
kSetAttributeValues,
kKerberosMutex,
kHandleSystemWillSleep,
kHandleSystemWillPowerOn,
kDSPlugInCallsEnd
};
enum eLogFlags {
kLogNone = 0x00000000, kLogMeta = 0x00000001, kLogApplication = 0x00000002,
kLogAssert = 0x00000004,
kLogListener = 0x00000010,
kLogHandler = 0x00000100, kLogMsgQueue = 0x00000200,
kLogThreads = 0x00001000,
kLogEndpoint = 0x00002000,
kLogPlugin = 0x00004000,
kLogConnection = 0x00008000,
kLogMsgTrans = 0x00010000,
kLogTCPEndpoint = 0x00020000,
kLogPerformanceStats = 0x00040000,
kLogEmergency = 0x00100000, kLogAlert = 0x00200000, kLogCritical = 0x00400000, kLogError = 0x00800000, kLogWarning = 0x01000000, kLogNotice = 0x02000000, kLogInfo = 0x04000000, kLogDebug = 0x08000000,
kLogAPICalls = 0x40000000,
kLogEverything = 0x7FFFFFFF,
kLogDebugHeader = 0x80000000 };
#endif // __SharedConsts_h__