Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 1 | syntax = "proto3"; |
| 2 | |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 3 | option go_package = "github.com/opencord/voltha-protos/v3/go/voltha"; |
| 4 | option java_package = "org.opencord.voltha"; |
| 5 | option java_outer_classname = "VolthaDevice"; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 6 | |
| 7 | package voltha; |
| 8 | |
| 9 | import "google/protobuf/any.proto"; |
| 10 | import "voltha_protos/common.proto"; |
| 11 | import "voltha_protos/meta.proto"; |
| 12 | import "voltha_protos/openflow_13.proto"; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 13 | |
| 14 | // A Device Type |
| 15 | message DeviceType { |
| 16 | |
| 17 | // Unique name for the device type |
| 18 | string id = 1; |
| 19 | |
William Kurkian | 6ea97f8 | 2019-03-13 15:51:55 -0400 | [diff] [blame] | 20 | // Unique vendor id for the device type applicable to ONU |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 21 | // 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 |
| 27 | string adapter = 2; |
| 28 | |
William Kurkian | 6ea97f8 | 2019-03-13 15:51:55 -0400 | [diff] [blame] | 29 | // Capabilities |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 30 | bool accepts_bulk_flow_update = 3; |
| 31 | bool accepts_add_remove_flow_updates = 4; |
| 32 | bool accepts_direct_logical_flows_update = 7; |
| 33 | |
| 34 | } |
| 35 | |
| 36 | // A plurality of device types |
| 37 | message DeviceTypes { |
| 38 | repeated DeviceType items = 1; |
| 39 | } |
| 40 | |
| 41 | message PmConfig { |
| 42 | enum PmType { |
| 43 | COUNTER = 0; |
| 44 | GAUGE = 1; |
| 45 | STATE = 2; |
| 46 | CONTEXT = 3; |
| 47 | } |
| 48 | string name = 1; |
| 49 | PmType type = 2; |
| 50 | bool enabled = 3; // Whether or not this metric makes it to Kafka |
| 51 | uint32 sample_freq = 4; // Sample rate in 10ths of a second |
| 52 | } |
| 53 | |
| 54 | message PmGroupConfig { |
| 55 | string group_name = 1; |
| 56 | uint32 group_freq = 2; // Frequency applicable to the grop |
| 57 | bool enabled = 3; // Enable/disable group level only |
| 58 | repeated PmConfig metrics = 4; |
| 59 | } |
| 60 | |
| 61 | message PmConfigs { |
| 62 | string id = 1; // To work around a chameleon POST bug |
| 63 | uint32 default_freq = 2; // Default sample rate |
| 64 | // Forces group names and group semantics |
| 65 | bool grouped = 3 [(access) = READ_ONLY]; |
| 66 | // Allows Pm to set an individual sample frequency |
| 67 | bool freq_override = 4 [(access) = READ_ONLY]; |
| 68 | repeated PmGroupConfig groups = 5; // The groups if grouped is true |
| 69 | repeated PmConfig metrics = 6; // The metrics themselves if grouped is false. |
| 70 | } |
| 71 | |
| 72 | // Describes instance of software image on the device |
| 73 | message Image { |
| 74 | string name = 1; // software patch name |
| 75 | string version = 2; // version of software |
| 76 | string hash = 3; // md5 hash |
| 77 | string install_datetime = 4; // combined date and time expressed in UTC. |
| 78 | // use ISO 8601 format for date and time |
| 79 | |
| 80 | // The active software image is one that is currently loaded and executing |
| 81 | // in the ONU or circuit pack. Under normal operation, one software image |
| 82 | // is always active while the other is inactive. Under no circumstances are |
| 83 | // both software images allowed to be active at the same time |
| 84 | bool is_active = 5; // True if the image is active |
| 85 | |
| 86 | // The committed software image is loaded and executed upon reboot of the |
| 87 | // ONU and/or circuit pack. During normal operation, one software image is |
| 88 | // always committed, while the other is uncommitted. |
| 89 | bool is_committed = 6; // True if the image is committed |
| 90 | |
| 91 | // A software image is valid if it has been verified to be an executable |
| 92 | // code image. The verification mechanism is not subject to standardization; |
| 93 | // however, it should include at least a data integrity (e.g., CRC) check of |
| 94 | // the entire code image. |
| 95 | bool is_valid = 7; // True if the image is valid |
| 96 | } |
| 97 | |
| 98 | // List of software on the device |
| 99 | message Images { |
| 100 | repeated Image image = 1; |
| 101 | } |
| 102 | |
| 103 | message ImageDownload { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 104 | enum ImageDownloadState { |
| 105 | DOWNLOAD_UNKNOWN = 0; |
| 106 | DOWNLOAD_SUCCEEDED = 1; |
| 107 | DOWNLOAD_REQUESTED = 2; |
| 108 | DOWNLOAD_STARTED = 3; |
| 109 | DOWNLOAD_FAILED = 4; |
| 110 | DOWNLOAD_UNSUPPORTED = 5; |
| 111 | DOWNLOAD_CANCELLED = 6; |
| 112 | } |
| 113 | |
| 114 | enum ImageDownloadFailureReason { |
| 115 | NO_ERROR = 0; |
| 116 | INVALID_URL = 1; |
| 117 | DEVICE_BUSY = 2; |
| 118 | INSUFFICIENT_SPACE = 3; |
| 119 | UNKNOWN_ERROR = 4; |
| 120 | CANCELLED = 5; |
| 121 | } |
| 122 | |
| 123 | enum ImageActivateState { |
| 124 | IMAGE_UNKNOWN = 0; |
| 125 | IMAGE_INACTIVE = 1; |
William Kurkian | 6ea97f8 | 2019-03-13 15:51:55 -0400 | [diff] [blame] | 126 | IMAGE_ACTIVATING = 2; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 127 | IMAGE_ACTIVE = 3; |
William Kurkian | 6ea97f8 | 2019-03-13 15:51:55 -0400 | [diff] [blame] | 128 | IMAGE_REVERTING = 4; |
| 129 | IMAGE_REVERTED = 5; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 130 | } |
| 131 | |
| 132 | // Device Identifier |
| 133 | string id = 1; |
| 134 | |
| 135 | // Image unique identifier |
| 136 | string name = 2; |
| 137 | |
| 138 | // URL where the image is available |
| 139 | // should include username password |
| 140 | string url = 3; |
| 141 | |
| 142 | // CRC of the image to be verified aginst |
| 143 | uint32 crc = 4; |
| 144 | |
| 145 | // Download state |
| 146 | ImageDownloadState download_state = 5; |
| 147 | |
| 148 | // Downloaded version |
| 149 | string image_version = 6; |
| 150 | |
| 151 | // Bytes downloaded |
| 152 | uint32 downloaded_bytes = 7; |
| 153 | |
| 154 | // Download failure reason |
| 155 | ImageDownloadFailureReason reason= 8; |
| 156 | |
| 157 | // Additional info |
| 158 | string additional_info = 9; |
| 159 | |
| 160 | // Save current configuration |
| 161 | bool save_config = 10; |
| 162 | |
| 163 | // Image local location |
| 164 | string local_dir = 11; |
| 165 | |
| 166 | // Image activation state |
| 167 | ImageActivateState image_state = 12; |
| 168 | |
| 169 | // Image file size |
| 170 | uint32 file_size = 13; |
| 171 | } |
| 172 | |
| 173 | message ImageDownloads { |
| 174 | repeated ImageDownload items = 2; |
| 175 | } |
| 176 | |
| 177 | message Port { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 178 | enum PortType { |
| 179 | UNKNOWN = 0; |
| 180 | ETHERNET_NNI = 1; |
| 181 | ETHERNET_UNI = 2; |
| 182 | PON_OLT = 3; |
| 183 | PON_ONU = 4; |
| 184 | VENET_OLT = 5; |
| 185 | VENET_ONU = 6; |
| 186 | } |
| 187 | |
| 188 | uint32 port_no = 1; // Device-unique port number |
| 189 | |
| 190 | string label = 2; // Arbitrary port label |
| 191 | |
| 192 | PortType type = 3; // Type of port |
| 193 | |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 194 | common.AdminState.Types admin_state = 5; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 195 | |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 196 | common.OperStatus.Types oper_status = 6; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 197 | |
| 198 | string device_id = 7; // Unique .id of device that owns this port |
| 199 | |
| 200 | message PeerPort { |
| 201 | string device_id = 1; |
| 202 | uint32 port_no = 2; |
| 203 | } |
| 204 | repeated PeerPort peers = 8; |
| 205 | |
| 206 | fixed64 rx_packets = 9; |
| 207 | fixed64 rx_bytes = 10; |
| 208 | fixed64 rx_errors = 11; |
| 209 | fixed64 tx_packets = 12; |
| 210 | fixed64 tx_bytes = 13; |
| 211 | fixed64 tx_errors = 14; |
| 212 | |
| 213 | } |
| 214 | |
| 215 | message Ports { |
| 216 | repeated Port items = 1; |
| 217 | } |
| 218 | |
| 219 | // A Physical Device instance |
| 220 | message Device { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 221 | // Voltha's device identifier |
| 222 | string id = 1 [(access) = READ_ONLY]; |
| 223 | |
| 224 | // Device type, refers to one of the registered device types |
| 225 | string type = 2 [(access) = READ_ONLY]; |
| 226 | |
| 227 | // Is this device a root device. Each logical switch has one root |
| 228 | // device that is associated with the logical flow switch. |
| 229 | bool root = 3 [(access) = READ_ONLY]; |
| 230 | |
| 231 | // Parent device id, in the device tree (for a root device, the parent_id |
| 232 | // is the logical_device.id) |
| 233 | string parent_id = 4 [(access) = READ_ONLY]; |
| 234 | uint32 parent_port_no = 20 [(access) = READ_ONLY]; |
| 235 | |
| 236 | // Vendor, version, serial number, etc. |
| 237 | string vendor = 5 [(access) = READ_ONLY]; |
| 238 | string model = 6 [(access) = READ_ONLY]; |
| 239 | string hardware_version = 7 [(access) = READ_ONLY]; |
| 240 | string firmware_version = 8 [(access) = READ_ONLY]; |
| 241 | // List of software on the device |
| 242 | Images images = 9 [(access) = READ_ONLY]; |
| 243 | string serial_number = 10 [(access) = READ_ONLY]; |
| 244 | string vendor_id = 24 [(access) = READ_ONLY]; |
| 245 | |
| 246 | // Addapter that takes care of device |
| 247 | string adapter = 11 [(access) = READ_ONLY]; |
| 248 | |
| 249 | // Device contact on vlan (if 0, no vlan) |
| 250 | uint32 vlan = 12; |
| 251 | |
| 252 | message ProxyAddress { |
| 253 | string device_id = 1; // Which device to use as proxy to this device |
| 254 | string device_type = 2; // The device type of the proxy device to use as the adapter name |
| 255 | uint32 channel_id = 3; // Sub-address within proxy |
| 256 | uint32 channel_group_id = 4; // Channel Group index |
| 257 | string channel_termination = 5; // Channel Termination name |
| 258 | uint32 onu_id = 6; // onu identifier; optional |
| 259 | uint32 onu_session_id = 7; // session identifier for the ONU; optional |
| 260 | }; |
| 261 | |
William Kurkian | 6ea97f8 | 2019-03-13 15:51:55 -0400 | [diff] [blame] | 262 | // Device contact MAC address (format: "xx:xx:xx:xx:xx:xx") |
| 263 | string mac_address = 13; |
| 264 | |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 265 | oneof address { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 266 | |
| 267 | // Device contact IPv4 address (format: "a.b.c.d" or can use hostname too) |
| 268 | string ipv4_address = 14; |
| 269 | |
| 270 | // Device contact IPv6 address using the canonical string form |
| 271 | // ("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx") |
| 272 | string ipv6_address = 15; |
| 273 | |
| 274 | string host_and_port = 21; |
| 275 | |
| 276 | }; |
| 277 | string extra_args = 23; // Used to pass additional device specific arguments |
| 278 | |
| 279 | ProxyAddress proxy_address = 19; |
| 280 | |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 281 | common.AdminState.Types admin_state = 16; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 282 | |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 283 | common.OperStatus.Types oper_status = 17 [(access) = READ_ONLY]; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 284 | |
| 285 | string reason = 22 [(access) = READ_ONLY]; // Used in FAILED state |
| 286 | |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 287 | common.ConnectStatus.Types connect_status = 18 [(access) = READ_ONLY]; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 288 | |
| 289 | // TODO additional common attribute here |
| 290 | |
| 291 | // Device type specific attributes |
| 292 | google.protobuf.Any custom = 64; |
| 293 | |
| 294 | repeated Port ports = 128 [(child_node) = {key: "port_no"}]; |
| 295 | openflow_13.Flows flows = 129 [(child_node) = {}]; |
| 296 | openflow_13.FlowGroups flow_groups = 130 [(child_node) = {}]; |
| 297 | // PmConfigs will eventually converted to a child node of the |
| 298 | // device to falicitata callbacks and to simplify manipulation. |
| 299 | PmConfigs pm_configs = 131 [(child_node) = {}]; |
| 300 | |
| 301 | repeated ImageDownload image_downloads = 133 [(child_node) = {key: "name"}]; |
| 302 | } |
| 303 | |
| 304 | message Devices { |
| 305 | repeated Device items = 1; |
| 306 | } |
| 307 | |
| 308 | message SimulateAlarmRequest { |
| 309 | enum OperationType { |
| 310 | RAISE = 0; |
| 311 | CLEAR = 1; |
| 312 | } |
| 313 | // Device Identifier |
| 314 | string id = 1; |
| 315 | string indicator = 2; |
| 316 | string intf_id = 3; |
| 317 | string port_type_name = 4; |
| 318 | string onu_device_id = 5; |
| 319 | int32 inverse_bit_error_rate = 6; |
| 320 | int32 drift = 7; |
| 321 | int32 new_eqd = 8; |
| 322 | string onu_serial_number = 9; |
| 323 | OperationType operation = 10; |
| 324 | } |