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

List of all members.

Public Member Functions

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

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.

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


Member Function Documentation

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().

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().

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, CAFirstMix::m_u64LastTimestampReceived, pMix, CAMsg::printMsg(), CAAbstractControlChannel::sendXMLMessage(), setDOMElementAttribute(), setDOMElementValue(), and CAFirstMix::setMixParameters().

Referenced by CAReplayControlChannel::processXMLMessage().

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(), and CALastMix::init().

Stops the timestamp propagation.

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

Referenced by ~CAReplayCtrlChannelMsgProc().


Friends And Related Function Documentation

THREAD_RETURN rp_loopPropagateTimestamp ( void *  param) [friend]

Member Data Documentation

volatile bool CAReplayCtrlChannelMsgProc::m_bRun [private]
XERCES_CPP_NAMESPACE::DOMDocument* CAReplayCtrlChannelMsgProc::m_docTemplate [private]