#ifndef __CMessaging_h__
#define __CMessaging_h__ 1
#include <DirectoryServiceCore/PrivateTypes.h>
#include <DirectoryServiceCore/SharedConsts.h>
#include <DirectoryService/DirServicesTypes.h>
#ifndef SERVERINTERNAL
#include <DirectoryService/CClientEndPoint.h>
#include "DSTCPEndpoint.h"
#endif
class DSMutexSemaphore;
class CMessaging {
public:
CMessaging ( Boolean inMachEndpoint, UInt32 inTranslateBit );
virtual ~CMessaging ( void );
SInt32 ConfigTCP ( const char *inRemoteIPAddress,
UInt32 inRemotePort );
#ifndef SERVERINTERNAL
SInt32 SendServerMessage ( void );
SInt32 SendRemoteMessage ( void );
#endif
SInt32 GetReplyMessage ( void );
SInt32 OpenCommPort ( Boolean inLocalDS );
SInt32 CloseCommPort ( void );
SInt32 OpenTCPEndpoint ( void );
SInt32 CloseTCPEndpoint ( void );
SInt32 Add_tDataBuff_ToMsg ( tDataBuffer *inBuff, eValueType inType );
SInt32 Add_tDataList_ToMsg ( tDataList *inList, eValueType inType );
SInt32 Add_Value_ToMsg ( UInt32 inValue, eValueType inType );
SInt32 Add_tAttrEntry_ToMsg ( tAttributeEntry *inData );
SInt32 Add_tAttrValueEntry_ToMsg ( tAttributeValueEntry *inData );
SInt32 Add_tRecordEntry_ToMsg ( tRecordEntry *inData );
SInt32 Get_tDataBuff_FromMsg ( tDataBuffer **outBuff, eValueType inType );
SInt32 Get_tDataList_FromMsg ( tDataList **outList, eValueType inType );
SInt32 Get_Value_FromMsg ( UInt32 *outValue, eValueType inType );
SInt32 Get_tAttrEntry_FromMsg ( tAttributeEntry **outAttrEntry, eValueType inType );
SInt32 Get_tAttrValueEntry_FromMsg ( tAttributeValueEntry **outAttrValue, eValueType inType );
SInt32 Get_tRecordEntry_FromMsg ( tRecordEntry **outRecEntry, eValueType inType );
SInt32 SendInlineMessage ( UInt32 inMsgType );
void Lock ( void );
void Unlock ( void );
void ClearMessageBlock ( void );
UInt32 GetServerVersion ( void );
void SetServerVersion ( UInt32 inServerVersion );
const char *GetProxyIPAddress ( void );
void ResetMessageBlock ( void );
void ChangeLocalDaemonUse ( dsBool inLocalDaemon ) { fLocalDaemonInUse = inLocalDaemon; }
#ifdef SERVERINTERNAL
static bool IsThreadUsingInternalDispatchBuffering
( UInt32 inThreadSig );
#endif
private:
SInt32 GetEmptyObj ( sComData *inMsg, eValueType inType, sObject **outObj );
SInt32 GetThisObj ( sComData *inMsg, eValueType inType, sObject **outObj );
sComData* GetMsgData ( void );
bool Grow ( UInt32 inOffset, UInt32 inSize );
#ifndef SERVERINTERNAL
CClientEndPoint *fCommPort;
DSTCPEndpoint *fTCPEndpoint;
UInt32 fRemoteIPAddress;
UInt32 fRemotePort;
#endif
dsBool fLocalDaemonInUse;
UInt32 fTranslateBit;
DSMutexSemaphore *fLock;
sComData *fMsgData;
Boolean bMachEndpoint; UInt32 fServerVersion; };
#endif