OverSim
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
Koorde.h
Go to the documentation of this file.
1
//
2
// Copyright (C) 2007 Institut fuer Telematik, Universitaet Karlsruhe (TH)
3
//
4
// This program is free software; you can redistribute it and/or
5
// modify it under the terms of the GNU General Public License
6
// as published by the Free Software Foundation; either version 2
7
// of the License, or (at your option) any later version.
8
//
9
// This program is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
// GNU General Public License for more details.
13
//
14
// You should have received a copy of the GNU General Public License
15
// along with this program; if not, write to the Free Software
16
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17
//
18
24
#ifndef __KOORDE_H_
25
#define __KOORDE_H_
26
27
#include <omnetpp.h>
28
29
#include <IPvXAddress.h>
30
31
#include <
OverlayKey.h
>
32
#include <
NodeHandle.h
>
33
#include <
BaseOverlay.h
>
34
35
#include "../chord/ChordSuccessorList.h"
36
#include "../chord/Chord.h"
37
38
namespace
oversim {
39
50
class
Koorde
:
public
Chord
51
{
52
public
:
53
virtual
~Koorde
();
54
55
// see BaseOverlay.h
56
virtual
void
initializeOverlay
(
int
stage);
57
58
// see BaseOverlay.h
59
virtual
void
handleTimerEvent
(cMessage* msg);
60
61
// see BaseOverlay.h
62
virtual
void
handleUDPMessage
(
BaseOverlayMessage
* msg);
63
64
// see BaseOverlay.h
65
virtual
void
recordOverlaySentStats
(
BaseOverlayMessage
* msg);
66
67
// see BaseOverlay.h
68
virtual
void
finishOverlay
();
69
73
virtual
void
updateTooltip
();
74
75
protected
:
76
//parameters
77
int
deBruijnDelay
;
78
int
deBruijnNumber
;
79
int
deBruijnListSize
;
80
int
shiftingBits
;
81
bool
useOtherLookup
;
82
bool
useSucList
;
83
bool
breakLookup
;
84
bool
setupDeBruijnBeforeJoin
;
85
bool
setupDeBruijnAtJoin
;
87
//statistics
88
int
deBruijnCount
;
89
int
deBruijnBytesSent
;
91
//Node handles
92
NodeHandle
*
deBruijnNodes
;
93
NodeHandle
deBruijnNode
;
95
//Timer Messages
96
cMessage*
deBruijn_timer
;
103
virtual
void
changeState
(
int
state
);
104
109
virtual
void
handleDeBruijnTimerExpired
();
110
116
//virtual void handleFixFingersTimerExpired(cMessage* msg);
117
118
// see BaseOverlay.h
119
virtual
bool
handleRpcCall
(
BaseCallMessage
* msg);
120
121
// see BaseOverlay.h
122
virtual
void
handleRpcResponse
(
BaseResponseMessage
* msg,
123
cPolymorphic* context,
int
rpcId,
124
simtime_t rtt );
125
126
// see BaseOverlay.h
127
virtual
void
handleRpcTimeout
(
BaseCallMessage
* msg,
128
const
TransportAddress
& dest,
129
cPolymorphic* context,
130
int
rpcId,
const
OverlayKey
& destKey);
131
137
virtual
void
handleRpcJoinResponse
(
JoinResponse
* joinResponse);
138
144
virtual
void
handleRpcDeBruijnRequest
(
DeBruijnCall
* deBruinCall);
145
151
virtual
void
handleRpcDeBruijnResponse
(
DeBruijnResponse
* deBruijnResponse);
152
158
virtual
void
handleDeBruijnTimeout
(
DeBruijnCall
* deBruijnCall);
159
168
virtual
NodeHandle
findDeBruijnHop
(
const
OverlayKey
& destKey,
169
KoordeFindNodeExtMessage
* findNodeExt);
170
171
// see BaseOverlay.h
172
NodeVector
*
findNode
(
const
OverlayKey
& key,
173
int
numRedundantNodes,
174
int
numSiblings,
175
BaseOverlayMessage
* msg);
186
virtual
OverlayKey
findStartKey
(
const
OverlayKey
& startKey,
187
const
OverlayKey
& endKey,
188
const
OverlayKey
& destKey,
189
int
& step);
190
200
virtual
const
NodeHandle
&
walkDeBruijnList
(
const
OverlayKey
& key);
201
211
virtual
const
NodeHandle
&
walkSuccessorList
(
const
OverlayKey
& key);
212
213
// see BaseOverlay.h
214
virtual
bool
handleFailedNode
(
const
TransportAddress
& failed);
215
216
// see Chord.h
217
virtual
void
rpcJoin
(
JoinCall
* call);
218
219
// see Chord.h
220
virtual
void
findFriendModules
();
221
222
// see Chord.h
223
virtual
void
initializeFriendModules
();
224
225
};
226
227
};
//namespace
228
229
#endif
230
src
overlay
koorde
Koorde.h
Generated on Fri Dec 7 2012 13:37:52 for OverSim by
1.8.1.2