This commit consists of:
1) Dockerizing the netconf server
2) Update proto2yang to support module imports
3) Provide a set of yang modules derived from the proto files in voltha.
These files as well as the slight mmodifications to the proto files are
provided in the experiments/netconf/proto2yang directory
4) Code to automatically pull proto files from voltha into the netconf server,
compiles them and produce the yang equivalent files.
5) Add a getvoltha netconf API to provide voltha state information (basic at
this time). There is potential to make this generic once we experiment
with additional APIs
Change-Id: I94f3a1f871b8025ad675d5f9b9b626d1be8b8d36
diff --git a/experiments/netconf/proto2yang/device_orig.proto b/experiments/netconf/proto2yang/device_orig.proto
new file mode 100644
index 0000000..0a1e9b2
--- /dev/null
+++ b/experiments/netconf/proto2yang/device_orig.proto
@@ -0,0 +1,135 @@
+syntax = "proto3";
+
+package voltha;
+
+import "meta.proto";
+import "google/protobuf/any.proto";
+import "common.proto";
+import "openflow_13.proto";
+
+// A Device Type
+message DeviceType {
+
+ // Unique name for the device type
+ string id = 1;
+
+ // Name of the adapter that handles device type
+ string adapter = 2;
+
+ // Capabilitities
+
+ bool accepts_bulk_flow_update = 3;
+ bool accepts_add_remove_flow_updates = 4;
+
+}
+
+// A plurality of device types
+message DeviceTypes {
+ repeated DeviceType items = 1;
+}
+
+message Port {
+
+ enum PortType {
+ UNKNOWN = 0;
+ ETHERNET_NNI = 1;
+ ETHERNET_UNI = 2;
+ PON_OLT = 3;
+ PON_ONU = 4;
+ }
+
+ uint32 port_no = 1; // Device-unique port number
+
+ string label = 2; // Arbitrary port label
+
+ PortType type = 3; // Type of port
+
+ AdminState.AdminState admin_state = 5;
+
+ OperStatus.OperStatus oper_status = 6;
+
+ string device_id = 7; // Unique .id of device that owns this port
+
+ message PeerPort {
+ string device_id = 1;
+ uint32 port_no = 2;
+ }
+ repeated PeerPort peers = 8;
+
+}
+
+message Ports {
+ repeated Port items = 1;
+}
+
+// A Physical Device instance
+message Device {
+
+ // Voltha's device identifier
+ string id = 1 [(access) = READ_ONLY];
+
+ // Device type, refers to one of the registered device types
+ string type = 2 [(access) = READ_ONLY];
+
+ // Is this device a root device. Each logical switch has one root
+ // device that is associated with the logical flow switch.
+ bool root = 3 [(access) = READ_ONLY];
+
+ // Parent device id, in the device tree (for a root device, the parent_id
+ // is the logical_device.id)
+ string parent_id = 4 [(access) = READ_ONLY];
+ uint32 parent_port_no = 20 [(access) = READ_ONLY];
+
+ // Vendor, version, serial number, etc.
+ string vendor = 5 [(access) = READ_ONLY];
+ string model = 6 [(access) = READ_ONLY];
+ string hardware_version = 7 [(access) = READ_ONLY];
+ string firmware_version = 8 [(access) = READ_ONLY];
+ string software_version = 9 [(access) = READ_ONLY];
+ string serial_number = 10 [(access) = READ_ONLY];
+
+ // Addapter that takes care of device
+ string adapter = 11 [(access) = READ_ONLY];
+
+ // Device contact on vlan (if 0, no vlan)
+ uint32 vlan = 12;
+
+ message ProxyAddress {
+ string device_id = 1; // Which device to use as proxy to this device
+ uint32 channel_id = 2; // Sub-address within proxy device
+ };
+
+ 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;
+
+ // Device contact IPv6 address using the canonical string form
+ // ("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx")
+ string ipv6_address = 15;
+
+ ProxyAddress proxy_device = 19;
+ };
+
+ AdminState.AdminState admin_state = 16;
+
+ OperStatus.OperStatus oper_status = 17 [(access) = READ_ONLY];
+
+ ConnectStatus.ConnectStatus connect_status = 18 [(access) = READ_ONLY];
+
+ // TODO additional common attribute here
+
+ // Device type specific attributes
+ google.protobuf.Any custom = 64;
+
+ repeated Port ports = 128 [(child_node) = {key: "port_no"}];
+ openflow_13.Flows flows = 129 [(child_node) = {}];
+ openflow_13.FlowGroups flow_groups = 130 [(child_node) = {}];
+
+}
+
+message Devices {
+ repeated Device items = 1;
+}