Mixe for Privacy and Anonymity in the Internet
TypeB
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
39
struct
t_chaintableEntry
{
40
t_chaintableEntry
*
rightEntry
;
41
t_chaintableEntry
**
rightEntryPointerOfLeftEntry
;
42
CAChain
*
chain
;
43
};
44
45
struct
t_chaintableIterator
{
46
t_chaintableEntry
*
currentEntry
;
47
bool
removeEntry
;
48
UINT16
nextHashkey
;
49
};
50
51
52
class
CAChainTable
{
53
public
:
54
CAChainTable
(
void
);
55
~CAChainTable
(
void
);
56
CAChain
*
getEntry
(
UINT8
* a_chainId);
57
CAChain
*
createEntry
();
58
void
deleteEntry
(
UINT8
* a_chainId);
59
UINT32
getSize
();
60
CAChain
*
getFirstEntry
();
61
CAChain
*
getNextEntry
();
62
#ifdef DELAY_CHANNELS
63
void
setDelayParameters(
UINT32
a_initialBucketSize,
UINT32
a_delayBucketGrow,
UINT32
a_delayBucketGrowInterval);
64
#endif
65
66
private
:
67
t_chaintableEntry
**
m_pChainTable
;
68
CAMutex
*
m_pMutex
;
69
UINT32
m_chaintableSize
;
70
t_chaintableIterator
*
m_pChaintableIterator
;
71
72
t_chaintableEntry
*
getEntryInternal
(
UINT8
* a_chainId);
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
86
void
removeEntryInternal
(
t_chaintableEntry
* a_entry);
87
void
getNextEntryInternal
(
t_chaintableIterator
* a_iterator);
88
89
};
90
#endif
//__CA_CHAINTABLE__
91
#endif
//ONLY_LOCAL_PROXY
CAChain.hpp
THREAD_RETURN
#define THREAD_RETURN
Definition:
StdAfx.h:540
UINT16
unsigned short UINT16
Definition:
basetypedefs.h:133
SINT32
signed int SINT32
Definition:
basetypedefs.h:132
UINT8
unsigned char UINT8
Definition:
basetypedefs.h:135
UINT32
unsigned int UINT32
Definition:
basetypedefs.h:131
CAChain
Definition:
CAChain.hpp:64
CAChainTable
Definition:
CAChainTable.hpp:52
CAChainTable::getNextEntry
CAChain * getNextEntry()
Definition:
CAChainTable.cpp:154
CAChainTable::m_pChaintableIterator
t_chaintableIterator * m_pChaintableIterator
Definition:
CAChainTable.hpp:70
CAChainTable::m_pMutex
CAMutex * m_pMutex
Definition:
CAChainTable.hpp:68
CAChainTable::m_chaintableSize
UINT32 m_chaintableSize
Definition:
CAChainTable.hpp:69
CAChainTable::getFirstEntry
CAChain * getFirstEntry()
Definition:
CAChainTable.cpp:126
CAChainTable::getSize
UINT32 getSize()
Definition:
CAChainTable.cpp:239
CAChainTable::CAChainTable
CAChainTable(void)
Definition:
CAChainTable.cpp:39
CAChainTable::createEntry
CAChain * createEntry()
Definition:
CAChainTable.cpp:172
CAChainTable::~CAChainTable
~CAChainTable(void)
Definition:
CAChainTable.cpp:64
CAChainTable::getEntry
CAChain * getEntry(UINT8 *a_chainId)
Definition:
CAChainTable.cpp:92
CAChainTable::getNextEntryInternal
void getNextEntryInternal(t_chaintableIterator *a_iterator)
Definition:
CAChainTable.cpp:297
CAChainTable::m_pChainTable
t_chaintableEntry ** m_pChainTable
Definition:
CAChainTable.hpp:67
CAChainTable::getEntryInternal
t_chaintableEntry * getEntryInternal(UINT8 *a_chainId)
Definition:
CAChainTable.cpp:248
CAChainTable::removeEntryInternal
void removeEntryInternal(t_chaintableEntry *a_entry)
Definition:
CAChainTable.cpp:282
CAChainTable::deleteEntry
void deleteEntry(UINT8 *a_chainId)
Definition:
CAChainTable.cpp:103
CAMutex
Definition:
CAMutex.hpp:36
CAThread
Definition:
CAThread.hpp:115
t_chaintableEntry
Definition:
CAChainTable.hpp:39
t_chaintableEntry::chain
CAChain * chain
Definition:
CAChainTable.hpp:42
t_chaintableEntry::rightEntry
t_chaintableEntry * rightEntry
Definition:
CAChainTable.hpp:40
t_chaintableEntry::rightEntryPointerOfLeftEntry
t_chaintableEntry ** rightEntryPointerOfLeftEntry
Definition:
CAChainTable.hpp:41
t_chaintableIterator
Definition:
CAChainTable.hpp:45
t_chaintableIterator::removeEntry
bool removeEntry
Definition:
CAChainTable.hpp:47
t_chaintableIterator::currentEntry
t_chaintableEntry * currentEntry
Definition:
CAChainTable.hpp:46
t_chaintableIterator::nextHashkey
UINT16 nextHashkey
Definition:
CAChainTable.hpp:48
Generated on Sat Jul 22 2023 00:20:07 for Mixe for Privacy and Anonymity in the Internet by
1.9.1