Mixes for Privacy and Anonymity in the Internet
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
CAReplayCtrlChannelMsgProc Class Reference

Public Member Functions

 CAReplayCtrlChannelMsgProc (const CAMixWithReplayDB *pMix)
 Initialises the replay control channel messages processor with the necessary information. More...
 
 ~CAReplayCtrlChannelMsgProc ()
 
SINT32 propagateCurrentReplayTimestamp ()
 Propagates downstream the current replay timestamp. More...
 
SINT32 startTimeStampPorpagation (UINT32 minutesPropagationIntervall)
 Sends the current replay timestamp periodically on the downstream replay control channel. More...
 
SINT32 stopTimeStampPorpagation ()
 Stops the timestamp propagation. More...
 
SINT32 proccessGetTimestamp (const CAReplayControlChannel *pReceiver, const UINT8 *strMixID) const
 Proccesses a getTimeStamps request on a reply control channel. More...
 
SINT32 proccessGotTimestamp (const CAReplayControlChannel *pReceiver, const UINT8 *strMixID, const UINT32 offset) const
 Proccesses a received replay timestamp rt from mix strMixID. More...
 
SINT32 sendGetTimestamp (const UINT8 *strMixID)
 Sends upstram a request for the replay timestamp for the given mix. More...
 

Private Member Functions

SINT32 initTimestampsMessageTemplate ()
 We initialise the template used to generate the idividual responses to gettimestamps requests according to the mix ids of the cascade. More...
 

Private Attributes

const CAMixWithReplayDBm_pMix
 
CAReplayControlChannelm_pDownstreamReplayControlChannel
 
CAReplayControlChannelm_pUpstreamReplayControlChannel
 
UINT32 m_u32PropagationInterval
 
CAThreadm_pThreadTimestampPropagation
 
volatile bool m_bRun
 
XERCES_CPP_NAMESPACE::DOMDocument * m_docTemplate
 

Friends

THREAD_RETURN rp_loopPropagateTimestamp (void *param)
 

Constructor & Destructor Documentation

◆ CAReplayCtrlChannelMsgProc()

CAReplayCtrlChannelMsgProc::CAReplayCtrlChannelMsgProc ( const CAMixWithReplayDB pMix)

◆ ~CAReplayCtrlChannelMsgProc()

CAReplayCtrlChannelMsgProc::~CAReplayCtrlChannelMsgProc ( )

Member Function Documentation

◆ initTimestampsMessageTemplate()

SINT32 CAReplayCtrlChannelMsgProc::initTimestampsMessageTemplate ( )
private

We initialise the template used to generate the idividual responses to gettimestamps requests according to the mix ids of the cascade.

We later use this template to generate the responses quickly.

References createDOMDocument(), createDOMElement(), E_SUCCESS, E_UNKNOWN, CAMix::FIRST_MIX, CAMix::getType(), m_docTemplate, m_pMix, REPLAY_BASE, setDOMElementAttribute(), and setDOMElementValue().

Referenced by CAReplayCtrlChannelMsgProc().

◆ proccessGetTimestamp()

SINT32 CAReplayCtrlChannelMsgProc::proccessGetTimestamp ( const CAReplayControlChannel pReceiver,
const UINT8 strMixID 
) const

Proccesses a getTimeStamps request on a reply control channel.

Parameters
pReceiverthe control chanel which receives the getTimeStamps request
Return values
E_SUCCESSif the request could be processed successfully
E_UNKNOWNotherwise Proccesses a getTimeStamp request on a reply control channel.
Parameters
pReceiverthe control channel which receives the request
strMixIDthe mix id for which the timestamp is requested. If NULL we timestamp of this mix is requested.
Return values
E_SUCCESSif the request could be processed successfully
E_UNKNOWNotherwise

References createDOMDocument(), createDOMElement(), E_SUCCESS, E_UNKNOWN, CAMix::FIRST_MIX, getDOMChildByName(), CAMix::getType(), m_docTemplate, m_pMix, m_pUpstreamReplayControlChannel, CAMixWithReplayDB::m_u64ReferenceTime, pMix, CAAbstractControlChannel::sendXMLMessage(), setDOMElementAttribute(), and setDOMElementValue().

Referenced by CAReplayControlChannel::processXMLMessage().

◆ proccessGotTimestamp()

SINT32 CAReplayCtrlChannelMsgProc::proccessGotTimestamp ( const CAReplayControlChannel pReceiver,
const UINT8 strMixID,
const UINT32  offset 
) const

Proccesses a received replay timestamp rt from mix strMixID.

Parameters
pReceiverthe control channel which receives the timestamp
strMixIDthe mix id of the mix which sends the timestamp
rtthe timestamp
Return values
E_SUCCESSif the timestamp was preocessed successfully
E_UNKNOWNotherwise

References createDOMDocument(), createDOMElement(), E_SUCCESS, CAMix::FIRST_MIX, CAMix::getType(), len, m_pDownstreamReplayControlChannel, m_pMix, t_mix_parameters::m_strMixID, t_mix_parameters::m_u32ReplayOffset, pMix, CAMsg::printMsg(), CAAbstractControlChannel::sendXMLMessage(), setDOMElementAttribute(), and setDOMElementValue().

Referenced by CAReplayControlChannel::processXMLMessage().

◆ propagateCurrentReplayTimestamp()

SINT32 CAReplayCtrlChannelMsgProc::propagateCurrentReplayTimestamp ( )

◆ sendGetTimestamp()

SINT32 CAReplayCtrlChannelMsgProc::sendGetTimestamp ( const UINT8 strMixID)

◆ startTimeStampPorpagation()

SINT32 CAReplayCtrlChannelMsgProc::startTimeStampPorpagation ( UINT32  minutesPropagationIntervall)

Sends the current replay timestamp periodically on the downstream replay control channel.

Parameters
minutesPropagationIntervallsays, how often (in minutes) should the timestamp information be sent

References m_bRun, m_pThreadTimestampPropagation, m_u32PropagationInterval, rp_loopPropagateTimestamp, CAThread::setMainLoop(), and CAThread::start().

Referenced by CAMiddleMix::init().

◆ stopTimeStampPorpagation()

SINT32 CAReplayCtrlChannelMsgProc::stopTimeStampPorpagation ( )

Stops the timestamp propagation.

References E_SUCCESS, CAThread::join(), m_bRun, and m_pThreadTimestampPropagation.

Referenced by ~CAReplayCtrlChannelMsgProc().

Friends And Related Function Documentation

◆ rp_loopPropagateTimestamp

THREAD_RETURN rp_loopPropagateTimestamp ( void *  param)
friend

Member Data Documentation

◆ m_bRun

volatile bool CAReplayCtrlChannelMsgProc::m_bRun
private

◆ m_docTemplate

XERCES_CPP_NAMESPACE::DOMDocument* CAReplayCtrlChannelMsgProc::m_docTemplate
private

◆ m_pDownstreamReplayControlChannel

CAReplayControlChannel* CAReplayCtrlChannelMsgProc::m_pDownstreamReplayControlChannel
private

◆ m_pMix

const CAMixWithReplayDB* CAReplayCtrlChannelMsgProc::m_pMix
private

◆ m_pThreadTimestampPropagation

CAThread* CAReplayCtrlChannelMsgProc::m_pThreadTimestampPropagation
private

◆ m_pUpstreamReplayControlChannel

CAReplayControlChannel* CAReplayCtrlChannelMsgProc::m_pUpstreamReplayControlChannel
private

◆ m_u32PropagationInterval

UINT32 CAReplayCtrlChannelMsgProc::m_u32PropagationInterval
private