Mixe for Privacy and Anonymity in the Internet
|
#include <CAMix.hpp>
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 () |
CAControlChannelDispatcher * | getDownstreamControlChannelDispatcher () const |
CAControlChannelDispatcher * | getUpstreamControlChannelDispatcher () 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 |
CAMultiSignature * | m_pMultiSignature |
CAInfoService * | m_pInfoService |
UINT32 | m_u32KeepAliveRecvInterval |
UINT32 | m_u32KeepAliveSendInterval |
bool | m_acceptReconfiguration |
volatile bool | m_bConnected |
volatile UINT32 | m_lLastConnectionTime |
XERCES_CPP_NAMESPACE::DOMDocument * | m_docMixCascadeInfo |
CAControlChannelDispatcher * | m_pMuxOutControlChannelDispatcher |
CAControlChannelDispatcher * | m_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... | |
enum CAMix::tMixType |
CAMix::CAMix | ( | ) |
Definition at line 39 of file CAMix.cpp.
References CACmdLnOptions::acceptReconfiguration(), CALibProxytest::getOptions(), m_acceptReconfiguration, m_bConnected, m_bLoop, m_bReconfiguring, m_bShutDown, m_docMixCascadeInfo, m_lLastConnectionTime, m_pInfoService, m_pMultiSignature, m_pMuxInControlChannelDispatcher, m_pMuxOutControlChannelDispatcher, m_u32KeepAliveRecvInterval, and m_u32KeepAliveSendInterval.
|
virtual |
|
inline |
Definition at line 110 of file CAMix.hpp.
References m_acceptReconfiguration.
|
protected |
Definition at line 437 of file CAMix.cpp.
References E_SUCCESS, E_UNKNOWN, and CALibProxytest::getOptions().
Referenced by initMixCascadeInfo(), CALastMix::processKeyExchange(), and CAMiddleMix::processKeyExchange().
|
protected |
EDIT HERE FOR INTRODUCING NEW FLAGS!
Definition at line 634 of file CAMix.cpp.
References createDOMElement(), E_SUCCESS, MIX_VERSION, NEW_CHANNEL_ENCRYPTION_COMPATIBILITY, NEW_FLOW_CONTROL_COMPATIBILITY, PAYMENT_COMPATIBILITY, setDOMElementAttribute(), and WITH_INTEGRITY_CHECK_COMPATIBILITY.
Referenced by CALastMix::processKeyExchange(), and CAMiddleMix::processKeyExchange().
|
protected |
EDIT HERE FOR ADDING INCOMPATIBLE VERSIONS!
EDIT HERE FOR INTRODUCING NEW FLAGS!
EDIT HERE FOR INTRODUCING NEW FLAGS!
Definition at line 670 of file CAMix.cpp.
References E_SUCCESS, E_UNKNOWN, flags, getDOMChildByName(), getDOMElementAttribute(), getNodeName(), len, MIX_VERSION, MIX_VERSION_COMPATIBILITY, NEW_CHANNEL_ENCRYPTION_COMPATIBILITY, NEW_FLOW_CONTROL_COMPATIBILITY, PAYMENT_COMPATIBILITY, CAMsg::printMsg(), and WITH_INTEGRITY_CHECK_COMPATIBILITY.
Referenced by CALastMix::processKeyExchange(), and CAMiddleMix::processKeyExchange().
|
protectedpure virtual |
Implemented in CAMiddleMix, CALastMix, and CAFirstMix.
Referenced by start().
|
inline |
Definition at line 115 of file CAMix.hpp.
References m_pMuxInControlChannelDispatcher.
Referenced by CAReplayCtrlChannelMsgProc::CAReplayCtrlChannelMsgProc(), and CAReplayCtrlChannelMsgProc::~CAReplayCtrlChannelMsgProc().
|
inline |
Definition at line 125 of file CAMix.hpp.
References m_lLastConnectionTime.
Referenced by CAInfoService::InfoLoop().
|
inline |
Returns the Mix-Cascade info which should be send to the InfoService.
This is NOT a copy!
docMixCascadeInfo | where the XML struct would be stored |
E_SUCCESS |
Definition at line 96 of file CAMix.hpp.
References E_SUCCESS, E_UNKNOWN, and m_docMixCascadeInfo.
Referenced by CAInfoService::getCascadeHeloXMLAsString(), and CAAccountingInstance::prepareCCRequest().
|
pure virtual |
Implemented in CAMiddleMix, CALastMix, and CAFirstMix.
Referenced by CAReplayCtrlChannelMsgProc::initTimestampsMessageTemplate(), CAReplayCtrlChannelMsgProc::proccessGetTimestamp(), and CAReplayCtrlChannelMsgProc::proccessGotTimestamp().
|
inline |
Definition at line 120 of file CAMix.hpp.
References m_pMuxOutControlChannelDispatcher.
Referenced by CAReplayCtrlChannelMsgProc::CAReplayCtrlChannelMsgProc(), and CAReplayCtrlChannelMsgProc::~CAReplayCtrlChannelMsgProc().
|
protectedpure virtual |
Implemented in CAMiddleMix, CALastMix, and CAFirstMix.
Referenced by start().
|
protectedvirtual |
This will initialize the XML Cascade Info struct XMLFirstMixToInfoService that is sent to the InfoService in CAInfoService::sendCascadeHelo()
mixes | the <Mixes> element of the XML struct we received from the succeeding mix. |
E_UNKNOWN | if processing produces an error |
E_SUCCESS | otherwise |
Reimplemented in CAMiddleMix, and CALastMix.
Definition at line 299 of file CAMix.cpp.
References addMixInfo(), CHANNELS_PER_CLIENT, createDOMDocument(), createDOMElement(), E_SUCCESS, equals(), getDOMChildByName(), getLastDOMChildByName(), CACmdLnOptions::getListenerInterface(), CACmdLnOptions::getListenerInterfaceCount(), CACmdLnOptions::getMaxNrOfUsers(), CACmdLnOptions::getMixId(), CALibProxytest::getOptions(), CAListenerInterface::getType(), CAListenerInterface::isHidden(), m_docMixCascadeInfo, PAYMENT_VERSION, CAMsg::printMsg(), RAW_TCP, RAW_UDP, setDOMElementAttribute(), setDOMElementValue(), signXML(), and CAListenerInterface::toDOMElement().
Referenced by CALastMix::initMixCascadeInfo().
|
protectedvirtual |
Reimplemented in CAMiddleMix, CALastMix, and CAFirstMix.
Definition at line 78 of file CAMix.cpp.
References E_SUCCESS, E_UNKNOWN, CALibProxytest::getOptions(), and CAMsg::printMsg().
Referenced by CAFirstMix::initOnce(), CALastMix::initOnce(), and start().
|
inline |
Definition at line 130 of file CAMix.hpp.
References m_bConnected.
Referenced by CAInfoService::InfoLoop(), CAInfoService::sendCascadeHelo(), and CAInfoService::sendStatus().
|
inlinevirtual |
Definition at line 77 of file CAMix.hpp.
References m_bShutDown.
Referenced by my_terminate().
|
protectedpure virtual |
Implemented in CALastMix, CAFirstMix, CALastMixB, CAFirstMixB, CALastMixA, CAFirstMixA, and CAMiddleMix.
Referenced by start().
|
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).
false | if the target interfaces are configured one way or another |
true | if config file contains no target interface info and InfoService is unavailable |
Definition at line 263 of file CAMix.cpp.
References CATargetInterface::cleanAddr(), CALibProxytest::getOptions(), CACmdLnOptions::getTargetInterface(), CACmdLnOptions::getTargetInterfaceCount(), CATargetInterface::getTargetType(), and TARGET_MIX.
Referenced by start().
|
protectedpure virtual |
Implemented in CAMiddleMix, CALastMix, and CAFirstMix.
|
inlinevirtual |
|
inlinevirtual |
Reimplemented in CAFirstMixA.
Definition at line 71 of file CAMix.hpp.
References m_bLoop, and m_bShutDown.
Referenced by my_terminate().
|
protected |
Definition at line 806 of file CAMix.cpp.
References m_pMultiSignature, and CAMultiSignature::signXML().
Referenced by initMixCascadeInfo(), CALastMix::processKeyExchange(), and CAMiddleMix::processKeyExchange().
SINT32 CAMix::start | ( | ) |
Definition at line 104 of file CAMix.cpp.
References CACmdLnOptions::acceptReconfiguration(), clean(), E_SHUTDOWN, E_SUCCESS, E_UNKNOWN, ev_sys_enterMainLoop, ev_sys_leavingMainLoop, getcurrentTimeMillis(), CALibProxytest::getOptions(), init(), initOnce(), CAInfoService::isRunning(), loop(), m_bConnected, m_bLoop, m_bReconfiguring, m_lLastConnectionTime, m_pInfoService, m_pMultiSignature, MONITORING_FIRE_SYS_EVENT, needAutoConfig(), CAMsg::printMsg(), CAInfoService::sendCascadeHelo(), CAInfoService::setConfiguring(), CAInfoService::setMultiSignature(), CAInfoService::setSerial(), CAInfoService::signal(), sSleep(), CAInfoService::start(), and CAInfoService::stop().
Referenced by main().
|
protected |
Definition at line 189 of file CAMix.hpp.
Referenced by acceptsReconfiguration(), and CAMix().
|
protected |
Definition at line 190 of file CAMix.hpp.
Referenced by CAMix(), isConnected(), and start().
|
protected |
Definition at line 135 of file CAMix.hpp.
Referenced by CAMix(), shutDown(), CAFirstMixA::shutDown(), and start().
|
protected |
|
protected |
Definition at line 144 of file CAMix.hpp.
Referenced by CAMix(), CAMiddleMix::clean(), isShutDown(), and shutDown().
|
protected |
Definition at line 193 of file CAMix.hpp.
Referenced by CAMix(), getMixCascadeInfo(), CALastMix::initMixCascadeInfo(), and initMixCascadeInfo().
|
protected |
Definition at line 191 of file CAMix.hpp.
Referenced by CAMix(), getLastConnectionTime(), and start().
|
protected |
Definition at line 184 of file CAMix.hpp.
Referenced by CAFirstMix::CAFirstMix(), CALastMix::CALastMix(), CAMiddleMix::CAMiddleMix(), CAMix(), CAFirstMix::clean(), CAFirstMixA::shutDown(), and start().
|
protected |
Definition at line 183 of file CAMix.hpp.
Referenced by CALastMix::CALastMix(), CAMiddleMix::CAMiddleMix(), CAMix(), CAFirstMix::doUserLogin_internal(), CAFirstMix::initOnce(), CALastMix::initOnce(), CAMiddleMix::initOnce(), CAMiddleMix::processKeyExchange(), signXML(), and start().
|
protected |
Definition at line 196 of file CAMix.hpp.
Referenced by CAMix(), CALastMix::clean(), getDownstreamControlChannelDispatcher(), CAMiddleMix::init(), CALastMixA::loop(), and CALastMixB::loop().
|
protected |
Definition at line 195 of file CAMix.hpp.
Referenced by CAMix(), CAFirstMix::clean(), getUpstreamControlChannelDispatcher(), and CAFirstMix::init().
|
protected |
Definition at line 186 of file CAMix.hpp.
Referenced by CAMix(), CALastMix::processKeyExchange(), and CAMiddleMix::processKeyExchange().
|
protected |
Definition at line 187 of file CAMix.hpp.
Referenced by CAMix(), CALastMix::processKeyExchange(), and CAMiddleMix::processKeyExchange().
|
static |
Definition at line 59 of file CAMix.hpp.
Referenced by CALastMix::processKeyExchange(), and CAMiddleMix::processKeyExchange().