summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/leap/common/events/Makefile (renamed from src/leap/common/ipc/Makefile)2
-rw-r--r--src/leap/common/events/signal.proto57
-rw-r--r--src/leap/common/events/signal_pb2.py250
-rw-r--r--src/leap/common/ipc/notification.proto23
-rw-r--r--src/leap/common/ipc/notification_pb2.py135
5 files changed, 308 insertions, 159 deletions
diff --git a/src/leap/common/ipc/Makefile b/src/leap/common/events/Makefile
index 7c01fc6..4f99f35 100644
--- a/src/leap/common/ipc/Makefile
+++ b/src/leap/common/events/Makefile
@@ -21,7 +21,7 @@
PROTOC = protoc
-all: notification_pb2.py
+all: signal_pb2.py
%_pb2.py: %.proto
$(PROTOC) --python_out=./ $<
diff --git a/src/leap/common/events/signal.proto b/src/leap/common/events/signal.proto
new file mode 100644
index 0000000..336471c
--- /dev/null
+++ b/src/leap/common/events/signal.proto
@@ -0,0 +1,57 @@
+// signal.proto
+// Copyright (C) 2013 LEA
+//
+// This program 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 3 of the License, or
+// (at your option) any later version.
+//
+// This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+package leap.common.events;
+
+message SignalRequest {
+
+ enum Signal {
+ CLIENT_SESSION_ID = 1;
+ CLIENT_UID = 2;
+ SOLEDAD_CREATING_KEYS = 3;
+ SOLEDAD_DONE_CREATING_KEYS = 4;
+ SOLEDAD_UPLOADING_KEYS = 5;
+ SOLEDAD_DONE_UPLOADING_KEYS = 6;
+ SOLEDAD_DOWNLOADING_KEYS = 7;
+ SOLEDAD_DONE_DOWNLOADING_KEYS = 8;
+ SOLEDAD_NEW_DATA_TO_SYNC = 9;
+ SOLEDAD_DONE_DATA_SYNC = 10;
+ }
+
+ required int32 id = 1;
+ required Signal signal = 2;
+ required string content = 3;
+ required string mac_method = 4;
+ required bytes mac = 5;
+ optional string enc_method = 6;
+ optional bool error_occurred = 7;
+}
+
+message SignalResponse {
+
+ enum Status {
+ OK = 1;
+ UNAUTH = 2;
+ ERROR = 3;
+ }
+
+ required int32 id = 1;
+ required Status status = 2;
+}
+
+service SignalService {
+ rpc signal(SignalRequest) returns (SignalResponse);
+}
diff --git a/src/leap/common/events/signal_pb2.py b/src/leap/common/events/signal_pb2.py
new file mode 100644
index 0000000..b21676f
--- /dev/null
+++ b/src/leap/common/events/signal_pb2.py
@@ -0,0 +1,250 @@
+# Generated by the protocol buffer compiler. DO NOT EDIT!
+
+from google.protobuf import descriptor
+from google.protobuf import message
+from google.protobuf import reflection
+from google.protobuf import service
+from google.protobuf import service_reflection
+from google.protobuf import descriptor_pb2
+# @@protoc_insertion_point(imports)
+
+
+DESCRIPTOR = descriptor.FileDescriptor(
+ name='signal.proto',
+ package='leap.common.events',
+ serialized_pb='\n\x0csignal.proto\x12\x12leap.common.events\"\xd8\x03\n\rSignalRequest\x12\n\n\x02id\x18\x01 \x02(\x05\x12\x38\n\x06signal\x18\x02 \x02(\x0e\x32(.leap.common.events.SignalRequest.Signal\x12\x0f\n\x07\x63ontent\x18\x03 \x02(\t\x12\x12\n\nmac_method\x18\x04 \x02(\t\x12\x0b\n\x03mac\x18\x05 \x02(\x0c\x12\x12\n\nenc_method\x18\x06 \x01(\t\x12\x16\n\x0e\x65rror_occurred\x18\x07 \x01(\x08\"\xa2\x02\n\x06Signal\x12\x15\n\x11\x43LIENT_SESSION_ID\x10\x01\x12\x0e\n\nCLIENT_UID\x10\x02\x12\x19\n\x15SOLEDAD_CREATING_KEYS\x10\x03\x12\x1e\n\x1aSOLEDAD_DONE_CREATING_KEYS\x10\x04\x12\x1a\n\x16SOLEDAD_UPLOADING_KEYS\x10\x05\x12\x1f\n\x1bSOLEDAD_DONE_UPLOADING_KEYS\x10\x06\x12\x1c\n\x18SOLEDAD_DOWNLOADING_KEYS\x10\x07\x12!\n\x1dSOLEDAD_DONE_DOWNLOADING_KEYS\x10\x08\x12\x1c\n\x18SOLEDAD_NEW_DATA_TO_SYNC\x10\t\x12\x1a\n\x16SOLEDAD_DONE_DATA_SYNC\x10\n\"\x80\x01\n\x0eSignalResponse\x12\n\n\x02id\x18\x01 \x02(\x05\x12\x39\n\x06status\x18\x02 \x02(\x0e\x32).leap.common.events.SignalResponse.Status\"\'\n\x06Status\x12\x06\n\x02OK\x10\x01\x12\n\n\x06UNAUTH\x10\x02\x12\t\n\x05\x45RROR\x10\x03\x32`\n\rSignalService\x12O\n\x06signal\x12!.leap.common.events.SignalRequest\x1a\".leap.common.events.SignalResponse')
+
+
+
+_SIGNALREQUEST_SIGNAL = descriptor.EnumDescriptor(
+ name='Signal',
+ full_name='leap.common.events.SignalRequest.Signal',
+ filename=None,
+ file=DESCRIPTOR,
+ values=[
+ descriptor.EnumValueDescriptor(
+ name='CLIENT_SESSION_ID', index=0, number=1,
+ options=None,
+ type=None),
+ descriptor.EnumValueDescriptor(
+ name='CLIENT_UID', index=1, number=2,
+ options=None,
+ type=None),
+ descriptor.EnumValueDescriptor(
+ name='SOLEDAD_CREATING_KEYS', index=2, number=3,
+ options=None,
+ type=None),
+ descriptor.EnumValueDescriptor(
+ name='SOLEDAD_DONE_CREATING_KEYS', index=3, number=4,
+ options=None,
+ type=None),
+ descriptor.EnumValueDescriptor(
+ name='SOLEDAD_UPLOADING_KEYS', index=4, number=5,
+ options=None,
+ type=None),
+ descriptor.EnumValueDescriptor(
+ name='SOLEDAD_DONE_UPLOADING_KEYS', index=5, number=6,
+ options=None,
+ type=None),
+ descriptor.EnumValueDescriptor(
+ name='SOLEDAD_DOWNLOADING_KEYS', index=6, number=7,
+ options=None,
+ type=None),
+ descriptor.EnumValueDescriptor(
+ name='SOLEDAD_DONE_DOWNLOADING_KEYS', index=7, number=8,
+ options=None,
+ type=None),
+ descriptor.EnumValueDescriptor(
+ name='SOLEDAD_NEW_DATA_TO_SYNC', index=8, number=9,
+ options=None,
+ type=None),
+ descriptor.EnumValueDescriptor(
+ name='SOLEDAD_DONE_DATA_SYNC', index=9, number=10,
+ options=None,
+ type=None),
+ ],
+ containing_type=None,
+ options=None,
+ serialized_start=219,
+ serialized_end=509,
+)
+
+_SIGNALRESPONSE_STATUS = descriptor.EnumDescriptor(
+ name='Status',
+ full_name='leap.common.events.SignalResponse.Status',
+ filename=None,
+ file=DESCRIPTOR,
+ values=[
+ descriptor.EnumValueDescriptor(
+ name='OK', index=0, number=1,
+ options=None,
+ type=None),
+ descriptor.EnumValueDescriptor(
+ name='UNAUTH', index=1, number=2,
+ options=None,
+ type=None),
+ descriptor.EnumValueDescriptor(
+ name='ERROR', index=2, number=3,
+ options=None,
+ type=None),
+ ],
+ containing_type=None,
+ options=None,
+ serialized_start=601,
+ serialized_end=640,
+)
+
+
+_SIGNALREQUEST = descriptor.Descriptor(
+ name='SignalRequest',
+ full_name='leap.common.events.SignalRequest',
+ filename=None,
+ file=DESCRIPTOR,
+ containing_type=None,
+ fields=[
+ descriptor.FieldDescriptor(
+ name='id', full_name='leap.common.events.SignalRequest.id', index=0,
+ number=1, type=5, cpp_type=1, label=2,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ descriptor.FieldDescriptor(
+ name='signal', full_name='leap.common.events.SignalRequest.signal', index=1,
+ number=2, type=14, cpp_type=8, label=2,
+ has_default_value=False, default_value=1,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ descriptor.FieldDescriptor(
+ name='content', full_name='leap.common.events.SignalRequest.content', index=2,
+ number=3, type=9, cpp_type=9, label=2,
+ has_default_value=False, default_value=unicode("", "utf-8"),
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ descriptor.FieldDescriptor(
+ name='mac_method', full_name='leap.common.events.SignalRequest.mac_method', index=3,
+ number=4, type=9, cpp_type=9, label=2,
+ has_default_value=False, default_value=unicode("", "utf-8"),
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ descriptor.FieldDescriptor(
+ name='mac', full_name='leap.common.events.SignalRequest.mac', index=4,
+ number=5, type=12, cpp_type=9, label=2,
+ has_default_value=False, default_value="",
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ descriptor.FieldDescriptor(
+ name='enc_method', full_name='leap.common.events.SignalRequest.enc_method', index=5,
+ number=6, type=9, cpp_type=9, label=1,
+ has_default_value=False, default_value=unicode("", "utf-8"),
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ descriptor.FieldDescriptor(
+ name='error_occurred', full_name='leap.common.events.SignalRequest.error_occurred', index=6,
+ number=7, type=8, cpp_type=7, label=1,
+ has_default_value=False, default_value=False,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ ],
+ extensions=[
+ ],
+ nested_types=[],
+ enum_types=[
+ _SIGNALREQUEST_SIGNAL,
+ ],
+ options=None,
+ is_extendable=False,
+ extension_ranges=[],
+ serialized_start=37,
+ serialized_end=509,
+)
+
+
+_SIGNALRESPONSE = descriptor.Descriptor(
+ name='SignalResponse',
+ full_name='leap.common.events.SignalResponse',
+ filename=None,
+ file=DESCRIPTOR,
+ containing_type=None,
+ fields=[
+ descriptor.FieldDescriptor(
+ name='id', full_name='leap.common.events.SignalResponse.id', index=0,
+ number=1, type=5, cpp_type=1, label=2,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ descriptor.FieldDescriptor(
+ name='status', full_name='leap.common.events.SignalResponse.status', index=1,
+ number=2, type=14, cpp_type=8, label=2,
+ has_default_value=False, default_value=1,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ ],
+ extensions=[
+ ],
+ nested_types=[],
+ enum_types=[
+ _SIGNALRESPONSE_STATUS,
+ ],
+ options=None,
+ is_extendable=False,
+ extension_ranges=[],
+ serialized_start=512,
+ serialized_end=640,
+)
+
+
+_SIGNALREQUEST.fields_by_name['signal'].enum_type = _SIGNALREQUEST_SIGNAL
+_SIGNALREQUEST_SIGNAL.containing_type = _SIGNALREQUEST;
+_SIGNALRESPONSE.fields_by_name['status'].enum_type = _SIGNALRESPONSE_STATUS
+_SIGNALRESPONSE_STATUS.containing_type = _SIGNALRESPONSE;
+
+class SignalRequest(message.Message):
+ __metaclass__ = reflection.GeneratedProtocolMessageType
+ DESCRIPTOR = _SIGNALREQUEST
+
+ # @@protoc_insertion_point(class_scope:leap.common.events.SignalRequest)
+
+class SignalResponse(message.Message):
+ __metaclass__ = reflection.GeneratedProtocolMessageType
+ DESCRIPTOR = _SIGNALRESPONSE
+
+ # @@protoc_insertion_point(class_scope:leap.common.events.SignalResponse)
+
+
+_SIGNALSERVICE = descriptor.ServiceDescriptor(
+ name='SignalService',
+ full_name='leap.common.events.SignalService',
+ file=DESCRIPTOR,
+ index=0,
+ options=None,
+ serialized_start=642,
+ serialized_end=738,
+ methods=[
+ descriptor.MethodDescriptor(
+ name='signal',
+ full_name='leap.common.events.SignalService.signal',
+ index=0,
+ containing_service=None,
+ input_type=_SIGNALREQUEST,
+ output_type=_SIGNALRESPONSE,
+ options=None,
+ ),
+])
+
+class SignalService(service.Service):
+ __metaclass__ = service_reflection.GeneratedServiceType
+ DESCRIPTOR = _SIGNALSERVICE
+class SignalService_Stub(SignalService):
+ __metaclass__ = service_reflection.GeneratedServiceStubType
+ DESCRIPTOR = _SIGNALSERVICE
+
+# @@protoc_insertion_point(module_scope)
diff --git a/src/leap/common/ipc/notification.proto b/src/leap/common/ipc/notification.proto
deleted file mode 100644
index 4ae0406..0000000
--- a/src/leap/common/ipc/notification.proto
+++ /dev/null
@@ -1,23 +0,0 @@
-// https://developers.google.com/protocol-buffers/docs/pythontutorial
-// https://developers.google.com/protocol-buffers/docs/reference/python-generated
-
-package leap.common;
-
-message Notification {
-
- enum Component {
- client = 0;
- soledad = 1;
- eip = 2;
- smtp_relay = 3;
- mx = 4;
- }
-
- required int32 id = 1;
- required Component component = 2;
- required string content = 3;
- required string mac_method = 4;
- required bytes mac = 5;
- optional string enc_method = 6;
- optional bool error_occurred = 7;
-}
diff --git a/src/leap/common/ipc/notification_pb2.py b/src/leap/common/ipc/notification_pb2.py
deleted file mode 100644
index a1c285f..0000000
--- a/src/leap/common/ipc/notification_pb2.py
+++ /dev/null
@@ -1,135 +0,0 @@
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: notification.proto
-
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import descriptor_pb2
-# @@protoc_insertion_point(imports)
-
-
-
-
-DESCRIPTOR = _descriptor.FileDescriptor(
- name='notification.proto',
- package='leap.common',
- serialized_pb='\n\x12notification.proto\x12\x0bleap.common\"\xf7\x01\n\x0cNotification\x12\n\n\x02id\x18\x01 \x02(\x05\x12\x36\n\tcomponent\x18\x02 \x02(\x0e\x32#.leap.common.Notification.Component\x12\x0f\n\x07\x63ontent\x18\x03 \x02(\t\x12\x12\n\nmac_method\x18\x04 \x02(\t\x12\x0b\n\x03mac\x18\x05 \x02(\x0c\x12\x12\n\nenc_method\x18\x06 \x01(\t\x12\x16\n\x0e\x65rror_occurred\x18\x07 \x01(\x08\"E\n\tComponent\x12\n\n\x06\x63lient\x10\x00\x12\x0b\n\x07soledad\x10\x01\x12\x07\n\x03\x65ip\x10\x02\x12\x0e\n\nsmtp_relay\x10\x03\x12\x06\n\x02mx\x10\x04')
-
-
-
-_NOTIFICATION_COMPONENT = _descriptor.EnumDescriptor(
- name='Component',
- full_name='leap.common.Notification.Component',
- filename=None,
- file=DESCRIPTOR,
- values=[
- _descriptor.EnumValueDescriptor(
- name='client', index=0, number=0,
- options=None,
- type=None),
- _descriptor.EnumValueDescriptor(
- name='soledad', index=1, number=1,
- options=None,
- type=None),
- _descriptor.EnumValueDescriptor(
- name='eip', index=2, number=2,
- options=None,
- type=None),
- _descriptor.EnumValueDescriptor(
- name='smtp_relay', index=3, number=3,
- options=None,
- type=None),
- _descriptor.EnumValueDescriptor(
- name='mx', index=4, number=4,
- options=None,
- type=None),
- ],
- containing_type=None,
- options=None,
- serialized_start=214,
- serialized_end=283,
-)
-
-
-_NOTIFICATION = _descriptor.Descriptor(
- name='Notification',
- full_name='leap.common.Notification',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- fields=[
- _descriptor.FieldDescriptor(
- name='id', full_name='leap.common.Notification.id', index=0,
- number=1, type=5, cpp_type=1, label=2,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='component', full_name='leap.common.Notification.component', index=1,
- number=2, type=14, cpp_type=8, label=2,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='content', full_name='leap.common.Notification.content', index=2,
- number=3, type=9, cpp_type=9, label=2,
- has_default_value=False, default_value=unicode("", "utf-8"),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='mac_method', full_name='leap.common.Notification.mac_method', index=3,
- number=4, type=9, cpp_type=9, label=2,
- has_default_value=False, default_value=unicode("", "utf-8"),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='mac', full_name='leap.common.Notification.mac', index=4,
- number=5, type=12, cpp_type=9, label=2,
- has_default_value=False, default_value="",
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='enc_method', full_name='leap.common.Notification.enc_method', index=5,
- number=6, type=9, cpp_type=9, label=1,
- has_default_value=False, default_value=unicode("", "utf-8"),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='error_occurred', full_name='leap.common.Notification.error_occurred', index=6,
- number=7, type=8, cpp_type=7, label=1,
- has_default_value=False, default_value=False,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- _NOTIFICATION_COMPONENT,
- ],
- options=None,
- is_extendable=False,
- extension_ranges=[],
- serialized_start=36,
- serialized_end=283,
-)
-
-_NOTIFICATION.fields_by_name['component'].enum_type = _NOTIFICATION_COMPONENT
-_NOTIFICATION_COMPONENT.containing_type = _NOTIFICATION;
-DESCRIPTOR.message_types_by_name['Notification'] = _NOTIFICATION
-
-class Notification(_message.Message):
- __metaclass__ = _reflection.GeneratedProtocolMessageType
- DESCRIPTOR = _NOTIFICATION
-
- # @@protoc_insertion_point(class_scope:leap.common.Notification)
-
-
-# @@protoc_insertion_point(module_scope)