-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.proto
76 lines (64 loc) · 1.38 KB
/
config.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
syntax = "proto3";
package config;
option java_package = "com.timzaak.fornet.protobuf";
enum Protocol {
Protocol_TCP = 0;
Protocol_UDP = 1;
}
message Interface {
optional string name = 1;
repeated string address = 2;
int32 listen_port = 3;
// optional string private_key = 4; // this is no needed now, we may support it in future version
repeated string dns = 5;
optional uint32 mtu = 6;
optional string pre_up = 7;
optional string post_up = 8;
optional string pre_down = 9;
optional string post_down = 10;
Protocol protocol = 11;
}
message Peer {
optional string endpoint = 1;
repeated string allowed_ip = 2;
string public_key = 3;
uint32 persistence_keep_alive = 4;
// This is for tcp
repeated string address = 5;
}
message PeerChange {
optional Peer add_peer = 1;
optional string remove_public_key = 2;
optional Peer change_peer = 3;
}
message WRConfig {
Interface interface = 1;
repeated Peer peers = 2;
NodeType type = 3;
}
enum NodeStatus {
NODE_WAITING = 0;
NODE_NORMAL = 1;
NODE_FORBID = 2;
}
enum NetworkStatus {
NETWORK_DELETE = 0;
}
enum NodeType {
NODE_CLIENT = 0;
NODE_RELAY = 1;
}
message ClientMessage {
string network_id = 1;
oneof info {
WRConfig config = 2;
NodeStatus status = 3;
}
}
message NetworkMessage {
string network_id = 1;
oneof info {
PeerChange peer = 2;
NetworkStatus status = 3;
}
}