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

List of all members.

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.
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)
DOMNode * appendTermsAndConditionsExtension (XERCES_CPP_NAMESPACE::DOMDocument *doc, DOMElement *root)
 convenience function: returns an already prepared and signed TermsAndCondition node which can be appended as a KeyInfoExtension.
DOMNode * termsAndConditionsInfoNode (XERCES_CPP_NAMESPACE::DOMDocument *ownerDoc)
 convenience function: creates a node for the KeyInfo structure for indicating the clients which Terms And Conditions are valid.
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()
SINT32 signXML (DOMNode *a_element)

Protected Attributes

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.

Member Enumeration Documentation

Enumerator:
FIRST_MIX 
MIDDLE_MIX 
LAST_MIX 
JAP 

Constructor & Destructor Documentation

CAMix::~CAMix ( ) [virtual]

Member Function Documentation

SINT32 CAMix::addMixInfo ( DOMNode *  a_element,
bool  a_bForceFirstNode 
) [protected]
SINT32 CAMix::appendCompatibilityInfo ( DOMNode *  a_parent) [protected]
DOMNode * CAMix::appendTermsAndConditionsExtension ( XERCES_CPP_NAMESPACE::DOMDocument *  doc,
DOMElement *  root 
) [protected]
SINT32 CAMix::checkCompatibility ( DOMNode *  a_parent,
const char *  a_mixPosition 
) [protected]
virtual SINT32 CAMix::clean ( ) [protected, pure virtual]

Implemented in CAFirstMix, CALastMix, and CAMiddleMix.

Referenced by start().

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

virtual tMixType CAMix::getType ( ) const [pure virtual]
virtual SINT32 CAMix::init ( ) [protected, pure virtual]

Implemented in CAFirstMix, CALastMix, and CAMiddleMix.

Referenced by start().

SINT32 CAMix::initMixCascadeInfo ( DOMElement *  mixes) [protected, virtual]
SINT32 CAMix::initOnce ( ) [protected, virtual]

Reimplemented in CAFirstMix, CALastMix, and CAMiddleMix.

References E_SUCCESS, E_UNKNOWN, CALibProxytest::getOptions(), and CAMsg::printMsg().

Referenced by start().

virtual bool CAMix::isShutDown ( ) [virtual]

References m_bShutDown.

Referenced by my_terminate().

virtual SINT32 CAMix::loop ( ) [protected, pure virtual]
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().

virtual SINT32 CAMix::processKeyExchange ( ) [protected, pure virtual]

Implemented in CAFirstMix, CALastMix, and CAMiddleMix.

virtual SINT32 CAMix::reconfigure ( ) [virtual]

Reimplemented in CAFirstMix, and CALastMix.

References E_SUCCESS.

Referenced by threadReConfigure().

virtual void CAMix::shutDown ( ) [virtual]

Reimplemented in CAFirstMixA.

References m_bShutDown.

Referenced by my_terminate().

SINT32 CAMix::signXML ( DOMNode *  a_element) [protected]
DOMNode * CAMix::termsAndConditionsInfoNode ( XERCES_CPP_NAMESPACE::DOMDocument *  ownerDoc) [protected]

Member Data Documentation

Referenced by acceptsReconfiguration(), and CAMix().

volatile bool CAMix::m_bConnected [protected]

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

bool CAMix::m_bReconfiguring [protected]

Referenced by CAMix(), and start().

volatile bool CAMix::m_bShutDown [protected]

Referenced by CAMix(), isShutDown(), and shutDown().

XERCES_CPP_NAMESPACE::DOMDocument* CAMix::m_docMixCascadeInfo [protected]
volatile UINT32 CAMix::m_lLastConnectionTime [protected]

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