Mixes for Privacy and Anonymity in the Internet
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
CALastMix Class Referenceabstract
Inheritance diagram for CALastMix:
CAMixWithReplayDB CAMix CALastMixA CALastMixB

Public Member Functions

 CALastMix ()
 
virtual ~CALastMix ()
 
SINT32 reconfigure ()
 
tMixType getType () const
 
- Public Member Functions inherited from CAMixWithReplayDB
 CAMixWithReplayDB ()
 
CADatabasegetReplayDB () const
 
- Public Member Functions inherited from CAMix
 CAMix ()
 
virtual ~CAMix ()
 
SINT32 start ()
 
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 ()
 

Protected Member Functions

virtual SINT32 loop ()=0
 
SINT32 init ()
 
virtual SINT32 initOnce ()
 
SINT32 clean ()
 
SINT32 initMixCascadeInfo (DOMElement *)
 This will initialize the XML Cascade Info struct XMLFirstMixToInfoService that is sent to the InfoService in CAInfoService::sendCascadeHelo() More...
 
virtual SINT32 processKeyExchange ()
 Processes the startup communication with the preceeding mix. More...
 
SINT32 setTargets ()
 Reads the configured proxies from options. More...
 
- Protected Member Functions inherited from CAMix
SINT32 checkCompatibility (DOMNode *a_parent, const char *a_mixPosition)
 
SINT32 appendCompatibilityInfo (DOMNode *a_parent)
 
SINT32 addMixInfo (DOMNode *a_element, bool a_bForceFirstNode)
 
SINT32 signXML (DOMNode *a_element)
 

Protected Attributes

volatile bool m_bRestart
 
CAMuxSocketm_pMuxIn
 
CAQueuem_pQueueSendToMix
 
CAQueuem_pQueueReadFromMix
 
CACacheLoadBalancingm_pCacheLB
 
CACacheLoadBalancingm_pSocksLB
 
CACacheLoadBalancingm_pVPNLB
 
CAASymCipherm_pRSA
 
CAThreadm_pthreadSendToMix
 
CAThreadm_pthreadReadFromMix
 
CALastMixChannelListm_pChannelList
 
volatile bool m_bRunLog
 
volatile UINT32 m_logUploadedPackets
 
volatile UINT64 m_logUploadedBytes
 
volatile UINT32 m_logDownloadedPackets
 
volatile UINT64 m_logDownloadedBytes
 
- Protected Attributes inherited from CAMixWithReplayDB
CADatabasem_pReplayDB
 
CAReplayCtrlChannelMsgProcm_pReplayMsgProc
 
- Protected Attributes inherited from CAMix
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
 

Friends

THREAD_RETURN lm_loopSendToMix (void *param)
 How to end this thread: 0. More...
 
THREAD_RETURN lm_loopReadFromMix (void *pParam)
 
THREAD_RETURN lm_loopLog (void *)
 

Additional Inherited Members

- Public Types inherited from CAMix
enum  tMixType { FIRST_MIX, MIDDLE_MIX, LAST_MIX, JAP }
 
- Public Attributes inherited from CAMixWithReplayDB
UINT64 m_u64ReferenceTime
 
- Static Public Attributes inherited from CAMix
static const UINT32 TIMEOUT_MIX_CONNECTION_ESTABLISHEMENT = 60000
 

Constructor & Destructor Documentation

◆ CALastMix()

CALastMix::CALastMix ( )

◆ ~CALastMix()

virtual CALastMix::~CALastMix ( )
virtual

Member Function Documentation

◆ clean()

SINT32 CALastMix::clean ( )
protectedvirtual

◆ getType()

tMixType CALastMix::getType ( ) const
virtual

◆ init()

SINT32 CALastMix::init ( )
protectedvirtual

◆ initMixCascadeInfo()

SINT32 CALastMix::initMixCascadeInfo ( DOMElement *  mixes)
protectedvirtual

This will initialize the XML Cascade Info struct XMLFirstMixToInfoService that is sent to the InfoService in CAInfoService::sendCascadeHelo()

Parameters
mixesthe <Mixes> element of the XML struct we received from the succeeding mix.
Return values
E_UNKNOWNif processing produces an error
E_SUCCESSotherwise

Reimplemented from CAMix.

References CAMix::initMixCascadeInfo(), CAMix::m_docMixCascadeInfo, and setDOMElementAttribute().

Referenced by getType(), and initOnce().

◆ initOnce()

SINT32 CALastMix::initOnce ( )
protectedvirtual

TODO: Check what is done her and if this is important for any last mix or only in case of dynamic mixes...

Reimplemented from CAMix.

References E_SUCCESS, E_UNKNOWN, CACmdLnOptions::getMultiSigner(), CALibProxytest::getOptions(), initMixCascadeInfo(), CAMix::initOnce(), CAMix::m_pMultiSignature, CAMsg::printMsg(), and setTargets().

Referenced by getType().

◆ loop()

virtual SINT32 CALastMix::loop ( )
protectedpure virtual

Implements CAMix.

Implemented in CALastMixB, and CALastMixA.

Referenced by getType().

◆ processKeyExchange()

SINT32 CALastMix::processKeyExchange ( )
protectedvirtual

Processes the startup communication with the preceeding mix.

  • Step 1: Mix n-1 open a TCP/IP Connection
  • Step 2: LastMix sends XML struct describing itself, containing PubKey of LastMix, signed by LastMix (see XML structs)
  • Step 3: Mix n-1 sends XML struct containing encrpyted (with PubKey) Symetric Key used for interlink encryption between Mix n-1 <—> LastMix, signed by Mix n-1 (see XML structs)

Getting and calculating the KeepAlive Traffice...

Implements CAMix.

References CAMix::addMixInfo(), CAMix::appendCompatibilityInfo(), CHAIN_TIMEOUT, CHANNEL_DOWNSTREAM_PACKETS, CHANNEL_TIMEOUT, CAMix::checkCompatibility(), createDOMDocument(), createDOMElement(), CABase64::decode(), decodeXMLEncryptedKey(), DOM_Output::dumpToMem(), E_SUCCESS, E_UNKNOWN, CABase64::encode(), FLOW_CONTROL_SENDME_SOFT_LIMIT, GET_NET_ERROR, GET_NET_ERROR_STR, CAMuxSocket::getCASocket(), getDOMChildByName(), getDOMElementValue(), CACmdLnOptions::getKeepAliveRecvInterval(), CACmdLnOptions::getKeepAliveSendInterval(), CALibProxytest::getOptions(), CACmdLnOptions::getPrevMixTestCertificate(), CAASymCipher::getPublicKeyAsDOMElement(), getRandom(), CACmdLnOptions::getTrustedCertificateStore(), len, m_pMuxIn, m_pRSA, CAMix::m_u32KeepAliveRecvInterval, CAMix::m_u32KeepAliveSendInterval, max, parseDOMDocument(), CAMsg::printMsg(), CAMuxSocket::receiveFully(), CASocket::send(), CAMuxSocket::setCrypt(), setDOMElementAttribute(), setDOMElementValue(), CACmdLnOptions::setPrevMixTestCertificate(), CAMuxSocket::setReceiveKey(), CAMuxSocket::setSendKey(), CAMix::signXML(), CAMix::TIMEOUT_MIX_CONNECTION_ESTABLISHEMENT, CACertStore::verifyMixCert(), and CAMultiSignature::verifyXML().

Referenced by getType(), and init().

◆ reconfigure()

SINT32 CALastMix::reconfigure ( )
virtual

◆ setTargets()

SINT32 CALastMix::setTargets ( )
protected

Friends And Related Function Documentation

◆ lm_loopLog

THREAD_RETURN lm_loopLog ( void *  )
friend

◆ lm_loopReadFromMix

THREAD_RETURN lm_loopReadFromMix ( void *  pParam)
friend

ToDo: check if keep-alive is really correct here - should it not be moved upwards?

Referenced by init().

◆ lm_loopSendToMix

THREAD_RETURN lm_loopSendToMix ( void *  param)
friend

How to end this thread: 0.

set m_bRestart=true;

  1. Close connection to next mix
  2. put a byte in the Mix-Output-Queue

Referenced by init().

Member Data Documentation

◆ m_bRestart

volatile bool CALastMix::m_bRestart
protected

◆ m_bRunLog

volatile bool CALastMix::m_bRunLog
protected

◆ m_logDownloadedBytes

volatile UINT64 CALastMix::m_logDownloadedBytes
protected

◆ m_logDownloadedPackets

volatile UINT32 CALastMix::m_logDownloadedPackets
protected

◆ m_logUploadedBytes

volatile UINT64 CALastMix::m_logUploadedBytes
protected

◆ m_logUploadedPackets

volatile UINT32 CALastMix::m_logUploadedPackets
protected

◆ m_pCacheLB

CACacheLoadBalancing* CALastMix::m_pCacheLB
protected

◆ m_pChannelList

CALastMixChannelList* CALastMix::m_pChannelList
protected

◆ m_pMuxIn

CAMuxSocket* CALastMix::m_pMuxIn
protected

◆ m_pQueueReadFromMix

CAQueue* CALastMix::m_pQueueReadFromMix
protected

◆ m_pQueueSendToMix

CAQueue* CALastMix::m_pQueueSendToMix
protected

◆ m_pRSA

CAASymCipher* CALastMix::m_pRSA
protected

◆ m_pSocksLB

CACacheLoadBalancing* CALastMix::m_pSocksLB
protected

◆ m_pthreadReadFromMix

CAThread* CALastMix::m_pthreadReadFromMix
protected

◆ m_pthreadSendToMix

CAThread* CALastMix::m_pthreadSendToMix
protected

◆ m_pVPNLB

CACacheLoadBalancing* CALastMix::m_pVPNLB
protected