Mixe for Privacy and Anonymity in the Internet
CAChainTable.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2006, The JAP-Team
3  * All rights reserved.
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are met:
6  *
7  * - Redistributions of source code must retain the above copyright notice,
8  * this list of conditions and the following disclaimer.
9  *
10  * - Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  *
14  * - Neither the name of the University of Technology Dresden, Germany nor
15  * the names of its contributors may be used to endorse or promote
16  * products derived from this software without specific prior written
17  * permission.
18  *
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
24  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30  * POSSIBILITY OF SUCH DAMAGE
31  */
32 #ifndef __CA_CHAINTABLE__
33 #define __CA_CHAINTABLE__
34 #ifndef ONLY_LOCAL_PROXY
35 #include "../CAMutex.hpp"
36 #include "../CAThread.hpp"
37 #include "CAChain.hpp"
38 
43 };
44 
49 };
50 
51 
52 class CAChainTable {
53  public:
54  CAChainTable(void);
55  ~CAChainTable(void);
56  CAChain* getEntry(UINT8* a_chainId);
58  void deleteEntry(UINT8* a_chainId);
59  UINT32 getSize();
62  #ifdef DELAY_CHANNELS
63  void setDelayParameters(UINT32 a_initialBucketSize, UINT32 a_delayBucketGrow, UINT32 a_delayBucketGrowInterval);
64  #endif
65 
66  private:
71 
73 
74  #ifdef DELAY_CHANNELS
75  CAMutex* m_pDelayBucketMutex;
76  SINT32* m_pDelayBuckets;
77  CAThread* m_pDelayBucketsLoop;
78  volatile bool m_delayBucketsLoopRun;
79  volatile UINT32 m_initialBucketSize;
80  volatile UINT32 m_delayBucketGrow;
81  volatile UINT32 m_delayBucketGrowInterval;
82 
83  friend THREAD_RETURN lml_chaintableDelayBucketsLoop(void* a_param);
84  #endif
85 
88 
89 };
90 #endif //__CA_CHAINTABLE__
91 #endif //ONLY_LOCAL_PROXY
#define THREAD_RETURN
Definition: StdAfx.h:540
unsigned short UINT16
Definition: basetypedefs.h:133
signed int SINT32
Definition: basetypedefs.h:132
unsigned char UINT8
Definition: basetypedefs.h:135
unsigned int UINT32
Definition: basetypedefs.h:131
CAChain * getNextEntry()
t_chaintableIterator * m_pChaintableIterator
CAMutex * m_pMutex
UINT32 m_chaintableSize
CAChain * getFirstEntry()
UINT32 getSize()
CAChainTable(void)
CAChain * createEntry()
~CAChainTable(void)
CAChain * getEntry(UINT8 *a_chainId)
void getNextEntryInternal(t_chaintableIterator *a_iterator)
t_chaintableEntry ** m_pChainTable
t_chaintableEntry * getEntryInternal(UINT8 *a_chainId)
void removeEntryInternal(t_chaintableEntry *a_entry)
void deleteEntry(UINT8 *a_chainId)
CAChain * chain
t_chaintableEntry * rightEntry
t_chaintableEntry ** rightEntryPointerOfLeftEntry
t_chaintableEntry * currentEntry