Mixe for Privacy and Anonymity in the Internet
|
#include <CAReplayCtrlChannelMsgProc.hpp>
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 CAMixWithReplayDB * | m_pMix |
CAReplayControlChannel * | m_pDownstreamReplayControlChannel |
CAReplayControlChannel * | m_pUpstreamReplayControlChannel |
UINT32 | m_u32PropagationInterval |
CAThread * | m_pThreadTimestampPropagation |
volatile bool | m_bRun |
XERCES_CPP_NAMESPACE::DOMDocument * | m_docTemplate |
Friends | |
THREAD_RETURN | rp_loopPropagateTimestamp (void *param) |
Definition at line 37 of file CAReplayCtrlChannelMsgProc.hpp.
CAReplayCtrlChannelMsgProc::CAReplayCtrlChannelMsgProc | ( | const CAMixWithReplayDB * | pMix | ) |
Initialises the replay control channel messages processor with the necessary information.
Definition at line 39 of file CAReplayCtrlChannelMsgProc.cpp.
References CAMix::getDownstreamControlChannelDispatcher(), CAMix::getUpstreamControlChannelDispatcher(), initTimestampsMessageTemplate(), m_docTemplate, m_pDownstreamReplayControlChannel, m_pMix, m_pThreadTimestampPropagation, m_pUpstreamReplayControlChannel, pMix, CAMsg::printMsg(), and CAControlChannelDispatcher::registerControlChannel().
CAReplayCtrlChannelMsgProc::~CAReplayCtrlChannelMsgProc | ( | ) |
Definition at line 70 of file CAReplayCtrlChannelMsgProc.cpp.
References CAMix::getDownstreamControlChannelDispatcher(), CAAbstractControlChannel::getID(), CAMix::getUpstreamControlChannelDispatcher(), m_pDownstreamReplayControlChannel, m_pMix, m_pUpstreamReplayControlChannel, CAMsg::printMsg(), CAControlChannelDispatcher::removeControlChannel(), and stopTimeStampPorpagation().
|
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.
Definition at line 232 of file CAReplayCtrlChannelMsgProc.cpp.
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.
pReceiver | the control chanel which receives the getTimeStamps request |
E_SUCCESS | if the request could be processed successfully |
E_UNKNOWN | otherwise Proccesses a getTimeStamp request on a reply control channel. |
pReceiver | the control channel which receives the request |
strMixID | the mix id for which the timestamp is requested. If NULL we timestamp of this mix is requested. |
E_SUCCESS | if the request could be processed successfully |
E_UNKNOWN | otherwise |
Definition at line 122 of file CAReplayCtrlChannelMsgProc.cpp.
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.
pReceiver | the control channel which receives the timestamp |
strMixID | the mix id of the mix which sends the timestamp |
rt | the timestamp |
E_SUCCESS | if the timestamp was preocessed successfully |
E_UNKNOWN | otherwise |
Definition at line 265 of file CAReplayCtrlChannelMsgProc.cpp.
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().
SINT32 CAReplayCtrlChannelMsgProc::propagateCurrentReplayTimestamp | ( | ) |
Propagates downstream the current replay timestamp.
Definition at line 161 of file CAReplayCtrlChannelMsgProc.cpp.
References E_SUCCESS, E_UNKNOWN, getDOMChildByName(), m_docTemplate, m_pDownstreamReplayControlChannel, m_pMix, CAMixWithReplayDB::m_u64ReferenceTime, CAMsg::printMsg(), CAAbstractControlChannel::sendXMLMessage(), and setDOMElementValue().
Sends upstram a request for the replay timestamp for the given mix.
Definition at line 313 of file CAReplayCtrlChannelMsgProc.cpp.
References createDOMDocument(), createDOMElement(), E_UNKNOWN, m_pUpstreamReplayControlChannel, CAAbstractControlChannel::sendXMLMessage(), and setDOMElementAttribute().
Referenced by CAFirstMix::sendReplayTimestampRequestsToAllMixes().
Sends the current replay timestamp periodically on the downstream replay control channel.
minutesPropagationIntervall | says, how often (in minutes) should the timestamp information be sent |
Definition at line 205 of file CAReplayCtrlChannelMsgProc.cpp.
References m_bRun, m_pThreadTimestampPropagation, m_u32PropagationInterval, rp_loopPropagateTimestamp, CAThread::setMainLoop(), and CAThread::start().
Referenced by CAMiddleMix::init().
SINT32 CAReplayCtrlChannelMsgProc::stopTimeStampPorpagation | ( | ) |
Stops the timestamp propagation.
Definition at line 214 of file CAReplayCtrlChannelMsgProc.cpp.
References E_SUCCESS, CAThread::join(), m_bRun, and m_pThreadTimestampPropagation.
Referenced by ~CAReplayCtrlChannelMsgProc().
|
friend |
Definition at line 188 of file CAReplayCtrlChannelMsgProc.cpp.
Referenced by startTimeStampPorpagation().
|
private |
Definition at line 96 of file CAReplayCtrlChannelMsgProc.hpp.
Referenced by startTimeStampPorpagation(), and stopTimeStampPorpagation().
|
private |
Definition at line 97 of file CAReplayCtrlChannelMsgProc.hpp.
Referenced by CAReplayCtrlChannelMsgProc(), initTimestampsMessageTemplate(), proccessGetTimestamp(), and propagateCurrentReplayTimestamp().
|
private |
Definition at line 90 of file CAReplayCtrlChannelMsgProc.hpp.
Referenced by CAReplayCtrlChannelMsgProc(), proccessGotTimestamp(), propagateCurrentReplayTimestamp(), and ~CAReplayCtrlChannelMsgProc().
|
private |
Definition at line 89 of file CAReplayCtrlChannelMsgProc.hpp.
Referenced by CAReplayCtrlChannelMsgProc(), initTimestampsMessageTemplate(), proccessGetTimestamp(), proccessGotTimestamp(), propagateCurrentReplayTimestamp(), and ~CAReplayCtrlChannelMsgProc().
|
private |
Definition at line 93 of file CAReplayCtrlChannelMsgProc.hpp.
Referenced by CAReplayCtrlChannelMsgProc(), startTimeStampPorpagation(), and stopTimeStampPorpagation().
|
private |
Definition at line 91 of file CAReplayCtrlChannelMsgProc.hpp.
Referenced by CAReplayCtrlChannelMsgProc(), proccessGetTimestamp(), sendGetTimestamp(), and ~CAReplayCtrlChannelMsgProc().
|
private |
Definition at line 92 of file CAReplayCtrlChannelMsgProc.hpp.
Referenced by startTimeStampPorpagation().