Adding build tools for gRPC compilation.
ONOS-6095
Change-Id: I80687eb2a91ad60c4dbec0bb966e917555d46151
diff --git a/incubator/protobuf/src/main/proto/models/Device.proto b/incubator/protobuf/src/main/proto/models/Device.proto
new file mode 100644
index 0000000..75cf0f5
--- /dev/null
+++ b/incubator/protobuf/src/main/proto/models/Device.proto
@@ -0,0 +1,51 @@
+syntax = "proto3";
+option java_package = "org.onosproject.grpc.net";
+
+package Device;
+
+message DeviceDescription {
+ string device_Uri = 1;
+ DeviceType type = 2;
+ string manufacturer = 3;
+ string hw_version = 4;
+ string sw_version = 5;
+ string serial_number = 6;
+ string chassis_id = 7;
+ map<string, string> annotations = 8;
+ bool is_default_available = 9;
+}
+
+enum MastershipRole {
+ NONE = 0;
+ MASTER = 1;
+ STANDBY = 2;
+}
+
+enum DeviceType {
+ OTHER = 0;
+ SWITCH = 1;
+ ROUTER = 2;
+ ROADM = 3;
+ OTN = 4;
+ ROADM_OTN = 5;
+ FIREWALL = 6;
+ BALANCER = 7;
+ IPS = 8;
+ IDS = 9;
+ CONTROLLER = 10;
+ VIRTUAL = 11;
+ FIBER_SWITCH = 12;
+ MICROWAVE = 13;
+}
+
+// Corresponds to org.onosproject.net.Device.
+message DeviceCore {
+ string deviceId = 1;
+ DeviceType type = 2;
+ string manufacturer = 3;
+ string hw_version = 4;
+ string sw_version = 5;
+ string serial_number = 6;
+ string chassis_id = 7;
+ map<string, string> annotations = 8;
+}
diff --git a/incubator/protobuf/src/main/proto/models/DeviceEvent.proto b/incubator/protobuf/src/main/proto/models/DeviceEvent.proto
new file mode 100644
index 0000000..f834aa1
--- /dev/null
+++ b/incubator/protobuf/src/main/proto/models/DeviceEvent.proto
@@ -0,0 +1,28 @@
+syntax = "proto3";
+option java_package = "org.onosproject.grpc.net";
+
+
+import "models/Device.proto";
+import "models/Port.proto";
+
+package DeviceEvent;
+
+// Corresponds to org.onosproject.net.device.DeviceEvent.
+message DeviceNotification {
+ Device.DeviceCore device = 1;
+ DeviceEventType deviceEventType = 2;
+ Port.PortCore port = 3;
+}
+
+enum DeviceEventType {
+ DEVICE_ADDED = 0;
+ DEVICE_UPDATED = 1;
+ DEVICE_REMOVED = 2;
+ DEVICE_SUSPENDED = 3;
+ DEVICE_AVAILABILITY_CHANGED = 4;
+ PORT_ADDED = 5;
+ PORT_UPDATED = 6;
+ PORT_REMOVED = 7;
+ PORT_STATS_UPDATED = 8;
+}
+
diff --git a/incubator/protobuf/src/main/proto/models/Link.proto b/incubator/protobuf/src/main/proto/models/Link.proto
new file mode 100644
index 0000000..a1ae8ff
--- /dev/null
+++ b/incubator/protobuf/src/main/proto/models/Link.proto
@@ -0,0 +1,60 @@
+syntax = "proto3";
+option java_package = "org.onosproject.grpc.net";
+
+package Link;
+
+enum LinkType {
+ // Signifies that this is a direct single-segment link.
+ DIRECT = 0;
+
+ // Signifies that this link is potentially comprised from multiple
+ // underlying segments or hops, and as such should be used to tag
+ // links traversing optical paths, tunnels or intervening 'dark'
+ // switches.
+ INDIRECT = 1;
+
+ // Signifies that this link is an edge, i.e. host link.
+ EDGE = 2;
+
+ // Signifies that this link represents a logical link backed by
+ // some form of a tunnel, e.g., GRE, MPLS, ODUk, OCH.
+ TUNNEL = 3;
+
+ // Signifies that this link is realized by fiber (either single channel or WDM).
+ OPTICAL = 4;
+
+ // Signifies that this link is a virtual link or a pseudo-wire.
+ VIRTUAL = 5;
+}
+
+message ConnectPoint {
+ oneof element_id {
+ // DeviceID as String DeviceId#toString
+ string device_id = 1;
+
+ // TODO add support to other element_id if required
+ }
+ // PortNumber as String PortNumber#toString
+ string port_number = 2;
+}
+
+enum LinkState {
+ ACTIVE = 0;
+ INACTIVE = 1;
+}
+
+// Corresponds to org.onosproject.net.Link.
+message LinkCore {
+ LinkState state = 1;
+ ConnectPoint src = 2;
+ ConnectPoint dst = 3;
+ LinkType type = 4;
+ map<string, string> annotations = 5;
+}
+
+message LinkDescription {
+ ConnectPoint src = 1;
+ ConnectPoint dst = 2;
+ LinkType type = 3;
+ map<string, string> annotations = 4;
+}
diff --git a/incubator/protobuf/src/main/proto/models/LinkEvent.proto b/incubator/protobuf/src/main/proto/models/LinkEvent.proto
new file mode 100644
index 0000000..fcd13fb
--- /dev/null
+++ b/incubator/protobuf/src/main/proto/models/LinkEvent.proto
@@ -0,0 +1,19 @@
+syntax = "proto3";
+option java_package = "org.onosproject.grpc.net";
+
+package LinkEvent;
+
+import "models/Link.proto";
+
+// Corresponds to org.onosproject.net.link.LinkEvent.
+message LinkNotification {
+ LinkEventType linkEventType = 2;
+ Link.LinkCore link = 3;
+}
+
+// Link Event Types
+enum LinkEventType {
+ LINK_ADDED = 0;
+ LINK_UPDATED = 1;
+ LINK_REMOVED = 2;
+}
diff --git a/incubator/protobuf/src/main/proto/models/Port.proto b/incubator/protobuf/src/main/proto/models/Port.proto
new file mode 100644
index 0000000..a3fd34d
--- /dev/null
+++ b/incubator/protobuf/src/main/proto/models/Port.proto
@@ -0,0 +1,48 @@
+syntax = "proto3";
+option java_package = "org.onosproject.grpc.net";
+
+package Port;
+
+enum PortType {
+ // Signifies copper-based connectivity.
+ COPPER = 0;
+ // Signifies optical fiber-based connectivity.
+ FIBER = 1;
+ // Signifies optical fiber-based packet port.
+ PACKET = 2;
+ // Signifies optical fiber-based optical tributary port (called T-port).
+ //The signal from the client side will be formed into a ITU G.709 (OTN) frame.
+ ODUCLT = 3;
+ // Signifies optical fiber-based Line-side port (called L-port).
+ OCH = 4;
+ // Signifies optical fiber-based WDM port (called W-port).
+ //Optical Multiplexing Section (See ITU G.709).
+ OMS = 5;
+ // Signifies virtual port.
+ VIRTUAL = 6;
+}
+
+message PortDescription {
+ // PortNumber as String PortNumber#toString
+ string port_number = 1;
+ bool is_enabled = 2;
+ PortType type = 3;
+ int64 port_speed = 4;
+ map<string, string> annotations = 8;
+}
+
+// Corresponds to org.onosproject.net.Port.
+message PortCore {
+ string port_number = 1;
+ bool is_enabled = 2;
+ PortType type = 3;
+ int64 port_speed = 4;
+ map<string, string> annotations = 5;
+}
+
+message PortStatistics {
+ int32 port = 1;
+ int64 packets_received = 2;
+ int64 packets_sent = 3;
+ // TODO add all other fields
+}