amit.ghosh | 9f6af0e | 2020-11-04 14:09:25 +0100 | [diff] [blame] | 1 | // Copyright (c) 2018 Open Networking Foundation |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at: |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
| 15 | syntax = "proto3"; |
| 16 | |
| 17 | option go_package = "github.com/opencord/voltha-protos/v4/go/extension"; |
| 18 | option java_package = "org.opencord.voltha.extension"; |
| 19 | |
| 20 | package extension; |
| 21 | |
| 22 | import public "voltha_protos/ext_config.proto"; |
| 23 | |
| 24 | message GetDistanceRequest { |
| 25 | string onuDeviceId = 1; |
| 26 | } |
| 27 | |
| 28 | message GetDistanceResponse { |
| 29 | uint32 distance = 1; // distance in meters |
| 30 | } |
| 31 | |
| 32 | message GetOnuUniInfoRequest { |
| 33 | uint32 uniIndex = 1; // Index of the uni starting from 0 |
| 34 | } |
| 35 | |
| 36 | message GetOnuUniInfoResponse { |
| 37 | enum ConfigurationInd { |
| 38 | UNKOWN = 0; |
| 39 | TEN_BASE_T_FDX = 1; |
| 40 | HUNDRED_BASE_T_FDX = 2; |
| 41 | GIGABIT_ETHERNET_FDX = 3; |
| 42 | TEN_G_ETHERNET_FDX = 4; |
| 43 | TEN_BASE_T_HDX = 5; |
| 44 | HUNDRED_BASE_T_HDX = 6; |
| 45 | GIGABIT_ETHERNET_HDX = 7; |
| 46 | } |
| 47 | |
| 48 | enum AdministrativeState { |
| 49 | ADMSTATE_UNDEFINED = 0; |
| 50 | LOCKED = 1; |
| 51 | UNLOCKED = 2; |
| 52 | } |
| 53 | |
| 54 | enum OperationalState { |
| 55 | OPERSTATE_UNDEFINED = 0; |
| 56 | ENABLED = 1; |
| 57 | DISABLED = 2; |
| 58 | } |
| 59 | |
| 60 | AdministrativeState admState = 1; |
| 61 | OperationalState operState = 2; |
| 62 | ConfigurationInd configInd = 3; |
| 63 | } |
| 64 | |
| 65 | message GetValueRequest { |
| 66 | oneof request { |
| 67 | GetDistanceRequest distance = 1; |
| 68 | GetOnuUniInfoRequest uniInfo = 2; |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | message GetValueResponse { |
| 73 | enum Status { |
| 74 | STATUS_UNDEFINED = 0; |
| 75 | OK = 1; |
| 76 | ERROR = 2; |
| 77 | } |
| 78 | |
| 79 | enum ErrorReason { |
| 80 | REASON_UNDEFINED = 0; |
| 81 | UNSUPPORTED = 1; |
| 82 | } |
| 83 | Status status = 1; |
| 84 | ErrorReason errReason = 2; |
| 85 | |
| 86 | oneof response { |
| 87 | GetDistanceResponse distance = 3; |
| 88 | GetOnuUniInfoResponse uniInfo = 4; |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | message SetValueRequest { |
| 93 | oneof request { |
| 94 | config.AlarmConfig alarm_config = 1; |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | message SetValueResponse { |
| 99 | enum Status { |
| 100 | STATUS_UNDEFINED = 0; |
| 101 | OK = 1; |
| 102 | ERROR = 2; |
| 103 | } |
| 104 | |
| 105 | enum ErrorReason { |
| 106 | REASON_UNDEFINED = 0; |
| 107 | UNSUPPORTED = 1; |
| 108 | } |
| 109 | Status status = 1; |
| 110 | ErrorReason errReason = 2; |
| 111 | |
| 112 | // As of now we don't have any explicit response for the supported SetValueRequests |
| 113 | // to be used later |
| 114 | //oneof response { |
| 115 | // |
| 116 | //} |
| 117 | } |
| 118 | |
| 119 | message SingleGetValueRequest { |
| 120 | string targetId = 1; |
| 121 | GetValueRequest request = 2; |
| 122 | } |
| 123 | |
| 124 | message SingleGetValueResponse{ |
| 125 | GetValueResponse response = 1; |
| 126 | } |
| 127 | |
| 128 | message SingleSetValueRequest { |
| 129 | string targetId = 1; |
| 130 | SetValueRequest request = 2; |
| 131 | } |
| 132 | message SingleSetValueResponse { |
| 133 | SetValueResponse response = 1; |
| 134 | } |
| 135 | |
| 136 | // Extension is a service to get and set specific attributes |
| 137 | service Extension { |
| 138 | // Get a single attribute |
| 139 | rpc GetExtValue(SingleGetValueRequest) returns (SingleGetValueResponse); |
| 140 | // Set a single attribute |
| 141 | rpc SetExtValue(SingleSetValueRequest) returns (SingleSetValueResponse); |
| 142 | } |