[VOL-1460]
- Imported protobuf definitions from pyvoltha at
https://gerrit.opencord.org/gitweb?p=pyvoltha.git, commit hash:
944aee71301b8ddb211b6e51d685f56d5c4a911b
- Imported upstream Google API protos from
https://github.com/googleapis/googleapis, commit hash:
5a90fbea68ce4a6e87c20d2df10df5ecd88299ff
- Fixed `import` paths and directory heirarchy in protobuf definitions
to be compatible with both python 2 and 3.
- Created Makefile scaffold to generate language-specific bindings for
python and go
Change-Id: Idd6b6b985a5eae4c38d40dd07ae78744c09e37f5
diff --git a/protos/voltha_protos/yang_options.proto b/protos/voltha_protos/yang_options.proto
new file mode 100644
index 0000000..25f70a8
--- /dev/null
+++ b/protos/voltha_protos/yang_options.proto
@@ -0,0 +1,74 @@
+// Copyright (c) 2015, Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// This file contains annotation definitions that can be used to describe
+// a configuration tree.
+
+syntax = "proto3";
+
+option go_package = "github.com/opencord/voltha-go/protos/common";
+
+package voltha;
+
+import "google/protobuf/descriptor.proto";
+
+enum MessageParserOption {
+ // Move any enclosing child enum/message definition to the same level
+ // as the parent (this message) in the yang generated file
+ MOVE_TO_PARENT_LEVEL= 0;
+
+ // Create both a grouping and a container for this message. The container
+ // name will be the message name. The grouping name will be the message
+ // name prefixed with "grouping_"
+ CREATE_BOTH_GROUPING_AND_CONTAINER = 1;
+}
+
+message InlineNode {
+ string id = 1;
+ string type = 2;
+}
+
+message RpcReturnDef {
+ // The gRPC methods return message types. NETCONF expects an actual
+ // attribute as defined in the YANG schema. The xnl_tag will be used
+ // as the top most tag when translating a gRPC response into an xml
+ // response
+ string xml_tag = 1;
+
+ // When the gRPC response is a list of items, we need to differentiate
+ // between a YANG schema attribute whose name is "items" and when "items"
+ // is used only to indicate a list of items is being returned. The default
+ // behavior assumes a list is returned when "items" is present in
+ // the response. This option will therefore be used when the attribute
+ // name in the YANG schema is 'items'
+ string list_items_name = 2;
+}
+
+extend google.protobuf.MessageOptions {
+ // This annotation is used to indicate how a message is parsed when
+ // converting from proto to yang format.
+ MessageParserOption yang_child_rule = 7761774;
+
+ MessageParserOption yang_message_rule = 7761775;
+}
+
+extend google.protobuf.FieldOptions {
+ // If present, the field (a message reference) should be replaced by the
+ // message itself. For now, this applies only to non-repeated fields.
+ InlineNode yang_inline_node = 7761776;
+}
+
+extend google.protobuf.MethodOptions {
+ RpcReturnDef yang_xml_tag = 7761777;
+}