blob: 7add29a15d99f7c32a77dda74033d2e1696249a6 [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;
bseenivad4072f62024-12-11 10:05:30 +0530277 IMAGE_DOWNLOADING_ABORTED = 11;
Andrea Campanella9e94e8a2021-01-19 15:21:25 +0100278 }
279
280 // image version
281 string version = 1;
282
283 // Download state
284 ImageDownloadState download_state = 2;
285
286 // Image Operation Failure reason (use for both Download and Activate)
287 ImageFailureReason reason= 3;
288
289 // Image activation state
290 ImageActivationState image_state = 4;
291
292}
293
Zack Williams52209662019-02-07 10:15:31 -0700294message Port {
Zack Williams52209662019-02-07 10:15:31 -0700295 enum PortType {
296 UNKNOWN = 0;
297 ETHERNET_NNI = 1;
298 ETHERNET_UNI = 2;
299 PON_OLT = 3;
300 PON_ONU = 4;
301 VENET_OLT = 5;
302 VENET_ONU = 6;
303 }
304
305 uint32 port_no = 1; // Device-unique port number
306
307 string label = 2; // Arbitrary port label
308
309 PortType type = 3; // Type of port
310
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300311 common.AdminState.Types admin_state = 5;
Zack Williams52209662019-02-07 10:15:31 -0700312
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300313 common.OperStatus.Types oper_status = 6;
Zack Williams52209662019-02-07 10:15:31 -0700314
315 string device_id = 7; // Unique .id of device that owns this port
316
317 message PeerPort {
318 string device_id = 1;
319 uint32 port_no = 2;
320 }
321 repeated PeerPort peers = 8;
322
323 fixed64 rx_packets = 9;
324 fixed64 rx_bytes = 10;
325 fixed64 rx_errors = 11;
326 fixed64 tx_packets = 12;
327 fixed64 tx_bytes = 13;
328 fixed64 tx_errors = 14;
329
khenaidooce41ea42020-06-09 18:10:16 -0400330 // ofp_port represents the characteristics of a port, e.g. hardware
331 // address and supported features. This field is relevant only for
332 // UNI and NNI ports. For PON ports, it can be left empty.
333 openflow_13.ofp_port ofp_port = 15;
Zack Williams52209662019-02-07 10:15:31 -0700334}
335
336message Ports {
337 repeated Port items = 1;
338}
339
340// A Physical Device instance
341message Device {
Zack Williams52209662019-02-07 10:15:31 -0700342 // Voltha's device identifier
khenaidoo4c6543e2021-10-19 17:25:58 -0400343 string id = 1 ;
Zack Williams52209662019-02-07 10:15:31 -0700344
345 // Device type, refers to one of the registered device types
khenaidoo4c6543e2021-10-19 17:25:58 -0400346 string type = 2 ;
Zack Williams52209662019-02-07 10:15:31 -0700347
348 // Is this device a root device. Each logical switch has one root
349 // device that is associated with the logical flow switch.
khenaidoo4c6543e2021-10-19 17:25:58 -0400350 bool root = 3 ;
Zack Williams52209662019-02-07 10:15:31 -0700351
352 // Parent device id, in the device tree (for a root device, the parent_id
353 // is the logical_device.id)
khenaidoo4c6543e2021-10-19 17:25:58 -0400354 string parent_id = 4;
355 uint32 parent_port_no = 20;
Zack Williams52209662019-02-07 10:15:31 -0700356
357 // Vendor, version, serial number, etc.
khenaidoo4c6543e2021-10-19 17:25:58 -0400358 string vendor = 5;
359 string model = 6;
360 string hardware_version = 7;
361 string firmware_version = 8;
Zack Williams52209662019-02-07 10:15:31 -0700362 // List of software on the device
khenaidoo4c6543e2021-10-19 17:25:58 -0400363 Images images = 9;
364 string serial_number = 10;
365 string vendor_id = 24;
Zack Williams52209662019-02-07 10:15:31 -0700366
khenaidoo4c6543e2021-10-19 17:25:58 -0400367 // adapter is deprecated and replaced by adapter_endpoint
368 reserved 11;
369 //string adapter = 11;
Zack Williams52209662019-02-07 10:15:31 -0700370
khenaidoo5fc5cea2021-08-11 17:39:16 -0400371 // Indicates how to reach the adapter instance that manages this device
372 string adapter_endpoint = 25;
373
Zack Williams52209662019-02-07 10:15:31 -0700374 // Device contact on vlan (if 0, no vlan)
375 uint32 vlan = 12;
376
377 message ProxyAddress {
378 string device_id = 1; // Which device to use as proxy to this device
379 string device_type = 2; // The device type of the proxy device to use as the adapter name
380 uint32 channel_id = 3; // Sub-address within proxy
381 uint32 channel_group_id = 4; // Channel Group index
382 string channel_termination = 5; // Channel Termination name
383 uint32 onu_id = 6; // onu identifier; optional
384 uint32 onu_session_id = 7; // session identifier for the ONU; optional
khenaidoo5fc5cea2021-08-11 17:39:16 -0400385 string adapter_endpoint = 8; // endpoint of the adapter that handles the proxy device
Zack Williams52209662019-02-07 10:15:31 -0700386 };
387
William Kurkian6ea97f82019-03-13 15:51:55 -0400388 // Device contact MAC address (format: "xx:xx:xx:xx:xx:xx")
389 string mac_address = 13;
390
Zack Williams52209662019-02-07 10:15:31 -0700391 oneof address {
Zack Williams52209662019-02-07 10:15:31 -0700392
393 // Device contact IPv4 address (format: "a.b.c.d" or can use hostname too)
394 string ipv4_address = 14;
395
396 // Device contact IPv6 address using the canonical string form
397 // ("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx")
398 string ipv6_address = 15;
399
400 string host_and_port = 21;
401
402 };
403 string extra_args = 23; // Used to pass additional device specific arguments
404
405 ProxyAddress proxy_address = 19;
406
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300407 common.AdminState.Types admin_state = 16;
Zack Williams52209662019-02-07 10:15:31 -0700408
khenaidoo4c6543e2021-10-19 17:25:58 -0400409 common.OperStatus.Types oper_status = 17 ;
Zack Williams52209662019-02-07 10:15:31 -0700410
khenaidoo4c6543e2021-10-19 17:25:58 -0400411 string reason = 22 ; // Used in FAILED state
khenaidoo Nursimulue9ae0452021-01-13 15:23:48 +0000412
khenaidoo4c6543e2021-10-19 17:25:58 -0400413 common.ConnectStatus.Types connect_status = 18 ;
Zack Williams52209662019-02-07 10:15:31 -0700414
415 // TODO additional common attribute here
416
417 // Device type specific attributes
418 google.protobuf.Any custom = 64;
419
khenaidoo4c6543e2021-10-19 17:25:58 -0400420 // PmConfigs type
421 PmConfigs pm_configs = 131 ;
Zack Williams52209662019-02-07 10:15:31 -0700422
khenaidoo4c6543e2021-10-19 17:25:58 -0400423 repeated ImageDownload image_downloads = 133;
Andrea Campanella9e94e8a2021-01-19 15:21:25 +0100424
Zack Williams52209662019-02-07 10:15:31 -0700425}
426
khenaidoo4c6543e2021-10-19 17:25:58 -0400427message DeviceImageDownloadRequest {
428
429 // Device Id
430 // allows for operations on multiple devices.
431 repeated common.ID device_id = 1;
432
433 //The image for the device containing all the information
434 Image image = 2;
435
436 //Activate the image if the download to the device is successful
437 bool activateOnSuccess = 3;
438
439 //Automatically commit the image if the activation on the device is successful
440 bool commitOnSuccess = 4;
441}
442
443message DeviceImageRequest {
444
445 //Device Id
446 //allows for operations on multiple adapters.
447 repeated common.ID device_id = 1;
448
449 // Image Version, this is the sole identifier of the image. it's the vendor specified OMCI version
450 // must be known at the time of initiating a download, activate, commit image on an onu.
451 string version = 2;
452
453 //Automatically commit the image if the activation on the device is successful
454 bool commitOnSuccess = 3;
455}
456
457message DeviceImageResponse {
458
459 //Image state for the different devices
460 repeated DeviceImageState device_image_states = 1;
461}
462
463// Device Self Test Response
464message SelfTestResponse {
465
466 enum SelfTestResult {
467 SUCCESS = 0;
468 FAILURE = 1;
469 NOT_SUPPORTED = 2;
470 UNKNOWN_ERROR = 3;
471 }
472 SelfTestResult result = 1;
473}
474
Zack Williams52209662019-02-07 10:15:31 -0700475message Devices {
476 repeated Device items = 1;
477}
478
479message SimulateAlarmRequest {
480 enum OperationType {
481 RAISE = 0;
482 CLEAR = 1;
483 }
484 // Device Identifier
485 string id = 1;
486 string indicator = 2;
487 string intf_id = 3;
488 string port_type_name = 4;
489 string onu_device_id = 5;
490 int32 inverse_bit_error_rate = 6;
491 int32 drift = 7;
492 int32 new_eqd = 8;
493 string onu_serial_number = 9;
494 OperationType operation = 10;
495}