diff --git a/pon/BUILD.bazel b/pon/BUILD.bazel new file mode 100644 index 00000000..292a693b --- /dev/null +++ b/pon/BUILD.bazel @@ -0,0 +1,62 @@ +load("@com_github_grpc_grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library") +load("@com_google_protobuf//bazel:cc_proto_library.bzl", "cc_proto_library") +load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library") +load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") + +#Copyright 2026 Google LLC +# +# 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 +# +# https://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. + +package( + default_visibility = ["//visibility:public"], + licenses = ["notice"], +) + +proto_library( + name = "pon_proto", + srcs = ["pon.proto"], + import_prefix = "github.com/openconfig/gnoi", + deps = [ + "//types:types_proto", + ], +) + +cc_proto_library( + name = "pon_cc_proto", + deps = [":pon_proto"], +) + +cc_grpc_library( + name = "pon_cc_grpc_proto", + srcs = [":pon_proto"], + grpc_only = True, + deps = [":pon_cc_proto"], +) + +go_proto_library( + name = "pon_go_proto", + compilers = [ + "@io_bazel_rules_go//proto:go_grpc_v2", + "@io_bazel_rules_go//proto:go_proto", + ], + importpath = "github.com/openconfig/gnoi/pon", + proto = ":pon_proto", + deps = ["//types"], +) + +go_library( + name = "pon", + embed = [":pon_go_proto"], + importpath = "github.com/openconfig/gnoi/pon", +) diff --git a/pon/pon.pb.go b/pon/pon.pb.go new file mode 100644 index 00000000..ff833b9e --- /dev/null +++ b/pon/pon.pb.go @@ -0,0 +1,1422 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.10 +// protoc v6.33.1 +// source: github.com/openconfig/gnoi/pon/pon.proto + +package pon + +import ( + reflect "reflect" + sync "sync" + unsafe "unsafe" + + types "github.com/openconfig/gnoi/types" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Enum representing the firmware type for download operations. +type FWType int32 + +const ( + FWType_FW_TYPE_UNSPECIFIED FWType = 0 // Unspecified firmware type (invalid) + FWType_FW_TYPE_OLT_FIRMWARE FWType = 1 // OLT firmware + FWType_FW_TYPE_ONU_FIRMWARE FWType = 2 // ONU firmware +) + +// Enum value maps for FWType. +var ( + FWType_name = map[int32]string{ + 0: "FW_TYPE_UNSPECIFIED", + 1: "FW_TYPE_OLT_FIRMWARE", + 2: "FW_TYPE_ONU_FIRMWARE", + } + FWType_value = map[string]int32{ + "FW_TYPE_UNSPECIFIED": 0, + "FW_TYPE_OLT_FIRMWARE": 1, + "FW_TYPE_ONU_FIRMWARE": 2, + } +) + +func (x FWType) Enum() *FWType { + p := new(FWType) + *p = x + return p +} + +func (x FWType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (FWType) Descriptor() protoreflect.EnumDescriptor { + return file_github_com_openconfig_gnoi_pon_pon_proto_enumTypes[0].Descriptor() +} + +func (FWType) Type() protoreflect.EnumType { + return &file_github_com_openconfig_gnoi_pon_pon_proto_enumTypes[0] +} + +func (x FWType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use FWType.Descriptor instead. +func (FWType) EnumDescriptor() ([]byte, []int) { + return file_github_com_openconfig_gnoi_pon_pon_proto_rawDescGZIP(), []int{0} +} + +// Enum representing the device state type for clear operations. +type DeviceStateType int32 + +const ( + DeviceStateType_DEVICE_STATE_UNSPECIFIED DeviceStateType = 0 + DeviceStateType_DEVICE_STATE_LOGS DeviceStateType = 1 // Clear logs + DeviceStateType_DEVICE_STATE_STATISTICS DeviceStateType = 2 // Clear statistics +) + +// Enum value maps for DeviceStateType. +var ( + DeviceStateType_name = map[int32]string{ + 0: "DEVICE_STATE_UNSPECIFIED", + 1: "DEVICE_STATE_LOGS", + 2: "DEVICE_STATE_STATISTICS", + } + DeviceStateType_value = map[string]int32{ + "DEVICE_STATE_UNSPECIFIED": 0, + "DEVICE_STATE_LOGS": 1, + "DEVICE_STATE_STATISTICS": 2, + } +) + +func (x DeviceStateType) Enum() *DeviceStateType { + p := new(DeviceStateType) + *p = x + return p +} + +func (x DeviceStateType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (DeviceStateType) Descriptor() protoreflect.EnumDescriptor { + return file_github_com_openconfig_gnoi_pon_pon_proto_enumTypes[1].Descriptor() +} + +func (DeviceStateType) Type() protoreflect.EnumType { + return &file_github_com_openconfig_gnoi_pon_pon_proto_enumTypes[1] +} + +func (x DeviceStateType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use DeviceStateType.Descriptor instead. +func (DeviceStateType) EnumDescriptor() ([]byte, []int) { + return file_github_com_openconfig_gnoi_pon_pon_proto_rawDescGZIP(), []int{1} +} + +// Enum representing the controller administrative status. +type ControllerAdminStatus int32 + +const ( + ControllerAdminStatus_ADMIN_STATUS_UNSPECIFIED ControllerAdminStatus = 0 + ControllerAdminStatus_ADMIN_STATUS_PAUSE ControllerAdminStatus = 1 // Pause the PON Controller + ControllerAdminStatus_ADMIN_STATUS_START ControllerAdminStatus = 2 // Start the PON Controller +) + +// Enum value maps for ControllerAdminStatus. +var ( + ControllerAdminStatus_name = map[int32]string{ + 0: "ADMIN_STATUS_UNSPECIFIED", + 1: "ADMIN_STATUS_PAUSE", + 2: "ADMIN_STATUS_START", + } + ControllerAdminStatus_value = map[string]int32{ + "ADMIN_STATUS_UNSPECIFIED": 0, + "ADMIN_STATUS_PAUSE": 1, + "ADMIN_STATUS_START": 2, + } +) + +func (x ControllerAdminStatus) Enum() *ControllerAdminStatus { + p := new(ControllerAdminStatus) + *p = x + return p +} + +func (x ControllerAdminStatus) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ControllerAdminStatus) Descriptor() protoreflect.EnumDescriptor { + return file_github_com_openconfig_gnoi_pon_pon_proto_enumTypes[2].Descriptor() +} + +func (ControllerAdminStatus) Type() protoreflect.EnumType { + return &file_github_com_openconfig_gnoi_pon_pon_proto_enumTypes[2] +} + +func (x ControllerAdminStatus) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ControllerAdminStatus.Descriptor instead. +func (ControllerAdminStatus) EnumDescriptor() ([]byte, []int) { + return file_github_com_openconfig_gnoi_pon_pon_proto_rawDescGZIP(), []int{2} +} + +// Common message for streaming file contents to be written on the target +// device. +type PonFilePutRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Types that are valid to be assigned to Request: + // + // *PonFilePutRequest_Filename + // *PonFilePutRequest_Contents + // *PonFilePutRequest_Hash + Request isPonFilePutRequest_Request `protobuf_oneof:"request"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PonFilePutRequest) Reset() { + *x = PonFilePutRequest{} + mi := &file_github_com_openconfig_gnoi_pon_pon_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PonFilePutRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PonFilePutRequest) ProtoMessage() {} + +func (x *PonFilePutRequest) ProtoReflect() protoreflect.Message { + mi := &file_github_com_openconfig_gnoi_pon_pon_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PonFilePutRequest.ProtoReflect.Descriptor instead. +func (*PonFilePutRequest) Descriptor() ([]byte, []int) { + return file_github_com_openconfig_gnoi_pon_pon_proto_rawDescGZIP(), []int{0} +} + +func (x *PonFilePutRequest) GetRequest() isPonFilePutRequest_Request { + if x != nil { + return x.Request + } + return nil +} + +func (x *PonFilePutRequest) GetFilename() string { + if x != nil { + if x, ok := x.Request.(*PonFilePutRequest_Filename); ok { + return x.Filename + } + } + return "" +} + +func (x *PonFilePutRequest) GetContents() []byte { + if x != nil { + if x, ok := x.Request.(*PonFilePutRequest_Contents); ok { + return x.Contents + } + } + return nil +} + +func (x *PonFilePutRequest) GetHash() *types.HashType { + if x != nil { + if x, ok := x.Request.(*PonFilePutRequest_Hash); ok { + return x.Hash + } + } + return nil +} + +type isPonFilePutRequest_Request interface { + isPonFilePutRequest_Request() +} + +type PonFilePutRequest_Filename struct { + // Name of the file to be written on the target device. + Filename string `protobuf:"bytes,1,opt,name=filename,proto3,oneof"` +} + +type PonFilePutRequest_Contents struct { + // Contents of the file to be written, streamed in multiple messages. + Contents []byte `protobuf:"bytes,2,opt,name=contents,proto3,oneof"` +} + +type PonFilePutRequest_Hash struct { + // Hash of the file contents for verification. Also marks end of stream. + Hash *types.HashType `protobuf:"bytes,3,opt,name=hash,proto3,oneof"` +} + +func (*PonFilePutRequest_Filename) isPonFilePutRequest_Request() {} + +func (*PonFilePutRequest_Contents) isPonFilePutRequest_Request() {} + +func (*PonFilePutRequest_Hash) isPonFilePutRequest_Request() {} + +// Request message for FirmwareDownload RPC. +type FirmwareDownloadRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Type of firmware to download (OLT or ONU) + FwType FWType `protobuf:"varint,1,opt,name=fw_type,json=fwType,proto3,enum=gnoi.pon.FWType" json:"fw_type,omitempty"` + // Manufacturer name of the target device + Manufacturer string `protobuf:"bytes,2,opt,name=manufacturer,proto3" json:"manufacturer,omitempty"` + // Firmware version + Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` + // List of target device models the firmware is compatible with + ModelList []string `protobuf:"bytes,4,rep,name=model_list,json=modelList,proto3" json:"model_list,omitempty"` + // Streaming file contents to be written on the target device + FilePutRequest *PonFilePutRequest `protobuf:"bytes,5,opt,name=file_put_request,json=filePutRequest,proto3" json:"file_put_request,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FirmwareDownloadRequest) Reset() { + *x = FirmwareDownloadRequest{} + mi := &file_github_com_openconfig_gnoi_pon_pon_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FirmwareDownloadRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FirmwareDownloadRequest) ProtoMessage() {} + +func (x *FirmwareDownloadRequest) ProtoReflect() protoreflect.Message { + mi := &file_github_com_openconfig_gnoi_pon_pon_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FirmwareDownloadRequest.ProtoReflect.Descriptor instead. +func (*FirmwareDownloadRequest) Descriptor() ([]byte, []int) { + return file_github_com_openconfig_gnoi_pon_pon_proto_rawDescGZIP(), []int{1} +} + +func (x *FirmwareDownloadRequest) GetFwType() FWType { + if x != nil { + return x.FwType + } + return FWType_FW_TYPE_UNSPECIFIED +} + +func (x *FirmwareDownloadRequest) GetManufacturer() string { + if x != nil { + return x.Manufacturer + } + return "" +} + +func (x *FirmwareDownloadRequest) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *FirmwareDownloadRequest) GetModelList() []string { + if x != nil { + return x.ModelList + } + return nil +} + +func (x *FirmwareDownloadRequest) GetFilePutRequest() *PonFilePutRequest { + if x != nil { + return x.FilePutRequest + } + return nil +} + +// Request message for OnuServiceConfigDownload RPC. +type OnuServiceConfigDownloadRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Service config file must always be a JSON file, otherwise the request + // will be rejected. + // Streaming file contents to be written on the target device + FilePutRequest *PonFilePutRequest `protobuf:"bytes,1,opt,name=file_put_request,json=filePutRequest,proto3" json:"file_put_request,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OnuServiceConfigDownloadRequest) Reset() { + *x = OnuServiceConfigDownloadRequest{} + mi := &file_github_com_openconfig_gnoi_pon_pon_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OnuServiceConfigDownloadRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OnuServiceConfigDownloadRequest) ProtoMessage() {} + +func (x *OnuServiceConfigDownloadRequest) ProtoReflect() protoreflect.Message { + mi := &file_github_com_openconfig_gnoi_pon_pon_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OnuServiceConfigDownloadRequest.ProtoReflect.Descriptor instead. +func (*OnuServiceConfigDownloadRequest) Descriptor() ([]byte, []int) { + return file_github_com_openconfig_gnoi_pon_pon_proto_rawDescGZIP(), []int{2} +} + +func (x *OnuServiceConfigDownloadRequest) GetFilePutRequest() *PonFilePutRequest { + if x != nil { + return x.FilePutRequest + } + return nil +} + +// Request message for ControllerClear RPC. +type ControllerClearRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Name identifier for the target PON Controller + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Type of state data to clear (logs, statistics) + DeviceState DeviceStateType `protobuf:"varint,2,opt,name=device_state,json=deviceState,proto3,enum=gnoi.pon.DeviceStateType" json:"device_state,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ControllerClearRequest) Reset() { + *x = ControllerClearRequest{} + mi := &file_github_com_openconfig_gnoi_pon_pon_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ControllerClearRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ControllerClearRequest) ProtoMessage() {} + +func (x *ControllerClearRequest) ProtoReflect() protoreflect.Message { + mi := &file_github_com_openconfig_gnoi_pon_pon_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ControllerClearRequest.ProtoReflect.Descriptor instead. +func (*ControllerClearRequest) Descriptor() ([]byte, []int) { + return file_github_com_openconfig_gnoi_pon_pon_proto_rawDescGZIP(), []int{3} +} + +func (x *ControllerClearRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ControllerClearRequest) GetDeviceState() DeviceStateType { + if x != nil { + return x.DeviceState + } + return DeviceStateType_DEVICE_STATE_UNSPECIFIED +} + +// Request message for ControllerSetStatus RPC. +type ControllerSetStatusRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Name identifier for the target PON Controller + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // PON Controller administrative status + AdminStatus ControllerAdminStatus `protobuf:"varint,2,opt,name=admin_status,json=adminStatus,proto3,enum=gnoi.pon.ControllerAdminStatus" json:"admin_status,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ControllerSetStatusRequest) Reset() { + *x = ControllerSetStatusRequest{} + mi := &file_github_com_openconfig_gnoi_pon_pon_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ControllerSetStatusRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ControllerSetStatusRequest) ProtoMessage() {} + +func (x *ControllerSetStatusRequest) ProtoReflect() protoreflect.Message { + mi := &file_github_com_openconfig_gnoi_pon_pon_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ControllerSetStatusRequest.ProtoReflect.Descriptor instead. +func (*ControllerSetStatusRequest) Descriptor() ([]byte, []int) { + return file_github_com_openconfig_gnoi_pon_pon_proto_rawDescGZIP(), []int{4} +} + +func (x *ControllerSetStatusRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ControllerSetStatusRequest) GetAdminStatus() ControllerAdminStatus { + if x != nil { + return x.AdminStatus + } + return ControllerAdminStatus_ADMIN_STATUS_UNSPECIFIED +} + +// Request message for OltAllowOnuRegistration RPC. +type OltAllowOnuRegistrationRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + OltName string `protobuf:"bytes,1,opt,name=olt_name,json=oltName,proto3" json:"olt_name,omitempty"` // Name identifier for the target OLT device + // ONU identifier: 'ALL' | ONU Serial Number (XGS-PON) | + // ONU MAC Address (EPON) + OnuId string `protobuf:"bytes,2,opt,name=onu_id,json=onuId,proto3" json:"onu_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OltAllowOnuRegistrationRequest) Reset() { + *x = OltAllowOnuRegistrationRequest{} + mi := &file_github_com_openconfig_gnoi_pon_pon_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OltAllowOnuRegistrationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OltAllowOnuRegistrationRequest) ProtoMessage() {} + +func (x *OltAllowOnuRegistrationRequest) ProtoReflect() protoreflect.Message { + mi := &file_github_com_openconfig_gnoi_pon_pon_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OltAllowOnuRegistrationRequest.ProtoReflect.Descriptor instead. +func (*OltAllowOnuRegistrationRequest) Descriptor() ([]byte, []int) { + return file_github_com_openconfig_gnoi_pon_pon_proto_rawDescGZIP(), []int{5} +} + +func (x *OltAllowOnuRegistrationRequest) GetOltName() string { + if x != nil { + return x.OltName + } + return "" +} + +func (x *OltAllowOnuRegistrationRequest) GetOnuId() string { + if x != nil { + return x.OnuId + } + return "" +} + +// Request message for OltClear RPC. +type OltClearRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Name identifier for the target OLT device + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Type of state data to clear (logs, statistics) + DeviceState DeviceStateType `protobuf:"varint,2,opt,name=device_state,json=deviceState,proto3,enum=gnoi.pon.DeviceStateType" json:"device_state,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OltClearRequest) Reset() { + *x = OltClearRequest{} + mi := &file_github_com_openconfig_gnoi_pon_pon_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OltClearRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OltClearRequest) ProtoMessage() {} + +func (x *OltClearRequest) ProtoReflect() protoreflect.Message { + mi := &file_github_com_openconfig_gnoi_pon_pon_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OltClearRequest.ProtoReflect.Descriptor instead. +func (*OltClearRequest) Descriptor() ([]byte, []int) { + return file_github_com_openconfig_gnoi_pon_pon_proto_rawDescGZIP(), []int{6} +} + +func (x *OltClearRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *OltClearRequest) GetDeviceState() DeviceStateType { + if x != nil { + return x.DeviceState + } + return DeviceStateType_DEVICE_STATE_UNSPECIFIED +} + +// Request message for OltDisableOnu RPC. +type OltDisableOnuRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + OltName string `protobuf:"bytes,1,opt,name=olt_name,json=oltName,proto3" json:"olt_name,omitempty"` // Name identifier for the target OLT device + // ONU identifier: Serial Number (XGS-PON) | MAC Address (EPON) + OnuId string `protobuf:"bytes,2,opt,name=onu_id,json=onuId,proto3" json:"onu_id,omitempty"` + Disable bool `protobuf:"varint,3,opt,name=disable,proto3" json:"disable,omitempty"` // true=disable, false=enable the ONU + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OltDisableOnuRequest) Reset() { + *x = OltDisableOnuRequest{} + mi := &file_github_com_openconfig_gnoi_pon_pon_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OltDisableOnuRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OltDisableOnuRequest) ProtoMessage() {} + +func (x *OltDisableOnuRequest) ProtoReflect() protoreflect.Message { + mi := &file_github_com_openconfig_gnoi_pon_pon_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OltDisableOnuRequest.ProtoReflect.Descriptor instead. +func (*OltDisableOnuRequest) Descriptor() ([]byte, []int) { + return file_github_com_openconfig_gnoi_pon_pon_proto_rawDescGZIP(), []int{7} +} + +func (x *OltDisableOnuRequest) GetOltName() string { + if x != nil { + return x.OltName + } + return "" +} + +func (x *OltDisableOnuRequest) GetOnuId() string { + if x != nil { + return x.OnuId + } + return "" +} + +func (x *OltDisableOnuRequest) GetDisable() bool { + if x != nil { + return x.Disable + } + return false +} + +// Request message for OltReset RPC. +type OltResetRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Name identifier for the target OLT device + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OltResetRequest) Reset() { + *x = OltResetRequest{} + mi := &file_github_com_openconfig_gnoi_pon_pon_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OltResetRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OltResetRequest) ProtoMessage() {} + +func (x *OltResetRequest) ProtoReflect() protoreflect.Message { + mi := &file_github_com_openconfig_gnoi_pon_pon_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OltResetRequest.ProtoReflect.Descriptor instead. +func (*OltResetRequest) Descriptor() ([]byte, []int) { + return file_github_com_openconfig_gnoi_pon_pon_proto_rawDescGZIP(), []int{8} +} + +func (x *OltResetRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +// Request message for OnuClearAbortedUpgrade RPC. +type OnuClearAbortedUpgradeRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Name identifier for the target ONU device + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OnuClearAbortedUpgradeRequest) Reset() { + *x = OnuClearAbortedUpgradeRequest{} + mi := &file_github_com_openconfig_gnoi_pon_pon_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OnuClearAbortedUpgradeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OnuClearAbortedUpgradeRequest) ProtoMessage() {} + +func (x *OnuClearAbortedUpgradeRequest) ProtoReflect() protoreflect.Message { + mi := &file_github_com_openconfig_gnoi_pon_pon_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OnuClearAbortedUpgradeRequest.ProtoReflect.Descriptor instead. +func (*OnuClearAbortedUpgradeRequest) Descriptor() ([]byte, []int) { + return file_github_com_openconfig_gnoi_pon_pon_proto_rawDescGZIP(), []int{9} +} + +func (x *OnuClearAbortedUpgradeRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +// Request message for OnuClear RPC. +type OnuClearRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Name identifier for the target ONU device + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Type of state data to clear (logs, statistics) + DeviceState DeviceStateType `protobuf:"varint,2,opt,name=device_state,json=deviceState,proto3,enum=gnoi.pon.DeviceStateType" json:"device_state,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OnuClearRequest) Reset() { + *x = OnuClearRequest{} + mi := &file_github_com_openconfig_gnoi_pon_pon_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OnuClearRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OnuClearRequest) ProtoMessage() {} + +func (x *OnuClearRequest) ProtoReflect() protoreflect.Message { + mi := &file_github_com_openconfig_gnoi_pon_pon_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OnuClearRequest.ProtoReflect.Descriptor instead. +func (*OnuClearRequest) Descriptor() ([]byte, []int) { + return file_github_com_openconfig_gnoi_pon_pon_proto_rawDescGZIP(), []int{10} +} + +func (x *OnuClearRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *OnuClearRequest) GetDeviceState() DeviceStateType { + if x != nil { + return x.DeviceState + } + return DeviceStateType_DEVICE_STATE_UNSPECIFIED +} + +// Request message for OnuReset RPC. +type OnuResetRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Name identifier for the target ONU device + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OnuResetRequest) Reset() { + *x = OnuResetRequest{} + mi := &file_github_com_openconfig_gnoi_pon_pon_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OnuResetRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OnuResetRequest) ProtoMessage() {} + +func (x *OnuResetRequest) ProtoReflect() protoreflect.Message { + mi := &file_github_com_openconfig_gnoi_pon_pon_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OnuResetRequest.ProtoReflect.Descriptor instead. +func (*OnuResetRequest) Descriptor() ([]byte, []int) { + return file_github_com_openconfig_gnoi_pon_pon_proto_rawDescGZIP(), []int{11} +} + +func (x *OnuResetRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +// Request message for OltProtectionArm RPC. +type OltProtectionArmRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Name identifier for the target OLT device + // true=arm (default), false=disarm protection switching + Arm bool `protobuf:"varint,2,opt,name=arm,proto3" json:"arm,omitempty"` + // true=force protection switch, false=normal (default) + ForceSwitch bool `protobuf:"varint,3,opt,name=force_switch,json=forceSwitch,proto3" json:"force_switch,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OltProtectionArmRequest) Reset() { + *x = OltProtectionArmRequest{} + mi := &file_github_com_openconfig_gnoi_pon_pon_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OltProtectionArmRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OltProtectionArmRequest) ProtoMessage() {} + +func (x *OltProtectionArmRequest) ProtoReflect() protoreflect.Message { + mi := &file_github_com_openconfig_gnoi_pon_pon_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OltProtectionArmRequest.ProtoReflect.Descriptor instead. +func (*OltProtectionArmRequest) Descriptor() ([]byte, []int) { + return file_github_com_openconfig_gnoi_pon_pon_proto_rawDescGZIP(), []int{12} +} + +func (x *OltProtectionArmRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *OltProtectionArmRequest) GetArm() bool { + if x != nil { + return x.Arm + } + return false +} + +func (x *OltProtectionArmRequest) GetForceSwitch() bool { + if x != nil { + return x.ForceSwitch + } + return false +} + +// Request message for OltProtectionSwitch RPC. +type OltProtectionSwitchRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Name identifier for the target OLT device + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OltProtectionSwitchRequest) Reset() { + *x = OltProtectionSwitchRequest{} + mi := &file_github_com_openconfig_gnoi_pon_pon_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OltProtectionSwitchRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OltProtectionSwitchRequest) ProtoMessage() {} + +func (x *OltProtectionSwitchRequest) ProtoReflect() protoreflect.Message { + mi := &file_github_com_openconfig_gnoi_pon_pon_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OltProtectionSwitchRequest.ProtoReflect.Descriptor instead. +func (*OltProtectionSwitchRequest) Descriptor() ([]byte, []int) { + return file_github_com_openconfig_gnoi_pon_pon_proto_rawDescGZIP(), []int{13} +} + +func (x *OltProtectionSwitchRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +// Request message for DbManagerDbRestart RPC. +type DbManagerDbRestartRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DbManagerDbRestartRequest) Reset() { + *x = DbManagerDbRestartRequest{} + mi := &file_github_com_openconfig_gnoi_pon_pon_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DbManagerDbRestartRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DbManagerDbRestartRequest) ProtoMessage() {} + +func (x *DbManagerDbRestartRequest) ProtoReflect() protoreflect.Message { + mi := &file_github_com_openconfig_gnoi_pon_pon_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DbManagerDbRestartRequest.ProtoReflect.Descriptor instead. +func (*DbManagerDbRestartRequest) Descriptor() ([]byte, []int) { + return file_github_com_openconfig_gnoi_pon_pon_proto_rawDescGZIP(), []int{14} +} + +// Request message for DbManagerServerStatisticsClear RPC. +type DbManagerServerStatisticsClearRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DbManagerServerStatisticsClearRequest) Reset() { + *x = DbManagerServerStatisticsClearRequest{} + mi := &file_github_com_openconfig_gnoi_pon_pon_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DbManagerServerStatisticsClearRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DbManagerServerStatisticsClearRequest) ProtoMessage() {} + +func (x *DbManagerServerStatisticsClearRequest) ProtoReflect() protoreflect.Message { + mi := &file_github_com_openconfig_gnoi_pon_pon_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DbManagerServerStatisticsClearRequest.ProtoReflect.Descriptor instead. +func (*DbManagerServerStatisticsClearRequest) Descriptor() ([]byte, []int) { + return file_github_com_openconfig_gnoi_pon_pon_proto_rawDescGZIP(), []int{15} +} + +// Request message for DbManagerDbClientStatisticsClear RPC. +type DbManagerDbClientStatisticsClearRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DbManagerDbClientStatisticsClearRequest) Reset() { + *x = DbManagerDbClientStatisticsClearRequest{} + mi := &file_github_com_openconfig_gnoi_pon_pon_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DbManagerDbClientStatisticsClearRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DbManagerDbClientStatisticsClearRequest) ProtoMessage() {} + +func (x *DbManagerDbClientStatisticsClearRequest) ProtoReflect() protoreflect.Message { + mi := &file_github_com_openconfig_gnoi_pon_pon_proto_msgTypes[16] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DbManagerDbClientStatisticsClearRequest.ProtoReflect.Descriptor instead. +func (*DbManagerDbClientStatisticsClearRequest) Descriptor() ([]byte, []int) { + return file_github_com_openconfig_gnoi_pon_pon_proto_rawDescGZIP(), []int{16} +} + +// Common response message for PON RPCs. +type PonResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` // Indicates whether the operation was successful + ErrorMessage string `protobuf:"bytes,2,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"` // Error message if the operation failed + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PonResponse) Reset() { + *x = PonResponse{} + mi := &file_github_com_openconfig_gnoi_pon_pon_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PonResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PonResponse) ProtoMessage() {} + +func (x *PonResponse) ProtoReflect() protoreflect.Message { + mi := &file_github_com_openconfig_gnoi_pon_pon_proto_msgTypes[17] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PonResponse.ProtoReflect.Descriptor instead. +func (*PonResponse) Descriptor() ([]byte, []int) { + return file_github_com_openconfig_gnoi_pon_pon_proto_rawDescGZIP(), []int{17} +} + +func (x *PonResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *PonResponse) GetErrorMessage() string { + if x != nil { + return x.ErrorMessage + } + return "" +} + +// Response message for PON Database Manager RPCs. +// Returns status string and optional error message from the db-manager +// backend. +type DbManagerResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` // Indicates whether the operation was successful + Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` // Status string returned by the db-manager backend + ErrorMessage string `protobuf:"bytes,3,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"` // Error message if the operation failed + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DbManagerResponse) Reset() { + *x = DbManagerResponse{} + mi := &file_github_com_openconfig_gnoi_pon_pon_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DbManagerResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DbManagerResponse) ProtoMessage() {} + +func (x *DbManagerResponse) ProtoReflect() protoreflect.Message { + mi := &file_github_com_openconfig_gnoi_pon_pon_proto_msgTypes[18] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DbManagerResponse.ProtoReflect.Descriptor instead. +func (*DbManagerResponse) Descriptor() ([]byte, []int) { + return file_github_com_openconfig_gnoi_pon_pon_proto_rawDescGZIP(), []int{18} +} + +func (x *DbManagerResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *DbManagerResponse) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +func (x *DbManagerResponse) GetErrorMessage() string { + if x != nil { + return x.ErrorMessage + } + return "" +} + +var File_github_com_openconfig_gnoi_pon_pon_proto protoreflect.FileDescriptor + +const file_github_com_openconfig_gnoi_pon_pon_proto_rawDesc = "" + + "\n" + + "(github.com/openconfig/gnoi/pon/pon.proto\x12\bgnoi.pon\x1a,github.com/openconfig/gnoi/types/types.proto\"\x86\x01\n" + + "\x11PonFilePutRequest\x12\x1c\n" + + "\bfilename\x18\x01 \x01(\tH\x00R\bfilename\x12\x1c\n" + + "\bcontents\x18\x02 \x01(\fH\x00R\bcontents\x12*\n" + + "\x04hash\x18\x03 \x01(\v2\x14.gnoi.types.HashTypeH\x00R\x04hashB\t\n" + + "\arequest\"\xe8\x01\n" + + "\x17FirmwareDownloadRequest\x12)\n" + + "\afw_type\x18\x01 \x01(\x0e2\x10.gnoi.pon.FWTypeR\x06fwType\x12\"\n" + + "\fmanufacturer\x18\x02 \x01(\tR\fmanufacturer\x12\x18\n" + + "\aversion\x18\x03 \x01(\tR\aversion\x12\x1d\n" + + "\n" + + "model_list\x18\x04 \x03(\tR\tmodelList\x12E\n" + + "\x10file_put_request\x18\x05 \x01(\v2\x1b.gnoi.pon.PonFilePutRequestR\x0efilePutRequest\"h\n" + + "\x1fOnuServiceConfigDownloadRequest\x12E\n" + + "\x10file_put_request\x18\x01 \x01(\v2\x1b.gnoi.pon.PonFilePutRequestR\x0efilePutRequest\"j\n" + + "\x16ControllerClearRequest\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12<\n" + + "\fdevice_state\x18\x02 \x01(\x0e2\x19.gnoi.pon.DeviceStateTypeR\vdeviceState\"t\n" + + "\x1aControllerSetStatusRequest\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12B\n" + + "\fadmin_status\x18\x02 \x01(\x0e2\x1f.gnoi.pon.ControllerAdminStatusR\vadminStatus\"R\n" + + "\x1eOltAllowOnuRegistrationRequest\x12\x19\n" + + "\bolt_name\x18\x01 \x01(\tR\aoltName\x12\x15\n" + + "\x06onu_id\x18\x02 \x01(\tR\x05onuId\"c\n" + + "\x0fOltClearRequest\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12<\n" + + "\fdevice_state\x18\x02 \x01(\x0e2\x19.gnoi.pon.DeviceStateTypeR\vdeviceState\"b\n" + + "\x14OltDisableOnuRequest\x12\x19\n" + + "\bolt_name\x18\x01 \x01(\tR\aoltName\x12\x15\n" + + "\x06onu_id\x18\x02 \x01(\tR\x05onuId\x12\x18\n" + + "\adisable\x18\x03 \x01(\bR\adisable\"%\n" + + "\x0fOltResetRequest\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\"3\n" + + "\x1dOnuClearAbortedUpgradeRequest\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\"c\n" + + "\x0fOnuClearRequest\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12<\n" + + "\fdevice_state\x18\x02 \x01(\x0e2\x19.gnoi.pon.DeviceStateTypeR\vdeviceState\"%\n" + + "\x0fOnuResetRequest\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\"b\n" + + "\x17OltProtectionArmRequest\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x10\n" + + "\x03arm\x18\x02 \x01(\bR\x03arm\x12!\n" + + "\fforce_switch\x18\x03 \x01(\bR\vforceSwitch\"0\n" + + "\x1aOltProtectionSwitchRequest\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\"\x1b\n" + + "\x19DbManagerDbRestartRequest\"'\n" + + "%DbManagerServerStatisticsClearRequest\")\n" + + "'DbManagerDbClientStatisticsClearRequest\"L\n" + + "\vPonResponse\x12\x18\n" + + "\asuccess\x18\x01 \x01(\bR\asuccess\x12#\n" + + "\rerror_message\x18\x02 \x01(\tR\ferrorMessage\"j\n" + + "\x11DbManagerResponse\x12\x18\n" + + "\asuccess\x18\x01 \x01(\bR\asuccess\x12\x16\n" + + "\x06status\x18\x02 \x01(\tR\x06status\x12#\n" + + "\rerror_message\x18\x03 \x01(\tR\ferrorMessage*U\n" + + "\x06FWType\x12\x17\n" + + "\x13FW_TYPE_UNSPECIFIED\x10\x00\x12\x18\n" + + "\x14FW_TYPE_OLT_FIRMWARE\x10\x01\x12\x18\n" + + "\x14FW_TYPE_ONU_FIRMWARE\x10\x02*c\n" + + "\x0fDeviceStateType\x12\x1c\n" + + "\x18DEVICE_STATE_UNSPECIFIED\x10\x00\x12\x15\n" + + "\x11DEVICE_STATE_LOGS\x10\x01\x12\x1b\n" + + "\x17DEVICE_STATE_STATISTICS\x10\x02*e\n" + + "\x15ControllerAdminStatus\x12\x1c\n" + + "\x18ADMIN_STATUS_UNSPECIFIED\x10\x00\x12\x16\n" + + "\x12ADMIN_STATUS_PAUSE\x10\x01\x12\x16\n" + + "\x12ADMIN_STATUS_START\x10\x022\xa9\n" + + "\n" + + "\x03Pon\x12J\n" + + "\x0fControllerClear\x12 .gnoi.pon.ControllerClearRequest\x1a\x15.gnoi.pon.PonResponse\x12R\n" + + "\x13ControllerSetStatus\x12$.gnoi.pon.ControllerSetStatusRequest\x1a\x15.gnoi.pon.PonResponse\x12Z\n" + + "\x17OltAllowOnuRegistration\x12(.gnoi.pon.OltAllowOnuRegistrationRequest\x1a\x15.gnoi.pon.PonResponse\x12<\n" + + "\bOltClear\x12\x19.gnoi.pon.OltClearRequest\x1a\x15.gnoi.pon.PonResponse\x12F\n" + + "\rOltDisableOnu\x12\x1e.gnoi.pon.OltDisableOnuRequest\x1a\x15.gnoi.pon.PonResponse\x12<\n" + + "\bOltReset\x12\x19.gnoi.pon.OltResetRequest\x1a\x15.gnoi.pon.PonResponse\x12X\n" + + "\x16OnuClearAbortedUpgrade\x12'.gnoi.pon.OnuClearAbortedUpgradeRequest\x1a\x15.gnoi.pon.PonResponse\x12<\n" + + "\bOnuClear\x12\x19.gnoi.pon.OnuClearRequest\x1a\x15.gnoi.pon.PonResponse\x12<\n" + + "\bOnuReset\x12\x19.gnoi.pon.OnuResetRequest\x1a\x15.gnoi.pon.PonResponse\x12L\n" + + "\x10OltProtectionArm\x12!.gnoi.pon.OltProtectionArmRequest\x1a\x15.gnoi.pon.PonResponse\x12R\n" + + "\x13OltProtectionSwitch\x12$.gnoi.pon.OltProtectionSwitchRequest\x1a\x15.gnoi.pon.PonResponse\x12V\n" + + "\x12DbManagerDbRestart\x12#.gnoi.pon.DbManagerDbRestartRequest\x1a\x1b.gnoi.pon.DbManagerResponse\x12n\n" + + "\x1eDbManagerServerStatisticsClear\x12/.gnoi.pon.DbManagerServerStatisticsClearRequest\x1a\x1b.gnoi.pon.DbManagerResponse\x12r\n" + + " DbManagerDbClientStatisticsClear\x121.gnoi.pon.DbManagerDbClientStatisticsClearRequest\x1a\x1b.gnoi.pon.DbManagerResponse\x12N\n" + + "\x10FirmwareDownload\x12!.gnoi.pon.FirmwareDownloadRequest\x1a\x15.gnoi.pon.PonResponse(\x01\x12^\n" + + "\x18OnuServiceConfigDownload\x12).gnoi.pon.OnuServiceConfigDownloadRequest\x1a\x15.gnoi.pon.PonResponse(\x01B(\xd2>\x050.1.0Z\x1egithub.com/openconfig/gnoi/ponb\x06proto3" + +var ( + file_github_com_openconfig_gnoi_pon_pon_proto_rawDescOnce sync.Once + file_github_com_openconfig_gnoi_pon_pon_proto_rawDescData []byte +) + +func file_github_com_openconfig_gnoi_pon_pon_proto_rawDescGZIP() []byte { + file_github_com_openconfig_gnoi_pon_pon_proto_rawDescOnce.Do(func() { + file_github_com_openconfig_gnoi_pon_pon_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_github_com_openconfig_gnoi_pon_pon_proto_rawDesc), len(file_github_com_openconfig_gnoi_pon_pon_proto_rawDesc))) + }) + return file_github_com_openconfig_gnoi_pon_pon_proto_rawDescData +} + +var file_github_com_openconfig_gnoi_pon_pon_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_github_com_openconfig_gnoi_pon_pon_proto_msgTypes = make([]protoimpl.MessageInfo, 19) +var file_github_com_openconfig_gnoi_pon_pon_proto_goTypes = []any{ + (FWType)(0), // 0: gnoi.pon.FWType + (DeviceStateType)(0), // 1: gnoi.pon.DeviceStateType + (ControllerAdminStatus)(0), // 2: gnoi.pon.ControllerAdminStatus + (*PonFilePutRequest)(nil), // 3: gnoi.pon.PonFilePutRequest + (*FirmwareDownloadRequest)(nil), // 4: gnoi.pon.FirmwareDownloadRequest + (*OnuServiceConfigDownloadRequest)(nil), // 5: gnoi.pon.OnuServiceConfigDownloadRequest + (*ControllerClearRequest)(nil), // 6: gnoi.pon.ControllerClearRequest + (*ControllerSetStatusRequest)(nil), // 7: gnoi.pon.ControllerSetStatusRequest + (*OltAllowOnuRegistrationRequest)(nil), // 8: gnoi.pon.OltAllowOnuRegistrationRequest + (*OltClearRequest)(nil), // 9: gnoi.pon.OltClearRequest + (*OltDisableOnuRequest)(nil), // 10: gnoi.pon.OltDisableOnuRequest + (*OltResetRequest)(nil), // 11: gnoi.pon.OltResetRequest + (*OnuClearAbortedUpgradeRequest)(nil), // 12: gnoi.pon.OnuClearAbortedUpgradeRequest + (*OnuClearRequest)(nil), // 13: gnoi.pon.OnuClearRequest + (*OnuResetRequest)(nil), // 14: gnoi.pon.OnuResetRequest + (*OltProtectionArmRequest)(nil), // 15: gnoi.pon.OltProtectionArmRequest + (*OltProtectionSwitchRequest)(nil), // 16: gnoi.pon.OltProtectionSwitchRequest + (*DbManagerDbRestartRequest)(nil), // 17: gnoi.pon.DbManagerDbRestartRequest + (*DbManagerServerStatisticsClearRequest)(nil), // 18: gnoi.pon.DbManagerServerStatisticsClearRequest + (*DbManagerDbClientStatisticsClearRequest)(nil), // 19: gnoi.pon.DbManagerDbClientStatisticsClearRequest + (*PonResponse)(nil), // 20: gnoi.pon.PonResponse + (*DbManagerResponse)(nil), // 21: gnoi.pon.DbManagerResponse + (*types.HashType)(nil), // 22: gnoi.types.HashType +} +var file_github_com_openconfig_gnoi_pon_pon_proto_depIdxs = []int32{ + 22, // 0: gnoi.pon.PonFilePutRequest.hash:type_name -> gnoi.types.HashType + 0, // 1: gnoi.pon.FirmwareDownloadRequest.fw_type:type_name -> gnoi.pon.FWType + 3, // 2: gnoi.pon.FirmwareDownloadRequest.file_put_request:type_name -> gnoi.pon.PonFilePutRequest + 3, // 3: gnoi.pon.OnuServiceConfigDownloadRequest.file_put_request:type_name -> gnoi.pon.PonFilePutRequest + 1, // 4: gnoi.pon.ControllerClearRequest.device_state:type_name -> gnoi.pon.DeviceStateType + 2, // 5: gnoi.pon.ControllerSetStatusRequest.admin_status:type_name -> gnoi.pon.ControllerAdminStatus + 1, // 6: gnoi.pon.OltClearRequest.device_state:type_name -> gnoi.pon.DeviceStateType + 1, // 7: gnoi.pon.OnuClearRequest.device_state:type_name -> gnoi.pon.DeviceStateType + 6, // 8: gnoi.pon.Pon.ControllerClear:input_type -> gnoi.pon.ControllerClearRequest + 7, // 9: gnoi.pon.Pon.ControllerSetStatus:input_type -> gnoi.pon.ControllerSetStatusRequest + 8, // 10: gnoi.pon.Pon.OltAllowOnuRegistration:input_type -> gnoi.pon.OltAllowOnuRegistrationRequest + 9, // 11: gnoi.pon.Pon.OltClear:input_type -> gnoi.pon.OltClearRequest + 10, // 12: gnoi.pon.Pon.OltDisableOnu:input_type -> gnoi.pon.OltDisableOnuRequest + 11, // 13: gnoi.pon.Pon.OltReset:input_type -> gnoi.pon.OltResetRequest + 12, // 14: gnoi.pon.Pon.OnuClearAbortedUpgrade:input_type -> gnoi.pon.OnuClearAbortedUpgradeRequest + 13, // 15: gnoi.pon.Pon.OnuClear:input_type -> gnoi.pon.OnuClearRequest + 14, // 16: gnoi.pon.Pon.OnuReset:input_type -> gnoi.pon.OnuResetRequest + 15, // 17: gnoi.pon.Pon.OltProtectionArm:input_type -> gnoi.pon.OltProtectionArmRequest + 16, // 18: gnoi.pon.Pon.OltProtectionSwitch:input_type -> gnoi.pon.OltProtectionSwitchRequest + 17, // 19: gnoi.pon.Pon.DbManagerDbRestart:input_type -> gnoi.pon.DbManagerDbRestartRequest + 18, // 20: gnoi.pon.Pon.DbManagerServerStatisticsClear:input_type -> gnoi.pon.DbManagerServerStatisticsClearRequest + 19, // 21: gnoi.pon.Pon.DbManagerDbClientStatisticsClear:input_type -> gnoi.pon.DbManagerDbClientStatisticsClearRequest + 4, // 22: gnoi.pon.Pon.FirmwareDownload:input_type -> gnoi.pon.FirmwareDownloadRequest + 5, // 23: gnoi.pon.Pon.OnuServiceConfigDownload:input_type -> gnoi.pon.OnuServiceConfigDownloadRequest + 20, // 24: gnoi.pon.Pon.ControllerClear:output_type -> gnoi.pon.PonResponse + 20, // 25: gnoi.pon.Pon.ControllerSetStatus:output_type -> gnoi.pon.PonResponse + 20, // 26: gnoi.pon.Pon.OltAllowOnuRegistration:output_type -> gnoi.pon.PonResponse + 20, // 27: gnoi.pon.Pon.OltClear:output_type -> gnoi.pon.PonResponse + 20, // 28: gnoi.pon.Pon.OltDisableOnu:output_type -> gnoi.pon.PonResponse + 20, // 29: gnoi.pon.Pon.OltReset:output_type -> gnoi.pon.PonResponse + 20, // 30: gnoi.pon.Pon.OnuClearAbortedUpgrade:output_type -> gnoi.pon.PonResponse + 20, // 31: gnoi.pon.Pon.OnuClear:output_type -> gnoi.pon.PonResponse + 20, // 32: gnoi.pon.Pon.OnuReset:output_type -> gnoi.pon.PonResponse + 20, // 33: gnoi.pon.Pon.OltProtectionArm:output_type -> gnoi.pon.PonResponse + 20, // 34: gnoi.pon.Pon.OltProtectionSwitch:output_type -> gnoi.pon.PonResponse + 21, // 35: gnoi.pon.Pon.DbManagerDbRestart:output_type -> gnoi.pon.DbManagerResponse + 21, // 36: gnoi.pon.Pon.DbManagerServerStatisticsClear:output_type -> gnoi.pon.DbManagerResponse + 21, // 37: gnoi.pon.Pon.DbManagerDbClientStatisticsClear:output_type -> gnoi.pon.DbManagerResponse + 20, // 38: gnoi.pon.Pon.FirmwareDownload:output_type -> gnoi.pon.PonResponse + 20, // 39: gnoi.pon.Pon.OnuServiceConfigDownload:output_type -> gnoi.pon.PonResponse + 24, // [24:40] is the sub-list for method output_type + 8, // [8:24] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name +} + +func init() { file_github_com_openconfig_gnoi_pon_pon_proto_init() } +func file_github_com_openconfig_gnoi_pon_pon_proto_init() { + if File_github_com_openconfig_gnoi_pon_pon_proto != nil { + return + } + file_github_com_openconfig_gnoi_pon_pon_proto_msgTypes[0].OneofWrappers = []any{ + (*PonFilePutRequest_Filename)(nil), + (*PonFilePutRequest_Contents)(nil), + (*PonFilePutRequest_Hash)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_github_com_openconfig_gnoi_pon_pon_proto_rawDesc), len(file_github_com_openconfig_gnoi_pon_pon_proto_rawDesc)), + NumEnums: 3, + NumMessages: 19, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_github_com_openconfig_gnoi_pon_pon_proto_goTypes, + DependencyIndexes: file_github_com_openconfig_gnoi_pon_pon_proto_depIdxs, + EnumInfos: file_github_com_openconfig_gnoi_pon_pon_proto_enumTypes, + MessageInfos: file_github_com_openconfig_gnoi_pon_pon_proto_msgTypes, + }.Build() + File_github_com_openconfig_gnoi_pon_pon_proto = out.File + file_github_com_openconfig_gnoi_pon_pon_proto_goTypes = nil + file_github_com_openconfig_gnoi_pon_pon_proto_depIdxs = nil +} diff --git a/pon/pon.proto b/pon/pon.proto new file mode 100644 index 00000000..a8d28e3e --- /dev/null +++ b/pon/pon.proto @@ -0,0 +1,253 @@ +// +// Copyright 2024 Google LLC. All Rights Reserved. +// +// 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. +// + +// This Protocol Buffers file defines the PON service in the gnoi.pon +// package. The PON service provides functionality for managing PON +// Controller, OLT, and ONU devices including clear, reset, and status +// operations. + +syntax = "proto3"; + +package gnoi.pon; + +import "github.com/openconfig/gnoi/types/types.proto"; + +option go_package = "github.com/openconfig/gnoi/pon"; + +option (types.gnoi_version) = "0.1.0"; + +// PON service definition. +// This service provides methods for managing PON Controller, OLT, and ONU +// devices. +service Pon { + // Clear state data for a PON Controller from the database. + rpc ControllerClear(ControllerClearRequest) returns (PonResponse); + + // Pause or start the PON Controller. + rpc ControllerSetStatus(ControllerSetStatusRequest) returns (PonResponse); + + // Clear the registration disallowed state for faulty ONUs on an OLT. + rpc OltAllowOnuRegistration(OltAllowOnuRegistrationRequest) + returns (PonResponse); + + // Clear state data for an OLT device from the database. + rpc OltClear(OltClearRequest) returns (PonResponse); + + // Send a disable serial number PLOAM message to the ONT (XGS-PON only). + rpc OltDisableOnu(OltDisableOnuRequest) returns (PonResponse); + + // Reset the OLT device. + rpc OltReset(OltResetRequest) returns (PonResponse); + + // Allow ONU firmware upgrades to continue by clearing the aborted state. + rpc OnuClearAbortedUpgrade(OnuClearAbortedUpgradeRequest) + returns (PonResponse); + + // Clear state data for an ONU device from the database. + rpc OnuClear(OnuClearRequest) returns (PonResponse); + + // Reset the ONU device. + rpc OnuReset(OnuResetRequest) returns (PonResponse); + + // Arm or disarm OLT protection switching. + rpc OltProtectionArm(OltProtectionArmRequest) returns (PonResponse); + + // Perform an OLT protection switch. + rpc OltProtectionSwitch(OltProtectionSwitchRequest) returns (PonResponse); + + // Restart the PON database manager. + rpc DbManagerDbRestart(DbManagerDbRestartRequest) + returns (DbManagerResponse); + + // Clear PON database manager server statistics. + rpc DbManagerServerStatisticsClear(DbManagerServerStatisticsClearRequest) + returns (DbManagerResponse); + + // Clear PON database manager client statistics. + rpc DbManagerDbClientStatisticsClear(DbManagerDbClientStatisticsClearRequest) + returns (DbManagerResponse); + + // Download OLT or ONU firmware to the device. + rpc FirmwareDownload(stream FirmwareDownloadRequest) returns (PonResponse); + + // Download ONU Service Configuration. Service config file must always be + // a JSON file, otherwise the request will be rejected by the server. + rpc OnuServiceConfigDownload(stream OnuServiceConfigDownloadRequest) + returns (PonResponse); +} + +// Enum representing the firmware type for download operations. +enum FWType { + FW_TYPE_UNSPECIFIED = 0; // Unspecified firmware type (invalid) + FW_TYPE_OLT_FIRMWARE = 1; // OLT firmware + FW_TYPE_ONU_FIRMWARE = 2; // ONU firmware +} + +// Common message for streaming file contents to be written on the target +// device. +message PonFilePutRequest { + oneof request { + // Name of the file to be written on the target device. + string filename = 1; + // Contents of the file to be written, streamed in multiple messages. + bytes contents = 2; + // Hash of the file contents for verification. Also marks end of stream. + types.HashType hash = 3; + } +} + +// Request message for FirmwareDownload RPC. +message FirmwareDownloadRequest { + // Type of firmware to download (OLT or ONU) + FWType fw_type = 1; + // Manufacturer name of the target device + string manufacturer = 2; + // Firmware version + string version = 3; + // List of target device models the firmware is compatible with + repeated string model_list = 4; + // Streaming file contents to be written on the target device + PonFilePutRequest file_put_request = 5; +} + +// Request message for OnuServiceConfigDownload RPC. +message OnuServiceConfigDownloadRequest { + // Service config file must always be a JSON file, otherwise the request + // will be rejected. + // Streaming file contents to be written on the target device + PonFilePutRequest file_put_request = 1; +} + +// Enum representing the device state type for clear operations. +enum DeviceStateType { + DEVICE_STATE_UNSPECIFIED = 0; + DEVICE_STATE_LOGS = 1; // Clear logs + DEVICE_STATE_STATISTICS = 2; // Clear statistics +} + +// Enum representing the controller administrative status. +enum ControllerAdminStatus { + ADMIN_STATUS_UNSPECIFIED = 0; + ADMIN_STATUS_PAUSE = 1; // Pause the PON Controller + ADMIN_STATUS_START = 2; // Start the PON Controller +} + +// Request message for ControllerClear RPC. +message ControllerClearRequest { + // Name identifier for the target PON Controller + string name = 1; + // Type of state data to clear (logs, statistics) + DeviceStateType device_state = 2; +} + +// Request message for ControllerSetStatus RPC. +message ControllerSetStatusRequest { + // Name identifier for the target PON Controller + string name = 1; + // PON Controller administrative status + ControllerAdminStatus admin_status = 2; +} + +// Request message for OltAllowOnuRegistration RPC. +message OltAllowOnuRegistrationRequest { + string olt_name = 1; // Name identifier for the target OLT device + // ONU identifier: 'ALL' | ONU Serial Number (XGS-PON) | + // ONU MAC Address (EPON) + string onu_id = 2; +} + +// Request message for OltClear RPC. +message OltClearRequest { + // Name identifier for the target OLT device + string name = 1; + // Type of state data to clear (logs, statistics) + DeviceStateType device_state = 2; +} + +// Request message for OltDisableOnu RPC. +message OltDisableOnuRequest { + string olt_name = 1; // Name identifier for the target OLT device + // ONU identifier: Serial Number (XGS-PON) | MAC Address (EPON) + string onu_id = 2; + bool disable = 3; // true=disable, false=enable the ONU +} + +// Request message for OltReset RPC. +message OltResetRequest { + string name = 1; // Name identifier for the target OLT device +} + +// Request message for OnuClearAbortedUpgrade RPC. +message OnuClearAbortedUpgradeRequest { + string name = 1; // Name identifier for the target ONU device +} + +// Request message for OnuClear RPC. +message OnuClearRequest { + // Name identifier for the target ONU device + string name = 1; + // Type of state data to clear (logs, statistics) + DeviceStateType device_state = 2; +} + +// Request message for OnuReset RPC. +message OnuResetRequest { + string name = 1; // Name identifier for the target ONU device +} + +// Request message for OltProtectionArm RPC. +message OltProtectionArmRequest { + string name = 1; // Name identifier for the target OLT device + // true=arm (default), false=disarm protection switching + bool arm = 2; + // true=force protection switch, false=normal (default) + bool force_switch = 3; +} + +// Request message for OltProtectionSwitch RPC. +message OltProtectionSwitchRequest { + string name = 1; // Name identifier for the target OLT device +} + +// Request message for DbManagerDbRestart RPC. +message DbManagerDbRestartRequest { + // No input fields required +} + +// Request message for DbManagerServerStatisticsClear RPC. +message DbManagerServerStatisticsClearRequest { + // No input fields required +} + +// Request message for DbManagerDbClientStatisticsClear RPC. +message DbManagerDbClientStatisticsClearRequest { + // No input fields required +} + +// Common response message for PON RPCs. +message PonResponse { + bool success = 1; // Indicates whether the operation was successful + string error_message = 2; // Error message if the operation failed +} + +// Response message for PON Database Manager RPCs. +// Returns status string and optional error message from the db-manager +// backend. +message DbManagerResponse { + bool success = 1; // Indicates whether the operation was successful + string status = 2; // Status string returned by the db-manager backend + string error_message = 3; // Error message if the operation failed +} diff --git a/pon/pon_grpc.pb.go b/pon/pon_grpc.pb.go new file mode 100644 index 00000000..870ce5ef --- /dev/null +++ b/pon/pon_grpc.pb.go @@ -0,0 +1,721 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc v6.33.1 +// source: github.com/openconfig/gnoi/pon/pon.proto + +package pon + +import ( + context "context" + + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + Pon_ControllerClear_FullMethodName = "/gnoi.pon.Pon/ControllerClear" + Pon_ControllerSetStatus_FullMethodName = "/gnoi.pon.Pon/ControllerSetStatus" + Pon_OltAllowOnuRegistration_FullMethodName = "/gnoi.pon.Pon/OltAllowOnuRegistration" + Pon_OltClear_FullMethodName = "/gnoi.pon.Pon/OltClear" + Pon_OltDisableOnu_FullMethodName = "/gnoi.pon.Pon/OltDisableOnu" + Pon_OltReset_FullMethodName = "/gnoi.pon.Pon/OltReset" + Pon_OnuClearAbortedUpgrade_FullMethodName = "/gnoi.pon.Pon/OnuClearAbortedUpgrade" + Pon_OnuClear_FullMethodName = "/gnoi.pon.Pon/OnuClear" + Pon_OnuReset_FullMethodName = "/gnoi.pon.Pon/OnuReset" + Pon_OltProtectionArm_FullMethodName = "/gnoi.pon.Pon/OltProtectionArm" + Pon_OltProtectionSwitch_FullMethodName = "/gnoi.pon.Pon/OltProtectionSwitch" + Pon_DbManagerDbRestart_FullMethodName = "/gnoi.pon.Pon/DbManagerDbRestart" + Pon_DbManagerServerStatisticsClear_FullMethodName = "/gnoi.pon.Pon/DbManagerServerStatisticsClear" + Pon_DbManagerDbClientStatisticsClear_FullMethodName = "/gnoi.pon.Pon/DbManagerDbClientStatisticsClear" + Pon_FirmwareDownload_FullMethodName = "/gnoi.pon.Pon/FirmwareDownload" + Pon_OnuServiceConfigDownload_FullMethodName = "/gnoi.pon.Pon/OnuServiceConfigDownload" +) + +// PonClient is the client API for Pon service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// PON service definition. +// This service provides methods for managing PON Controller, OLT, and ONU +// devices. +type PonClient interface { + // Clear state data for a PON Controller from the database. + ControllerClear(ctx context.Context, in *ControllerClearRequest, opts ...grpc.CallOption) (*PonResponse, error) + // Pause or start the PON Controller. + ControllerSetStatus(ctx context.Context, in *ControllerSetStatusRequest, opts ...grpc.CallOption) (*PonResponse, error) + // Clear the registration disallowed state for faulty ONUs on an OLT. + OltAllowOnuRegistration(ctx context.Context, in *OltAllowOnuRegistrationRequest, opts ...grpc.CallOption) (*PonResponse, error) + // Clear state data for an OLT device from the database. + OltClear(ctx context.Context, in *OltClearRequest, opts ...grpc.CallOption) (*PonResponse, error) + // Send a disable serial number PLOAM message to the ONT (XGS-PON only). + OltDisableOnu(ctx context.Context, in *OltDisableOnuRequest, opts ...grpc.CallOption) (*PonResponse, error) + // Reset the OLT device. + OltReset(ctx context.Context, in *OltResetRequest, opts ...grpc.CallOption) (*PonResponse, error) + // Allow ONU firmware upgrades to continue by clearing the aborted state. + OnuClearAbortedUpgrade(ctx context.Context, in *OnuClearAbortedUpgradeRequest, opts ...grpc.CallOption) (*PonResponse, error) + // Clear state data for an ONU device from the database. + OnuClear(ctx context.Context, in *OnuClearRequest, opts ...grpc.CallOption) (*PonResponse, error) + // Reset the ONU device. + OnuReset(ctx context.Context, in *OnuResetRequest, opts ...grpc.CallOption) (*PonResponse, error) + // Arm or disarm OLT protection switching. + OltProtectionArm(ctx context.Context, in *OltProtectionArmRequest, opts ...grpc.CallOption) (*PonResponse, error) + // Perform an OLT protection switch. + OltProtectionSwitch(ctx context.Context, in *OltProtectionSwitchRequest, opts ...grpc.CallOption) (*PonResponse, error) + // Restart the PON database manager. + DbManagerDbRestart(ctx context.Context, in *DbManagerDbRestartRequest, opts ...grpc.CallOption) (*DbManagerResponse, error) + // Clear PON database manager server statistics. + DbManagerServerStatisticsClear(ctx context.Context, in *DbManagerServerStatisticsClearRequest, opts ...grpc.CallOption) (*DbManagerResponse, error) + // Clear PON database manager client statistics. + DbManagerDbClientStatisticsClear(ctx context.Context, in *DbManagerDbClientStatisticsClearRequest, opts ...grpc.CallOption) (*DbManagerResponse, error) + // Download OLT or ONU firmware to the device. + FirmwareDownload(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[FirmwareDownloadRequest, PonResponse], error) + // Download ONU Service Configuration. Service config file must always be + // a JSON file, otherwise the request will be rejected by the server. + OnuServiceConfigDownload(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[OnuServiceConfigDownloadRequest, PonResponse], error) +} + +type ponClient struct { + cc grpc.ClientConnInterface +} + +func NewPonClient(cc grpc.ClientConnInterface) PonClient { + return &ponClient{cc} +} + +func (c *ponClient) ControllerClear(ctx context.Context, in *ControllerClearRequest, opts ...grpc.CallOption) (*PonResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(PonResponse) + err := c.cc.Invoke(ctx, Pon_ControllerClear_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *ponClient) ControllerSetStatus(ctx context.Context, in *ControllerSetStatusRequest, opts ...grpc.CallOption) (*PonResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(PonResponse) + err := c.cc.Invoke(ctx, Pon_ControllerSetStatus_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *ponClient) OltAllowOnuRegistration(ctx context.Context, in *OltAllowOnuRegistrationRequest, opts ...grpc.CallOption) (*PonResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(PonResponse) + err := c.cc.Invoke(ctx, Pon_OltAllowOnuRegistration_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *ponClient) OltClear(ctx context.Context, in *OltClearRequest, opts ...grpc.CallOption) (*PonResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(PonResponse) + err := c.cc.Invoke(ctx, Pon_OltClear_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *ponClient) OltDisableOnu(ctx context.Context, in *OltDisableOnuRequest, opts ...grpc.CallOption) (*PonResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(PonResponse) + err := c.cc.Invoke(ctx, Pon_OltDisableOnu_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *ponClient) OltReset(ctx context.Context, in *OltResetRequest, opts ...grpc.CallOption) (*PonResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(PonResponse) + err := c.cc.Invoke(ctx, Pon_OltReset_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *ponClient) OnuClearAbortedUpgrade(ctx context.Context, in *OnuClearAbortedUpgradeRequest, opts ...grpc.CallOption) (*PonResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(PonResponse) + err := c.cc.Invoke(ctx, Pon_OnuClearAbortedUpgrade_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *ponClient) OnuClear(ctx context.Context, in *OnuClearRequest, opts ...grpc.CallOption) (*PonResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(PonResponse) + err := c.cc.Invoke(ctx, Pon_OnuClear_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *ponClient) OnuReset(ctx context.Context, in *OnuResetRequest, opts ...grpc.CallOption) (*PonResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(PonResponse) + err := c.cc.Invoke(ctx, Pon_OnuReset_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *ponClient) OltProtectionArm(ctx context.Context, in *OltProtectionArmRequest, opts ...grpc.CallOption) (*PonResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(PonResponse) + err := c.cc.Invoke(ctx, Pon_OltProtectionArm_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *ponClient) OltProtectionSwitch(ctx context.Context, in *OltProtectionSwitchRequest, opts ...grpc.CallOption) (*PonResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(PonResponse) + err := c.cc.Invoke(ctx, Pon_OltProtectionSwitch_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *ponClient) DbManagerDbRestart(ctx context.Context, in *DbManagerDbRestartRequest, opts ...grpc.CallOption) (*DbManagerResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(DbManagerResponse) + err := c.cc.Invoke(ctx, Pon_DbManagerDbRestart_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *ponClient) DbManagerServerStatisticsClear(ctx context.Context, in *DbManagerServerStatisticsClearRequest, opts ...grpc.CallOption) (*DbManagerResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(DbManagerResponse) + err := c.cc.Invoke(ctx, Pon_DbManagerServerStatisticsClear_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *ponClient) DbManagerDbClientStatisticsClear(ctx context.Context, in *DbManagerDbClientStatisticsClearRequest, opts ...grpc.CallOption) (*DbManagerResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(DbManagerResponse) + err := c.cc.Invoke(ctx, Pon_DbManagerDbClientStatisticsClear_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *ponClient) FirmwareDownload(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[FirmwareDownloadRequest, PonResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &Pon_ServiceDesc.Streams[0], Pon_FirmwareDownload_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &grpc.GenericClientStream[FirmwareDownloadRequest, PonResponse]{ClientStream: stream} + return x, nil +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type Pon_FirmwareDownloadClient = grpc.ClientStreamingClient[FirmwareDownloadRequest, PonResponse] + +func (c *ponClient) OnuServiceConfigDownload(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[OnuServiceConfigDownloadRequest, PonResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &Pon_ServiceDesc.Streams[1], Pon_OnuServiceConfigDownload_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &grpc.GenericClientStream[OnuServiceConfigDownloadRequest, PonResponse]{ClientStream: stream} + return x, nil +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type Pon_OnuServiceConfigDownloadClient = grpc.ClientStreamingClient[OnuServiceConfigDownloadRequest, PonResponse] + +// PonServer is the server API for Pon service. +// All implementations must embed UnimplementedPonServer +// for forward compatibility. +// +// PON service definition. +// This service provides methods for managing PON Controller, OLT, and ONU +// devices. +type PonServer interface { + // Clear state data for a PON Controller from the database. + ControllerClear(context.Context, *ControllerClearRequest) (*PonResponse, error) + // Pause or start the PON Controller. + ControllerSetStatus(context.Context, *ControllerSetStatusRequest) (*PonResponse, error) + // Clear the registration disallowed state for faulty ONUs on an OLT. + OltAllowOnuRegistration(context.Context, *OltAllowOnuRegistrationRequest) (*PonResponse, error) + // Clear state data for an OLT device from the database. + OltClear(context.Context, *OltClearRequest) (*PonResponse, error) + // Send a disable serial number PLOAM message to the ONT (XGS-PON only). + OltDisableOnu(context.Context, *OltDisableOnuRequest) (*PonResponse, error) + // Reset the OLT device. + OltReset(context.Context, *OltResetRequest) (*PonResponse, error) + // Allow ONU firmware upgrades to continue by clearing the aborted state. + OnuClearAbortedUpgrade(context.Context, *OnuClearAbortedUpgradeRequest) (*PonResponse, error) + // Clear state data for an ONU device from the database. + OnuClear(context.Context, *OnuClearRequest) (*PonResponse, error) + // Reset the ONU device. + OnuReset(context.Context, *OnuResetRequest) (*PonResponse, error) + // Arm or disarm OLT protection switching. + OltProtectionArm(context.Context, *OltProtectionArmRequest) (*PonResponse, error) + // Perform an OLT protection switch. + OltProtectionSwitch(context.Context, *OltProtectionSwitchRequest) (*PonResponse, error) + // Restart the PON database manager. + DbManagerDbRestart(context.Context, *DbManagerDbRestartRequest) (*DbManagerResponse, error) + // Clear PON database manager server statistics. + DbManagerServerStatisticsClear(context.Context, *DbManagerServerStatisticsClearRequest) (*DbManagerResponse, error) + // Clear PON database manager client statistics. + DbManagerDbClientStatisticsClear(context.Context, *DbManagerDbClientStatisticsClearRequest) (*DbManagerResponse, error) + // Download OLT or ONU firmware to the device. + FirmwareDownload(grpc.ClientStreamingServer[FirmwareDownloadRequest, PonResponse]) error + // Download ONU Service Configuration. Service config file must always be + // a JSON file, otherwise the request will be rejected by the server. + OnuServiceConfigDownload(grpc.ClientStreamingServer[OnuServiceConfigDownloadRequest, PonResponse]) error + mustEmbedUnimplementedPonServer() +} + +// UnimplementedPonServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedPonServer struct{} + +func (UnimplementedPonServer) ControllerClear(context.Context, *ControllerClearRequest) (*PonResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ControllerClear not implemented") +} +func (UnimplementedPonServer) ControllerSetStatus(context.Context, *ControllerSetStatusRequest) (*PonResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ControllerSetStatus not implemented") +} +func (UnimplementedPonServer) OltAllowOnuRegistration(context.Context, *OltAllowOnuRegistrationRequest) (*PonResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method OltAllowOnuRegistration not implemented") +} +func (UnimplementedPonServer) OltClear(context.Context, *OltClearRequest) (*PonResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method OltClear not implemented") +} +func (UnimplementedPonServer) OltDisableOnu(context.Context, *OltDisableOnuRequest) (*PonResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method OltDisableOnu not implemented") +} +func (UnimplementedPonServer) OltReset(context.Context, *OltResetRequest) (*PonResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method OltReset not implemented") +} +func (UnimplementedPonServer) OnuClearAbortedUpgrade(context.Context, *OnuClearAbortedUpgradeRequest) (*PonResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method OnuClearAbortedUpgrade not implemented") +} +func (UnimplementedPonServer) OnuClear(context.Context, *OnuClearRequest) (*PonResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method OnuClear not implemented") +} +func (UnimplementedPonServer) OnuReset(context.Context, *OnuResetRequest) (*PonResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method OnuReset not implemented") +} +func (UnimplementedPonServer) OltProtectionArm(context.Context, *OltProtectionArmRequest) (*PonResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method OltProtectionArm not implemented") +} +func (UnimplementedPonServer) OltProtectionSwitch(context.Context, *OltProtectionSwitchRequest) (*PonResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method OltProtectionSwitch not implemented") +} +func (UnimplementedPonServer) DbManagerDbRestart(context.Context, *DbManagerDbRestartRequest) (*DbManagerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DbManagerDbRestart not implemented") +} +func (UnimplementedPonServer) DbManagerServerStatisticsClear(context.Context, *DbManagerServerStatisticsClearRequest) (*DbManagerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DbManagerServerStatisticsClear not implemented") +} +func (UnimplementedPonServer) DbManagerDbClientStatisticsClear(context.Context, *DbManagerDbClientStatisticsClearRequest) (*DbManagerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DbManagerDbClientStatisticsClear not implemented") +} +func (UnimplementedPonServer) FirmwareDownload(grpc.ClientStreamingServer[FirmwareDownloadRequest, PonResponse]) error { + return status.Errorf(codes.Unimplemented, "method FirmwareDownload not implemented") +} +func (UnimplementedPonServer) OnuServiceConfigDownload(grpc.ClientStreamingServer[OnuServiceConfigDownloadRequest, PonResponse]) error { + return status.Errorf(codes.Unimplemented, "method OnuServiceConfigDownload not implemented") +} +func (UnimplementedPonServer) mustEmbedUnimplementedPonServer() {} +func (UnimplementedPonServer) testEmbeddedByValue() {} + +// UnsafePonServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to PonServer will +// result in compilation errors. +type UnsafePonServer interface { + mustEmbedUnimplementedPonServer() +} + +func RegisterPonServer(s grpc.ServiceRegistrar, srv PonServer) { + // If the following call pancis, it indicates UnimplementedPonServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&Pon_ServiceDesc, srv) +} + +func _Pon_ControllerClear_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ControllerClearRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PonServer).ControllerClear(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Pon_ControllerClear_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PonServer).ControllerClear(ctx, req.(*ControllerClearRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Pon_ControllerSetStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ControllerSetStatusRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PonServer).ControllerSetStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Pon_ControllerSetStatus_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PonServer).ControllerSetStatus(ctx, req.(*ControllerSetStatusRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Pon_OltAllowOnuRegistration_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(OltAllowOnuRegistrationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PonServer).OltAllowOnuRegistration(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Pon_OltAllowOnuRegistration_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PonServer).OltAllowOnuRegistration(ctx, req.(*OltAllowOnuRegistrationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Pon_OltClear_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(OltClearRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PonServer).OltClear(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Pon_OltClear_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PonServer).OltClear(ctx, req.(*OltClearRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Pon_OltDisableOnu_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(OltDisableOnuRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PonServer).OltDisableOnu(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Pon_OltDisableOnu_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PonServer).OltDisableOnu(ctx, req.(*OltDisableOnuRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Pon_OltReset_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(OltResetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PonServer).OltReset(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Pon_OltReset_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PonServer).OltReset(ctx, req.(*OltResetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Pon_OnuClearAbortedUpgrade_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(OnuClearAbortedUpgradeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PonServer).OnuClearAbortedUpgrade(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Pon_OnuClearAbortedUpgrade_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PonServer).OnuClearAbortedUpgrade(ctx, req.(*OnuClearAbortedUpgradeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Pon_OnuClear_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(OnuClearRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PonServer).OnuClear(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Pon_OnuClear_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PonServer).OnuClear(ctx, req.(*OnuClearRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Pon_OnuReset_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(OnuResetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PonServer).OnuReset(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Pon_OnuReset_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PonServer).OnuReset(ctx, req.(*OnuResetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Pon_OltProtectionArm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(OltProtectionArmRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PonServer).OltProtectionArm(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Pon_OltProtectionArm_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PonServer).OltProtectionArm(ctx, req.(*OltProtectionArmRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Pon_OltProtectionSwitch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(OltProtectionSwitchRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PonServer).OltProtectionSwitch(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Pon_OltProtectionSwitch_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PonServer).OltProtectionSwitch(ctx, req.(*OltProtectionSwitchRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Pon_DbManagerDbRestart_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DbManagerDbRestartRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PonServer).DbManagerDbRestart(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Pon_DbManagerDbRestart_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PonServer).DbManagerDbRestart(ctx, req.(*DbManagerDbRestartRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Pon_DbManagerServerStatisticsClear_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DbManagerServerStatisticsClearRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PonServer).DbManagerServerStatisticsClear(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Pon_DbManagerServerStatisticsClear_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PonServer).DbManagerServerStatisticsClear(ctx, req.(*DbManagerServerStatisticsClearRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Pon_DbManagerDbClientStatisticsClear_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DbManagerDbClientStatisticsClearRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PonServer).DbManagerDbClientStatisticsClear(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Pon_DbManagerDbClientStatisticsClear_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PonServer).DbManagerDbClientStatisticsClear(ctx, req.(*DbManagerDbClientStatisticsClearRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Pon_FirmwareDownload_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(PonServer).FirmwareDownload(&grpc.GenericServerStream[FirmwareDownloadRequest, PonResponse]{ServerStream: stream}) +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type Pon_FirmwareDownloadServer = grpc.ClientStreamingServer[FirmwareDownloadRequest, PonResponse] + +func _Pon_OnuServiceConfigDownload_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(PonServer).OnuServiceConfigDownload(&grpc.GenericServerStream[OnuServiceConfigDownloadRequest, PonResponse]{ServerStream: stream}) +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type Pon_OnuServiceConfigDownloadServer = grpc.ClientStreamingServer[OnuServiceConfigDownloadRequest, PonResponse] + +// Pon_ServiceDesc is the grpc.ServiceDesc for Pon service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Pon_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "gnoi.pon.Pon", + HandlerType: (*PonServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ControllerClear", + Handler: _Pon_ControllerClear_Handler, + }, + { + MethodName: "ControllerSetStatus", + Handler: _Pon_ControllerSetStatus_Handler, + }, + { + MethodName: "OltAllowOnuRegistration", + Handler: _Pon_OltAllowOnuRegistration_Handler, + }, + { + MethodName: "OltClear", + Handler: _Pon_OltClear_Handler, + }, + { + MethodName: "OltDisableOnu", + Handler: _Pon_OltDisableOnu_Handler, + }, + { + MethodName: "OltReset", + Handler: _Pon_OltReset_Handler, + }, + { + MethodName: "OnuClearAbortedUpgrade", + Handler: _Pon_OnuClearAbortedUpgrade_Handler, + }, + { + MethodName: "OnuClear", + Handler: _Pon_OnuClear_Handler, + }, + { + MethodName: "OnuReset", + Handler: _Pon_OnuReset_Handler, + }, + { + MethodName: "OltProtectionArm", + Handler: _Pon_OltProtectionArm_Handler, + }, + { + MethodName: "OltProtectionSwitch", + Handler: _Pon_OltProtectionSwitch_Handler, + }, + { + MethodName: "DbManagerDbRestart", + Handler: _Pon_DbManagerDbRestart_Handler, + }, + { + MethodName: "DbManagerServerStatisticsClear", + Handler: _Pon_DbManagerServerStatisticsClear_Handler, + }, + { + MethodName: "DbManagerDbClientStatisticsClear", + Handler: _Pon_DbManagerDbClientStatisticsClear_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "FirmwareDownload", + Handler: _Pon_FirmwareDownload_Handler, + ClientStreams: true, + }, + { + StreamName: "OnuServiceConfigDownload", + Handler: _Pon_OnuServiceConfigDownload_Handler, + ClientStreams: true, + }, + }, + Metadata: "github.com/openconfig/gnoi/pon/pon.proto", +} diff --git a/regenerate-files.sh b/regenerate-files.sh index 45d1f7de..6669526d 100755 --- a/regenerate-files.sh +++ b/regenerate-files.sh @@ -48,6 +48,8 @@ bazel build //packet_capture:all copy_generated "packet_capture" "pcap" bazel build //packet_link_qualification:all copy_generated "packet_link_qualification" "linkqual" +bazel build //pon:all +copy_generated "pon" bazel build //software_bundle:all copy_generated "software_bundle" bazel build //system:all