blob: ce0b7913e742fa69ba748199e9bdbf182d05ca3d [file] [log] [blame]
Scott Baker2c1c4822019-10-16 11:02:41 -07001/*
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 */
16package adapters
17
18import (
Neha Sharma94f16a92020-06-26 04:17:55 +000019 "context"
serkant.uluderyab38671c2019-11-01 09:35:38 -070020 ic "github.com/opencord/voltha-protos/v3/go/inter_container"
21 "github.com/opencord/voltha-protos/v3/go/openflow_13"
22 "github.com/opencord/voltha-protos/v3/go/voltha"
Scott Baker2c1c4822019-10-16 11:02:41 -070023)
24
25//IAdapter represents the set of APIs a voltha adapter has to support.
26type IAdapter interface {
Neha Sharma94f16a92020-06-26 04:17:55 +000027 Adapter_descriptor(ctx context.Context) error
28 Device_types(ctx context.Context) (*voltha.DeviceTypes, error)
29 Health(ctx context.Context) (*voltha.HealthStatus, error)
30 Adopt_device(ctx context.Context, device *voltha.Device) error
31 Reconcile_device(ctx context.Context, device *voltha.Device) error
32 Abandon_device(ctx context.Context, device *voltha.Device) error
33 Disable_device(ctx context.Context, device *voltha.Device) error
34 Reenable_device(ctx context.Context, device *voltha.Device) error
35 Reboot_device(ctx context.Context, device *voltha.Device) error
36 Self_test_device(ctx context.Context, device *voltha.Device) error
37 Delete_device(ctx context.Context, device *voltha.Device) error
38 Get_device_details(ctx context.Context, device *voltha.Device) error
39 Update_flows_bulk(ctx context.Context, device *voltha.Device, flows *voltha.Flows, groups *voltha.FlowGroups, flowMetadata *voltha.FlowMetadata) error
40 Update_flows_incrementally(ctx context.Context, device *voltha.Device, flows *openflow_13.FlowChanges, groups *openflow_13.FlowGroupChanges, flowMetadata *voltha.FlowMetadata) error
41 Update_pm_config(ctx context.Context, device *voltha.Device, pm_configs *voltha.PmConfigs) error
42 Receive_packet_out(ctx context.Context, deviceId string, egress_port_no int, msg *openflow_13.OfpPacketOut) error
43 Suppress_event(ctx context.Context, filter *voltha.EventFilter) error
44 Unsuppress_event(ctx context.Context, filter *voltha.EventFilter) error
45 Get_ofp_device_info(ctx context.Context, device *voltha.Device) (*ic.SwitchCapability, error)
46 Process_inter_adapter_message(ctx context.Context, msg *ic.InterAdapterMessage) error
47 Download_image(ctx context.Context, device *voltha.Device, request *voltha.ImageDownload) (*voltha.ImageDownload, error)
48 Get_image_download_status(ctx context.Context, device *voltha.Device, request *voltha.ImageDownload) (*voltha.ImageDownload, error)
49 Cancel_image_download(ctx context.Context, device *voltha.Device, request *voltha.ImageDownload) (*voltha.ImageDownload, error)
50 Activate_image_update(ctx context.Context, device *voltha.Device, request *voltha.ImageDownload) (*voltha.ImageDownload, error)
51 Revert_image_update(ctx context.Context, device *voltha.Device, request *voltha.ImageDownload) (*voltha.ImageDownload, error)
52 Enable_port(ctx context.Context, deviceId string, port *voltha.Port) error
53 Disable_port(ctx context.Context, deviceId string, port *voltha.Port) error
54 Child_device_lost(ctx context.Context, parentDeviceId string, parentPortNo uint32, onuID uint32) error
55 Start_omci_test(ctx context.Context, device *voltha.Device, request *voltha.OmciTestRequest) (*voltha.TestResponse, error)
56 Get_ext_value(ctx context.Context, deviceId string, device *voltha.Device, valueflag voltha.ValueType_Type) (*voltha.ReturnValues, error)
Scott Baker2c1c4822019-10-16 11:02:41 -070057}