VOL-1460 Updates to protos to match core and updates to go stubs.
Also added support to build with godeps.
Change-Id: I4b312a6dcf67e3a3f93f675da38da2ed5164e077
diff --git a/protos/voltha_protos/adapter.proto b/protos/voltha_protos/adapter.proto
index 9447510..e8889c5 100644
--- a/protos/voltha_protos/adapter.proto
+++ b/protos/voltha_protos/adapter.proto
@@ -1,6 +1,6 @@
syntax = "proto3";
-option go_package = "github.com/opencord/voltha-go/protos/voltha";
+option go_package = "github.com/opencord/voltha-protos/go/voltha";
package voltha;
@@ -22,7 +22,7 @@
// Adapter (software plugin)
message Adapter {
- // Unique name of adapter, matching the python packate name under
+ // Unique name of adapter, matching the python package name under
// voltha/adapters.
string id = 1 [(access) = READ_ONLY];
string vendor = 2 [(access) = READ_ONLY];
diff --git a/protos/voltha_protos/afrouter.proto b/protos/voltha_protos/afrouter.proto
new file mode 100644
index 0000000..34d7da3
--- /dev/null
+++ b/protos/voltha_protos/afrouter.proto
@@ -0,0 +1,43 @@
+// protoc -I echo/ echo/*.proto --go_out=plugins=grpc:echo
+
+syntax = "proto3";
+
+option go_package = "github.com/opencord/voltha-protos/go/afrouter";
+
+package afrouter;
+
+service Configuration {
+ rpc SetConnection (Conn) returns (Result) {}
+ rpc SetAffinity(Affinity) returns (Result) {}
+}
+
+message Result {
+ bool success = 1;
+ string error = 2;
+}
+
+message Empty {
+}
+
+message Count {
+ uint32 count = 1;
+}
+
+message Conn {
+ string server = 1;
+ string pkg = 2;
+ string svc = 3;
+ string cluster = 4;
+ string backend = 5;
+ string connection = 6;
+ string addr = 7;
+ uint64 port = 8;
+}
+
+message Affinity {
+ string router = 1;
+ string route = 2;
+ string cluster = 3;
+ string backend = 4;
+ string id = 5;
+}
diff --git a/protos/voltha_protos/common.proto b/protos/voltha_protos/common.proto
index e3b6211..24c3c46 100644
--- a/protos/voltha_protos/common.proto
+++ b/protos/voltha_protos/common.proto
@@ -1,6 +1,6 @@
syntax = "proto3";
-option go_package = "github.com/opencord/voltha-go/protos/common";
+option go_package = "github.com/opencord/voltha-protos/go/common";
package voltha;
diff --git a/protos/voltha_protos/device.proto b/protos/voltha_protos/device.proto
index 0dc19cf..bbe8894 100644
--- a/protos/voltha_protos/device.proto
+++ b/protos/voltha_protos/device.proto
@@ -1,6 +1,6 @@
syntax = "proto3";
-option go_package = "github.com/opencord/voltha-go/protos/voltha";
+option go_package = "github.com/opencord/voltha-protos/go/voltha";
package voltha;
@@ -16,7 +16,7 @@
// Unique name for the device type
string id = 1;
- // Unique venor id for the device type applicable to ONU
+ // Unique vendor id for the device type applicable to ONU
// 4 bytes of vendor id from ONU serial number
string vendor_id = 5;
@@ -25,8 +25,7 @@
// Name of the adapter that handles device type
string adapter = 2;
- // Capabilitities
-
+ // Capabilities
bool accepts_bulk_flow_update = 3;
bool accepts_add_remove_flow_updates = 4;
bool accepts_direct_logical_flows_update = 7;
@@ -125,9 +124,10 @@
enum ImageActivateState {
IMAGE_UNKNOWN = 0;
IMAGE_INACTIVE = 1;
- IMAGE_ACTIVATE = 2;
+ IMAGE_ACTIVATING = 2;
IMAGE_ACTIVE = 3;
- IMAGE_REVERT = 4;
+ IMAGE_REVERTING = 4;
+ IMAGE_REVERTED = 5;
}
// Device Identifier
@@ -264,9 +264,10 @@
uint32 onu_session_id = 7; // session identifier for the ONU; optional
};
+ // Device contact MAC address (format: "xx:xx:xx:xx:xx:xx")
+ string mac_address = 13;
+
oneof address {
- // Device contact MAC address (format: "xx:xx:xx:xx:xx:xx")
- string mac_address = 13;
// Device contact IPv4 address (format: "a.b.c.d" or can use hostname too)
string ipv4_address = 14;
diff --git a/protos/voltha_protos/events.proto b/protos/voltha_protos/events.proto
index bd8c045..0a2c0e4 100644
--- a/protos/voltha_protos/events.proto
+++ b/protos/voltha_protos/events.proto
@@ -1,6 +1,6 @@
syntax = "proto3";
-option go_package = "github.com/opencord/voltha-go/protos/voltha";
+option go_package = "github.com/opencord/voltha-protos/go/voltha";
package voltha;
diff --git a/protos/voltha_protos/health.proto b/protos/voltha_protos/health.proto
index a6337cf..7721825 100644
--- a/protos/voltha_protos/health.proto
+++ b/protos/voltha_protos/health.proto
@@ -1,6 +1,6 @@
syntax = "proto3";
-option go_package = "github.com/opencord/voltha-go/protos/voltha";
+option go_package = "github.com/opencord/voltha-protos/go/voltha";
package voltha;
diff --git a/protos/voltha_protos/ietf_interfaces.proto b/protos/voltha_protos/ietf_interfaces.proto
new file mode 100644
index 0000000..d43c02d
--- /dev/null
+++ b/protos/voltha_protos/ietf_interfaces.proto
@@ -0,0 +1,53 @@
+syntax = "proto3";
+
+option go_package = "github.com/opencord/voltha-go/protos/ietf";
+
+package ietf_interfaces;
+
+message Interfaces {
+ repeated Interface all_interfaces = 1;
+}
+message Interface {
+ string name = 1 ;
+ string description = 2 ;
+ string type = 3 ;
+ bool enabled = 4;
+ enum LinkUpDownTrapEnableType
+ {
+ TRAP_DISABLED = 0 ;
+ TRAP_ENABLED = 1 ;
+ }
+ LinkUpDownTrapEnableType link_up_down_trap_enable = 5;
+}
+
+message InterfacesState {
+ repeated InterfaceState all_interfacs = 1;
+}
+message InterfaceState {
+ string name = 1 ;
+ string type = 2 ;
+ enum AdminStatusType
+ {
+ ADMIN_DOWN = 0 ;
+ ADMIN_TESTING = 1 ;
+ ADMIN_UP = 2 ;
+ }
+ AdminStatusType admin_status = 3;
+ enum OperStatusType
+ {
+ DORMANT = 0 ;
+ LOWER_LAYER_DOWN = 1 ;
+ UNKNOWN = 2 ;
+ TESTING = 3 ;
+ UP = 4 ;
+ DOWN = 5 ;
+ NOT_PRESENT = 6 ;
+ }
+ OperStatusType oper_status = 4;
+ string last_change = 5 ;
+ int32 if_index = 6 ;
+ string phys_address = 7 ;
+ repeated string higher_layer_if = 8 ;
+ repeated string lower_layer_if = 9 ;
+ uint64 speed = 10 ;
+}
diff --git a/protos/voltha_protos/inter_container.proto b/protos/voltha_protos/inter_container.proto
index 207828b..e1d5406 100644
--- a/protos/voltha_protos/inter_container.proto
+++ b/protos/voltha_protos/inter_container.proto
@@ -5,7 +5,7 @@
import public "voltha_protos/logical_device.proto";
-option go_package = "github.com/opencord/voltha-go/protos/inter_container";
+option go_package = "github.com/opencord/voltha-protos/go/inter_container";
package voltha;
@@ -48,7 +48,8 @@
MessageType type = 2;
string from_topic = 3;
string to_topic = 4;
- int64 timestamp = 5;
+ string key_topic = 5;
+ int64 timestamp = 6;
}
message Argument {
diff --git a/protos/voltha_protos/logical_device.proto b/protos/voltha_protos/logical_device.proto
index 4af0a14..6e3a233 100644
--- a/protos/voltha_protos/logical_device.proto
+++ b/protos/voltha_protos/logical_device.proto
@@ -1,6 +1,6 @@
syntax = "proto3";
-option go_package = "github.com/opencord/voltha-go/protos/voltha";
+option go_package = "github.com/opencord/voltha-protos/go/voltha";
package voltha;
diff --git a/protos/voltha_protos/meta.proto b/protos/voltha_protos/meta.proto
index fc02e46..a308ffa 100644
--- a/protos/voltha_protos/meta.proto
+++ b/protos/voltha_protos/meta.proto
@@ -17,7 +17,7 @@
syntax = "proto3";
-option go_package = "github.com/opencord/voltha-go/protos/common";
+option go_package = "github.com/opencord/voltha-protos/go/common";
package voltha;
diff --git a/protos/voltha_protos/omci_alarm_db.proto b/protos/voltha_protos/omci_alarm_db.proto
index d1cdab6..e3f8c0f 100644
--- a/protos/voltha_protos/omci_alarm_db.proto
+++ b/protos/voltha_protos/omci_alarm_db.proto
@@ -15,7 +15,7 @@
//
syntax = "proto3";
-option go_package = "github.com/opencord/voltha-go/protos/omci";
+option go_package = "github.com/opencord/voltha-protos/go/omci";
package alarm;
diff --git a/protos/voltha_protos/omci_mib_db.proto b/protos/voltha_protos/omci_mib_db.proto
index 39c7972..9a2933a 100644
--- a/protos/voltha_protos/omci_mib_db.proto
+++ b/protos/voltha_protos/omci_mib_db.proto
@@ -15,7 +15,7 @@
//
syntax = "proto3";
-option go_package = "github.com/opencord/voltha-go/protos/omci";
+option go_package = "github.com/opencord/voltha-protos/go/omci";
package omci;
diff --git a/protos/voltha_protos/openflow_13.proto b/protos/voltha_protos/openflow_13.proto
index 5adfb72..890fc04 100644
--- a/protos/voltha_protos/openflow_13.proto
+++ b/protos/voltha_protos/openflow_13.proto
@@ -57,7 +57,7 @@
*/
syntax = "proto3";
-option go_package = "github.com/opencord/voltha-go/protos/openflow_13";
+option go_package = "github.com/opencord/voltha-protos/go/openflow_13";
package openflow_13;
@@ -2283,6 +2283,7 @@
message FlowGroupChanges {
FlowGroups to_add = 1;
FlowGroups to_remove = 2;
+ FlowGroups to_update = 3;
}
message PacketIn {
diff --git a/protos/voltha_protos/ponsim.proto b/protos/voltha_protos/ponsim.proto
new file mode 100644
index 0000000..d4cbaa2
--- /dev/null
+++ b/protos/voltha_protos/ponsim.proto
@@ -0,0 +1,67 @@
+syntax = "proto3";
+
+option go_package = "github.com/opencord/voltha-protos/go/voltha";
+
+package voltha;
+
+import "google/protobuf/empty.proto";
+import "voltha_protos/openflow_13.proto";
+
+
+message PonSimOnuDeviceInfo {
+ int32 uni_port = 1;
+ string serial_number = 2;
+}
+
+message PonSimDeviceInfo {
+ int32 nni_port = 1;
+ repeated PonSimOnuDeviceInfo onus = 2;
+}
+
+message FlowTable {
+ int32 port = 1; // Used to address right device
+ repeated openflow_13.ofp_flow_stats flows = 2;
+}
+
+message PonSimFrame {
+ string id = 1;
+ bytes payload = 2;
+ int32 out_port = 3;
+}
+
+message PonSimPacketCounter {
+ string name = 1;
+ int64 value = 2;
+}
+
+message PonSimPortMetrics {
+ string port_name = 1;
+ repeated PonSimPacketCounter packets = 2;
+}
+
+message PonSimMetrics {
+ string device = 1;
+ repeated PonSimPortMetrics metrics = 2;
+}
+
+message PonSimMetricsRequest {
+ int32 port = 1;
+}
+
+service PonSim {
+ rpc SendFrame(PonSimFrame)
+ returns (google.protobuf.Empty) {}
+
+ rpc ReceiveFrames(google.protobuf.Empty)
+ returns (stream PonSimFrame) {}
+
+ rpc GetDeviceInfo(google.protobuf.Empty)
+ returns(PonSimDeviceInfo) {}
+
+ rpc UpdateFlowTable(FlowTable)
+ returns(google.protobuf.Empty) {}
+
+ rpc GetStats(google.protobuf.Empty)
+ returns(PonSimMetrics) {}
+
+}
diff --git a/protos/voltha_protos/schema.proto b/protos/voltha_protos/schema.proto
index bb1f895..2edd85a 100644
--- a/protos/voltha_protos/schema.proto
+++ b/protos/voltha_protos/schema.proto
@@ -1,6 +1,6 @@
syntax = "proto3";
-option go_package = "github.com/opencord/voltha-go/protos/schema";
+option go_package = "github.com/opencord/voltha-protos/go/schema";
package schema;
diff --git a/protos/voltha_protos/voltha.proto b/protos/voltha_protos/voltha.proto
index cc785f1..c9e7347 100644
--- a/protos/voltha_protos/voltha.proto
+++ b/protos/voltha_protos/voltha.proto
@@ -6,7 +6,7 @@
syntax = "proto3";
-option go_package = "github.com/opencord/voltha-go/protos/voltha";
+option go_package = "github.com/opencord/voltha-protos/go/voltha";
package voltha;
@@ -141,6 +141,15 @@
string voltha_id = 2;
}
+// Identifies a membership group a Core belongs to
+message Membership {
+ // Group name
+ string group_name = 1;
+
+ // Unique ID of a container within that group
+ string id = 2;
+}
+
/*
* Voltha APIs
*
@@ -154,6 +163,21 @@
};
}
+ // Get the membership group of a Voltha Core
+ rpc GetMembership(google.protobuf.Empty) returns(Membership) {
+ option (google.api.http) = {
+ get: "/api/v1/membership"
+ };
+ }
+
+ // Set the membership group of a Voltha Core
+ rpc UpdateMembership(Membership) returns(google.protobuf.Empty) {
+ option (google.api.http) = {
+ post: "/api/v1/membership"
+ body: "*"
+ };
+ }
+
// Get high level information on the Voltha cluster
rpc GetVoltha(google.protobuf.Empty) returns(Voltha) {
option (google.api.http) = {
diff --git a/protos/voltha_protos/yang_options.proto b/protos/voltha_protos/yang_options.proto
index 25f70a8..25e6fa7 100644
--- a/protos/voltha_protos/yang_options.proto
+++ b/protos/voltha_protos/yang_options.proto
@@ -17,7 +17,7 @@
syntax = "proto3";
-option go_package = "github.com/opencord/voltha-go/protos/common";
+option go_package = "github.com/opencord/voltha-protos/go/common";
package voltha;