28 #ifndef __CAFRISTMIXCHANNELLIST__
29 #define __CAFRISTMIXCHANNELLIST__
31 #if !defined ONLY_LOCAL_PROXY || defined INCLUDE_FIRST_MIX
48 #define KICKOUT_FORCED true
49 #define MAX_KICKOUT_RETRIES 4
63 time_t channelOpenedLastIntervalTS;
66 #ifdef LOG_TRAFFIC_PER_USER
75 #if defined(DATA_RETENTION_LOG) || defined(LOG_CRIME)
149 #ifdef ANON_DEBUG_MODE
233 UINT8* controlChannelKeyRecv,
UINT8* controlChannelKeySent);
285 void cleanVacantOutChannels();
384 if(m_maxAlloc<m_aktAlloc)
386 m_maxAlloc=m_aktAlloc;
387 CAMsg::printMsg(LOG_DEBUG,
"FirstMixChannelList current alloc: %u\n",m_aktAlloc);
struct t_firstmixchannellist fmChannelListEntry
fmChannelListEntry * LP_fmChannelListEntry
THREAD_RETURN fml_loopDelayBuckets(void *param)
fmHashTableEntry * LP_fmHashTableEntry
implementation of a per-user control-channel for the AccountingInstance.
This is the AI (accounting instance or abrechnungsinstanz in german) class.
This class "dispatches" messages which it receives via proccessMixPacket() to the associated control ...
Data structure that stores all information about the currently open Mix channels.
fmChannelListEntry * getFirstChannelForSocket(CAMuxSocket *pMuxSocket)
Gets the first channel for a given connection.
void setDelayParameters(UINT32 unlimitTraffic, UINT32 bucketGrow, UINT32 intervall)
CAThread * m_pThreadDelayBucketsLoop
fmHashTableEntry * getFirst()
Gets the first connection of all connections in the list.
LP_fmChannelListEntry * m_HashTableOutChannels
The Hash-Table of all out-channels.
volatile UINT32 ** m_pDelayBuckets
bool isKickoutForced(fmHashTableEntry *pHashTableEntry)
bool isTimedOut_internal(fmHashTableEntry *pHashTableEntry)
SINT32 removeFromTimeoutList(fmHashTableEntry *pHashTableEntry)
fmHashTableEntry * m_listTimoutHead
Pointer to the head of the timout list of all connections.
SINT32 addChannel(CAMuxSocket *pMuxSocket, HCHANNEL channelIn, CASymChannelCipher *pCipher, HCHANNEL *channelOut)
Adds a new channel for a given connection to the channel list.
static const SINT32 EXPIRATION_TIME_SECS
fmChannelListEntry * get(CAMuxSocket *pMuxSocket, HCHANNEL channelIn)
Returns the information for a given Input-Channel-ID.
fmHashTableEntry * m_listHashTableNext
Next Element in the enumeration of all connections.
CAMutex * m_pMutexDelayChannel
fmHashTableEntry * getNext()
Gets the next entry in the connections-list.
fmChannelListEntry * get_intern_without_lock(HCHANNEL channelOut)
Gets the in-channel and all associated information for the given out-channel.
fmHashTableEntry * m_listHashTableHead
Pointer to the head of a list of all connections.
friend THREAD_RETURN fml_loopDelayBuckets(void *)
bool forceKickout(fmHashTableEntry *pHashTableEntry, const XERCES_CPP_NAMESPACE::DOMDocument *pErrDoc)
forces a kickout for this entry if the entry is still valid and sends an errorMessage via the control...
fmHashTableEntry * popTimeoutEntry_internal(bool a_bForce)
SINT32 removeChannel(CAMuxSocket *pMuxSocket, HCHANNEL channelIn)
Removes a single channel from the list.
bool isTimedOut(fmHashTableEntry *pHashTableEntry)
fmHashTableEntry * m_listTimoutFoot
bool isKickoutForced_internal(fmHashTableEntry *pHashTableEntry)
void decDelayBuckets(UINT32 delayBucketID)
volatile UINT32 m_u32DelayChannelBucketGrowIntervall
fmChannelListEntry * getNextChannel(fmChannelListEntry *pEntry)
Gets the next channel for a given connection.
fmChannelListEntry * get(HCHANNEL channelOut)
Gets the in-channel and all associated information for the given out-channel.
fmHashTableEntry * add(CAMuxSocket *pMuxSocket, const UINT8 peerIP[4], CAQueue *pQueueSend, UINT8 *controlChannelKeyRecv, UINT8 *controlChannelKeySent)
Adds a new TCP/IP connection (a new user) to the channel list.
volatile UINT32 m_u32DelayChannelBucketGrow
SINT32 remove(CAMuxSocket *pMuxSocket)
Removes all channels, which belongs to the given connection and the connection itself from the list.
void setKickoutForced_internal(fmHashTableEntry *pHashTableEntry, bool kickoutForced)
void setKickoutForced(fmHashTableEntry *pHashTableEntry, bool kickoutForced)
bool m_bDelayBucketsLoopRun
UINT32 countTimeoutEntries()
LP_fmHashTableEntry * m_HashTable
The Hash-Table of all connections.
fmHashTableEntry * popTimeoutEntry()
SINT32 pushTimeoutEntry(fmHashTableEntry *pHashTableEntry, bool kickoutForced=!KICKOUT_FORCED)
adds the entry to the timeout queue with mutex
bool hasDelayBuckets(UINT32 delayBucketID)
CAMutex m_Mutex
This mutex is used in all functions and makes them thread safe.
SINT32 pushTimeoutEntry_internal(fmHashTableEntry *pHashTableEntry, bool kickoutForced=!KICKOUT_FORCED)
adds the entry to the timeout queue
volatile UINT32 m_u32DelayChannelUnlimitTraffic
static SINT32 printMsg(UINT32 typ, const char *format,...)
Writes a given message to the log.
This is a simple FIFO-Queue.
Structure that holds all per-user payment information Included in CAFirstMixChannelList (struct fmHas...
CASymChannelCipher * pCipher
struct t_firstmixchannellist * prev
struct t_firstmixchannellist * next
struct t_firstmixchannellist::@2 list_OutChannelHashTable
struct t_firstmixchannellist::@3 list_InChannelPerSocket
volatile UINT32 delayBucketID
struct t_fmhashtableentry * prev
CAQueue * pControlMessageQueue
CASymChannelCipher * pSymCipher
CAControlChannelDispatcher * pControlChannelDispatcher
SINT32 kickoutSendRetries
volatile UINT32 delayBucket
CountryID of this IP Address.
CAConditionVariable * cleanupNotifier
struct t_fmhashtableentry::@1 list_TimeoutHashEntries
struct t_firstmixchannellist * pChannelList
tAiAccountingInfo * pAccountingInfo
SINT32 uAlreadySendPacketSize
struct t_fmhashtableentry * next
struct t_fmhashtableentry::@0 list_HashEntries