blob: 1a335a89cac8686b6f6fc8d8c944fcdba4cc44b1 (
plain)
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
|
/*
Copyright © 2015-2016 Gluzskiy Alexandr (sss)
This file is part of Unknown Download Manager (UDM).
UDM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
UDM 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with UDM. If not, see <http://www.gnu.org/licenses/>.
*/
//TODO: write readable proto description
syntax = "proto2";
import "ui.proto";
import "events.proto";
import "download.proto";
import "module.proto";
import "auth.proto";
import "core.proto";
//TODO: large datatransfer proto part
// it should be in separate connection
// it should be very simple
// it should have as small overhead as possible, better none at all
//vaviant 1: client: > request peace of data
// server: < reply "peace of data" size or error
// client: if no error and data size is sane start reading "data size"
// done, server can handle more commands now
//message client_data_transfer_request {
//}
//message server_data_transfer_reply {
//}
//top level messages begin
enum CLIENT_MSG_TYPE {
CLIENT_AUTH_REQUEST = 0;
CLIENT_DATA_TRANSFER_REQUEST = 1;
CLIENT_UI_DATA_REQUEST = 2;
CLIENT_MODULES_REQUEST = 3;
CLIENT_CORE_INFO_REQUEST = 4;
CLIENT_SUBSCRIPTION_REQUEST = 5;
CLIENT_UNSUBSCRIPTION_REQUEST = 6;
CLIENT_DOWNLOADS_LIST_REQUEST = 7;
CLIENT_DOWNLOAD_ADD = 8;
CLIENT_DOWNLOAD_START = 9;
CLIENT_DOWNLOAD_STOP = 10;
CLIENT_DOWNLOAD_DELETE = 11;
CLIENT_DOWNLOAD_EXECUTE_ACTION = 12;
CLIENT_DOWNLOAD_INFO_REQUEST = 13;
}
message client_msg {
required CLIENT_MSG_TYPE type = 1;
optional string auth_token = 2; //this must be set in all message type's except CLIENT_AUTH_REQUEST
optional client_auth_request auth_request = 3;
repeated client_download_ui_data_request download_ui_data_request = 4;
repeated client_event_subscription_request subscription_request = 5;
repeated client_event_unsubscription_request unsubscription_request = 6;
optional client_download_request download_info_request = 7;
optional client_download_add_request download_add_request = 8;
//TODO: use new download_state_change_request instaed of all download_*_request structures (simplification)
repeated client_download_start_request download_start_request = 9;
repeated client_download_stop_request download_stop_request = 10;
repeated client_download_delete_request download_delete_request = 11;
repeated client_download_action_request download_action_request = 12;
optional client_downloads_request download_list_request = 13;
}
enum SERVER_MSG_TYPE {
SERVER_AUTH_REPLY = 0;
SERVER_UI_DATA_REPLY = 1;
SERVER_MODULES_REPLY = 2;
SERVER_CORE_INFO_REPLY = 3;
SERVER_SUBSCRIPTIONS_REPLY = 4;
SERVER_UNSUBSCRIPTIONS_REPLY = 5;
SERVER_DOWNLOADS_LIST_REPLY = 6;
SERVER_DOWNLOAD_INFO_REPLY = 7;
SERVER_DOWNLOAD_STATE_CHANGE = 8;
}
message server_msg {
required SERVER_MSG_TYPE type = 1;
optional server_download_ui_data_reply download_ui_data_reply = 2;
optional server_auth_reply auth_reply = 3;
repeated module_info server_modules_reply = 4;
optional core_info server_core_info_reply = 5;
repeated server_event_subscription_reply subscription_reply = 6;
repeated server_event_unsubscription_reply unsubscription_reply = 7;
optional server_download_reply download = 8;
repeated server_download_reply downloads = 9;
repeated download_state_change download_state_changes = 10;
}
//top level messages end
|