|
Mixes for Privacy and Anonymity in the Internet
|
Classes | |
| struct | InfoServiceHeloMsg |
Public Member Functions | |
| CAInfoService () | |
| CAInfoService (CAMix *pMix) | |
| ~CAInfoService () | |
| SINT32 | sendMixHelo (SINT32 requestCommand=-1, const UINT8 *param=NULL) |
| POSTs the MIXINFO message for a mix to the InfoService. | |
| SINT32 | sendCascadeHelo () |
| SINT32 | sendStatus (bool bIncludeCerts) |
| SINT32 | start () |
| SINT32 | stop () |
| SINT32 | signal () |
| SINT32 | getLevel (SINT32 *puser, SINT32 *prisk, SINT32 *ptraffic) |
| SINT32 | getMixedPackets (UINT64 &ppackets) |
| SINT32 | getPaymentInstance (const UINT8 *a_pstrPIID, CAXMLBI **pXMLBI) |
| bool | isRunning () |
| SINT32 | setMultiSignature (CAMultiSignature *pMultiSignature) |
| bool | isConfiguring () |
| void | setConfiguring (bool a_configuring) |
| void | setSerial (UINT64 a_serial) |
| UINT8 * | getStatusXMLAsString (bool bIncludeCerts, UINT32 &len) |
Static Public Attributes | |
| static const UINT64 | MINUTE = 60 |
| static const UINT64 | SEND_LOOP_SLEEP = 60 |
| static const UINT64 | SEND_CASCADE_INFO_WAIT = MINUTE * 10 |
| static const UINT64 | SEND_MIX_INFO_WAIT = MINUTE * 10 |
| static const UINT64 | SEND_STATUS_INFO_WAIT = MINUTE |
| static const UINT32 | SEND_INFO_TIMEOUT_MS = 3000 |
| static const UINT32 | REPEAT_ON_STATUS_SENT_ERROR = 3 |
Private Member Functions | |
| SINT32 | getPaymentInstance (const UINT8 *a_pstrPIID, CAXMLBI **pXMLBI, CASocketAddrINet *a_socketAddress) |
| Gets a payment instance from the InfoService. | |
| SINT32 | sendHelo (UINT8 *a_strXML, UINT32 a_len, THREAD_RETURN(*a_thread)(void *), UINT8 *a_strThreadName, SINT32 requestCommand, const UINT8 *param=NULL) |
| UINT8 * | getCascadeHeloXMLAsString (UINT32 &len) |
| SINT32 | sendCascadeHelo (const UINT8 *xml, UINT32 len, const CASocketAddrINet *a_socketAddress) const |
| POSTs the HELO message for a whole cascade to the InfoService. | |
| SINT32 | sendStatus (const UINT8 *strStatusXML, UINT32 len, const CASocketAddrINet *a_socketAddress) const |
| POSTs mix status to the InfoService. | |
| UINT8 ** | getOperatorTnCsAsStrings (UINT32 **lengths, XMLSize_t *nrOfTnCs) |
| returns a string array with all signed Terms and Condition-Objects NOTE: this method has a side-effect: the DOMNodes are all signed and thus modified | |
| SINT32 | sendOperatorTnCData () |
| UINT8 * | getMixHeloXMLAsString (UINT32 &len) |
| UINT8 * | xmlDocToStringWithSignature (DOMNode *a_node, UINT32 &a_len, bool bIncludeCerts) |
| SINT32 | sendMixHelo (const UINT8 *strMixHeloXML, UINT32 len, SINT32 requestCommand, const UINT8 *param, const CASocketAddrINet *a_socketAddress) |
| POSTs the HELO message for a mix to the InfoService. | |
| SINT32 | handleConfigEvent (XERCES_CPP_NAMESPACE::DOMDocument *doc) const |
Static Private Member Functions | |
| static THREAD_RETURN | TCascadeHelo (void *p) |
| static THREAD_RETURN | TCascadeStatus (void *p) |
| static THREAD_RETURN | TMixHelo (void *p) |
| static THREAD_RETURN | InfoLoop (void *p) |
Private Attributes | |
| volatile bool | m_bRun |
| CAMultiSignature * | m_pMultiSignature |
| CAMix * | m_pMix |
| CAThread * | m_pthreadRunLoop |
| CAConditionVariable * | m_pLoopCV |
| UINT64 | m_lastMixedPackets |
| UINT64 | m_serial |
| UINT32 | m_minuts |
| SINT32 | m_expectedMixRelPos |
| bool | m_bConfiguring |
References m_bRun, m_expectedMixRelPos, m_lastMixedPackets, m_minuts, m_pLoopCV, m_pMix, m_pMultiSignature, and m_pthreadRunLoop.
| CAInfoService::CAInfoService | ( | CAMix * | pMix | ) |
References m_bRun, m_expectedMixRelPos, m_lastMixedPackets, m_minuts, m_pLoopCV, m_pMix, m_pMultiSignature, m_pthreadRunLoop, and pMix.
References m_pLoopCV, m_pthreadRunLoop, and stop().
| UINT8 * CAInfoService::getCascadeHeloXMLAsString | ( | UINT32 & | len | ) | [private] |
References ATTRIBUTE_SERIAL, createDOMElement(), DOM_Output::dumpToMem(), E_SUCCESS, getcurrentTimeMillis(), getDOMChildByName(), CAMix::getMixCascadeInfo(), m_pMix, m_pMultiSignature, m_serial, print64(), setDOMElementAttribute(), setDOMElementValue(), and CAMultiSignature::signXML().
Referenced by sendCascadeHelo().
| SINT32 CAInfoService::getLevel | ( | SINT32 * | puser, |
| SINT32 * | prisk, | ||
| SINT32 * | ptraffic | ||
| ) |
References E_UNKNOWN, CALibProxytest::getOptions(), and m_pMix.
Referenced by getStatusXMLAsString().
| SINT32 CAInfoService::getMixedPackets | ( | UINT64 & | ppackets | ) |
References E_UNKNOWN, CALibProxytest::getOptions(), and m_pMix.
Referenced by getStatusXMLAsString().
| UINT8 * CAInfoService::getMixHeloXMLAsString | ( | UINT32 & | len | ) | [private] |
References ATTRIBUTE_SERIAL, E_SUCCESS, CALibProxytest::getOptions(), m_serial, setDOMElementAttribute(), and xmlDocToStringWithSignature().
Referenced by sendMixHelo().
| UINT8 ** CAInfoService::getOperatorTnCsAsStrings | ( | UINT32 ** | lengths, |
| XMLSize_t * | nrOfTnCs | ||
| ) | [private] |
returns a string array with all signed Terms and Condition-Objects NOTE: this method has a side-effect: the DOMNodes are all signed and thus modified
| lengths | contains the lengths of each corresponding object. Its memory is allocated by this method and has to be freed explicitly by calling delete [] |
| nrOfTnCs | is the length of the returned array |
| a | list with all Terms and conditions object which has to be freed explicitly by calling delete [] |
References E_SUCCESS, getDOMElementAttribute(), getElementsByTagName(), CACmdLnOptions::getOperatorSubjectKeyIdentifier(), CALibProxytest::getOptions(), CACmdLnOptions::getTermsAndConditions(), LOCALE_DEFAULT, OPTIONS_ATTRIBUTE_TNC_DATE, OPTIONS_ATTRIBUTE_TNC_ID, OPTIONS_ATTRIBUTE_TNC_LOCALE, OPTIONS_ATTRIBUTE_TNC_SERIAL, OPTIONS_ATTRIBUTE_TNC_VERSION, OPTIONS_NODE_TNCS_TRANSLATION, setCurrentTimeMilliesAsDOMAttribute(), setDOMElementAttribute(), TMP_BUFF_SIZE, and xmlDocToStringWithSignature().
| SINT32 CAInfoService::getPaymentInstance | ( | const UINT8 * | a_pstrPIID, |
| CAXMLBI ** | a_pXMLBI, | ||
| CASocketAddrINet * | a_socketAddress | ||
| ) | [private] |
Gets a payment instance from the InfoService.
| a_pstrPIID | id of the payment instance for which the information is requested |
| a_pXMLBI | a pointer to a pointer which on a successful return will point to a newly created CAXMLBI object |
| a_socketAddress | adress of the InfoService from which the information is to be requested |
| E_SUCCESS | if succesful |
| E_UNKNOWN | if an error occured |
References CASocket::close(), CASocket::connect(), E_SUCCESS, E_UNKNOWN, CAHttpClient::getContent(), CAXMLBI::getInstance(), CASocketAddrINet::getIPAsStr(), CASocketAddrINet::getPort(), parseDOMDocument(), CAHttpClient::parseHTTPHeader(), CAMsg::printMsg(), CAHttpClient::sendGetRequest(), CASocketAddrINet::setAddr(), and CAHttpClient::setSocket().
Referenced by getPaymentInstance().
| SINT32 CAInfoService::getPaymentInstance | ( | const UINT8 * | a_pstrPIID, |
| CAXMLBI ** | pXMLBI | ||
| ) |
| UINT8 * CAInfoService::getStatusXMLAsString | ( | bool | bIncludeCerts, |
| UINT32 & | len | ||
| ) |
References diff64(), div64(), E_SUCCESS, getcurrentTimeMillis(), getLevel(), getMixedPackets(), CACmdLnOptions::getMixId(), CALibProxytest::getOptions(), m_lastMixedPackets, m_minuts, m_pMultiSignature, print64(), set64(), CAMultiSignature::signXML(), and XML_MIX_CASCADE_STATUS.
Referenced by sendStatus().
| SINT32 CAInfoService::handleConfigEvent | ( | XERCES_CPP_NAMESPACE::DOMDocument * | doc | ) | const [private] |
*** Nedd redesigning!*/
References E_SUCCESS.
| THREAD_RETURN CAInfoService::InfoLoop | ( | void * | p | ) | [static, private] |
References BEGIN_STACK, E_SUCCESS, FINISH_STACK, CAMix::getLastConnectionTime(), CALibProxytest::getOptions(), INIT_STACK, isConfiguring(), CAMix::isConnected(), CACmdLnOptions::isFirstMix(), CACmdLnOptions::isLastMix(), isRunning(), CAMutex::lock(), m_pLoopCV, m_pMix, CAMsg::printMsg(), REPEAT_ON_STATUS_SENT_ERROR, SEND_CASCADE_INFO_WAIT, SEND_LOOP_SLEEP, SEND_MIX_INFO_WAIT, SEND_STATUS_INFO_WAIT, sendCascadeHelo(), sendMixHelo(), sendStatus(), sSleep(), THREAD_RETURN_SUCCESS, CAMutex::unlock(), and CAConditionVariable::wait().
Referenced by start().
| bool CAInfoService::isConfiguring | ( | ) |
References m_bConfiguring.
Referenced by InfoLoop().
| bool CAInfoService::isRunning | ( | ) |
References m_bRun.
Referenced by InfoLoop(), and CAMix::start().
References E_SUCCESS, E_UNKNOWN, getCascadeHeloXMLAsString(), CALibProxytest::getOptions(), CAMix::isConnected(), len, m_pMix, CAMsg::printMsg(), REQUEST_COMMAND_CASCADE, sendHelo(), and TCascadeHelo().
Referenced by InfoLoop(), CAMix::start(), and TCascadeHelo().
| SINT32 CAInfoService::sendCascadeHelo | ( | const UINT8 * | a_strCascadeHeloXML, |
| UINT32 | a_len, | ||
| const CASocketAddrINet * | a_pSocketAddress | ||
| ) | const [private] |
POSTs the HELO message for a whole cascade to the InfoService.
If the running mix is a last mix, this method is used to inform the InfoService that it wants to create a new cascade. The InfoService then tells all involved mixes to join this cascade. If the current mix is a middle mix, this method does nothing.
| E_SUCCESS | on success |
| E_UNKNOWN | on any error |
References CASocket::close(), CASocket::connect(), E_SUCCESS, E_UNKNOWN, getcurrentTimeMillis(), CASocketAddrINet::getIPAsStr(), CALibProxytest::getOptions(), CASocketAddrINet::getPort(), CACmdLnOptions::isFirstMix(), CACmdLnOptions::isLastMix(), m_bConfiguring, MIX_TO_INFOSERVICE_TIMEOUT, CAMsg::printMsg(), CASocket::receiveFullyT(), SEND_INFO_TIMEOUT_MS, and CASocket::sendFullyTimeOut().
| SINT32 CAInfoService::sendHelo | ( | UINT8 * | a_strXML, |
| UINT32 | a_len, | ||
| THREAD_RETURN(*)(void *) | a_thread, | ||
| UINT8 * | a_strThreadName, | ||
| SINT32 | requestCommand, | ||
| const UINT8 * | param = NULL |
||
| ) | [private] |
References CAInfoService::InfoServiceHeloMsg::addr, E_SUCCESS, E_UNKNOWN, CACmdLnOptions::getInfoServices(), CALibProxytest::getOptions(), CAInfoService::InfoServiceHeloMsg::is, CAInfoService::InfoServiceHeloMsg::len, CAInfoService::InfoServiceHeloMsg::param, CAInfoService::InfoServiceHeloMsg::requestCommand, CAThread::setMainLoop(), CAThread::start(), CAInfoService::InfoServiceHeloMsg::strXML, and THREAD_RETURN.
Referenced by sendCascadeHelo(), sendMixHelo(), and sendStatus().
| SINT32 CAInfoService::sendMixHelo | ( | SINT32 | requestCommand = -1, |
| const UINT8 * | param = NULL |
||
| ) |
POSTs the MIXINFO message for a mix to the InfoService.
References E_UNKNOWN, getMixHeloXMLAsString(), len, CAMsg::printMsg(), sendHelo(), and TMixHelo().
Referenced by InfoLoop(), and TMixHelo().
| SINT32 CAInfoService::sendMixHelo | ( | const UINT8 * | strMixHeloXML, |
| UINT32 | len, | ||
| SINT32 | requestCommand, | ||
| const UINT8 * | param, | ||
| const CASocketAddrINet * | a_socketAddress | ||
| ) | [private] |
POSTs the HELO message for a mix to the InfoService.
References CASocket::close(), CASocket::connect(), E_SUCCESS, E_UNKNOWN, GET_NET_ERROR, GET_NET_ERROR_STR, getcurrentTimeMillis(), CASocketAddrINet::getIPAsStr(), CASocketAddrINet::getPort(), len, m_bConfiguring, MIX_TO_INFOSERVICE_TIMEOUT, CAHttpClient::parseHTTPHeader(), CAMsg::printMsg(), CASocket::receiveFullyT(), REQUEST_COMMAND_CONFIGURE, REQUEST_COMMAND_HELO, REQUEST_COMMAND_MIXINFO, REQUEST_TYPE_GET, REQUEST_TYPE_POST, SEND_INFO_TIMEOUT_MS, CASocket::sendFullyTimeOut(), CASocket::setRecvBuff(), CAHttpClient::setSocket(), STRINGS_REQUEST_COMMANDS, and STRINGS_REQUEST_TYPES.
| SINT32 CAInfoService::sendOperatorTnCData | ( | ) | [private] |
References E_SUCCESS.
| SINT32 CAInfoService::sendStatus | ( | bool | bIncludeCerts | ) |
References E_SUCCESS, E_UNKNOWN, CALibProxytest::getOptions(), getStatusXMLAsString(), CAMix::isConnected(), len, m_pMix, CAMsg::printMsg(), REQUEST_COMMAND_STATUS, sendHelo(), and TCascadeStatus().
Referenced by InfoLoop(), and TCascadeStatus().
| SINT32 CAInfoService::sendStatus | ( | const UINT8 * | a_strStatusXML, |
| UINT32 | a_len, | ||
| const CASocketAddrINet * | a_pSocketAddress | ||
| ) | const [private] |
POSTs mix status to the InfoService.
[only first mix does this at the moment]
| E_UNKNOWN | if something goes wrong |
| E_SUCCESS | otherwisetodo use httpclient class |
References CASocket::close(), CASocket::connect(), E_SUCCESS, E_UNKNOWN, GET_NET_ERROR, GET_NET_ERROR_STR, getcurrentTimeMillis(), CASocketAddrINet::getIPAsStr(), CALibProxytest::getOptions(), CASocketAddrINet::getPort(), MIX_TO_INFOSERVICE_TIMEOUT, CAMsg::printMsg(), SEND_INFO_TIMEOUT_MS, and CASocket::sendFullyTimeOut().
| void CAInfoService::setConfiguring | ( | bool | a_configuring | ) |
References m_bConfiguring.
Referenced by CAMix::start().
| SINT32 CAInfoService::setMultiSignature | ( | CAMultiSignature * | pMultiSignature | ) |
References E_SUCCESS, and m_pMultiSignature.
Referenced by CAMix::start().
| void CAInfoService::setSerial | ( | UINT64 | a_serial | ) |
References m_serial.
Referenced by CAMix::start().
References E_SUCCESS, CAMutex::lock(), m_pLoopCV, CAConditionVariable::signal(), and CAMutex::unlock().
Referenced by CAMix::start().
References E_UNKNOWN, InfoLoop(), m_bRun, m_lastMixedPackets, m_minuts, m_pMultiSignature, m_pthreadRunLoop, CAMsg::printMsg(), set64(), CAThread::setMainLoop(), and CAThread::start().
Referenced by CAMix::start().
References E_SUCCESS, CAThread::join(), CAMutex::lock(), m_bRun, m_pLoopCV, m_pthreadRunLoop, CAConditionVariable::signal(), and CAMutex::unlock().
Referenced by CAFirstMixA::shutDown(), CAMix::start(), and ~CAInfoService().
| THREAD_RETURN CAInfoService::TCascadeHelo | ( | void * | p | ) | [static, private] |
References CAInfoService::InfoServiceHeloMsg::addr, BEGIN_STACK, FINISH_STACK, INIT_STACK, CAInfoService::InfoServiceHeloMsg::is, CAInfoService::InfoServiceHeloMsg::len, CAInfoService::InfoServiceHeloMsg::retVal, sendCascadeHelo(), CAInfoService::InfoServiceHeloMsg::strXML, and THREAD_RETURN_SUCCESS.
Referenced by sendCascadeHelo().
| THREAD_RETURN CAInfoService::TCascadeStatus | ( | void * | p | ) | [static, private] |
References CAInfoService::InfoServiceHeloMsg::addr, BEGIN_STACK, FINISH_STACK, INIT_STACK, CAInfoService::InfoServiceHeloMsg::is, CAInfoService::InfoServiceHeloMsg::len, CAInfoService::InfoServiceHeloMsg::retVal, sendStatus(), CAInfoService::InfoServiceHeloMsg::strXML, and THREAD_RETURN_SUCCESS.
Referenced by sendStatus().
| THREAD_RETURN CAInfoService::TMixHelo | ( | void * | p | ) | [static, private] |
References CAInfoService::InfoServiceHeloMsg::addr, BEGIN_STACK, FINISH_STACK, INIT_STACK, CAInfoService::InfoServiceHeloMsg::is, CAInfoService::InfoServiceHeloMsg::len, CAInfoService::InfoServiceHeloMsg::param, CAInfoService::InfoServiceHeloMsg::requestCommand, CAInfoService::InfoServiceHeloMsg::retVal, sendMixHelo(), CAInfoService::InfoServiceHeloMsg::strXML, and THREAD_RETURN_SUCCESS.
Referenced by sendMixHelo().
| UINT8 * CAInfoService::xmlDocToStringWithSignature | ( | DOMNode * | a_node, |
| UINT32 & | a_len, | ||
| bool | bIncludeCerts | ||
| ) | [private] |
References DOM_Output::dumpToMem(), E_SUCCESS, m_pMultiSignature, and CAMultiSignature::signXML().
Referenced by getMixHeloXMLAsString(), and getOperatorTnCsAsStrings().
bool CAInfoService::m_bConfiguring [private] |
Referenced by isConfiguring(), sendCascadeHelo(), sendMixHelo(), and setConfiguring().
volatile bool CAInfoService::m_bRun [private] |
Referenced by CAInfoService(), isRunning(), start(), and stop().
SINT32 CAInfoService::m_expectedMixRelPos [private] |
Referenced by CAInfoService().
UINT64 CAInfoService::m_lastMixedPackets [private] |
Referenced by CAInfoService(), getStatusXMLAsString(), and start().
UINT32 CAInfoService::m_minuts [private] |
Referenced by CAInfoService(), getStatusXMLAsString(), and start().
CAConditionVariable* CAInfoService::m_pLoopCV [private] |
Referenced by CAInfoService(), InfoLoop(), signal(), stop(), and ~CAInfoService().
CAMix* CAInfoService::m_pMix [private] |
Referenced by CAInfoService(), getCascadeHeloXMLAsString(), getLevel(), getMixedPackets(), InfoLoop(), sendCascadeHelo(), and sendStatus().
CAMultiSignature* CAInfoService::m_pMultiSignature [private] |
CAThread* CAInfoService::m_pthreadRunLoop [private] |
Referenced by CAInfoService(), start(), stop(), and ~CAInfoService().
UINT64 CAInfoService::m_serial [private] |
Referenced by getCascadeHeloXMLAsString(), getMixHeloXMLAsString(), and setSerial().
const UINT64 CAInfoService::MINUTE = 60 [static] |
const UINT32 CAInfoService::REPEAT_ON_STATUS_SENT_ERROR = 3 [static] |
Referenced by InfoLoop().
const UINT64 CAInfoService::SEND_CASCADE_INFO_WAIT = MINUTE * 10 [static] |
Referenced by InfoLoop().
const UINT32 CAInfoService::SEND_INFO_TIMEOUT_MS = 3000 [static] |
Referenced by sendCascadeHelo(), sendMixHelo(), and sendStatus().
const UINT64 CAInfoService::SEND_LOOP_SLEEP = 60 [static] |
Referenced by InfoLoop().
const UINT64 CAInfoService::SEND_MIX_INFO_WAIT = MINUTE * 10 [static] |
Referenced by InfoLoop().
const UINT64 CAInfoService::SEND_STATUS_INFO_WAIT = MINUTE [static] |
Referenced by InfoLoop().
1.7.6.1