Mixe for Privacy and Anonymity in the Internet
Classes | Macros | Functions
CAAccountingInstance.hpp File Reference
#include "doxygen.h"
#include "CAFirstMix.hpp"
#include "CAFirstMixChannelList.hpp"
#include "CASymCipher.hpp"
#include "CAQueue.hpp"
#include "CAThread.hpp"
#include "CATempIPBlockList.hpp"
#include "CAThreadPool.hpp"
#include "CAAccountingDBInterface.hpp"
#include "CAAccountingBIInterface.hpp"
#include "CAAccountingControlChannel.hpp"
#include "CAAccountingSettleThread.hpp"
#include "CACmdLnOptions.hpp"
#include "Hashtable.hpp"
#include "CAMix.hpp"
#include "xml/DOM_Output.hpp"
#include "CAStatusManager.hpp"
Include dependency graph for CAAccountingInstance.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  AccountLoginHashEntry
 
struct  SettleEntry
 
class  CAAccountingInstance
 This is the AI (accounting instance or abrechnungsinstanz in german) class. More...
 
struct  CAAccountingInstance::t_aiqueueitem
 

Macros

#define CHALLENGE_TIMEOUT   15
 
#define HARD_LIMIT_TIMEOUT   30
 
#define AUTH_TIMEOUT   15
 
#define CRITICAL_SUBSEQUENT_BI_CONN_ERRORS   5
 
#define CLIENT_VERSION_STR_LEN   20
 
#define PREPAID_PROTO_CLIENT_VERSION   "00.10.057"
 
#define CRITICAL_SETTLE_FLAGS    (AUTH_INVALID_ACCOUNT | AUTH_ACCOUNT_EMPTY | AUTH_BLOCKED | AUTH_UNKNOWN)
 

Functions

bool testAndSetLoginOwner (struct AccountLoginHashEntry *loginEntry, struct t_fmhashtableentry *ownerRef)
 if the current login entry isn't locked by a login thread the calling login-thread obtains ownership More...
 
bool resetLoginOngoing (struct AccountLoginHashEntry *loginEntry, struct t_fmhashtableentry *ownerRef)
 indicates that the ongoing login process for this entry is finished but doesn't reset ownership. More...
 
bool testLoginEntryOwner (struct AccountLoginHashEntry *loginEntry, fmHashTableEntry *ownerRef)
 tests whether the corresponding ownerEntry owns this loginEntry. More...
 
bool isLoginOngoing (struct AccountLoginHashEntry *loginEntry, struct t_fmhashtableentry *ownerRef)
 test whether this entry is currently resrved by an ongoing login process. More...
 
bool testLoginEntryOwner_internal (struct AccountLoginHashEntry *loginEntry, struct t_fmhashtableentry *ownerRef)
 

Macro Definition Documentation

◆ AUTH_TIMEOUT

#define AUTH_TIMEOUT   15

Definition at line 62 of file CAAccountingInstance.hpp.

◆ CHALLENGE_TIMEOUT

#define CHALLENGE_TIMEOUT   15

Definition at line 60 of file CAAccountingInstance.hpp.

◆ CLIENT_VERSION_STR_LEN

#define CLIENT_VERSION_STR_LEN   20

Definition at line 65 of file CAAccountingInstance.hpp.

◆ CRITICAL_SETTLE_FLAGS

#define CRITICAL_SETTLE_FLAGS    (AUTH_INVALID_ACCOUNT | AUTH_ACCOUNT_EMPTY | AUTH_BLOCKED | AUTH_UNKNOWN)

Definition at line 68 of file CAAccountingInstance.hpp.

◆ CRITICAL_SUBSEQUENT_BI_CONN_ERRORS

#define CRITICAL_SUBSEQUENT_BI_CONN_ERRORS   5

Definition at line 63 of file CAAccountingInstance.hpp.

◆ HARD_LIMIT_TIMEOUT

#define HARD_LIMIT_TIMEOUT   30

Definition at line 61 of file CAAccountingInstance.hpp.

◆ PREPAID_PROTO_CLIENT_VERSION

#define PREPAID_PROTO_CLIENT_VERSION   "00.10.057"

Definition at line 66 of file CAAccountingInstance.hpp.

Function Documentation

◆ isLoginOngoing()

bool isLoginOngoing ( struct AccountLoginHashEntry loginEntry,
struct t_fmhashtableentry ownerRef 
)

test whether this entry is currently resrved by an ongoing login process.

Definition at line 3839 of file CAAccountingInstance.cpp.

3840 {
3841  bool ret;
3842  loginEntry->ownerLock->lock();
3843  ret = loginEntry->loginOngoing;
3844  loginEntry->ownerLock->unlock();
3845  return ret;
3846 }
SINT32 unlock()
Definition: CAMutex.hpp:52
SINT32 lock()
Definition: CAMutex.hpp:41
bool loginOngoing
CAMutex * ownerLock

References CAMutex::lock(), AccountLoginHashEntry::loginOngoing, AccountLoginHashEntry::ownerLock, and CAMutex::unlock().

Referenced by CAAccountingInstance::cleanupTableEntry().

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

◆ resetLoginOngoing()

bool resetLoginOngoing ( struct AccountLoginHashEntry loginEntry,
struct t_fmhashtableentry ownerRef 
)

indicates that the ongoing login process for this entry is finished but doesn't reset ownership.

Definition at line 3806 of file CAAccountingInstance.cpp.

3807 {
3808  bool success = false;
3809  loginEntry->ownerLock->lock();
3810  success = testLoginEntryOwner_internal(loginEntry, ownerRef);
3811  if(success)
3812  {
3813  loginEntry->loginOngoing = false;
3814  //CAMsg::printMsg(LOG_DEBUG,"resetted for %x.\n", loginEntry->ownerRef);
3815  }
3816  /*else
3817  {
3818  CAMsg::printMsg(LOG_DEBUG,"not resetted for %x.\n", loginEntry->ownerRef);
3819  }*/
3820  loginEntry->ownerLock->unlock();
3821  return success;
3822 }
bool testLoginEntryOwner_internal(struct AccountLoginHashEntry *loginEntry, fmHashTableEntry *ownerRef)

References CAMutex::lock(), AccountLoginHashEntry::loginOngoing, AccountLoginHashEntry::ownerLock, testLoginEntryOwner_internal(), and CAMutex::unlock().

Referenced by CAAccountingInstance::unlockLogin().

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

◆ testAndSetLoginOwner()

bool testAndSetLoginOwner ( struct AccountLoginHashEntry loginEntry,
struct t_fmhashtableentry ownerRef 
)

if the current login entry isn't locked by a login thread the calling login-thread obtains ownership

Definition at line 3763 of file CAAccountingInstance.cpp.

3764 {
3765  bool success = false;
3766  loginEntry->ownerLock->lock();
3767  success = !loginEntry->loginOngoing;
3768  if(success)
3769  {
3770  //CAMsg::printMsg(LOG_DEBUG,"login free, owner %x \n", loginEntry->ownerRef);
3771  loginEntry->ownerRef = ownerRef;
3772  loginEntry->loginOngoing = true;
3773  }
3774  /*else
3775  {
3776  CAMsg::printMsg(LOG_DEBUG,"login ongoing, owner %x \n", loginEntry->ownerRef);
3777  }*/
3778  loginEntry->ownerLock->unlock();
3779  return success;
3780 }
struct t_fmhashtableentry * ownerRef

References CAMutex::lock(), AccountLoginHashEntry::loginOngoing, AccountLoginHashEntry::ownerLock, AccountLoginHashEntry::ownerRef, and CAMutex::unlock().

Referenced by CAAccountingInstance::handleChallengeResponse_internal().

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

◆ testLoginEntryOwner()

bool testLoginEntryOwner ( struct AccountLoginHashEntry loginEntry,
fmHashTableEntry ownerRef 
)

tests whether the corresponding ownerEntry owns this loginEntry.

Definition at line 3827 of file CAAccountingInstance.cpp.

3828 {
3829  bool ret;
3830  loginEntry->ownerLock->lock();
3831  ret = testLoginEntryOwner_internal(loginEntry, ownerRef);
3832  loginEntry->ownerLock->unlock();
3833  return ret;
3834 }

References CAMutex::lock(), AccountLoginHashEntry::ownerLock, testLoginEntryOwner_internal(), and CAMutex::unlock().

Referenced by CAAccountingInstance::cleanupTableEntry().

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

◆ testLoginEntryOwner_internal()

bool testLoginEntryOwner_internal ( struct AccountLoginHashEntry loginEntry,
struct t_fmhashtableentry ownerRef 
)
inline

Definition at line 3848 of file CAAccountingInstance.cpp.

3849 {
3850  return (loginEntry->ownerRef == ownerRef);
3851 }

References AccountLoginHashEntry::ownerRef.

Referenced by resetLoginOngoing(), and testLoginEntryOwner().

Here is the caller graph for this function: