OverSim
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
PastryTypes.h
Go to the documentation of this file.
1
//
2
// Copyright (C) 2006 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
26
#ifndef __PASTRY_TYPES_H_
27
#define __PASTRY_TYPES_H_
28
29
#include <map>
30
#include <limits>
31
32
#include <
OverlayKey.h
>
33
#include <
NodeHandle.h
>
34
35
#include "
PastryMessage_m.h
"
36
40
#define PASTRY_PROX_INFINITE -1
41
45
#define PASTRY_PROX_UNDEF -2
46
50
#define PASTRY_PROX_PENDING -3
51
55
struct
PastryStateMsgProximity
56
{
57
std::vector<simtime_t>
pr_rt
;
58
std::vector<simtime_t>
pr_ls
;
59
std::vector<simtime_t>
pr_ns
;
60
};
61
65
struct
PastryStateMsgHandle
66
{
67
PastryStateMessage
*
msg
;
68
PastryStateMsgProximity
*
prox
;
69
bool
outdatedUpdate
;
70
uint32_t
nonce
;
71
72
PastryStateMsgHandle
() :
msg
(NULL),
prox
(NULL),
outdatedUpdate
(false) {};
73
PastryStateMsgHandle
(
PastryStateMessage
*
msg
)
74
: msg(msg),
prox
(NULL),
outdatedUpdate
(false)
75
{
76
nonce
= intuniform(0, std::numeric_limits<uint32_t>::max());
//0x7FFFFF ???
77
};
78
};
79
84
struct
PastryExtendedNode
85
{
86
NodeHandle
node
;
87
simtime_t
rtt
;
88
simtime_t
timestamp
;
89
90
PastryExtendedNode
() :
node
(),
rtt
(-2),
timestamp
(0) {};
91
PastryExtendedNode
(
const
NodeHandle
&
node
, simtime_t
rtt
,
92
simtime_t
timestamp
= 0)
93
: node(node), rtt(rtt),
timestamp
(
timestamp
) {};
94
};
95
96
97
#endif
src
overlay
pastry
PastryTypes.h
Generated on Fri Dec 7 2012 13:37:53 for OverSim by
1.8.1.2