Mixe for Privacy and Anonymity in the Internet
Static Public Member Functions | Static Private Member Functions | Static Private Attributes | List of all members
CALibProxytest Class Reference

#include <CALibProxytest.hpp>

Collaboration diagram for CALibProxytest:

Static Public Member Functions

static SINT32 init ()
 do necessary initialisations of libraries etc. More...
 
static SINT32 cleanup ()
 do necessary cleanups of libraries etc. More...
 
static CACmdLnOptions * getOptions ()
 

Static Private Member Functions

static void openssl_locking_callback (int mode, int type, char *, int)
 Callbackfunction for locking required by OpenSSL <1.1. More...
 

Static Private Attributes

static CACmdLnOptions * m_pglobalOptions
 
static CAMutex * m_pOpenSSLMutexes
 

Detailed Description

Definition at line 6 of file CALibProxytest.hpp.

Member Function Documentation

◆ cleanup()

SINT32 CALibProxytest::cleanup ( )
static

do necessary cleanups of libraries etc.

Definition at line 83 of file CALibProxytest.cpp.

84  {
86  #ifdef _WIN32
87  WSACleanup();
88  #endif
89  delete m_pglobalOptions;
90  m_pglobalOptions=NULL;
91 
92  //OpenSSL Cleanup
93 #if OPENSSL_VERSION_NUMBER < 0x10100000L
94  CRYPTO_set_locking_callback(NULL);
95  delete []m_pOpenSSLMutexes;
96  m_pOpenSSLMutexes=NULL;
97 #endif
98  //XML Cleanup
99  //Note: We have to destroy all XML Objects and all objects that uses XML Objects BEFORE
100  //we terminate the XML lib!
101 #ifdef SERVER_MONITORING
103 #endif
105 #if !defined MXML_DOM
106  XMLPlatformUtils::Terminate();
107 #endif
108 
109 #if defined _DEBUG && ! defined (ONLY_LOCAL_PROXY)
110  if(m_pThreadList != NULL)
111  {
112  int nrOfThreads = m_pThreadList->getSize();
113  CAMsg::printMsg(LOG_INFO,"After cleanup %d threads listed.\n", nrOfThreads);
114  if(nrOfThreads > 0)
115  {
116  m_pThreadList->showAll();
117  }
118  delete m_pThreadList;
119  m_pThreadList = NULL;
120  }
121 #endif
124  CAMsg::cleanup();
125  return E_SUCCESS;
126  }
void releaseDOMParser()
Definition: CAUtil.cpp:694
static CAMutex * m_pOpenSSLMutexes
static CACmdLnOptions * m_pglobalOptions
static SINT32 cleanup()
Definition: CAMsg.hpp:77
static SINT32 printMsg(UINT32 typ, const char *format,...)
Writes a given message to the log.
Definition: CAMsg.cpp:251
static SINT32 cleanup()
static SINT32 cleanup()
static SINT32 cleanup()
Definition: CASocket.hpp:49
const SINT32 E_SUCCESS
Definition: errorcodes.hpp:2
void cleanup()
do necessary cleanups of libraries etc.
Definition: proxytest.cpp:151

References CAMsg::cleanup(), CAMuxSocket::cleanup(), CASocket::cleanup(), CASocketAddrINet::cleanup(), cleanup(), E_SUCCESS, m_pglobalOptions, m_pOpenSSLMutexes, CAMsg::printMsg(), and releaseDOMParser().

Referenced by cleanup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getOptions()

static CACmdLnOptions* CALibProxytest::getOptions ( )
inlinestatic

Definition at line 11 of file CALibProxytest.hpp.

12  {
13  return m_pglobalOptions;
14  }

References m_pglobalOptions.

Referenced by CAMix::addMixInfo(), CAAccountingInstance::CAAccountingInstance(), CAMix::CAMix(), CAAccountingInstance::cleanupTableEntry(), CAFirstMix::doUserLogin_internal(), 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(), CAFirstMix::init(), CALastMix::init(), CALocalProxy::init(), CAMiddleMix::init(), CAFirstMix::initCountryStats(), CAAccountingDBInterface::initDBConnection(), CAMix::initMixCascadeInfo(), CAFirstMix::initMixParameters(), CAFirstMix::initOnce(), CALastMix::initOnce(), CALocalProxy::initOnce(), CAMiddleMix::initOnce(), CAMix::initOnce(), isAllowedToPassRestrictions(), CALocalProxy::loop(), CAFirstMixA::loop(), CALastMixA::loop(), main(), CAAccountingSettleThread::mainLoop(), CAMix::needAutoConfig(), CAMsg::openEncryptedLog(), CAMsg::openLog(), CALastMix::processKeyExchange(), CAMiddleMix::processKeyExchange(), CALocalProxy::processKeyExchange(), CAFirstMix::reconfigure(), CALastMix::reconfigure(), CALastMixB::reconfigureMix(), CALastMixChannelList::removeChannel(), removePidFile(), CAMsg::rotateLog(), CAInfoService::sendCascadeHelo(), CAAccountingInstance::sendCCRequest(), CAInfoService::sendHelo(), CAInfoService::sendStatus(), CALastMix::setTargets(), signal_hup(), and CAMix::start().

◆ init()

SINT32 CALibProxytest::init ( )
static

do necessary initialisations of libraries etc.

Definition at line 42 of file CALibProxytest.cpp.

43  {
44 #if !defined MXML_DOM
45  XMLPlatformUtils::Initialize();
46 #endif
47  initDOMParser();
48 #if !defined ONLY_LOCAL_PROXY || defined INLUDE_MIDDLE_MIX
49  #if OPENSSL_VERSION_NUMBER < 0x10100000L
50  SSL_library_init();
51  #else
52  OPENSSL_init_ssl(0, NULL);
53  #endif
54 #endif
55 #if OPENSSL_VERSION_NUMBER < 0x10100000L
56  OpenSSL_add_all_algorithms();
57  //It seems that only older versions of OpenSSL need the thred locking callbacks.
58  //But the mor interesting question is: at which version did the change happen?
59  m_pOpenSSLMutexes=new CAMutex[CRYPTO_num_locks()];
60  CRYPTO_set_locking_callback((void (*)(int,int,const char *,int))openssl_locking_callback);
61  CRYPTO_set_id_callback(openssl_get_thread_id);
62 #endif
63 #if defined _DEBUG && ! defined (ONLY_LOCAL_PROXY)
64  m_pThreadList=new CAThreadList();
65  CAThread::setThreadList(m_pThreadList);
66 #endif
67  CAMsg::init();
71  //startup
72  #ifdef _WIN32
73  int err=0;
74  WSADATA wsadata;
75  err=WSAStartup(0x0202,&wsadata);
76  #endif
77  initRandom();
79  return E_SUCCESS;
80 }
unsigned long openssl_get_thread_id(void)
Callback used by openssl to identify a thread.
SINT32 initRandom()
Definition: CAUtil.cpp:302
void initDOMParser()
Definition: CAUtil.cpp:656
static void openssl_locking_callback(int mode, int type, char *, int)
Callbackfunction for locking required by OpenSSL <1.1.
static SINT32 init()
Definition: CAMsg.hpp:69
static SINT32 init()
static SINT32 init()
static SINT32 init()
Definition: CASocket.hpp:43

References E_SUCCESS, CAMsg::init(), CAMuxSocket::init(), CASocket::init(), CASocketAddrINet::init(), initDOMParser(), initRandom(), m_pglobalOptions, m_pOpenSSLMutexes, openssl_get_thread_id(), and openssl_locking_callback().

Referenced by init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ openssl_locking_callback()

void CALibProxytest::openssl_locking_callback ( int  mode,
int  type,
char *  ,
int   
)
staticprivate

Callbackfunction for locking required by OpenSSL <1.1.

Definition at line 16 of file CALibProxytest.cpp.

17  {
18  if (mode & CRYPTO_LOCK)
19  {
21  }
22  else
23  {
25  }
26  }
SINT32 unlock()
Definition: CAMutex.hpp:52
SINT32 lock()
Definition: CAMutex.hpp:41
UINT8 type
Definition: typedefs.hpp:1

References CAMutex::lock(), m_pOpenSSLMutexes, type, and CAMutex::unlock().

Referenced by init().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_pglobalOptions

CACmdLnOptions * CALibProxytest::m_pglobalOptions
staticprivate

Definition at line 17 of file CALibProxytest.hpp.

Referenced by cleanup(), getOptions(), and init().

◆ m_pOpenSSLMutexes

CAMutex * CALibProxytest::m_pOpenSSLMutexes
staticprivate

Definition at line 18 of file CALibProxytest.hpp.

Referenced by cleanup(), init(), and openssl_locking_callback().


The documentation for this class was generated from the following files: