blob: cbf380537e625a43ea91d730c62f269ca44b1142 [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
95// The types are from Table 11.2.10-1 in G.988
96message GetOnuPonOpticalInfoResponse{
97 int32 laserBiasCurrent = 1;
98 int32 laserBiasCurrentTypeId = 2;
99 int32 meanOpticalLaunchPower = 3;
100 int32 meanOpticalLaunchPowerTypeId = 4;
101 int32 powerFeedTypeId = 5;
102 int32 powerFeedVoltage = 6;
103 int32 receivedOpticalPower = 7;
104 int32 receivedOpticalPowerTypeId = 8;
105 int32 temperature = 9;
106 int32 temperatureTypeId = 10;
107}
108
109message GetOnuEthernetBridgePortHistory {
110 enum Direction {
111 UNDEFINED = 0;
112 UPSTREAM = 1;
113 DOWNSTREAM = 2;
114 }
115 Direction direction = 1;
116}
117
118message GetOnuEthernetBridgePortHistoryResponse {
119 uint32 dropEvents = 1;
120 uint32 octets = 2;
121 uint32 packets= 3;
122 uint32 broadcastPackets = 4;
123 uint32 multicastPackets = 5;
124 uint32 crcErroredPackets = 6;
125 uint32 undersizePackets = 7;
126 uint32 oversizePackets = 8;
127 uint32 packets64octets = 9;
128 uint32 packets65To127octets = 10;
129 uint32 packets128To255Octets = 11;
130 uint32 packets256To511octets = 12;
131 uint32 packets512To1023octets = 13;
132 uint32 packets1024To1518octets = 14;
133}
134
135message GetOnuFecHistory {
136 google.protobuf.Empty empty = 1;
137}
138
139message GetOnuFecHistoryResponse {
140 uint32 correctedBytes = 1;
141 uint32 correctedCodeWords = 2;
142 uint32 fecSeconds = 3;
143 uint32 totalCodeWords = 4;
144 uint32 uncorrectableCodeWords = 5;
145}
146
amit.ghosh9f6af0e2020-11-04 14:09:25 +0100147message GetValueRequest {
148 oneof request {
149 GetDistanceRequest distance = 1;
150 GetOnuUniInfoRequest uniInfo = 2;
kesavand763d8002021-01-04 16:24:42 +0530151 // Corresponds to PmMetricId.PON_PORT_COUNTERS, PmMetricId.NNI_PORT_COUNTERS
152 GetOltPortCounters oltPortInfo = 3;
153 // Corresponds to PmMetricId.PON_OPTICAL
154 GetOnuPonOpticalInfo onuOpticalInfo = 4;
155 // Corresponds to PmMetricId.ETHERNET_BRIDGE_PORT_HISTORY
156 GetOnuEthernetBridgePortHistory ethBridgePort = 5;
157 // Corresponds to PmMetricId.FEC_HISTORY
158 GetOnuFecHistory fecHistory= 6;
amit.ghosh9f6af0e2020-11-04 14:09:25 +0100159 }
160}
161
162message GetValueResponse {
163 enum Status {
164 STATUS_UNDEFINED = 0;
165 OK = 1;
166 ERROR = 2;
167 }
168
169 enum ErrorReason {
170 REASON_UNDEFINED = 0;
171 UNSUPPORTED = 1;
kesavand763d8002021-01-04 16:24:42 +0530172 INVALID_DEVICE_ID = 2;
173 INVALID_PORT_TYPE = 3;
174 TIMEOUT = 4;
175 INVALID_REQ_TYPE = 5;
176 INTERNAL_ERROR = 6;
amit.ghosh9f6af0e2020-11-04 14:09:25 +0100177 }
178 Status status = 1;
179 ErrorReason errReason = 2;
180
181 oneof response {
182 GetDistanceResponse distance = 3;
183 GetOnuUniInfoResponse uniInfo = 4;
kesavand763d8002021-01-04 16:24:42 +0530184 GetOltPortCountersResponse portCoutners = 5;
185 GetOnuPonOpticalInfoResponse onuOpticalInfo = 6;
186 GetOnuEthernetBridgePortHistoryResponse ethBridgePortInfo = 7;
187 GetOnuFecHistoryResponse fecHistory = 8;
amit.ghosh9f6af0e2020-11-04 14:09:25 +0100188 }
189}
190
191message SetValueRequest {
192 oneof request {
193 config.AlarmConfig alarm_config = 1;
194 }
195}
196
197message SetValueResponse {
198 enum Status {
199 STATUS_UNDEFINED = 0;
200 OK = 1;
201 ERROR = 2;
202 }
203
204 enum ErrorReason {
205 REASON_UNDEFINED = 0;
206 UNSUPPORTED = 1;
207 }
208 Status status = 1;
209 ErrorReason errReason = 2;
210
211 // As of now we don't have any explicit response for the supported SetValueRequests
212 // to be used later
213 //oneof response {
214 //
215 //}
216}
217
218message SingleGetValueRequest {
219 string targetId = 1;
220 GetValueRequest request = 2;
221}
222
223message SingleGetValueResponse{
224 GetValueResponse response = 1;
225}
226
227message SingleSetValueRequest {
228 string targetId = 1;
229 SetValueRequest request = 2;
230}
231message SingleSetValueResponse {
232 SetValueResponse response = 1;
233}
234
235// Extension is a service to get and set specific attributes
236service Extension {
237 // Get a single attribute
238 rpc GetExtValue(SingleGetValueRequest) returns (SingleGetValueResponse);
239 // Set a single attribute
240 rpc SetExtValue(SingleSetValueRequest) returns (SingleSetValueResponse);
241}