Mixe for Privacy and Anonymity in the Internet
Macros | Functions
CAAccountingInstance.cpp File Reference
#include "StdAfx.h"
#include "CAAccountingInstance.hpp"
#include "CAAccountingControlChannel.hpp"
#include "CABase64.hpp"
#include "CAMsg.hpp"
#include "CAUtil.hpp"
#include "CASignature.hpp"
#include "CAThreadPool.hpp"
#include "CAXMLErrorMessage.hpp"
#include "Hashtable.hpp"
#include "packetintro.h"
#include "CALibProxytest.hpp"
Include dependency graph for CAAccountingInstance.cpp:

Go to the source code of this file.

Macros

#define JAP_DIGEST_LENGTH   28
 

Functions

bool testAndSetLoginOwner (struct AccountLoginHashEntry *loginEntry, 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, 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, fmHashTableEntry *ownerRef)
 test whether this entry is currently resrved by an ongoing login process. More...
 
bool testLoginEntryOwner_internal (struct AccountLoginHashEntry *loginEntry, fmHashTableEntry *ownerRef)
 

Macro Definition Documentation

◆ JAP_DIGEST_LENGTH

#define JAP_DIGEST_LENGTH   28

Definition at line 49 of file CAAccountingInstance.cpp.

Function Documentation

◆ isLoginOngoing()

bool isLoginOngoing ( struct AccountLoginHashEntry loginEntry,
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,
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,
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,
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: