2 // Copyright (C) 2013 LEAP
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 package leap.common.events;
18 option py_generic_services = true;
21 // These are the events that can be signaled using the events mechanism.
24 CLIENT_SESSION_ID = 1;
26 SOLEDAD_CREATING_KEYS = 3;
27 SOLEDAD_DONE_CREATING_KEYS = 4;
28 SOLEDAD_UPLOADING_KEYS = 5;
29 SOLEDAD_DONE_UPLOADING_KEYS = 6;
30 SOLEDAD_DOWNLOADING_KEYS = 7;
31 SOLEDAD_DONE_DOWNLOADING_KEYS = 8;
32 SOLEDAD_NEW_DATA_TO_SYNC = 9;
33 SOLEDAD_DONE_DATA_SYNC = 10;
34 UPDATER_NEW_UPDATES = 11;
35 UPDATER_DONE_UPDATING = 12;
40 // A SignalRequest is the type of the message sent from one component to request
41 // that a signal be sent to every registered component.
43 message SignalRequest {
44 required Event event = 1;
45 required string content = 2;
46 required string mac_method = 3;
47 required bytes mac = 4;
48 optional string enc_method = 5;
49 optional bool error_occurred = 6;
53 // A RegisterRequest message tells the server that a component wants to
54 // be signaled whenever a specific event occurs.
56 message RegisterRequest {
57 required Event event = 1;
58 required int32 port = 2;
59 required string mac_method = 3;
60 required bytes mac = 4;
64 // An UnregisterRequest message tells the server that a component does not
65 // want to be signaled when a specific event occurs.
67 message UnregisterRequest {
68 required Event event = 1;
69 required int32 port = 2;
70 required string mac_method = 3;
71 required bytes mac = 4;
75 // A PingRequest message is used to find out if a server or component is
82 // The EventResponse is the message sent back by server and components after
83 // they receive other kinds of requests.
85 message EventResponse {
93 required Status status = 1;
94 optional string result = 2;
98 // The EventsServerService is the service provided by the server.
100 service EventsServerService {
101 rpc ping(PingRequest) returns (EventResponse);
102 rpc register(RegisterRequest) returns (EventResponse);
103 rpc unregister(UnregisterRequest) returns (EventResponse);
104 rpc signal(SignalRequest) returns (EventResponse);
108 // EventsComponentService is the service provided by components (clients).
110 service EventsClientService {
111 rpc ping(PingRequest) returns (EventResponse);
112 rpc signal(SignalRequest) returns (EventResponse);