khenaidoo | d2b6df9 | 2018-12-13 16:37:20 -0500 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2018-present Open Networking Foundation |
| 3 | |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | package adapters |
| 17 | |
| 18 | import ( |
Scott Baker | 555307d | 2019-11-04 08:58:01 -0800 | [diff] [blame] | 19 | ic "github.com/opencord/voltha-protos/v2/go/inter_container" |
| 20 | "github.com/opencord/voltha-protos/v2/go/openflow_13" |
| 21 | "github.com/opencord/voltha-protos/v2/go/voltha" |
khenaidoo | d2b6df9 | 2018-12-13 16:37:20 -0500 | [diff] [blame] | 22 | ) |
| 23 | |
| 24 | //IAdapter represents the set of APIs a voltha adapter has to support. |
| 25 | type IAdapter interface { |
| 26 | Adapter_descriptor() error |
| 27 | Device_types() (*voltha.DeviceTypes, error) |
| 28 | Health() (*voltha.HealthStatus, error) |
| 29 | Adopt_device(device *voltha.Device) error |
| 30 | Reconcile_device(device *voltha.Device) error |
| 31 | Abandon_device(device *voltha.Device) error |
| 32 | Disable_device(device *voltha.Device) error |
| 33 | Reenable_device(device *voltha.Device) error |
| 34 | Reboot_device(device *voltha.Device) error |
| 35 | Self_test_device(device *voltha.Device) error |
khenaidoo | 0a822f9 | 2019-05-08 15:15:57 -0400 | [diff] [blame] | 36 | Delete_device(device *voltha.Device) error |
khenaidoo | d2b6df9 | 2018-12-13 16:37:20 -0500 | [diff] [blame] | 37 | Get_device_details(device *voltha.Device) error |
Manikkaraj k | b1a1092 | 2019-07-29 12:10:34 -0400 | [diff] [blame] | 38 | Update_flows_bulk(device *voltha.Device, flows *voltha.Flows, groups *voltha.FlowGroups, flowMetadata *voltha.FlowMetadata) error |
| 39 | Update_flows_incrementally(device *voltha.Device, flows *openflow_13.FlowChanges, groups *openflow_13.FlowGroupChanges, flowMetadata *voltha.FlowMetadata) error |
khenaidoo | d2b6df9 | 2018-12-13 16:37:20 -0500 | [diff] [blame] | 40 | Update_pm_config(device *voltha.Device, pm_configs *voltha.PmConfigs) error |
manikkaraj k | 6c9689d | 2019-05-09 12:59:52 -0400 | [diff] [blame] | 41 | Receive_packet_out(deviceId string, egress_port_no int, msg *openflow_13.OfpPacketOut) error |
Devmalya Paul | c594bb3 | 2019-11-06 07:34:27 +0000 | [diff] [blame] | 42 | Suppress_event(filter *voltha.EventFilter) error |
| 43 | Unsuppress_event(filter *voltha.EventFilter) error |
khenaidoo | d2b6df9 | 2018-12-13 16:37:20 -0500 | [diff] [blame] | 44 | Get_ofp_device_info(device *voltha.Device) (*ic.SwitchCapability, error) |
| 45 | Get_ofp_port_info(device *voltha.Device, port_no int64) (*ic.PortCapability, error) |
| 46 | Process_inter_adapter_message(msg *ic.InterAdapterMessage) error |
khenaidoo | f5a5bfa | 2019-01-23 22:20:29 -0500 | [diff] [blame] | 47 | Download_image(device *voltha.Device, request *voltha.ImageDownload) (*voltha.ImageDownload, error) |
| 48 | Get_image_download_status(device *voltha.Device, request *voltha.ImageDownload) (*voltha.ImageDownload, error) |
| 49 | Cancel_image_download(device *voltha.Device, request *voltha.ImageDownload) (*voltha.ImageDownload, error) |
| 50 | Activate_image_update(device *voltha.Device, request *voltha.ImageDownload) (*voltha.ImageDownload, error) |
| 51 | Revert_image_update(device *voltha.Device, request *voltha.ImageDownload) (*voltha.ImageDownload, error) |
khenaidoo | d2b6df9 | 2018-12-13 16:37:20 -0500 | [diff] [blame] | 52 | } |