blob: 9f05ed9913ef72fd9d16d9c688253ae0a0463cd2 [file] [log] [blame]
Zack Williams52209662019-02-07 10:15:31 -07001syntax = "proto3";
2
khenaidoo5fc5cea2021-08-11 17:39:16 -04003option go_package = "github.com/opencord/voltha-protos/v5/go/voltha";
khenaidoo4c6543e2021-10-19 17:25:58 -04004option java_package = "org.opencord.voltha.device";
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +03005option java_outer_classname = "VolthaDevice";
Zack Williams52209662019-02-07 10:15:31 -07006
khenaidoo4c6543e2021-10-19 17:25:58 -04007package device;
Zack Williams52209662019-02-07 10:15:31 -07008
9import "google/protobuf/any.proto";
khenaidoo5fc5cea2021-08-11 17:39:16 -040010
Zack Williams52209662019-02-07 10:15:31 -070011import "voltha_protos/common.proto";
Zack Williams52209662019-02-07 10:15:31 -070012import "voltha_protos/openflow_13.proto";
Zack Williams52209662019-02-07 10:15:31 -070013
14// A Device Type
15message DeviceType {
16
17 // Unique name for the device type
18 string id = 1;
19
William Kurkian6ea97f82019-03-13 15:51:55 -040020 // Unique vendor id for the device type applicable to ONU
Zack Williams52209662019-02-07 10:15:31 -070021 // 4 bytes of vendor id from ONU serial number
22 string vendor_id = 5;
23
24 repeated string vendor_ids = 6;
25
26 // Name of the adapter that handles device type
khenaidoo5fc5cea2021-08-11 17:39:16 -040027 // Deprecated and replaced by adapterType
Zack Williams52209662019-02-07 10:15:31 -070028 string adapter = 2;
29
William Kurkian6ea97f82019-03-13 15:51:55 -040030 // Capabilities
Zack Williams52209662019-02-07 10:15:31 -070031 bool accepts_bulk_flow_update = 3;
32 bool accepts_add_remove_flow_updates = 4;
33 bool accepts_direct_logical_flows_update = 7;
34
khenaidoo5fc5cea2021-08-11 17:39:16 -040035 // Type of adapter that can handle this device type
36 string adapter_type = 8;
37
Zack Williams52209662019-02-07 10:15:31 -070038}
39
40// A plurality of device types
41message DeviceTypes {
42 repeated DeviceType items = 1;
43}
44
45message PmConfig {
46 enum PmType {
47 COUNTER = 0;
48 GAUGE = 1;
49 STATE = 2;
50 CONTEXT = 3;
51 }
52 string name = 1;
53 PmType type = 2;
54 bool enabled = 3; // Whether or not this metric makes it to Kafka
55 uint32 sample_freq = 4; // Sample rate in 10ths of a second
56}
57
58message PmGroupConfig {
59 string group_name = 1;
60 uint32 group_freq = 2; // Frequency applicable to the grop
61 bool enabled = 3; // Enable/disable group level only
62 repeated PmConfig metrics = 4;
63}
64
65message PmConfigs {
66 string id = 1; // To work around a chameleon POST bug
67 uint32 default_freq = 2; // Default sample rate
68 // Forces group names and group semantics
khenaidoo4c6543e2021-10-19 17:25:58 -040069 bool grouped = 3;
Zack Williams52209662019-02-07 10:15:31 -070070 // Allows Pm to set an individual sample frequency
khenaidoo4c6543e2021-10-19 17:25:58 -040071 bool freq_override = 4;
Zack Williams52209662019-02-07 10:15:31 -070072 repeated PmGroupConfig groups = 5; // The groups if grouped is true
73 repeated PmConfig metrics = 6; // The metrics themselves if grouped is false.
Rohan Agrawal065c8182020-06-29 11:05:32 +000074 uint32 max_skew = 7; //Default value is set to 5 seconds
Zack Williams52209662019-02-07 10:15:31 -070075}
76
Andrea Campanella9e94e8a2021-01-19 15:21:25 +010077//Object representing an image
Zack Williams52209662019-02-07 10:15:31 -070078message Image {
Andrea Campanella9e94e8a2021-01-19 15:21:25 +010079
Zack Williams52209662019-02-07 10:15:31 -070080 string name = 1; // software patch name
Andrea Campanella9e94e8a2021-01-19 15:21:25 +010081
82 // Version, this is the sole identifier of the image. it's the vendor specified OMCI version
83 // must be known at the time of initiating a download, activate, commit image on an onu.
84 string version = 2;
85
86 // hash of the image to be verified against
87 // Deprecated in voltha 2.8, will be removed
88 uint32 hash = 3;
89
90 // Deprecated in voltha 2.8, will be removed
Zack Williams52209662019-02-07 10:15:31 -070091 string install_datetime = 4; // combined date and time expressed in UTC.
Andrea Campanella9e94e8a2021-01-19 15:21:25 +010092 // use ISO 8601 format for date and time
Zack Williams52209662019-02-07 10:15:31 -070093
94 // The active software image is one that is currently loaded and executing
95 // in the ONU or circuit pack. Under normal operation, one software image
96 // is always active while the other is inactive. Under no circumstances are
97 // both software images allowed to be active at the same time
Andrea Campanella9e94e8a2021-01-19 15:21:25 +010098 // Deprecated in voltha 2.8, will be removed
Zack Williams52209662019-02-07 10:15:31 -070099 bool is_active = 5; // True if the image is active
100
101 // The committed software image is loaded and executed upon reboot of the
102 // ONU and/or circuit pack. During normal operation, one software image is
103 // always committed, while the other is uncommitted.
Andrea Campanella9e94e8a2021-01-19 15:21:25 +0100104 // Deprecated in voltha 2.8, will be removed
Zack Williams52209662019-02-07 10:15:31 -0700105 bool is_committed = 6; // True if the image is committed
106
107 // A software image is valid if it has been verified to be an executable
108 // code image. The verification mechanism is not subject to standardization;
109 // however, it should include at least a data integrity (e.g., CRC) check of
110 // the entire code image.
Andrea Campanella9e94e8a2021-01-19 15:21:25 +0100111 // Deprecated in voltha 2.8, will be removed
Zack Williams52209662019-02-07 10:15:31 -0700112 bool is_valid = 7; // True if the image is valid
Andrea Campanella9e94e8a2021-01-19 15:21:25 +0100113
114 // URL where the image is available
115 // URL MUST be fully qualified,
116 // including filename, username and password
117 string url = 8;
118
119 // Represents the vendor/device mfr
120 // Needs to match the vendor of the device the image will be installed on
121 // optional, if not matched no check will be performed
122 string vendor = 9;
123
124 // Represents the ONU Image CRC value.
125 // Default to value 0 if not specified.
126 // If different then 0 it's used to verify the image retrieved from outside before sending it to the ONU.
127 // Calculation of this needs to be done according to ITU-T I.363.5 as per OMCI spec (section A.2.27)
128 uint32 crc32 = 10;
129
130 //TODO augment with RecommendedWindowsSize, Timeout and other valuable attributes.
131
Zack Williams52209662019-02-07 10:15:31 -0700132}
133
Andrea Campanella9e94e8a2021-01-19 15:21:25 +0100134// Older version of the API please see DeviceImageDownloadRequest
135// Deprecated in voltha 2.8, will be removed
Zack Williams52209662019-02-07 10:15:31 -0700136message ImageDownload {
khenaidoo4c6543e2021-10-19 17:25:58 -0400137 option deprecated = true;
Zack Williams52209662019-02-07 10:15:31 -0700138 enum ImageDownloadState {
139 DOWNLOAD_UNKNOWN = 0;
140 DOWNLOAD_SUCCEEDED = 1;
141 DOWNLOAD_REQUESTED = 2;
142 DOWNLOAD_STARTED = 3;
143 DOWNLOAD_FAILED = 4;
144 DOWNLOAD_UNSUPPORTED = 5;
145 DOWNLOAD_CANCELLED = 6;
146 }
147
148 enum ImageDownloadFailureReason {
149 NO_ERROR = 0;
150 INVALID_URL = 1;
151 DEVICE_BUSY = 2;
152 INSUFFICIENT_SPACE = 3;
153 UNKNOWN_ERROR = 4;
154 CANCELLED = 5;
155 }
156
157 enum ImageActivateState {
158 IMAGE_UNKNOWN = 0;
159 IMAGE_INACTIVE = 1;
William Kurkian6ea97f82019-03-13 15:51:55 -0400160 IMAGE_ACTIVATING = 2;
Zack Williams52209662019-02-07 10:15:31 -0700161 IMAGE_ACTIVE = 3;
William Kurkian6ea97f82019-03-13 15:51:55 -0400162 IMAGE_REVERTING = 4;
163 IMAGE_REVERTED = 5;
Zack Williams52209662019-02-07 10:15:31 -0700164 }
165
166 // Device Identifier
167 string id = 1;
168
169 // Image unique identifier
170 string name = 2;
171
172 // URL where the image is available
173 // should include username password
174 string url = 3;
175
176 // CRC of the image to be verified aginst
177 uint32 crc = 4;
178
179 // Download state
180 ImageDownloadState download_state = 5;
181
182 // Downloaded version
183 string image_version = 6;
184
185 // Bytes downloaded
186 uint32 downloaded_bytes = 7;
187
188 // Download failure reason
189 ImageDownloadFailureReason reason= 8;
190
191 // Additional info
192 string additional_info = 9;
193
194 // Save current configuration
195 bool save_config = 10;
196
197 // Image local location
198 string local_dir = 11;
199
200 // Image activation state
201 ImageActivateState image_state = 12;
Kent Hagerman66e56b42020-07-09 14:30:23 -0400202
Zack Williams52209662019-02-07 10:15:31 -0700203 // Image file size
204 uint32 file_size = 13;
205}
206
Andrea Campanella9e94e8a2021-01-19 15:21:25 +0100207// Deprecated in voltha 2.8, will be removed
Zack Williams52209662019-02-07 10:15:31 -0700208message ImageDownloads {
khenaidoo4c6543e2021-10-19 17:25:58 -0400209 option deprecated = true;
Zack Williams52209662019-02-07 10:15:31 -0700210 repeated ImageDownload items = 2;
211}
212
Andrea Campanella9e94e8a2021-01-19 15:21:25 +0100213message Images {
214 repeated Image image = 1;
215}
216
217// OnuImage represents the OMCI information as per OMCI spec
218// the information will be populates exactly as extracted from the device.
219message OnuImage {
220 //image version
221 string version = 1;
222 bool isCommited = 2;
223 bool isActive = 3;
224 bool isValid = 4;
225 string productCode = 5;
226 // Hash is computed by the ONU and is optional as per OMCI spec (paragraph 9.1.4)
227 // No assumption should be made on the existence of this attribute at any time.
228 string hash = 6;
229}
230
231message OnuImages {
232 repeated OnuImage items = 1;
233}
234
235message DeviceImageState {
236 string device_id = 1;
237 ImageState imageState = 2;
238}
239
240message ImageState {
241 enum ImageDownloadState {
242 DOWNLOAD_UNKNOWN = 0;
243 DOWNLOAD_SUCCEEDED = 1;
244 DOWNLOAD_REQUESTED = 2;
245 DOWNLOAD_STARTED = 3;
246 DOWNLOAD_FAILED = 4;
247 DOWNLOAD_UNSUPPORTED = 5;
248 DOWNLOAD_CANCELLING = 6;
249 DOWNLOAD_CANCELLED = 7;
250 }
251
252 enum ImageFailureReason {
253 NO_ERROR = 0;
254 INVALID_URL = 1;
255 DEVICE_BUSY = 2;
256 INSUFFICIENT_SPACE = 3; // VOLTHA ONU ADAPTER has no more space to store images
257 UNKNOWN_ERROR = 4; // Used also for Checksum failure on ONU
258 CANCELLED_ON_REQUEST = 5;
259 CANCELLED_ON_ONU_STATE = 6;
260 VENDOR_DEVICE_MISMATCH = 7;
261 OMCI_TRANSFER_ERROR = 8;
262 IMAGE_REFUSED_BY_ONU = 9;
263 }
264
265 enum ImageActivationState {
266 IMAGE_UNKNOWN = 0;
267 IMAGE_INACTIVE = 1;
268 IMAGE_ACTIVATING = 2; // Happens during Reboot of the ONU after activate call.
269 IMAGE_ACTIVE = 3;
270 IMAGE_COMMITTING = 4;
271 IMAGE_COMMITTED = 5;
272 IMAGE_ACTIVATION_ABORTING = 6;
273 IMAGE_ACTIVATION_ABORTED = 7;
274 IMAGE_COMMIT_ABORTING = 8;
275 IMAGE_COMMIT_ABORTED = 9;
276 IMAGE_DOWNLOADING = 10;
277 }
278
279 // image version
280 string version = 1;
281
282 // Download state
283 ImageDownloadState download_state = 2;
284
285 // Image Operation Failure reason (use for both Download and Activate)
286 ImageFailureReason reason= 3;
287
288 // Image activation state
289 ImageActivationState image_state = 4;
290
291}
292
Zack Williams52209662019-02-07 10:15:31 -0700293message Port {
Zack Williams52209662019-02-07 10:15:31 -0700294 enum PortType {
295 UNKNOWN = 0;
296 ETHERNET_NNI = 1;
297 ETHERNET_UNI = 2;
298 PON_OLT = 3;
299 PON_ONU = 4;
300 VENET_OLT = 5;
301 VENET_ONU = 6;
302 }
303
304 uint32 port_no = 1; // Device-unique port number
305
306 string label = 2; // Arbitrary port label
307
308 PortType type = 3; // Type of port
309
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300310 common.AdminState.Types admin_state = 5;
Zack Williams52209662019-02-07 10:15:31 -0700311
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300312 common.OperStatus.Types oper_status = 6;
Zack Williams52209662019-02-07 10:15:31 -0700313
314 string device_id = 7; // Unique .id of device that owns this port
315
316 message PeerPort {
317 string device_id = 1;
318 uint32 port_no = 2;
319 }
320 repeated PeerPort peers = 8;
321
322 fixed64 rx_packets = 9;
323 fixed64 rx_bytes = 10;
324 fixed64 rx_errors = 11;
325 fixed64 tx_packets = 12;
326 fixed64 tx_bytes = 13;
327 fixed64 tx_errors = 14;
328
khenaidooce41ea42020-06-09 18:10:16 -0400329 // ofp_port represents the characteristics of a port, e.g. hardware
330 // address and supported features. This field is relevant only for
331 // UNI and NNI ports. For PON ports, it can be left empty.
332 openflow_13.ofp_port ofp_port = 15;
Zack Williams52209662019-02-07 10:15:31 -0700333}
334
335message Ports {
336 repeated Port items = 1;
337}
338
339// A Physical Device instance
340message Device {
Zack Williams52209662019-02-07 10:15:31 -0700341 // Voltha's device identifier
khenaidoo4c6543e2021-10-19 17:25:58 -0400342 string id = 1 ;
Zack Williams52209662019-02-07 10:15:31 -0700343
344 // Device type, refers to one of the registered device types
khenaidoo4c6543e2021-10-19 17:25:58 -0400345 string type = 2 ;
Zack Williams52209662019-02-07 10:15:31 -0700346
347 // Is this device a root device. Each logical switch has one root
348 // device that is associated with the logical flow switch.
khenaidoo4c6543e2021-10-19 17:25:58 -0400349 bool root = 3 ;
Zack Williams52209662019-02-07 10:15:31 -0700350
351 // Parent device id, in the device tree (for a root device, the parent_id
352 // is the logical_device.id)
khenaidoo4c6543e2021-10-19 17:25:58 -0400353 string parent_id = 4;
354 uint32 parent_port_no = 20;
Zack Williams52209662019-02-07 10:15:31 -0700355
356 // Vendor, version, serial number, etc.
khenaidoo4c6543e2021-10-19 17:25:58 -0400357 string vendor = 5;
358 string model = 6;
359 string hardware_version = 7;
360 string firmware_version = 8;
Zack Williams52209662019-02-07 10:15:31 -0700361 // List of software on the device
khenaidoo4c6543e2021-10-19 17:25:58 -0400362 Images images = 9;
363 string serial_number = 10;
364 string vendor_id = 24;
Zack Williams52209662019-02-07 10:15:31 -0700365
khenaidoo4c6543e2021-10-19 17:25:58 -0400366 // adapter is deprecated and replaced by adapter_endpoint
367 reserved 11;
368 //string adapter = 11;
Zack Williams52209662019-02-07 10:15:31 -0700369
khenaidoo5fc5cea2021-08-11 17:39:16 -0400370 // Indicates how to reach the adapter instance that manages this device
371 string adapter_endpoint = 25;
372
Zack Williams52209662019-02-07 10:15:31 -0700373 // Device contact on vlan (if 0, no vlan)
374 uint32 vlan = 12;
375
376 message ProxyAddress {
377 string device_id = 1; // Which device to use as proxy to this device
378 string device_type = 2; // The device type of the proxy device to use as the adapter name
379 uint32 channel_id = 3; // Sub-address within proxy
380 uint32 channel_group_id = 4; // Channel Group index
381 string channel_termination = 5; // Channel Termination name
382 uint32 onu_id = 6; // onu identifier; optional
383 uint32 onu_session_id = 7; // session identifier for the ONU; optional
khenaidoo5fc5cea2021-08-11 17:39:16 -0400384 string adapter_endpoint = 8; // endpoint of the adapter that handles the proxy device
Zack Williams52209662019-02-07 10:15:31 -0700385 };
386
William Kurkian6ea97f82019-03-13 15:51:55 -0400387 // Device contact MAC address (format: "xx:xx:xx:xx:xx:xx")
388 string mac_address = 13;
389
Zack Williams52209662019-02-07 10:15:31 -0700390 oneof address {
Zack Williams52209662019-02-07 10:15:31 -0700391
392 // Device contact IPv4 address (format: "a.b.c.d" or can use hostname too)
393 string ipv4_address = 14;
394
395 // Device contact IPv6 address using the canonical string form
396 // ("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx")
397 string ipv6_address = 15;
398
399 string host_and_port = 21;
400
401 };
402 string extra_args = 23; // Used to pass additional device specific arguments
403
404 ProxyAddress proxy_address = 19;
405
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300406 common.AdminState.Types admin_state = 16;
Zack Williams52209662019-02-07 10:15:31 -0700407
khenaidoo4c6543e2021-10-19 17:25:58 -0400408 common.OperStatus.Types oper_status = 17 ;
Zack Williams52209662019-02-07 10:15:31 -0700409
khenaidoo4c6543e2021-10-19 17:25:58 -0400410 string reason = 22 ; // Used in FAILED state
khenaidoo Nursimulue9ae0452021-01-13 15:23:48 +0000411
khenaidoo4c6543e2021-10-19 17:25:58 -0400412 common.ConnectStatus.Types connect_status = 18 ;
Zack Williams52209662019-02-07 10:15:31 -0700413
414 // TODO additional common attribute here
415
416 // Device type specific attributes
417 google.protobuf.Any custom = 64;
418
khenaidoo4c6543e2021-10-19 17:25:58 -0400419 // PmConfigs type
420 PmConfigs pm_configs = 131 ;
Zack Williams52209662019-02-07 10:15:31 -0700421
khenaidoo4c6543e2021-10-19 17:25:58 -0400422 repeated ImageDownload image_downloads = 133;
Andrea Campanella9e94e8a2021-01-19 15:21:25 +0100423
Zack Williams52209662019-02-07 10:15:31 -0700424}
425
khenaidoo4c6543e2021-10-19 17:25:58 -0400426message DeviceImageDownloadRequest {
427
428 // Device Id
429 // allows for operations on multiple devices.
430 repeated common.ID device_id = 1;
431
432 //The image for the device containing all the information
433 Image image = 2;
434
435 //Activate the image if the download to the device is successful
436 bool activateOnSuccess = 3;
437
438 //Automatically commit the image if the activation on the device is successful
439 bool commitOnSuccess = 4;
440}
441
442message DeviceImageRequest {
443
444 //Device Id
445 //allows for operations on multiple adapters.
446 repeated common.ID device_id = 1;
447
448 // Image Version, this is the sole identifier of the image. it's the vendor specified OMCI version
449 // must be known at the time of initiating a download, activate, commit image on an onu.
450 string version = 2;
451
452 //Automatically commit the image if the activation on the device is successful
453 bool commitOnSuccess = 3;
454}
455
456message DeviceImageResponse {
457
458 //Image state for the different devices
459 repeated DeviceImageState device_image_states = 1;
460}
461
462// Device Self Test Response
463message SelfTestResponse {
464
465 enum SelfTestResult {
466 SUCCESS = 0;
467 FAILURE = 1;
468 NOT_SUPPORTED = 2;
469 UNKNOWN_ERROR = 3;
470 }
471 SelfTestResult result = 1;
472}
473
Zack Williams52209662019-02-07 10:15:31 -0700474message Devices {
475 repeated Device items = 1;
476}
477
478message SimulateAlarmRequest {
479 enum OperationType {
480 RAISE = 0;
481 CLEAR = 1;
482 }
483 // Device Identifier
484 string id = 1;
485 string indicator = 2;
486 string intf_id = 3;
487 string port_type_name = 4;
488 string onu_device_id = 5;
489 int32 inverse_bit_error_rate = 6;
490 int32 drift = 7;
491 int32 new_eqd = 8;
492 string onu_serial_number = 9;
493 OperationType operation = 10;
494}