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