blob: 849934fac0e1d60d44f229d68059562a6540f757 [file] [log] [blame]
amit.ghosh9f6af0e2020-11-04 14:09:25 +01001// 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
15syntax = "proto3";
16
17option go_package = "github.com/opencord/voltha-protos/v4/go/extension";
18option java_package = "org.opencord.voltha.extension";
19
20package extension;
21
22import public "voltha_protos/ext_config.proto";
kesavand763d8002021-01-04 16:24:42 +053023import "google/protobuf/empty.proto";
amit.ghosh9f6af0e2020-11-04 14:09:25 +010024
25message GetDistanceRequest {
26 string onuDeviceId = 1;
27}
28
29message GetDistanceResponse {
30 uint32 distance = 1; // distance in meters
31}
32
33message GetOnuUniInfoRequest {
34 uint32 uniIndex = 1; // Index of the uni starting from 0
35}
36
37message GetOnuUniInfoResponse {
38 enum ConfigurationInd {
39 UNKOWN = 0;
40 TEN_BASE_T_FDX = 1;
41 HUNDRED_BASE_T_FDX = 2;
42 GIGABIT_ETHERNET_FDX = 3;
43 TEN_G_ETHERNET_FDX = 4;
44 TEN_BASE_T_HDX = 5;
45 HUNDRED_BASE_T_HDX = 6;
46 GIGABIT_ETHERNET_HDX = 7;
47 }
48
49 enum AdministrativeState {
50 ADMSTATE_UNDEFINED = 0;
51 LOCKED = 1;
52 UNLOCKED = 2;
53 }
54
55 enum OperationalState {
56 OPERSTATE_UNDEFINED = 0;
57 ENABLED = 1;
58 DISABLED = 2;
59 }
60
61 AdministrativeState admState = 1;
62 OperationalState operState = 2;
63 ConfigurationInd configInd = 3;
64}
65
kesavand763d8002021-01-04 16:24:42 +053066message GetOltPortCounters {
67 enum PortType {
68 Port_UNKNOWN = 0;
69 Port_ETHERNET_NNI = 1;
70 Port_PON_OLT = 2;
71 }
72 uint32 portNo = 1; // Device-unique port number
73 PortType portType = 2;
74}
75
76message GetOltPortCountersResponse {
77 uint64 txBytes = 1;
78 uint64 rxBytes = 2;
79 uint64 txPackets = 3;
80 uint64 rxPackets = 4;
81 uint64 txErrorPackets = 5;
82 uint64 rxErrorPackets = 6;
83 uint64 txBcastPackets = 7;
84 uint64 rxBcastPackets = 8;
85 uint64 txUcastPackets = 9;
86 uint64 rxUcastPackets = 10;
87 uint64 txMcastPackets = 11;
88 uint64 rxMcastPackets = 12;
89}
90
91message GetOnuPonOpticalInfo {
92 google.protobuf.Empty empty = 1;
93}
94
Girish Gowdrab1d742d2021-05-01 15:34:32 -070095// These values correspond to the Optical Line Supervision Test results
96// described in section A3.39.5 of ITU-T G.988 (11/2017) specification.
kesavand763d8002021-01-04 16:24:42 +053097message GetOnuPonOpticalInfoResponse{
Girish Gowdrab1d742d2021-05-01 15:34:32 -070098 float powerFeedVoltage = 1; // unit of value is voltage
99 float receivedOpticalPower = 2; // unit of value is dBm
100 float meanOpticalLaunchPower = 3; // unit of value is dBm
Girish Gowdrabce9ea72021-05-05 08:47:49 -0700101 float laserBiasCurrent = 4; // unit of value is milli-amphere (mA)
Girish Gowdrab1d742d2021-05-01 15:34:32 -0700102 float temperature = 5; // unit of value is degree celsius
kesavand763d8002021-01-04 16:24:42 +0530103}
104
105message GetOnuEthernetBridgePortHistory {
106 enum Direction {
107 UNDEFINED = 0;
108 UPSTREAM = 1;
109 DOWNSTREAM = 2;
110 }
111 Direction direction = 1;
112}
113
114message GetOnuEthernetBridgePortHistoryResponse {
115 uint32 dropEvents = 1;
116 uint32 octets = 2;
117 uint32 packets= 3;
118 uint32 broadcastPackets = 4;
119 uint32 multicastPackets = 5;
120 uint32 crcErroredPackets = 6;
121 uint32 undersizePackets = 7;
122 uint32 oversizePackets = 8;
123 uint32 packets64octets = 9;
124 uint32 packets65To127octets = 10;
125 uint32 packets128To255Octets = 11;
126 uint32 packets256To511octets = 12;
127 uint32 packets512To1023octets = 13;
128 uint32 packets1024To1518octets = 14;
129}
130
131message GetOnuFecHistory {
132 google.protobuf.Empty empty = 1;
133}
134
135message GetOnuFecHistoryResponse {
136 uint32 correctedBytes = 1;
137 uint32 correctedCodeWords = 2;
138 uint32 fecSeconds = 3;
139 uint32 totalCodeWords = 4;
140 uint32 uncorrectableCodeWords = 5;
141}
142
amit.ghosh9f6af0e2020-11-04 14:09:25 +0100143message GetValueRequest {
144 oneof request {
145 GetDistanceRequest distance = 1;
146 GetOnuUniInfoRequest uniInfo = 2;
kesavand763d8002021-01-04 16:24:42 +0530147 // Corresponds to PmMetricId.PON_PORT_COUNTERS, PmMetricId.NNI_PORT_COUNTERS
148 GetOltPortCounters oltPortInfo = 3;
149 // Corresponds to PmMetricId.PON_OPTICAL
150 GetOnuPonOpticalInfo onuOpticalInfo = 4;
151 // Corresponds to PmMetricId.ETHERNET_BRIDGE_PORT_HISTORY
152 GetOnuEthernetBridgePortHistory ethBridgePort = 5;
153 // Corresponds to PmMetricId.FEC_HISTORY
154 GetOnuFecHistory fecHistory= 6;
amit.ghosh9f6af0e2020-11-04 14:09:25 +0100155 }
156}
157
158message GetValueResponse {
159 enum Status {
160 STATUS_UNDEFINED = 0;
161 OK = 1;
162 ERROR = 2;
163 }
164
165 enum ErrorReason {
166 REASON_UNDEFINED = 0;
167 UNSUPPORTED = 1;
kesavand763d8002021-01-04 16:24:42 +0530168 INVALID_DEVICE_ID = 2;
169 INVALID_PORT_TYPE = 3;
170 TIMEOUT = 4;
171 INVALID_REQ_TYPE = 5;
172 INTERNAL_ERROR = 6;
amit.ghosh9f6af0e2020-11-04 14:09:25 +0100173 }
174 Status status = 1;
175 ErrorReason errReason = 2;
176
177 oneof response {
178 GetDistanceResponse distance = 3;
179 GetOnuUniInfoResponse uniInfo = 4;
kesavand763d8002021-01-04 16:24:42 +0530180 GetOltPortCountersResponse portCoutners = 5;
181 GetOnuPonOpticalInfoResponse onuOpticalInfo = 6;
182 GetOnuEthernetBridgePortHistoryResponse ethBridgePortInfo = 7;
183 GetOnuFecHistoryResponse fecHistory = 8;
amit.ghosh9f6af0e2020-11-04 14:09:25 +0100184 }
185}
186
187message SetValueRequest {
188 oneof request {
189 config.AlarmConfig alarm_config = 1;
190 }
191}
192
193message SetValueResponse {
194 enum Status {
195 STATUS_UNDEFINED = 0;
196 OK = 1;
197 ERROR = 2;
198 }
199
200 enum ErrorReason {
201 REASON_UNDEFINED = 0;
202 UNSUPPORTED = 1;
203 }
204 Status status = 1;
205 ErrorReason errReason = 2;
206
207 // As of now we don't have any explicit response for the supported SetValueRequests
208 // to be used later
209 //oneof response {
210 //
211 //}
212}
213
214message SingleGetValueRequest {
215 string targetId = 1;
216 GetValueRequest request = 2;
217}
218
219message SingleGetValueResponse{
220 GetValueResponse response = 1;
221}
222
223message SingleSetValueRequest {
224 string targetId = 1;
225 SetValueRequest request = 2;
226}
227message SingleSetValueResponse {
228 SetValueResponse response = 1;
229}
230
231// Extension is a service to get and set specific attributes
232service Extension {
233 // Get a single attribute
234 rpc GetExtValue(SingleGetValueRequest) returns (SingleGetValueResponse);
235 // Set a single attribute
236 rpc SetExtValue(SingleSetValueRequest) returns (SingleSetValueResponse);
237}