-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathChordMessages.msg
139 lines (108 loc) · 3.66 KB
/
ChordMessages.msg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see http://www.gnu.org/licenses/.
//
//
// TODO generated message class
//
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see http://www.gnu.org/licenses/.
//
cplusplus {{
#include <NodeHandle.h>
#include <SuccessorList.h>
#include <FingerTable.h>
}}
enum STATE {
PING = 0;
JOIN = 1;
FIND_SUCCESSOR = 2;
FIND_PREDECESSOR = 3;
NEWSUCCESSORHINT = 4;
}
packet BaseChordMessage {
}
packet BaseCallMessage extends BaseChordMessage{
}
packet BaseResponseMessage extends BaseChordMessage{
}
packet BaseNetworkPacket{
}
packet Stabilization extends BaseNetworkPacket{
string ring[];
string src;
int hops;
simtime_t start;
}
// call/response for PING
// TODO: ci va messo qualcosa qua dentro?
packet PingTimeout extends BaseChordMessage{
string failed;
}
packet PingCall extends BaseCallMessage {
//string dst;
}
packet PingResponse extends BaseResponseMessage {
}
// call/response for JOIN
packet JoinCall extends BaseCallMessage {
string requester;
string key;
}
packet JoinResponse extends BaseResponseMessage {
int successorNum;// number of entries in the successor list
string src;
string successorNode[]; // successor list of the message originator
string predecessorNode; // in aggressiveJoinMode: predecessor hint
}
// call/response for STABILIZE
packet StabilizeCall extends BaseCallMessage {
}
packet StabilizeResponse extends BaseResponseMessage {
string predecessorNode;
string predecessorNodeIP; // the predecessor of the message originator
}
// call/response for NOTIFY
packet NotifyCall extends BaseCallMessage {
string failed;// TODO: qui non so cosa metterci, su oversim mette TransportAddress failed = TransportAddress::UNSPECIFIED_NODE;
}
packet NotifyResponse extends BaseResponseMessage {
int successorNum; // number of entries in successor list
string successorNode[]; // successor list of the node that sent the msg
//string predecessorNode;
//bool predecessorNodeSet; // this tells if the dest node has been set as new predecessor (for merging)
}
// call/response for FIXING the finger table
packet FixFingerCall extends BaseCallMessage {
int finger;
string fingerKey;
string requester; // the finger number that has to be fixed
}
packet FixFingerResponse extends BaseResponseMessage {
int finger; // the finger number that has to be fixed
string successorNode; // the successor of the node that sent the msg
}
packet NotifyBoostrapList extends BaseNetworkPacket {
string Overlaykey;
}