This commit is the initial attempt in converting a protobuf schema
into a yang schema. Intructions on how to execute this convertion is
in the proto2yang.py header. Test cases to follow.
Change-Id: I7a9273138339bbaf521a2b5eab3e5f1205f79bd0
diff --git a/experiments/proto2Yang/yang.proto b/experiments/proto2Yang/yang.proto
new file mode 100644
index 0000000..94959a3
--- /dev/null
+++ b/experiments/proto2Yang/yang.proto
@@ -0,0 +1,67 @@
+syntax = "proto3";
+
+package experiment;
+
+//import "google/protobuf/empty.proto";
+
+message AsyncEvent {
+ int32 seq = 1;
+ enum EventType {
+ BIG_BANG = 0; // just a big bang
+ SMALL_BANG = 1; // so small bang
+ NO_BANG = 2;
+ }
+ EventType type = 2;
+ string details = 3;
+}
+
+enum khenType {
+ BIG_KHEN = 0;
+ SMALL_KHEN = 1;
+ NO_KHEN = 2;
+}
+
+
+message Packet {
+ int32 source = 1;
+ bytes content = 2;
+ message Result {
+ string url = 1;
+ string title = 2;
+ repeated string snippets = 3;
+ message Success {
+ string input = 1;
+ string desc = 2;
+ }
+ repeated Success success = 4;
+ }
+ repeated Result results = 3;
+}
+
+message Echo {
+ string msg = 1;
+ float delay = 2;
+}
+
+message testMessage{
+ oneof oneOfTest {
+ string test2 = 1;
+ int32 test3 = 2;
+ }
+}
+
+service ExperimentalService {
+
+ rpc GetEcho(Echo) returns(Echo);
+
+ // For server to send async stream to client
+ rpc ReceiveStreamedEvents(Packet)
+ returns(stream AsyncEvent);
+
+ // For server to send async packets to client
+ rpc ReceivePackets(Echo) returns(stream Packet);
+
+ // For client to send async packets to server
+ rpc SendPackets(stream Packet) returns(Echo);
+
+}
\ No newline at end of file