|
Mixe for Privacy and Anonymity in the Internet
|
A Control channel for the exchange of the current replay detection timestamps. More...
#include <CAReplayControlChannel.hpp>
Public Member Functions | |
| CAReplayControlChannel (const CAReplayCtrlChannelMsgProc *pProcessor) | |
| virtual | ~CAReplayControlChannel (void) |
| virtual SINT32 | processXMLMessage (const XERCES_CPP_NAMESPACE::DOMDocument *doc) |
| Reads incoming replay timestamps or timestamp requests and delegates them to the associated CAReplayCtrlChannelMsgProc. | |
Private Attributes | |
| const CAReplayCtrlChannelMsgProc * | m_pProcessor |
A Control channel for the exchange of the current replay detection timestamps.
Definition at line 36 of file CAReplayControlChannel.hpp.
| CAReplayControlChannel::CAReplayControlChannel | ( | const CAReplayCtrlChannelMsgProc * | pProcessor | ) |
Definition at line 33 of file CAReplayControlChannel.cpp.
References m_pProcessor, and CAMsg::printMsg().
:CASyncControlChannel(REPLAY_CONTROL_CHANNEL_ID,false) { #ifdef DEBUG CAMsg::printMsg(LOG_DEBUG,"CAReplayControlChannel - constructor - pProcessor=%p\n",pProcessor); #endif m_pProcessor=pProcessor; }
| CAReplayControlChannel::~CAReplayControlChannel | ( | void | ) | [virtual] |
Definition at line 42 of file CAReplayControlChannel.cpp.
{
//@todo: delete m_MsgBuff of superclass CASyncControlChannel
}
| SINT32 CAReplayControlChannel::processXMLMessage | ( | const XERCES_CPP_NAMESPACE::DOMDocument * | doc | ) | [virtual] |
Reads incoming replay timestamps or timestamp requests and delegates them to the associated CAReplayCtrlChannelMsgProc.
Implements CASyncControlChannel.
Definition at line 47 of file CAReplayControlChannel.cpp.
References E_SUCCESS, E_UNKNOWN, equals(), getDOMChildByName(), getDOMElementAttribute(), getDOMElementValue(), m_pProcessor, CAMsg::printMsg(), CAReplayCtrlChannelMsgProc::proccessGetTimestamp(), and CAReplayCtrlChannelMsgProc::proccessGotTimestamp().
{
#ifdef DEBUG
CAMsg::printMsg(LOG_DEBUG,"CAReplayControlChannel::processXMLMessage()\n");
#endif
DOMElement* elemRoot=doc->getDocumentElement();
if(elemRoot==NULL)
return E_UNKNOWN;
if(equals(elemRoot->getNodeName(),"GetTimestamp"))
{
UINT8 buff[255];
UINT32 bufflen=255;
if(getDOMElementAttribute(elemRoot,"id",buff,&bufflen)!=E_SUCCESS)
return E_UNKNOWN;
buff[bufflen]=0;
m_pProcessor->proccessGetTimestamp(this,buff);
}
else if(equals(elemRoot->getNodeName(),"Mix"))
{
#ifdef DEBUG
CAMsg::printMsg(LOG_DEBUG,"CAReplayControlChannel::processXMLMessage() - got a timestamp\n");
#endif
UINT8 buff[255];
UINT32 bufflen=255;
if(getDOMElementAttribute(elemRoot,"id",buff,&bufflen)!=E_SUCCESS)
return E_UNKNOWN;
buff[bufflen]=0;
DOMElement *child;
getDOMChildByName(elemRoot,"Replay",child,false);
DOMElement *elemReplayTimestamp;
getDOMChildByName(child,"ReplayOffset",elemReplayTimestamp,false);
UINT32 offset=0;
if( getDOMElementValue(elemReplayTimestamp,offset,0)!=E_SUCCESS)
return E_UNKNOWN;
#ifdef DEBUG
CAMsg::printMsg(LOG_DEBUG,"CAReplayControlChannel::processXMLMessage() - call m_pProcessor->proccessGotTimestamp() - m_pProcessor=%p\n",m_pProcessor);
#endif
m_pProcessor->proccessGotTimestamp(this,buff,offset);
}
return E_SUCCESS;
}
const CAReplayCtrlChannelMsgProc* CAReplayControlChannel::m_pProcessor [private] |
Definition at line 50 of file CAReplayControlChannel.hpp.
Referenced by CAReplayControlChannel(), and processXMLMessage().
1.7.6.1