Mixes for Privacy and Anonymity in the Internet
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
CAMix Class Referenceabstract
Inheritance diagram for CAMix:
CAMixWithReplayDB CAFirstMix CALastMix CAMiddleMix CAFirstMixA CAFirstMixB CALastMixA CALastMixB

Public Types

enum  tMixType { FIRST_MIX, MIDDLE_MIX, LAST_MIX, JAP }
 

Public Member Functions

 CAMix ()
 
virtual ~CAMix ()
 
SINT32 start ()
 
virtual SINT32 reconfigure ()
 
virtual tMixType getType () const =0
 
virtual void shutDown ()
 
virtual bool isShutDown ()
 
SINT32 getMixCascadeInfo (XERCES_CPP_NAMESPACE::DOMDocument *&docMixCascadeInfo)
 Returns the Mix-Cascade info which should be send to the InfoService. More...
 
bool acceptsReconfiguration ()
 
CAControlChannelDispatchergetDownstreamControlChannelDispatcher () const
 
CAControlChannelDispatchergetUpstreamControlChannelDispatcher () const
 
UINT32 getLastConnectionTime ()
 
bool isConnected ()
 

Static Public Attributes

static const UINT32 TIMEOUT_MIX_CONNECTION_ESTABLISHEMENT = 60000
 

Protected Member Functions

virtual SINT32 clean ()=0
 
virtual SINT32 initOnce ()
 
virtual SINT32 init ()=0
 
virtual SINT32 loop ()=0
 
SINT32 checkCompatibility (DOMNode *a_parent, const char *a_mixPosition)
 
SINT32 appendCompatibilityInfo (DOMNode *a_parent)
 
SINT32 addMixInfo (DOMNode *a_element, bool a_bForceFirstNode)
 
virtual SINT32 processKeyExchange ()=0
 
virtual SINT32 initMixCascadeInfo (DOMElement *elemMixes)
 This will initialize the XML Cascade Info struct XMLFirstMixToInfoService that is sent to the InfoService in CAInfoService::sendCascadeHelo() More...
 
SINT32 signXML (DOMNode *a_element)
 

Protected Attributes

volatile bool m_bLoop
 
bool m_bReconfiguring
 
volatile bool m_bShutDown
 
CAMultiSignaturem_pMultiSignature
 
CAInfoServicem_pInfoService
 
UINT32 m_u32KeepAliveRecvInterval
 
UINT32 m_u32KeepAliveSendInterval
 
bool m_acceptReconfiguration
 
volatile bool m_bConnected
 
volatile UINT32 m_lLastConnectionTime
 
XERCES_CPP_NAMESPACE::DOMDocument * m_docMixCascadeInfo
 
CAControlChannelDispatcherm_pMuxOutControlChannelDispatcher
 
CAControlChannelDispatcherm_pMuxInControlChannelDispatcher
 

Private Member Functions

bool needAutoConfig ()
 This method checks if target interfaces (network adress and port of next mix) have been specified in the config file. More...
 

Member Enumeration Documentation

◆ tMixType

Enumerator
FIRST_MIX 
MIDDLE_MIX 
LAST_MIX 
JAP 

Constructor & Destructor Documentation

◆ CAMix()

CAMix::CAMix ( )

◆ ~CAMix()

CAMix::~CAMix ( )
virtual

Member Function Documentation

◆ acceptsReconfiguration()

bool CAMix::acceptsReconfiguration ( )

◆ addMixInfo()

SINT32 CAMix::addMixInfo ( DOMNode *  a_element,
bool  a_bForceFirstNode 
)
protected

◆ appendCompatibilityInfo()

SINT32 CAMix::appendCompatibilityInfo ( DOMNode *  a_parent)
protected

◆ checkCompatibility()

SINT32 CAMix::checkCompatibility ( DOMNode *  a_parent,
const char *  a_mixPosition 
)
protected

◆ clean()

virtual SINT32 CAMix::clean ( )
protectedpure virtual

Implemented in CAFirstMix, CALastMix, and CAMiddleMix.

Referenced by start().

◆ getDownstreamControlChannelDispatcher()

CAControlChannelDispatcher* CAMix::getDownstreamControlChannelDispatcher ( ) const

◆ getLastConnectionTime()

UINT32 CAMix::getLastConnectionTime ( )

◆ getMixCascadeInfo()

SINT32 CAMix::getMixCascadeInfo ( XERCES_CPP_NAMESPACE::DOMDocument *&  docMixCascadeInfo)

Returns the Mix-Cascade info which should be send to the InfoService.

This is NOT a copy!

Parameters
docMixCascadeInfowhere the XML struct would be stored
Return values
E_SUCCESS

References E_SUCCESS, E_UNKNOWN, and m_docMixCascadeInfo.

Referenced by CAInfoService::getCascadeHeloXMLAsString(), and CAAccountingInstance::prepareCCRequest().

◆ getType()

virtual tMixType CAMix::getType ( ) const
pure virtual

◆ getUpstreamControlChannelDispatcher()

CAControlChannelDispatcher* CAMix::getUpstreamControlChannelDispatcher ( ) const

◆ init()

virtual SINT32 CAMix::init ( )
protectedpure virtual

Implemented in CAFirstMix, CALastMix, and CAMiddleMix.

Referenced by start().

◆ initMixCascadeInfo()

SINT32 CAMix::initMixCascadeInfo ( DOMElement *  mixes)
protectedvirtual

◆ initOnce()

SINT32 CAMix::initOnce ( )
protectedvirtual

◆ isConnected()

bool CAMix::isConnected ( )

◆ isShutDown()

virtual bool CAMix::isShutDown ( )
virtual

References m_bReconfiguring, and m_bShutDown.

Referenced by my_terminate().

◆ loop()

virtual SINT32 CAMix::loop ( )
protectedpure virtual

◆ needAutoConfig()

bool CAMix::needAutoConfig ( )
private

This method checks if target interfaces (network adress and port of next mix) have been specified in the config file.

A return value of true means that necessary information to bring the cascade online is missing and must be downloaded from the InfoService (if available).

Return values
falseif the target interfaces are configured one way or another
trueif config file contains no target interface info and InfoService is unavailable

References CATargetInterface::cleanAddr(), CALibProxytest::getOptions(), CACmdLnOptions::getTargetInterface(), CACmdLnOptions::getTargetInterfaceCount(), CATargetInterface::getTargetType(), and TARGET_MIX.

Referenced by start().

◆ processKeyExchange()

virtual SINT32 CAMix::processKeyExchange ( )
protectedpure virtual

Implemented in CAFirstMix, CALastMix, and CAMiddleMix.

◆ reconfigure()

virtual SINT32 CAMix::reconfigure ( )
virtual

Reimplemented in CAFirstMix, and CALastMix.

References E_SUCCESS, and getType().

Referenced by threadReConfigure().

◆ shutDown()

virtual void CAMix::shutDown ( )
virtual

Reimplemented in CAFirstMixA.

References m_bLoop, and m_bShutDown.

Referenced by my_terminate().

◆ signXML()

SINT32 CAMix::signXML ( DOMNode *  a_element)
protected

◆ start()

SINT32 CAMix::start ( )

Member Data Documentation

◆ m_acceptReconfiguration

bool CAMix::m_acceptReconfiguration
protected

Referenced by acceptsReconfiguration(), and CAMix().

◆ m_bConnected

volatile bool CAMix::m_bConnected
protected

Referenced by CAMix(), isConnected(), and start().

◆ m_bLoop

volatile bool CAMix::m_bLoop
protected

◆ m_bReconfiguring

bool CAMix::m_bReconfiguring
protected

Referenced by CAMix(), isShutDown(), signXML(), and start().

◆ m_bShutDown

volatile bool CAMix::m_bShutDown
protected

◆ m_docMixCascadeInfo

XERCES_CPP_NAMESPACE::DOMDocument* CAMix::m_docMixCascadeInfo
protected

◆ m_lLastConnectionTime

volatile UINT32 CAMix::m_lLastConnectionTime
protected

Referenced by CAMix(), getLastConnectionTime(), and start().

◆ m_pInfoService

CAInfoService* CAMix::m_pInfoService
protected

◆ m_pMultiSignature

CAMultiSignature* CAMix::m_pMultiSignature
protected

◆ m_pMuxInControlChannelDispatcher

CAControlChannelDispatcher* CAMix::m_pMuxInControlChannelDispatcher
protected

◆ m_pMuxOutControlChannelDispatcher

CAControlChannelDispatcher* CAMix::m_pMuxOutControlChannelDispatcher
protected

◆ m_u32KeepAliveRecvInterval

UINT32 CAMix::m_u32KeepAliveRecvInterval
protected

◆ m_u32KeepAliveSendInterval

UINT32 CAMix::m_u32KeepAliveSendInterval
protected

◆ TIMEOUT_MIX_CONNECTION_ESTABLISHEMENT

const UINT32 CAMix::TIMEOUT_MIX_CONNECTION_ESTABLISHEMENT = 60000
static