|
Mixe for Privacy and Anonymity in the Internet
|
#include <CALibProxytest.hpp>
Static Public Member Functions | |
| static SINT32 | init () |
| do necessary initialisations of libraries etc. | |
| static SINT32 | cleanup () |
| do necessary cleanups of libraries etc. | |
| static CACmdLnOptions * | getOptions () |
Static Private Member Functions | |
| static void | openssl_locking_callback (int mode, int type, char *, int) |
| Callbackfunction for locking required by OpenSSL. | |
Static Private Attributes | |
| static CACmdLnOptions * | m_pglobalOptions |
| static CAMutex * | m_pOpenSSLMutexes |
Definition at line 6 of file CALibProxytest.hpp.
| SINT32 CALibProxytest::cleanup | ( | ) | [static] |
do necessary cleanups of libraries etc.
Definition at line 65 of file CALibProxytest.cpp.
References E_SUCCESS, m_pglobalOptions, m_pOpenSSLMutexes, CAMsg::printMsg(), and releaseDOMParser().
Referenced by cleanup().
{
CASocketAddrINet::cleanup();
#ifdef _WIN32
WSACleanup();
#endif
delete m_pglobalOptions;
m_pglobalOptions=NULL;
//OpenSSL Cleanup
CRYPTO_set_locking_callback(NULL);
delete []m_pOpenSSLMutexes;
m_pOpenSSLMutexes=NULL;
//XML Cleanup
//Note: We have to destroy all XML Objects and all objects that uses XML Objects BEFORE
//we terminate the XML lib!
#ifdef SERVER_MONITORING
CAStatusManager::cleanup();
#endif
releaseDOMParser();
#ifndef ONLY_LOCAL_PROXY
XMLPlatformUtils::Terminate();
#endif
#if defined _DEBUG && ! defined (ONLY_LOCAL_PROXY)
if(m_pThreadList != NULL)
{
int nrOfThreads = m_pThreadList->getSize();
CAMsg::printMsg(LOG_INFO,"After cleanup %d threads listed.\n", nrOfThreads);
if(nrOfThreads > 0)
{
m_pThreadList->showAll();
}
delete m_pThreadList;
m_pThreadList = NULL;
}
#endif
CAMsg::cleanup();
return E_SUCCESS;
}
| static CACmdLnOptions* CALibProxytest::getOptions | ( | ) | [inline, static] |
Definition at line 11 of file CALibProxytest.hpp.
References m_pglobalOptions.
Referenced by CAMix::addMixInfo(), CAMix::appendTermsAndConditionsExtension(), CAAccountingInstance::CAAccountingInstance(), CAMix::CAMix(), CAAccountingInstance::cleanupTableEntry(), CAFirstMix::doUserLogin_internal(), fm_loopAcceptUsers(), CAInfoService::getLevel(), CAInfoService::getMixedPackets(), CAInfoService::getMixHeloXMLAsString(), CAInfoService::getOperatorTnCsAsStrings(), CAInfoService::getPaymentInstance(), CAInfoService::getStatusXMLAsString(), CAAccountingInstance::handleAccountCertificate_internal(), CAAccountingInstance::handleChallengeResponse_internal(), CAAccountingInstance::handleCostConfirmation_internal(), CAAccountingInstance::handleJapPacket_internal(), CAInfoService::InfoLoop(), CALocalProxy::init(), CAMiddleMix::init(), CALastMix::init(), CAFirstMix::init(), CAFirstMix::initCountryStats(), CAAccountingDBInterface::initDBConnection(), CAMix::initMixCascadeInfo(), CAFirstMix::initMixParameters(), CALocalProxy::initOnce(), CAMiddleMix::initOnce(), CALastMix::initOnce(), CAMix::initOnce(), CAFirstMix::initOnce(), iplist_loopDoLogCountries(), isAllowedToPassRestrictions(), CALastMixA::loop(), CAFirstMixA::loop(), CALocalProxy::loop(), main(), CAAccountingSettleThread::mainLoop(), CAMix::needAutoConfig(), CAMsg::openEncryptedLog(), CAMsg::openLog(), CAMiddleMix::processKeyExchange(), CALastMix::processKeyExchange(), CAFirstMix::processKeyExchange(), CALastMix::reconfigure(), CAFirstMix::reconfigure(), removePidFile(), CAMsg::rotateLog(), CAInfoService::sendCascadeHelo(), CAAccountingInstance::sendCCRequest(), CAInfoService::sendHelo(), CAInfoService::sendStatus(), CALastMix::setTargets(), signal_hup(), CAMix::start(), and CAMix::termsAndConditionsInfoNode().
{
return m_pglobalOptions;
}
| SINT32 CALibProxytest::init | ( | ) | [static] |
do necessary initialisations of libraries etc.
Definition at line 34 of file CALibProxytest.cpp.
References E_SUCCESS, initDOMParser(), initRandom(), m_pglobalOptions, m_pOpenSSLMutexes, openssl_get_thread_id(), and openssl_locking_callback().
Referenced by init().
{
#ifndef ONLY_LOCAL_PROXY
XMLPlatformUtils::Initialize();
initDOMParser();
#endif
#ifndef ONLY_LOCAL_PROXY
SSL_library_init();
#endif
OpenSSL_add_all_algorithms();
m_pOpenSSLMutexes=new CAMutex[CRYPTO_num_locks()];
CRYPTO_set_locking_callback((void (*)(int,int,const char *,int))openssl_locking_callback);
CRYPTO_set_id_callback(openssl_get_thread_id);
#if defined _DEBUG && ! defined (ONLY_LOCAL_PROXY)
m_pThreadList=new CAThreadList();
CAThread::setThreadList(m_pThreadList);
#endif
CAMsg::init();
CASocketAddrINet::init();
//startup
#ifdef _WIN32
int err=0;
WSADATA wsadata;
err=WSAStartup(0x0202,&wsadata);
#endif
initRandom();
m_pglobalOptions=new CACmdLnOptions();
return E_SUCCESS;
}
| void CALibProxytest::openssl_locking_callback | ( | int | mode, |
| int | type, | ||
| char * | , | ||
| int | |||
| ) | [static, private] |
Callbackfunction for locking required by OpenSSL.
Definition at line 13 of file CALibProxytest.cpp.
References CAMutex::lock(), m_pOpenSSLMutexes, type, and CAMutex::unlock().
Referenced by init().
{
if (mode & CRYPTO_LOCK)
{
m_pOpenSSLMutexes[type].lock();
}
else
{
m_pOpenSSLMutexes[type].unlock();
}
}
CACmdLnOptions * CALibProxytest::m_pglobalOptions [static, private] |
Definition at line 17 of file CALibProxytest.hpp.
Referenced by cleanup(), getOptions(), and init().
CAMutex * CALibProxytest::m_pOpenSSLMutexes [static, private] |
Definition at line 18 of file CALibProxytest.hpp.
Referenced by cleanup(), init(), and openssl_locking_callback().
1.7.6.1