VOL-159: Stubbed initial commit of asvolt16_olt adapter
Change-Id: Id7bf2bd72028daacb3a2f77c59d0bc7df7791913
Signed-off-by: Shad Ansari <shad@onlab.us>
diff --git a/voltha/adapters/asfvolt16_olt/__init__.py b/voltha/adapters/asfvolt16_olt/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/voltha/adapters/asfvolt16_olt/__init__.py
diff --git a/voltha/adapters/asfvolt16_olt/asfvolt16_olt.py b/voltha/adapters/asfvolt16_olt/asfvolt16_olt.py
new file mode 100644
index 0000000..42e9838
--- /dev/null
+++ b/voltha/adapters/asfvolt16_olt/asfvolt16_olt.py
@@ -0,0 +1,123 @@
+#
+# Copyright 2017 the original author or authors.
+#
+# 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.
+#
+
+"""
+Asfvolt16 OLT adapter
+"""
+
+import structlog
+from zope.interface import implementer
+
+from voltha.protos.device_pb2 import DeviceType, DeviceTypes
+from voltha.adapters.interface import IAdapterInterface
+from voltha.protos.adapter_pb2 import Adapter
+from voltha.protos.adapter_pb2 import AdapterConfig
+from voltha.protos.common_pb2 import LogLevel
+
+log = structlog.get_logger()
+
+@implementer(IAdapterInterface)
+class Asfvolt16Adapter(object):
+ name = 'asfvolt16_olt'
+
+ supported_device_types = [
+ DeviceType(
+ id=name,
+ adapter=name,
+ accepts_bulk_flow_update=False
+ )
+ ]
+
+ def __init__(self, adapter_agent, config):
+ self.adapter_agent = adapter_agent
+ self.config = config
+ self.descriptor = Adapter(
+ id=self.name,
+ vendor='Edgecore',
+ version='0.1',
+ config=AdapterConfig(log_level=LogLevel.INFO)
+ )
+
+ # register for adapter messages
+ self.adapter_agent.register_for_inter_adapter_messages()
+
+ def start(self):
+ log.debug('starting')
+ log.info('started')
+
+ def stop(self):
+ log.debug('stopping')
+ log.info('stopped')
+
+ def adapter_descriptor(self):
+ return self.descriptor
+
+ def device_types(self):
+ return DeviceTypes(items=self.supported_device_types)
+
+ def health(self):
+ raise NotImplementedError()
+
+ def change_master_state(self, master):
+ raise NotImplementedError()
+
+ def update_pm_config(self, device, pm_config):
+ raise NotImplementedError()
+
+ def adopt_device(self, device):
+ raise NotImplementedError()
+
+ def abandon_device(self, device):
+ raise NotImplementedError()
+
+ def disable_device(self, device):
+ raise NotImplementedError()
+
+ def reenable_device(self, device):
+ raise NotImplementedError()
+
+ def reboot_device(self, device):
+ raise NotImplementedError()
+
+ def delete_device(self, device):
+ raise NotImplementedError()
+
+ def get_device_details(self, device):
+ raise NotImplementedError()
+
+ def update_flows_bulk(self, device, flows, groups):
+ raise NotImplementedError()
+
+ def update_flows_incrementally(self, device, flow_changes, group_changes):
+ raise NotImplementedError()
+
+ def send_proxied_message(self, proxy_address, msg):
+ raise NotImplementedError()
+
+ def receive_proxied_message(self, proxy_address, msg):
+ raise NotImplementedError()
+
+ def receive_packet_out(self, logical_device_id, egress_port_no, msg):
+ raise NotImplementedError()
+
+ def receive_inter_adapter_message(self, msg):
+ raise NotImplementedError()
+
+ def suppress_alarm(self, filter):
+ raise NotImplementedError()
+
+ def unsuppress_alarm(self, filter):
+ raise NotImplementedError()
diff --git a/voltha/adapters/asfvolt16_olt/protos/bal_model_types.proto b/voltha/adapters/asfvolt16_olt/protos/bal_model_types.proto
index 2b417c6..5adb020 100644
--- a/voltha/adapters/asfvolt16_olt/protos/bal_model_types.proto
+++ b/voltha/adapters/asfvolt16_olt/protos/bal_model_types.proto
@@ -331,8 +331,7 @@
*/
message BalAggregationPortIdList
{
- uint32 len = 1; /**< List length in uint8 (bytes). */
- repeated uint32 val = 2; /**< List contents. */
+ repeated uint32 val = 1; /**< List contents. */
}
/** classifier.
@@ -382,8 +381,7 @@
*/
message BalFlowIdList
{
- uint32 len = 1; /**< List length. */
- repeated uint32 val = 2; /**< List contents. */
+ repeated uint32 val = 1; /**< List contents. */
}
/** Queue Reference
@@ -406,10 +404,9 @@
/** Variable-length list of groupMemberInfo.
*/
-message BalGroupMemberInfoList_u16
+message BalGroupMemberInfoList
{
- uint32 len = 1; /**< List length. */
- repeated BalGroupMemberInfo val = 2; /**< List contents. */
+ repeated BalGroupMemberInfo val = 1; /**< List contents. */
}
/** Serial number.
@@ -422,10 +419,9 @@
/** Variable-length list of servicePortId.
*/
-message uint32List_u8
+message SvcPortIdList
{
- uint32 len = 1; /**< List length. */
- repeated uint32 val = 2; /**< List contents. */
+ repeated uint32 val = 1; /**< List contents. */
}
/** SLA.
@@ -439,10 +435,9 @@
/** Variable-length list of subId.
*/
-message uint32List_u16
+message SubTermIdList
{
- uint32 len = 1; /**< List length. */
- repeated uint32 val = 2; /**< List contents. */
+ repeated uint32 val = 1; /**< List contents. */
}
/** Random Early Discard Configuration
@@ -485,16 +480,14 @@
*/
message BalTmQueueIdList
{
- uint32 len = 1; /**< List length. */
- repeated uint32 val = 2; /**< List contents. */
+ repeated uint32 val = 1; /**< List contents. */
}
/** Variable-length list of TmSchedId.
*/
message BalTmSchedIdList
{
- uint32 len = 1; /**< List length. */
- repeated uint32 val = 2; /**< List contents. */
+ repeated uint32 val = 1; /**< List contents. */
}
/** TM Scheduler Owner
@@ -575,14 +568,6 @@
uint32 nrt_profile = 6; /**< NRT Profile */
}
-/** Variable-length list of U8.
- */
-message BalU8List
-{
- uint32 len = 1; /**< List length. */
- repeated uint32 val = 2; /**< List contents. */
-}
-
/** Structure definition for the "key" group of the "access_terminal" object.
*/
message BalAccessTerminalKey
@@ -723,7 +708,7 @@
message BalGroupCfgData
{
BalGroupMemberCmd members_cmd = 1; /**< Membership operation commands. */
- BalGroupMemberInfoList_u16 members = 2; /**< The list of members associated with this group */
+ BalGroupMemberInfoList members = 2; /**< The list of members associated with this group */
uint64 cookie = 3; /**< Application cookie */
BalFlowIdList flows = 4; /**< List of flows associated with this group */
BalGroupOwner owner = 5; /**< Owner of the group. */
@@ -759,7 +744,7 @@
BalControl flow_control = 8; /**< Flow control enable or disable */
uint32 ds_tm = 9; /**< Downstream scheduler and shaper */
uint32 us_tm = 10; /**< Upstream scheduler and shaper */
- uint32List_u16 sub_term_id_list = 11; /**< A list of subscriber terminal ids configured on this interface */
+ SubTermIdList sub_term_id_list = 11; /**< A list of subscriber terminal ids configured on this interface */
}
/** Transport message definition for "cfg" group of "interface" object.
@@ -832,7 +817,7 @@
BalIntfType intf_type = 4; /**< Interface Type. */
uint32 svc_port = 5; /**< N/A for sending a packet */
uint64 flow_cookie = 6; /**< N/A for sending a packet */
- BalU8List pkt = 7; /**< Packet Data. */
+ bytes pkt = 7; /**< Packet Data. */
}
/** Transport message definition for "cfg" group of "packet" object.
@@ -853,7 +838,7 @@
BalIntfType intf_type = 4; /**< Interface Type. */
uint32 svc_port = 5; /**< N/A for sending a packet */
uint64 flow_cookie = 6; /**< N/A for sending a packet */
- BalU8List pkt = 7; /**< Packet Data. */
+ bytes pkt = 7; /**< Packet Data. */
}
/** Transport message definition for "ind" group of "packet" object.
@@ -888,7 +873,7 @@
bytes mac_address = 7; /**< The Ethernet MAC address of an EPON subscriber terminal */
uint32 ds_tm = 8; /**< Downstream scheduler and shaper */
uint32 us_tm = 9; /**< Upstream scheduler and shaper */
- uint32List_u8 svc_port_id_list = 10; /**< A list of bearer traffic svc_port_ids associated with this subscriber terminal */
+ SvcPortIdList svc_port_id_list = 10; /**< A list of bearer traffic svc_port_ids associated with this subscriber terminal */
BalAggregationPortIdList agg_port_id_list = 11; /**< A list of aggrPort_ids associated with this subscriber terminal */
}