From 9933e786f460e654fefc7f2cde0457d7fec2dba8 Mon Sep 17 00:00:00 2001 From: Marcus Hines Date: Mon, 17 Apr 2023 18:54:52 +0000 Subject: [PATCH] Remove interface service based on no implementations nor no clear use gNMI can set all of these configurations at this point This service no longer is needed Also the reset counters actually breaks many streaming implementations --- compile_protos.sh | 2 +- interface/BUILD.bazel | 52 ---- interface/interface.pb.go | 509 --------------------------------- interface/interface.proto | 68 ----- interface/interface_grpc.pb.go | 183 ------------ 5 files changed, 1 insertion(+), 813 deletions(-) delete mode 100644 interface/BUILD.bazel delete mode 100644 interface/interface.pb.go delete mode 100644 interface/interface.proto delete mode 100644 interface/interface_grpc.pb.go diff --git a/compile_protos.sh b/compile_protos.sh index 936a722a..ddf9a98c 100755 --- a/compile_protos.sh +++ b/compile_protos.sh @@ -4,7 +4,7 @@ set -euo pipefail proto_imports=".:${GOPATH}/src/github.com/google/protobuf/src:${GOPATH}/src/github.com/googleapis/googleapis:${GOPATH}/src:." # Go -for p in types common diag bgp cert factory_reset file healthz interface layer2 mpls system os otdr wavelength_router packet_link_qualification; do +for p in types common diag bgp cert factory_reset file healthz layer2 mpls system os otdr wavelength_router packet_link_qualification; do protoc -I="${proto_imports}" --go-grpc_out=. --go-grpc_opt=paths=source_relative --go_out=. --go_opt=paths=source_relative $p/$p.proto done diff --git a/interface/BUILD.bazel b/interface/BUILD.bazel deleted file mode 100644 index 519ded07..00000000 --- a/interface/BUILD.bazel +++ /dev/null @@ -1,52 +0,0 @@ -load("@rules_proto//proto:defs.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 2021 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. -# -# Supporting infrastructure for implementing and testing PINS. -# -load("@com_github_grpc_grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library") - -package( - default_visibility = ["//visibility:public"], - licenses = ["notice"], -) - -proto_library( - name = "interface_proto", - srcs = ["interface.proto"], - deps = ["//types:types_proto"], -) - -cc_proto_library( - name = "interface_cc_proto", - deps = [":interface_proto"], -) - -cc_grpc_library( - name = "interface_cc_grpc_proto", - srcs = [":interface_proto"], - grpc_only = True, - deps = [":interface_cc_proto"], -) - -go_proto_library( - name = "interface_go_proto", - compilers = ["@io_bazel_rules_go//proto:go_grpc"], - importpath = "github.com/openconfig/gnoi/interface", - proto = ":interface_proto", - deps = ["//types:types_go_proto"], -) diff --git a/interface/interface.pb.go b/interface/interface.pb.go deleted file mode 100644 index 3dafed21..00000000 --- a/interface/interface.pb.go +++ /dev/null @@ -1,509 +0,0 @@ -// -// Copyright 2017 Google Inc. 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. -// - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc v3.21.12 -// source: interface/interface.proto - -package intf - -import ( - types "github.com/openconfig/gnoi/types" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -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) -) - -// SetLoopbackModeRequest requests the provide interface be have its loopback -// mode set to the specified mode. The mode may be vendor specific. For example, -// on a transport device, available modes are "none", "mac", "phy", -// "phy_remote", "framer_facility", and "framer_terminal". -type SetLoopbackModeRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Interface *types.Path `protobuf:"bytes,1,opt,name=interface,proto3" json:"interface,omitempty"` - Mode string `protobuf:"bytes,2,opt,name=mode,proto3" json:"mode,omitempty"` -} - -func (x *SetLoopbackModeRequest) Reset() { - *x = SetLoopbackModeRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_interface_interface_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SetLoopbackModeRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetLoopbackModeRequest) ProtoMessage() {} - -func (x *SetLoopbackModeRequest) ProtoReflect() protoreflect.Message { - mi := &file_interface_interface_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SetLoopbackModeRequest.ProtoReflect.Descriptor instead. -func (*SetLoopbackModeRequest) Descriptor() ([]byte, []int) { - return file_interface_interface_proto_rawDescGZIP(), []int{0} -} - -func (x *SetLoopbackModeRequest) GetInterface() *types.Path { - if x != nil { - return x.Interface - } - return nil -} - -func (x *SetLoopbackModeRequest) GetMode() string { - if x != nil { - return x.Mode - } - return "" -} - -type SetLoopbackModeResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *SetLoopbackModeResponse) Reset() { - *x = SetLoopbackModeResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_interface_interface_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SetLoopbackModeResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetLoopbackModeResponse) ProtoMessage() {} - -func (x *SetLoopbackModeResponse) ProtoReflect() protoreflect.Message { - mi := &file_interface_interface_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SetLoopbackModeResponse.ProtoReflect.Descriptor instead. -func (*SetLoopbackModeResponse) Descriptor() ([]byte, []int) { - return file_interface_interface_proto_rawDescGZIP(), []int{1} -} - -type GetLoopbackModeRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Interface *types.Path `protobuf:"bytes,1,opt,name=interface,proto3" json:"interface,omitempty"` -} - -func (x *GetLoopbackModeRequest) Reset() { - *x = GetLoopbackModeRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_interface_interface_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetLoopbackModeRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetLoopbackModeRequest) ProtoMessage() {} - -func (x *GetLoopbackModeRequest) ProtoReflect() protoreflect.Message { - mi := &file_interface_interface_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetLoopbackModeRequest.ProtoReflect.Descriptor instead. -func (*GetLoopbackModeRequest) Descriptor() ([]byte, []int) { - return file_interface_interface_proto_rawDescGZIP(), []int{2} -} - -func (x *GetLoopbackModeRequest) GetInterface() *types.Path { - if x != nil { - return x.Interface - } - return nil -} - -type GetLoopbackModeResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Mode string `protobuf:"bytes,1,opt,name=mode,proto3" json:"mode,omitempty"` -} - -func (x *GetLoopbackModeResponse) Reset() { - *x = GetLoopbackModeResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_interface_interface_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetLoopbackModeResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetLoopbackModeResponse) ProtoMessage() {} - -func (x *GetLoopbackModeResponse) ProtoReflect() protoreflect.Message { - mi := &file_interface_interface_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetLoopbackModeResponse.ProtoReflect.Descriptor instead. -func (*GetLoopbackModeResponse) Descriptor() ([]byte, []int) { - return file_interface_interface_proto_rawDescGZIP(), []int{3} -} - -func (x *GetLoopbackModeResponse) GetMode() string { - if x != nil { - return x.Mode - } - return "" -} - -type ClearInterfaceCountersRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Interface []*types.Path `protobuf:"bytes,1,rep,name=interface,proto3" json:"interface,omitempty"` -} - -func (x *ClearInterfaceCountersRequest) Reset() { - *x = ClearInterfaceCountersRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_interface_interface_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ClearInterfaceCountersRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ClearInterfaceCountersRequest) ProtoMessage() {} - -func (x *ClearInterfaceCountersRequest) ProtoReflect() protoreflect.Message { - mi := &file_interface_interface_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ClearInterfaceCountersRequest.ProtoReflect.Descriptor instead. -func (*ClearInterfaceCountersRequest) Descriptor() ([]byte, []int) { - return file_interface_interface_proto_rawDescGZIP(), []int{4} -} - -func (x *ClearInterfaceCountersRequest) GetInterface() []*types.Path { - if x != nil { - return x.Interface - } - return nil -} - -type ClearInterfaceCountersResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *ClearInterfaceCountersResponse) Reset() { - *x = ClearInterfaceCountersResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_interface_interface_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ClearInterfaceCountersResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ClearInterfaceCountersResponse) ProtoMessage() {} - -func (x *ClearInterfaceCountersResponse) ProtoReflect() protoreflect.Message { - mi := &file_interface_interface_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ClearInterfaceCountersResponse.ProtoReflect.Descriptor instead. -func (*ClearInterfaceCountersResponse) Descriptor() ([]byte, []int) { - return file_interface_interface_proto_rawDescGZIP(), []int{5} -} - -var File_interface_interface_proto protoreflect.FileDescriptor - -var file_interface_interface_proto_rawDesc = []byte{ - 0x0a, 0x19, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x2f, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x66, 0x61, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x67, 0x6e, 0x6f, - 0x69, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x1a, 0x11, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5c, - 0x0a, 0x16, 0x53, 0x65, 0x74, 0x4c, 0x6f, 0x6f, 0x70, 0x62, 0x61, 0x63, 0x6b, 0x4d, 0x6f, 0x64, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2e, 0x0a, 0x09, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x66, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x6e, - 0x6f, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x52, 0x09, 0x69, - 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x22, 0x19, 0x0a, 0x17, - 0x53, 0x65, 0x74, 0x4c, 0x6f, 0x6f, 0x70, 0x62, 0x61, 0x63, 0x6b, 0x4d, 0x6f, 0x64, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x48, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x4c, 0x6f, - 0x6f, 0x70, 0x62, 0x61, 0x63, 0x6b, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x2e, 0x0a, 0x09, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x52, 0x09, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, - 0x65, 0x22, 0x2d, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x4c, 0x6f, 0x6f, 0x70, 0x62, 0x61, 0x63, 0x6b, - 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, - 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, - 0x22, 0x4f, 0x0a, 0x1d, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, - 0x63, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x2e, 0x0a, 0x09, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x52, 0x09, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, - 0x65, 0x22, 0x20, 0x0a, 0x1e, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, - 0x61, 0x63, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x32, 0xd2, 0x02, 0x0a, 0x09, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, - 0x65, 0x12, 0x64, 0x0a, 0x0f, 0x53, 0x65, 0x74, 0x4c, 0x6f, 0x6f, 0x70, 0x62, 0x61, 0x63, 0x6b, - 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x26, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x66, 0x61, 0x63, 0x65, 0x2e, 0x53, 0x65, 0x74, 0x4c, 0x6f, 0x6f, 0x70, 0x62, 0x61, 0x63, - 0x6b, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x67, - 0x6e, 0x6f, 0x69, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x2e, 0x53, 0x65, - 0x74, 0x4c, 0x6f, 0x6f, 0x70, 0x62, 0x61, 0x63, 0x6b, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x64, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x4c, 0x6f, - 0x6f, 0x70, 0x62, 0x61, 0x63, 0x6b, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x26, 0x2e, 0x67, 0x6e, 0x6f, - 0x69, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x4c, - 0x6f, 0x6f, 0x70, 0x62, 0x61, 0x63, 0x6b, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, - 0x61, 0x63, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x6f, 0x6f, 0x70, 0x62, 0x61, 0x63, 0x6b, 0x4d, - 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x79, 0x0a, - 0x16, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x43, - 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x73, 0x12, 0x2d, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x69, - 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x2e, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x49, 0x6e, - 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x2e, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x49, 0x6e, 0x74, - 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x33, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x2f, 0x67, 0x6e, 0x6f, 0x69, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, - 0x3b, 0x69, 0x6e, 0x74, 0x66, 0xd2, 0x3e, 0x05, 0x30, 0x2e, 0x31, 0x2e, 0x30, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_interface_interface_proto_rawDescOnce sync.Once - file_interface_interface_proto_rawDescData = file_interface_interface_proto_rawDesc -) - -func file_interface_interface_proto_rawDescGZIP() []byte { - file_interface_interface_proto_rawDescOnce.Do(func() { - file_interface_interface_proto_rawDescData = protoimpl.X.CompressGZIP(file_interface_interface_proto_rawDescData) - }) - return file_interface_interface_proto_rawDescData -} - -var file_interface_interface_proto_msgTypes = make([]protoimpl.MessageInfo, 6) -var file_interface_interface_proto_goTypes = []interface{}{ - (*SetLoopbackModeRequest)(nil), // 0: gnoi.interface.SetLoopbackModeRequest - (*SetLoopbackModeResponse)(nil), // 1: gnoi.interface.SetLoopbackModeResponse - (*GetLoopbackModeRequest)(nil), // 2: gnoi.interface.GetLoopbackModeRequest - (*GetLoopbackModeResponse)(nil), // 3: gnoi.interface.GetLoopbackModeResponse - (*ClearInterfaceCountersRequest)(nil), // 4: gnoi.interface.ClearInterfaceCountersRequest - (*ClearInterfaceCountersResponse)(nil), // 5: gnoi.interface.ClearInterfaceCountersResponse - (*types.Path)(nil), // 6: gnoi.types.Path -} -var file_interface_interface_proto_depIdxs = []int32{ - 6, // 0: gnoi.interface.SetLoopbackModeRequest.interface:type_name -> gnoi.types.Path - 6, // 1: gnoi.interface.GetLoopbackModeRequest.interface:type_name -> gnoi.types.Path - 6, // 2: gnoi.interface.ClearInterfaceCountersRequest.interface:type_name -> gnoi.types.Path - 0, // 3: gnoi.interface.Interface.SetLoopbackMode:input_type -> gnoi.interface.SetLoopbackModeRequest - 2, // 4: gnoi.interface.Interface.GetLoopbackMode:input_type -> gnoi.interface.GetLoopbackModeRequest - 4, // 5: gnoi.interface.Interface.ClearInterfaceCounters:input_type -> gnoi.interface.ClearInterfaceCountersRequest - 1, // 6: gnoi.interface.Interface.SetLoopbackMode:output_type -> gnoi.interface.SetLoopbackModeResponse - 3, // 7: gnoi.interface.Interface.GetLoopbackMode:output_type -> gnoi.interface.GetLoopbackModeResponse - 5, // 8: gnoi.interface.Interface.ClearInterfaceCounters:output_type -> gnoi.interface.ClearInterfaceCountersResponse - 6, // [6:9] is the sub-list for method output_type - 3, // [3:6] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name -} - -func init() { file_interface_interface_proto_init() } -func file_interface_interface_proto_init() { - if File_interface_interface_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_interface_interface_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SetLoopbackModeRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_interface_interface_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SetLoopbackModeResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_interface_interface_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetLoopbackModeRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_interface_interface_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetLoopbackModeResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_interface_interface_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ClearInterfaceCountersRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_interface_interface_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ClearInterfaceCountersResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_interface_interface_proto_rawDesc, - NumEnums: 0, - NumMessages: 6, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_interface_interface_proto_goTypes, - DependencyIndexes: file_interface_interface_proto_depIdxs, - MessageInfos: file_interface_interface_proto_msgTypes, - }.Build() - File_interface_interface_proto = out.File - file_interface_interface_proto_rawDesc = nil - file_interface_interface_proto_goTypes = nil - file_interface_interface_proto_depIdxs = nil -} diff --git a/interface/interface.proto b/interface/interface.proto deleted file mode 100644 index 8a84af83..00000000 --- a/interface/interface.proto +++ /dev/null @@ -1,68 +0,0 @@ -// -// Copyright 2017 Google Inc. 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. -// - -syntax = "proto3"; - -package gnoi.interface; - -import "types/types.proto"; - -// Short name is required in order to avoid using a reserved name. -option go_package = "github.com/openconfig/gnoi/interface;intf"; - -option (types.gnoi_version) = "0.1.0"; - -service Interface { - // SetLoopbackMode is used to set the mode of loopback on a interface. - rpc SetLoopbackMode(SetLoopbackModeRequest) - returns (SetLoopbackModeResponse) {} - - // GetLoopbackMode is used to get the mode of loopback on a interface. - rpc GetLoopbackMode(GetLoopbackModeRequest) - returns (GetLoopbackModeResponse) {} - - // ClearInterfaceCounters will reset the counters for the provided interface. - rpc ClearInterfaceCounters(ClearInterfaceCountersRequest) - returns (ClearInterfaceCountersResponse) {} - -} - -// SetLoopbackModeRequest requests the provide interface be have its loopback -// mode set to the specified mode. The mode may be vendor specific. For example, -// on a transport device, available modes are "none", "mac", "phy", -// "phy_remote", "framer_facility", and "framer_terminal". -message SetLoopbackModeRequest { - types.Path interface = 1; - string mode = 2; -} - -message SetLoopbackModeResponse { -} - -message GetLoopbackModeRequest { - types.Path interface = 1; -} - -message GetLoopbackModeResponse { - string mode = 1; -} - -message ClearInterfaceCountersRequest { - repeated types.Path interface = 1; -} - -message ClearInterfaceCountersResponse { -} diff --git a/interface/interface_grpc.pb.go b/interface/interface_grpc.pb.go deleted file mode 100644 index b3f29842..00000000 --- a/interface/interface_grpc.pb.go +++ /dev/null @@ -1,183 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v3.21.12 -// source: interface/interface.proto - -package intf - -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.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -// InterfaceClient is the client API for Interface 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. -type InterfaceClient interface { - // SetLoopbackMode is used to set the mode of loopback on a interface. - SetLoopbackMode(ctx context.Context, in *SetLoopbackModeRequest, opts ...grpc.CallOption) (*SetLoopbackModeResponse, error) - // GetLoopbackMode is used to get the mode of loopback on a interface. - GetLoopbackMode(ctx context.Context, in *GetLoopbackModeRequest, opts ...grpc.CallOption) (*GetLoopbackModeResponse, error) - // ClearInterfaceCounters will reset the counters for the provided interface. - ClearInterfaceCounters(ctx context.Context, in *ClearInterfaceCountersRequest, opts ...grpc.CallOption) (*ClearInterfaceCountersResponse, error) -} - -type interfaceClient struct { - cc grpc.ClientConnInterface -} - -func NewInterfaceClient(cc grpc.ClientConnInterface) InterfaceClient { - return &interfaceClient{cc} -} - -func (c *interfaceClient) SetLoopbackMode(ctx context.Context, in *SetLoopbackModeRequest, opts ...grpc.CallOption) (*SetLoopbackModeResponse, error) { - out := new(SetLoopbackModeResponse) - err := c.cc.Invoke(ctx, "/gnoi.interface.Interface/SetLoopbackMode", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *interfaceClient) GetLoopbackMode(ctx context.Context, in *GetLoopbackModeRequest, opts ...grpc.CallOption) (*GetLoopbackModeResponse, error) { - out := new(GetLoopbackModeResponse) - err := c.cc.Invoke(ctx, "/gnoi.interface.Interface/GetLoopbackMode", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *interfaceClient) ClearInterfaceCounters(ctx context.Context, in *ClearInterfaceCountersRequest, opts ...grpc.CallOption) (*ClearInterfaceCountersResponse, error) { - out := new(ClearInterfaceCountersResponse) - err := c.cc.Invoke(ctx, "/gnoi.interface.Interface/ClearInterfaceCounters", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// InterfaceServer is the server API for Interface service. -// All implementations must embed UnimplementedInterfaceServer -// for forward compatibility -type InterfaceServer interface { - // SetLoopbackMode is used to set the mode of loopback on a interface. - SetLoopbackMode(context.Context, *SetLoopbackModeRequest) (*SetLoopbackModeResponse, error) - // GetLoopbackMode is used to get the mode of loopback on a interface. - GetLoopbackMode(context.Context, *GetLoopbackModeRequest) (*GetLoopbackModeResponse, error) - // ClearInterfaceCounters will reset the counters for the provided interface. - ClearInterfaceCounters(context.Context, *ClearInterfaceCountersRequest) (*ClearInterfaceCountersResponse, error) - mustEmbedUnimplementedInterfaceServer() -} - -// UnimplementedInterfaceServer must be embedded to have forward compatible implementations. -type UnimplementedInterfaceServer struct { -} - -func (UnimplementedInterfaceServer) SetLoopbackMode(context.Context, *SetLoopbackModeRequest) (*SetLoopbackModeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SetLoopbackMode not implemented") -} -func (UnimplementedInterfaceServer) GetLoopbackMode(context.Context, *GetLoopbackModeRequest) (*GetLoopbackModeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetLoopbackMode not implemented") -} -func (UnimplementedInterfaceServer) ClearInterfaceCounters(context.Context, *ClearInterfaceCountersRequest) (*ClearInterfaceCountersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ClearInterfaceCounters not implemented") -} -func (UnimplementedInterfaceServer) mustEmbedUnimplementedInterfaceServer() {} - -// UnsafeInterfaceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to InterfaceServer will -// result in compilation errors. -type UnsafeInterfaceServer interface { - mustEmbedUnimplementedInterfaceServer() -} - -func RegisterInterfaceServer(s grpc.ServiceRegistrar, srv InterfaceServer) { - s.RegisterService(&Interface_ServiceDesc, srv) -} - -func _Interface_SetLoopbackMode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SetLoopbackModeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(InterfaceServer).SetLoopbackMode(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/gnoi.interface.Interface/SetLoopbackMode", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(InterfaceServer).SetLoopbackMode(ctx, req.(*SetLoopbackModeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Interface_GetLoopbackMode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetLoopbackModeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(InterfaceServer).GetLoopbackMode(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/gnoi.interface.Interface/GetLoopbackMode", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(InterfaceServer).GetLoopbackMode(ctx, req.(*GetLoopbackModeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Interface_ClearInterfaceCounters_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ClearInterfaceCountersRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(InterfaceServer).ClearInterfaceCounters(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/gnoi.interface.Interface/ClearInterfaceCounters", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(InterfaceServer).ClearInterfaceCounters(ctx, req.(*ClearInterfaceCountersRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Interface_ServiceDesc is the grpc.ServiceDesc for Interface service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Interface_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "gnoi.interface.Interface", - HandlerType: (*InterfaceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "SetLoopbackMode", - Handler: _Interface_SetLoopbackMode_Handler, - }, - { - MethodName: "GetLoopbackMode", - Handler: _Interface_GetLoopbackMode_Handler, - }, - { - MethodName: "ClearInterfaceCounters", - Handler: _Interface_ClearInterfaceCounters_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "interface/interface.proto", -}