-
Notifications
You must be signed in to change notification settings - Fork 84
Expand file tree
/
Copy pathrouter_net_info.proto
More file actions
156 lines (136 loc) · 3.29 KB
/
router_net_info.proto
File metadata and controls
156 lines (136 loc) · 3.29 KB
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
syntax = "proto3";
package qaul.net.router_net_info;
// Router information Container
message RouterInfoContainer {
// signature
bytes signature = 1;
// message content
bytes message = 2;
}
// Router information content
message RouterInfoContent {
// node id
bytes id = 1;
// RouterInfo Module
RouterInfoModule routerInfoModule = 2;
// message content
bytes content = 3;
// timestamp in milli seconds
uint64 time = 4;
}
// RouterInfoModule
enum RouterInfoModule {
// Message is a common RouterInfoMessage
ROUTER_INFO = 0;
// Message is a FeedRequestMessage
FEED_REQUEST = 1;
// Message is a FeedResponseMessage
FEED_RESPONSE = 2;
// Message is a UserRequestMessage
USER_REQUEST = 3;
// Message is a UserResponseMessage
USER_RESPONSE = 4;
}
// Router information message
message RouterInfoMessage {
// node id
bytes node = 1;
// Routing information table
RoutingInfoTable routes = 2;
// Latest Feed ids table
FeedIdsTable feeds = 4;
// timestamp
uint64 timestamp = 5;
}
// Routing information to send to neighbours
message RoutingInfoTable {
repeated RoutingInfoEntry entry = 1;
}
// Routing structures to send over the network
message RoutingInfoEntry {
// user id
bytes user = 1;
// round trip time
uint32 rtt = 2;
// hop count
bytes hc = 3;
// propagation id
uint32 pgid = 5;
}
// User information table
message UserIdTable {
// user ids
repeated bytes ids = 1;
}
// User information table
message UserInfoTable {
// legacy user info (unsigned)
repeated UserInfo info = 1;
// signed user profiles (preferred when available)
repeated SignedUserProfile signed_profiles = 2;
}
// User info structure for sending to the neighbours
message UserInfo {
// user id
bytes id = 1;
// public key of the user
bytes key = 2;
// user name
string name = 3;
}
// Extended user profile, signed by the user's own key
message UserProfile {
// user id (38 byte PeerId)
bytes id = 1;
// protobuf-encoded Ed25519 public key
bytes key = 2;
// display name
string name = 3;
// small avatar image (max ~32KB)
bytes avatar = 4;
// bio / status text
string bio = 5;
// monotonically increasing version counter
uint64 version = 6;
// timestamp in milliseconds since epoch
uint64 updated_at = 7;
}
// Self-signed user profile wrapper
message SignedUserProfile {
// protobuf-encoded UserProfile bytes
bytes profile = 1;
// Ed25519 signature over profile bytes, signed by the user's own key
bytes signature = 2;
}
// List of feed ID's
message FeedIdsTable {
// feed id
repeated bytes ids = 1;
}
// Feed request message
message FeedRequestMessage {
// Feed ids table
FeedIdsTable feeds = 1;
}
// Feed response message
message FeedResponseMessage {
// Feed table
FeedResponseTable feeds = 1;
}
// Feed response table
// containing the feed messages for response
message FeedResponseTable {
// feed messages
repeated FeedMessage messages = 1;
}
// Feed Message
message FeedMessage {
// message id
bytes message_id = 1;
// sender id
bytes sender_id = 2;
// message content
string content = 3;
// timestamp in milli seconds
uint64 time = 4;
}