Mixe for Privacy and Anonymity in the Internet
Public Member Functions | Private Attributes
CAReplayControlChannel Class Reference

A Control channel for the exchange of the current replay detection timestamps. More...

#include <CAReplayControlChannel.hpp>

Inheritance diagram for CAReplayControlChannel:
[legend]
Collaboration diagram for CAReplayControlChannel:
[legend]

List of all members.

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 CAReplayCtrlChannelMsgProcm_pProcessor

Detailed Description

A Control channel for the exchange of the current replay detection timestamps.

Definition at line 36 of file CAReplayControlChannel.hpp.


Constructor & Destructor Documentation

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;
  }

Here is the call graph for this function:

Definition at line 42 of file CAReplayControlChannel.cpp.

  {
    //@todo: delete m_MsgBuff of superclass CASyncControlChannel
  }

Member Function Documentation

SINT32 CAReplayControlChannel::processXMLMessage ( const XERCES_CPP_NAMESPACE::DOMDocument *  doc) [virtual]

Reads incoming replay timestamps or timestamp requests and delegates them to the associated CAReplayCtrlChannelMsgProc.

See also:
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;
  }

Here is the call graph for this function:


Member Data Documentation

Definition at line 50 of file CAReplayControlChannel.hpp.

Referenced by CAReplayControlChannel(), and processXMLMessage().


The documentation for this class was generated from the following files: