blob: aca4271e427199ef2363e266a71ae87406860a74 [file] [log] [blame]
William Kurkianea869482019-04-09 15:16:11 -04001/*
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 Sharma96b7bf22020-06-15 10:37:32 +000019 "context"
kesavand62126212021-01-12 04:56:06 -050020
21 "github.com/opencord/voltha-protos/v4/go/extension"
Girish Gowdraa09aeab2020-09-14 16:30:52 -070022 ic "github.com/opencord/voltha-protos/v4/go/inter_container"
23 "github.com/opencord/voltha-protos/v4/go/openflow_13"
24 "github.com/opencord/voltha-protos/v4/go/voltha"
William Kurkianea869482019-04-09 15:16:11 -040025)
26
27//IAdapter represents the set of APIs a voltha adapter has to support.
28type IAdapter interface {
Neha Sharma96b7bf22020-06-15 10:37:32 +000029 Adapter_descriptor(ctx context.Context) error
30 Device_types(ctx context.Context) (*voltha.DeviceTypes, error)
31 Health(ctx context.Context) (*voltha.HealthStatus, error)
32 Adopt_device(ctx context.Context, device *voltha.Device) error
33 Reconcile_device(ctx context.Context, device *voltha.Device) error
34 Abandon_device(ctx context.Context, device *voltha.Device) error
35 Disable_device(ctx context.Context, device *voltha.Device) error
36 Reenable_device(ctx context.Context, device *voltha.Device) error
37 Reboot_device(ctx context.Context, device *voltha.Device) error
38 Self_test_device(ctx context.Context, device *voltha.Device) error
39 Delete_device(ctx context.Context, device *voltha.Device) error
40 Get_device_details(ctx context.Context, device *voltha.Device) error
41 Update_flows_bulk(ctx context.Context, device *voltha.Device, flows *voltha.Flows, groups *voltha.FlowGroups, flowMetadata *voltha.FlowMetadata) error
42 Update_flows_incrementally(ctx context.Context, device *voltha.Device, flows *openflow_13.FlowChanges, groups *openflow_13.FlowGroupChanges, flowMetadata *voltha.FlowMetadata) error
43 Update_pm_config(ctx context.Context, device *voltha.Device, pm_configs *voltha.PmConfigs) error
44 Receive_packet_out(ctx context.Context, deviceId string, egress_port_no int, msg *openflow_13.OfpPacketOut) error
45 Suppress_event(ctx context.Context, filter *voltha.EventFilter) error
46 Unsuppress_event(ctx context.Context, filter *voltha.EventFilter) error
47 Get_ofp_device_info(ctx context.Context, device *voltha.Device) (*ic.SwitchCapability, error)
48 Process_inter_adapter_message(ctx context.Context, msg *ic.InterAdapterMessage) error
Girish Gowdra8a0bdcd2021-05-13 12:31:04 -070049 Process_tech_profile_instance_request(ctx context.Context, msg *ic.InterAdapterTechProfileInstanceRequestMessage) *ic.InterAdapterTechProfileDownloadMessage
Neha Sharma96b7bf22020-06-15 10:37:32 +000050 Download_image(ctx context.Context, device *voltha.Device, request *voltha.ImageDownload) (*voltha.ImageDownload, error)
51 Get_image_download_status(ctx context.Context, device *voltha.Device, request *voltha.ImageDownload) (*voltha.ImageDownload, error)
52 Cancel_image_download(ctx context.Context, device *voltha.Device, request *voltha.ImageDownload) (*voltha.ImageDownload, error)
53 Activate_image_update(ctx context.Context, device *voltha.Device, request *voltha.ImageDownload) (*voltha.ImageDownload, error)
54 Revert_image_update(ctx context.Context, device *voltha.Device, request *voltha.ImageDownload) (*voltha.ImageDownload, error)
55 Enable_port(ctx context.Context, deviceId string, port *voltha.Port) error
56 Disable_port(ctx context.Context, deviceId string, port *voltha.Port) error
Girish Gowdraa0870562021-03-11 14:30:14 -080057 Child_device_lost(ctx context.Context, childDevice *voltha.Device) error
Neha Sharma96b7bf22020-06-15 10:37:32 +000058 Start_omci_test(ctx context.Context, device *voltha.Device, request *voltha.OmciTestRequest) (*voltha.TestResponse, error)
59 Get_ext_value(ctx context.Context, deviceId string, device *voltha.Device, valueflag voltha.ValueType_Type) (*voltha.ReturnValues, error)
kesavand62126212021-01-12 04:56:06 -050060 Single_get_value_request(ctx context.Context, request extension.SingleGetValueRequest) (*extension.SingleGetValueResponse, error)
Girish Gowdrac1b9d5e2021-04-22 12:47:44 -070061 Download_onu_image(ctx context.Context, request *voltha.DeviceImageDownloadRequest) (*voltha.DeviceImageResponse, error)
62 Get_onu_image_status(ctx context.Context, in *voltha.DeviceImageRequest) (*voltha.DeviceImageResponse, error)
63 Abort_onu_image_upgrade(ctx context.Context, in *voltha.DeviceImageRequest) (*voltha.DeviceImageResponse, error)
64 Get_onu_images(ctx context.Context, deviceID string) (*voltha.OnuImages, error)
65 Activate_onu_image(ctx context.Context, in *voltha.DeviceImageRequest) (*voltha.DeviceImageResponse, error)
66 Commit_onu_image(ctx context.Context, in *voltha.DeviceImageRequest) (*voltha.DeviceImageResponse, error)
William Kurkianea869482019-04-09 15:16:11 -040067}