Fixing BBSIM adapter and adding BBSM vendor name in broadcom_onu adapter
Change-Id: I07731b5579bc3d536308608f2d1ab8021001e100
diff --git a/voltha/adapters/bbsimolt/bbsimolt_device.py b/voltha/adapters/bbsimolt/bbsimolt_device.py
index 43be4e3..3cbafc1 100644
--- a/voltha/adapters/bbsimolt/bbsimolt_device.py
+++ b/voltha/adapters/bbsimolt/bbsimolt_device.py
@@ -27,7 +27,7 @@
from voltha.adapters.bbsimolt.bbsimolt_platform import BBSimOltPlatform
from voltha.adapters.bbsimolt.bbsimolt_flow_mgr import BBSimOltFlowMgr
from voltha.protos.device_pb2 import Port, Device
-from voltha.adapters.bbsimolt.protos import openolt_pb2, openolt_pb2_grpc
+from voltha.adapters.openolt.protos import openolt_pb2, openolt_pb2_grpc
from voltha.adapters.openolt.openolt_device import OpenoltDevice
from voltha.protos.common_pb2 import ConnectStatus, OperStatus, AdminState
from voltha.protos.bbf_fiber_tcont_body_pb2 import TcontsConfigData
diff --git a/voltha/adapters/bbsimolt/bbsimolt_flow_mgr.py b/voltha/adapters/bbsimolt/bbsimolt_flow_mgr.py
index 1494a01..fa266d4 100644
--- a/voltha/adapters/bbsimolt/bbsimolt_flow_mgr.py
+++ b/voltha/adapters/bbsimolt/bbsimolt_flow_mgr.py
@@ -23,7 +23,7 @@
from voltha.protos.device_pb2 import Port
import voltha.core.flow_decomposer as fd
import bbsimolt_platform as platform
-from voltha.adapters.bbsimolt.protos import openolt_pb2
+from voltha.adapters.openolt.protos import openolt_pb2
from voltha.registry import registry
HSIA_FLOW_INDEX = 0 # FIXME
diff --git a/voltha/adapters/bbsimolt/protos/Makefile b/voltha/adapters/bbsimolt/protos/Makefile
deleted file mode 100644
index 62eacc8..0000000
--- a/voltha/adapters/bbsimolt/protos/Makefile
+++ /dev/null
@@ -1,85 +0,0 @@
-#
-# 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.
-#
-
-# Makefile to build all protobuf and gRPC related artifacts
-
-ifeq ($(VOLTHA_BASE)_set,_set)
- $(error To get started, please source the env.sh file from Voltha top level directory)
-endif
-
-default: build
-
-PROTO_FILES := $(wildcard *.proto) $(wildcard $(VOLTHA_BASE)/voltha/protos/third_party/google/api/*proto)
-PROTO_PB2_FILES := $(foreach f,$(PROTO_FILES),$(subst .proto,_pb2.py,$(f)))
-PROTO_DESC_FILES := $(foreach f,$(PROTO_FILES),$(subst .proto,.desc,$(f)))
-
-PROTOC_PREFIX := /usr/local
-PROTOC_LIBDIR := $(PROTOC_PREFIX)/lib
-
-PROTOC := $(PROTOC_PREFIX)/bin/protoc
-
-PROTOC_VERSION := "3.3.0"
-PROTOC_DOWNLOAD_PREFIX := "https://github.com/google/protobuf/releases/download"
-PROTOC_DIR := protobuf-$(PROTOC_VERSION)
-PROTOC_TARBALL := protobuf-python-$(PROTOC_VERSION).tar.gz
-PROTOC_DOWNLOAD_URI := $(PROTOC_DOWNLOAD_PREFIX)/v$(PROTOC_VERSION)/$(PROTOC_TARBALL)
-PROTOC_BUILD_TMP_DIR := "/tmp/protobuf-build-$(shell uname -s | tr '[:upper:]' '[:lower:]')"
-
-build: $(PROTOC) protos
-
-protos: $(PROTO_PB2_FILES)
-
-%_pb2.py: %.proto Makefile
- @echo "Building protocol buffer artifacts from $<"
- env LD_LIBRARY_PATH=$(PROTOC_LIBDIR) python -m grpc.tools.protoc \
- -I. \
- -I$(VOLTHA_BASE)/voltha/protos/third_party \
- --python_out=. \
- --grpc_python_out=. \
- --descriptor_set_out=$(basename $<).desc \
- --include_imports \
- --include_source_info \
- $<
-
-clean:
- rm -f $(PROTO_PB2_FILES) $(PROTO_DESC_FILES)
-
-$(PROTOC):
- @echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
- @echo "It looks like you don't have protocol buffer tools installed."
- @echo "To install the protocol buffer toolchain, you can run:"
- @echo " make install-protoc"
- @echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
-
-install-protoc: $(PROTOC)
- @echo "Downloading and installing protocol buffer support."
- @echo "Installation will require sodo priviledges"
- @echo "This will take a few minutes."
- mkdir -p $(PROTOC_BUILD_TMP_DIR)
- @echo "We ask for sudo credentials now so we can install at the end"; \
- sudo echo "Thanks"; \
- cd $(PROTOC_BUILD_TMP_DIR); \
- wget $(PROTOC_DOWNLOAD_URI); \
- tar xzvf $(PROTOC_TARBALL); \
- cd $(PROTOC_DIR); \
- ./configure --prefix=$(PROTOC_PREFIX); \
- make; \
- sudo make install
-
-uninstall-protoc:
- cd $(PROTOC_BUILD_TMP_DIR)/$(PROTOC_DIR); \
- sudo make uninstall
-
diff --git a/voltha/adapters/bbsimolt/protos/__init__.py b/voltha/adapters/bbsimolt/protos/__init__.py
deleted file mode 100644
index b0fb0b2..0000000
--- a/voltha/adapters/bbsimolt/protos/__init__.py
+++ /dev/null
@@ -1,13 +0,0 @@
-# Copyright 2017-present Open Networking Foundation
-#
-# 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.
diff --git a/voltha/adapters/bbsimolt/protos/openolt.proto b/voltha/adapters/bbsimolt/protos/openolt.proto
deleted file mode 100644
index d357334..0000000
--- a/voltha/adapters/bbsimolt/protos/openolt.proto
+++ /dev/null
@@ -1,409 +0,0 @@
-// Copyright (c) 2018 Open Networking Foundation
-//
-// 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.
-
-syntax = "proto3";
-package openolt;
-import "google/api/annotations.proto";
-
-service Openolt {
-
- rpc DisableOlt(Empty) returns (Empty) {
- option (google.api.http) = {
- post: "/v1/Disable"
- body: "*"
- };
- }
-
- rpc ReenableOlt(Empty) returns (Empty) {
- option (google.api.http) = {
- post: "/v1/Reenable"
- body: "*"
- };
- }
-
- rpc ActivateOnu(Onu) returns (Empty) {
- option (google.api.http) = {
- post: "/v1/EnableOnu"
- body: "*"
- };
- }
-
- rpc DeactivateOnu(Onu) returns (Empty) {
- option (google.api.http) = {
- post: "/v1/DisableOnu"
- body: "*"
- };
- }
-
- rpc DeleteOnu(Onu) returns (Empty) {
- option (google.api.http) = {
- post: "/v1/DeleteOnu"
- body: "*"
- };
- }
-
- rpc OmciMsgOut(OmciMsg) returns (Empty) {
- option (google.api.http) = {
- post: "/v1/OmciMsgOut"
- body: "*"
- };
- }
-
- rpc OnuPacketOut(OnuPacket) returns (Empty) {
- option (google.api.http) = {
- post: "/v1/OnuPacketOut"
- body: "*"
- };
- }
-
- rpc UplinkPacketOut(UplinkPacket) returns (Empty) {
- option (google.api.http) = {
- post: "/v1/UplinkPacketOut"
- body: "*"
- };
- }
-
- rpc FlowAdd(Flow) returns (Empty) {
- option (google.api.http) = {
- post: "/v1/FlowAdd"
- body: "*"
- };
- }
-
- rpc FlowRemove(Flow) returns (Empty) {
- option (google.api.http) = {
- post: "/v1/FlowRemove"
- body: "*"
- };
- }
-
- rpc HeartbeatCheck(Empty) returns (Heartbeat) {
- option (google.api.http) = {
- post: "/v1/HeartbeatCheck"
- body: "*"
- };
- }
-
- rpc EnablePonIf(Interface) returns (Empty) {
- option (google.api.http) = {
- post: "/v1/EnablePonIf"
- body: "*"
- };
- }
-
- rpc DisablePonIf(Interface) returns (Empty) {
- option (google.api.http) = {
- post: "/v1/DisablePonIf"
- body: "*"
- };
- }
-
- rpc GetDeviceInfo(Empty) returns (DeviceInfo) {
- option (google.api.http) = {
- post: "/v1/GetDeviceInfo"
- body: "*"
- };
- }
-
- rpc Reboot(Empty) returns (Empty) {
- option (google.api.http) = {
- post: "/v1/Reboot"
- body: "*"
- };
- }
-
- rpc CollectStatistics(Empty) returns (Empty) {
- option (google.api.http) = {
- post: "/v1/CollectStatistics"
- body: "*"
- };
- }
-
- rpc EnableIndication(Empty) returns (stream Indication) {}
-}
-
-message Indication {
- oneof data {
- OltIndication olt_ind = 1;
- IntfIndication intf_ind = 2;
- IntfOperIndication intf_oper_ind = 3;
- OnuDiscIndication onu_disc_ind = 4;
- OnuIndication onu_ind = 5;
- OmciIndication omci_ind = 6;
- PacketIndication pkt_ind = 7;
- PortStatistics port_stats = 8;
- FlowStatistics flow_stats = 9;
- AlarmIndication alarm_ind= 10;
- }
-}
-
-message AlarmIndication {
- oneof data {
- LosIndication los_ind = 1;
- DyingGaspIndication dying_gasp_ind = 2;
- OnuAlarmIndication onu_alarm_ind = 3;
- OnuStartupFailureIndication onu_startup_fail_ind = 4;
- OnuSignalDegradeIndication onu_signal_degrade_ind = 5;
- OnuDriftOfWindowIndication onu_drift_of_window_ind = 6;
- OnuLossOfOmciChannelIndication onu_loss_omci_ind = 7;
- OnuSignalsFailureIndication onu_signals_fail_ind = 8;
- OnuTransmissionInterferenceWarning onu_tiwi_ind = 9;
- OnuActivationFailureIndication onu_activation_fail_ind = 10;
- OnuProcessingErrorIndication onu_processing_error_ind = 11;
- }
-}
-
-message OltIndication {
- string oper_state = 1; // up, down
-}
-
-message IntfIndication {
- fixed32 intf_id = 1;
- string oper_state = 2; // up, down
-}
-
-message OnuDiscIndication {
- fixed32 intf_id = 1;
- SerialNumber serial_number = 2;
-}
-
-message OnuIndication {
- fixed32 intf_id = 1;
- fixed32 onu_id = 2;
- string oper_state = 3; // up, down
- string admin_state = 5; // up, down
- SerialNumber serial_number = 4;
-}
-
-message IntfOperIndication {
- string type = 1; // nni, pon
- fixed32 intf_id = 2;
- string oper_state = 3; // up, down
-}
-
-message OmciIndication {
- fixed32 intf_id = 1;
- fixed32 onu_id = 2;
- bytes pkt = 3;
-}
-
-message PacketIndication {
- string intf_type = 5; // nni, pon, unknown
- fixed32 intf_id = 1;
- fixed32 gemport_id = 2;
- fixed32 flow_id = 3;
- bytes pkt = 4;
-}
-
-message Interface {
- fixed32 intf_id = 1;
-}
-
-message Heartbeat {
- fixed32 heartbeat_signature = 1;
-}
-
-message Onu {
- fixed32 intf_id = 1;
- fixed32 onu_id = 2;
- SerialNumber serial_number = 3;
- fixed32 pir = 4; // peak information rate assigned to onu
- fixed32 alloc_id = 5;
-}
-
-message OmciMsg {
- fixed32 intf_id = 1;
- fixed32 onu_id = 2;
- bytes pkt = 3;
-}
-
-message OnuPacket {
- fixed32 intf_id = 1;
- fixed32 onu_id = 2;
- bytes pkt = 3;
-}
-
-message UplinkPacket {
- fixed32 intf_id = 1;
- bytes pkt = 2;
-}
-
-message DeviceInfo {
- string vendor = 1;
- string model = 2;
- string hardware_version = 3;
- string firmware_version = 4;
- string technology = 5;
- fixed32 onu_id_start = 6;
- fixed32 onu_id_end = 7;
- fixed32 alloc_id_start = 8;
- fixed32 alloc_id_end = 9;
- fixed32 gemport_id_start = 10;
- fixed32 gemport_id_end = 11;
- fixed32 pon_ports = 12;
-}
-
-message Classifier {
- fixed32 o_tpid = 1;
- fixed32 o_vid = 2;
- fixed32 i_tpid = 3;
- fixed32 i_vid = 4;
- fixed32 o_pbits = 5;
- fixed32 i_pbits = 6;
- fixed32 eth_type = 7;
- bytes dst_mac = 8;
- bytes src_mac = 9;
- fixed32 ip_proto = 10;
- fixed32 dst_ip = 11;
- fixed32 src_ip = 12;
- fixed32 src_port = 13;
- fixed32 dst_port = 14;
- string pkt_tag_type = 15; // untagged, single_tag, double_tag
-}
-
-message ActionCmd {
- bool add_outer_tag = 1;
- bool remove_outer_tag = 2;
- bool trap_to_host = 3;
-}
-
-message Action {
- ActionCmd cmd = 1;
- fixed32 o_vid = 2;
- fixed32 o_pbits = 3;
- fixed32 o_tpid = 4;
- fixed32 i_vid = 5;
- fixed32 i_pbits = 6;
- fixed32 i_tpid = 7;
-}
-
-message Flow {
- sfixed32 access_intf_id = 1;
- sfixed32 onu_id = 2;
- fixed32 flow_id = 3;
- string flow_type = 4; // upstream, downstream, broadcast, multicast
- sfixed32 alloc_id = 10;
- sfixed32 network_intf_id = 5;
- sfixed32 gemport_id = 6;
- Classifier classifier = 7;
- Action action = 8;
- sfixed32 priority = 9;
-}
-
-message SerialNumber {
- bytes vendor_id = 1;
- bytes vendor_specific = 2;
-}
-
-message PortStatistics {
- fixed32 intf_id = 1;
- fixed64 rx_bytes = 2;
- fixed64 rx_packets = 3;
- fixed64 rx_ucast_packets = 4;
- fixed64 rx_mcast_packets = 5;
- fixed64 rx_bcast_packets = 6;
- fixed64 rx_error_packets = 7;
- fixed64 tx_bytes = 8;
- fixed64 tx_packets = 9;
- fixed64 tx_ucast_packets = 10;
- fixed64 tx_mcast_packets = 11;
- fixed64 tx_bcast_packets = 12;
- fixed64 tx_error_packets = 13;
- fixed64 rx_crc_errors = 14;
- fixed64 bip_errors = 15;
- fixed32 timestamp = 16;
-}
-
-message FlowStatistics {
- fixed32 flow_id = 1;
- fixed64 rx_bytes = 2;
- fixed64 rx_packets = 3;
- fixed64 tx_bytes = 8;
- fixed64 tx_packets = 9;
- fixed32 timestamp = 16;
-}
-
-message LosIndication {
- fixed32 intf_id = 1;
- string status = 2;
-}
-
-message DyingGaspIndication {
- fixed32 intf_id = 1;
- fixed32 onu_id = 2;
- string status = 3;
-}
-
-message OnuAlarmIndication {
- fixed32 intf_id = 1;
- fixed32 onu_id = 2;
- string los_status = 3;
- string lob_status = 4;
- string lopc_miss_status = 5;
- string lopc_mic_error_status = 6;
-}
-
-message OnuStartupFailureIndication {
- fixed32 intf_id = 1;
- fixed32 onu_id = 2;
- string status = 3;
-}
-
-message OnuSignalDegradeIndication {
- fixed32 intf_id = 1;
- fixed32 onu_id = 2;
- string status = 3;
- fixed32 inverse_bit_error_rate = 4;
-}
-
-message OnuDriftOfWindowIndication {
- fixed32 intf_id = 1;
- fixed32 onu_id = 2;
- string status = 3;
- fixed32 drift = 4;
- fixed32 new_eqd = 5;
-}
-
-message OnuLossOfOmciChannelIndication {
- fixed32 intf_id = 1;
- fixed32 onu_id = 2;
- string status = 3;
-}
-
-message OnuSignalsFailureIndication {
- fixed32 intf_id = 1;
- fixed32 onu_id = 2;
- string status = 3;
- fixed32 inverse_bit_error_rate = 4;
-}
-
-message OnuTransmissionInterferenceWarning {
- fixed32 intf_id = 1;
- fixed32 onu_id = 2;
- string status = 3;
- fixed32 drift = 4;
-}
-
-message OnuActivationFailureIndication {
- fixed32 intf_id = 1;
- fixed32 onu_id = 2;
-}
-
-message OnuProcessingErrorIndication {
- fixed32 intf_id = 1;
- fixed32 onu_id = 2;
-}
-
-
-message Empty {}
diff --git a/voltha/adapters/broadcom_onu/broadcom_onu.py b/voltha/adapters/broadcom_onu/broadcom_onu.py
index 35b2537..992e1b6 100644
--- a/voltha/adapters/broadcom_onu/broadcom_onu.py
+++ b/voltha/adapters/broadcom_onu/broadcom_onu.py
@@ -69,7 +69,7 @@
supported_device_types = [
DeviceType(
id=name,
- vendor_ids=['NONE'],
+ vendor_ids=['NONE', 'BBSM'],
adapter=name,
accepts_bulk_flow_update=True,
accepts_add_remove_flow_updates=True