Dinesh Belwalkar | 0c328db | 2018-12-02 21:11:49 -0800 | [diff] [blame] | 1 | // 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 | |
| 15 | syntax = "proto3"; |
| 16 | option go_package = "github.com/opencord/voltha-go/protos/voltha"; |
| 17 | |
| 18 | package voltha; |
| 19 | |
| 20 | import "google/api/annotations.proto"; |
| 21 | import "openflow_13.proto"; |
| 22 | |
| 23 | |
| 24 | |
| 25 | service Openolt { |
| 26 | |
| 27 | rpc DisableOlt(Empty) returns (Empty) { |
| 28 | option (google.api.http) = { |
| 29 | post: "/v1/Disable" |
| 30 | body: "*" |
| 31 | }; |
| 32 | } |
| 33 | |
| 34 | rpc ReenableOlt(Empty) returns (Empty) { |
| 35 | option (google.api.http) = { |
| 36 | post: "/v1/Reenable" |
| 37 | body: "*" |
| 38 | }; |
| 39 | } |
| 40 | |
| 41 | rpc ActivateOnu(Onu) returns (Empty) { |
| 42 | option (google.api.http) = { |
| 43 | post: "/v1/EnableOnu" |
| 44 | body: "*" |
| 45 | }; |
| 46 | } |
| 47 | |
| 48 | rpc DeactivateOnu(Onu) returns (Empty) { |
| 49 | option (google.api.http) = { |
| 50 | post: "/v1/DisableOnu" |
| 51 | body: "*" |
| 52 | }; |
| 53 | } |
| 54 | |
| 55 | rpc DeleteOnu(Onu) returns (Empty) { |
| 56 | option (google.api.http) = { |
| 57 | post: "/v1/DeleteOnu" |
| 58 | body: "*" |
| 59 | }; |
| 60 | } |
| 61 | |
| 62 | rpc OmciMsgOut(OmciMsg) returns (Empty) { |
| 63 | option (google.api.http) = { |
| 64 | post: "/v1/OmciMsgOut" |
| 65 | body: "*" |
| 66 | }; |
| 67 | } |
| 68 | |
| 69 | rpc OnuPacketOut(OnuPacket) returns (Empty) { |
| 70 | option (google.api.http) = { |
| 71 | post: "/v1/OnuPacketOut" |
| 72 | body: "*" |
| 73 | }; |
| 74 | } |
| 75 | |
| 76 | rpc UplinkPacketOut(UplinkPacket) returns (Empty) { |
| 77 | option (google.api.http) = { |
| 78 | post: "/v1/UplinkPacketOut" |
| 79 | body: "*" |
| 80 | }; |
| 81 | } |
| 82 | |
| 83 | rpc FlowAdd(Flow) returns (Empty) { |
| 84 | option (google.api.http) = { |
| 85 | post: "/v1/FlowAdd" |
| 86 | body: "*" |
| 87 | }; |
| 88 | } |
| 89 | |
| 90 | rpc FlowRemove(Flow) returns (Empty) { |
| 91 | option (google.api.http) = { |
| 92 | post: "/v1/FlowRemove" |
| 93 | body: "*" |
| 94 | }; |
| 95 | } |
| 96 | |
| 97 | rpc HeartbeatCheck(Empty) returns (Heartbeat) { |
| 98 | option (google.api.http) = { |
| 99 | post: "/v1/HeartbeatCheck" |
| 100 | body: "*" |
| 101 | }; |
| 102 | } |
| 103 | |
| 104 | rpc EnablePonIf(Interface) returns (Empty) { |
| 105 | option (google.api.http) = { |
| 106 | post: "/v1/EnablePonIf" |
| 107 | body: "*" |
| 108 | }; |
| 109 | } |
| 110 | |
| 111 | rpc DisablePonIf(Interface) returns (Empty) { |
| 112 | option (google.api.http) = { |
| 113 | post: "/v1/DisablePonIf" |
| 114 | body: "*" |
| 115 | }; |
| 116 | } |
| 117 | |
| 118 | rpc GetDeviceInfo(Empty) returns (DeviceInfo) { |
| 119 | option (google.api.http) = { |
| 120 | post: "/v1/GetDeviceInfo" |
| 121 | body: "*" |
| 122 | }; |
| 123 | } |
| 124 | |
| 125 | rpc Reboot(Empty) returns (Empty) { |
| 126 | option (google.api.http) = { |
| 127 | post: "/v1/Reboot" |
| 128 | body: "*" |
| 129 | }; |
| 130 | } |
| 131 | |
| 132 | rpc CollectStatistics(Empty) returns (Empty) { |
| 133 | option (google.api.http) = { |
| 134 | post: "/v1/CollectStatistics" |
| 135 | body: "*" |
| 136 | }; |
| 137 | } |
| 138 | |
| 139 | rpc EnableIndication(Empty) returns (stream Indication) {} |
| 140 | } |
| 141 | |
| 142 | message Indication { |
| 143 | oneof data { |
| 144 | OltIndication olt_ind = 1; |
| 145 | IntfIndication intf_ind = 2; |
| 146 | IntfOperIndication intf_oper_ind = 3; |
| 147 | OnuDiscIndication onu_disc_ind = 4; |
| 148 | OnuIndication onu_ind = 5; |
| 149 | OmciIndication omci_ind = 6; |
| 150 | PacketIndication pkt_ind = 7; |
| 151 | PortStatistics port_stats = 8; |
| 152 | FlowStatistics flow_stats = 9; |
| 153 | AlarmIndication alarm_ind= 10; |
| 154 | } |
| 155 | } |
| 156 | |
| 157 | message AlarmIndication { |
| 158 | oneof data { |
| 159 | LosIndication los_ind = 1; |
| 160 | DyingGaspIndication dying_gasp_ind = 2; |
| 161 | OnuAlarmIndication onu_alarm_ind = 3; |
| 162 | OnuStartupFailureIndication onu_startup_fail_ind = 4; |
| 163 | OnuSignalDegradeIndication onu_signal_degrade_ind = 5; |
| 164 | OnuDriftOfWindowIndication onu_drift_of_window_ind = 6; |
| 165 | OnuLossOfOmciChannelIndication onu_loss_omci_ind = 7; |
| 166 | OnuSignalsFailureIndication onu_signals_fail_ind = 8; |
| 167 | OnuTransmissionInterferenceWarning onu_tiwi_ind = 9; |
| 168 | OnuActivationFailureIndication onu_activation_fail_ind = 10; |
| 169 | OnuProcessingErrorIndication onu_processing_error_ind = 11; |
| 170 | } |
| 171 | } |
| 172 | |
| 173 | message OltIndication { |
| 174 | string oper_state = 1; // up, down |
| 175 | } |
| 176 | |
| 177 | message IntfIndication { |
| 178 | fixed32 intf_id = 1; |
| 179 | string oper_state = 2; // up, down |
| 180 | } |
| 181 | |
| 182 | message OnuDiscIndication { |
| 183 | fixed32 intf_id = 1; |
| 184 | SerialNumber serial_number = 2; |
| 185 | } |
| 186 | |
| 187 | message OnuIndication { |
| 188 | fixed32 intf_id = 1; |
| 189 | fixed32 onu_id = 2; |
| 190 | string oper_state = 3; // up, down |
| 191 | string admin_state = 5; // up, down |
| 192 | SerialNumber serial_number = 4; |
| 193 | } |
| 194 | |
| 195 | message IntfOperIndication { |
| 196 | string type = 1; // nni, pon |
| 197 | fixed32 intf_id = 2; |
| 198 | string oper_state = 3; // up, down |
| 199 | } |
| 200 | |
| 201 | message OmciIndication { |
| 202 | fixed32 intf_id = 1; |
| 203 | fixed32 onu_id = 2; |
| 204 | bytes pkt = 3; |
| 205 | } |
| 206 | |
| 207 | message PacketIndication { |
| 208 | string intf_type = 5; // nni, pon, unknown |
| 209 | fixed32 intf_id = 1; |
| 210 | fixed32 gemport_id = 2; |
| 211 | fixed32 flow_id = 3; |
| 212 | bytes pkt = 4; |
| 213 | } |
| 214 | |
| 215 | message Interface { |
| 216 | fixed32 intf_id = 1; |
| 217 | } |
| 218 | |
| 219 | message Heartbeat { |
| 220 | fixed32 heartbeat_signature = 1; |
| 221 | } |
| 222 | |
| 223 | message Onu { |
| 224 | fixed32 intf_id = 1; |
| 225 | fixed32 onu_id = 2; |
| 226 | SerialNumber serial_number = 3; |
| 227 | fixed32 pir = 4; // peak information rate assigned to onu |
| 228 | fixed32 alloc_id = 5; |
| 229 | } |
| 230 | |
| 231 | message OmciMsg { |
| 232 | fixed32 intf_id = 1; |
| 233 | fixed32 onu_id = 2; |
| 234 | bytes pkt = 3; |
| 235 | } |
| 236 | |
| 237 | message OnuPacket { |
| 238 | fixed32 intf_id = 1; |
| 239 | fixed32 onu_id = 2; |
| 240 | bytes pkt = 3; |
| 241 | } |
| 242 | |
| 243 | message UplinkPacket { |
| 244 | fixed32 intf_id = 1; |
| 245 | bytes pkt = 2; |
| 246 | } |
| 247 | |
| 248 | message DeviceInfo { |
| 249 | string vendor = 1; |
| 250 | string model = 2; |
| 251 | string hardware_version = 3; |
| 252 | string firmware_version = 4; |
| 253 | |
| 254 | // Total number of pon intf ports on the device |
| 255 | fixed32 pon_ports = 12; |
| 256 | |
| 257 | // If using global per-device technology profile. To be deprecated |
| 258 | string technology = 5; |
| 259 | fixed32 onu_id_start = 6; |
| 260 | fixed32 onu_id_end = 7; |
| 261 | fixed32 alloc_id_start = 8; |
| 262 | fixed32 alloc_id_end = 9; |
| 263 | fixed32 gemport_id_start = 10; |
| 264 | fixed32 gemport_id_end = 11; |
| 265 | fixed32 flow_id_start = 13; |
| 266 | fixed32 flow_id_end = 14; |
| 267 | |
| 268 | message DeviceResourceRanges { |
| 269 | |
| 270 | // List of 0 or more intf_ids that use the same technology and pools. |
| 271 | // If 0 intf_ids supplied, it implies ALL interfaces |
| 272 | repeated fixed32 intf_ids = 1; |
| 273 | |
| 274 | // Technology profile for this pool |
| 275 | string technology = 2; |
| 276 | |
| 277 | message Pool { |
| 278 | enum PoolType { |
| 279 | ONU_ID = 0; |
| 280 | ALLOC_ID = 1; |
| 281 | GEMPORT_ID = 2; |
| 282 | FLOW_ID = 3; |
| 283 | } |
| 284 | |
| 285 | enum SharingType { |
| 286 | DEDICATED_PER_INTF = 0; |
| 287 | SHARED_BY_ALL_INTF_ALL_TECH = 1; // Shared across all interfaces in all technologies in all ranges |
| 288 | SHARED_BY_ALL_INTF_SAME_TECH = 2; // Shared across all interfaces of the same technology used in this range |
| 289 | } |
| 290 | |
| 291 | PoolType type = 1; |
| 292 | SharingType sharing = 2; |
| 293 | fixed32 start = 3; // lower bound on IDs allocated from this pool |
| 294 | fixed32 end = 4; // upper bound on IDs allocated from this pool |
| 295 | } |
| 296 | repeated Pool pools = 3; |
| 297 | } |
| 298 | repeated DeviceResourceRanges ranges = 15; |
| 299 | } |
| 300 | |
| 301 | message Classifier { |
| 302 | fixed32 o_tpid = 1; |
| 303 | fixed32 o_vid = 2; |
| 304 | fixed32 i_tpid = 3; |
| 305 | fixed32 i_vid = 4; |
| 306 | fixed32 o_pbits = 5; |
| 307 | fixed32 i_pbits = 6; |
| 308 | fixed32 eth_type = 7; |
| 309 | bytes dst_mac = 8; |
| 310 | bytes src_mac = 9; |
| 311 | fixed32 ip_proto = 10; |
| 312 | fixed32 dst_ip = 11; |
| 313 | fixed32 src_ip = 12; |
| 314 | fixed32 src_port = 13; |
| 315 | fixed32 dst_port = 14; |
| 316 | string pkt_tag_type = 15; // untagged, single_tag, double_tag |
| 317 | } |
| 318 | |
| 319 | message ActionCmd { |
| 320 | bool add_outer_tag = 1; |
| 321 | bool remove_outer_tag = 2; |
| 322 | bool trap_to_host = 3; |
| 323 | } |
| 324 | |
| 325 | message Action { |
| 326 | ActionCmd cmd = 1; |
| 327 | fixed32 o_vid = 2; |
| 328 | fixed32 o_pbits = 3; |
| 329 | fixed32 o_tpid = 4; |
| 330 | fixed32 i_vid = 5; |
| 331 | fixed32 i_pbits = 6; |
| 332 | fixed32 i_tpid = 7; |
| 333 | } |
| 334 | |
| 335 | message Flow { |
| 336 | sfixed32 access_intf_id = 1; |
| 337 | sfixed32 onu_id = 2; |
| 338 | fixed32 flow_id = 3; |
| 339 | string flow_type = 4; // upstream, downstream, broadcast, multicast |
| 340 | sfixed32 alloc_id = 10; |
| 341 | sfixed32 network_intf_id = 5; |
| 342 | sfixed32 gemport_id = 6; |
| 343 | Classifier classifier = 7; |
| 344 | Action action = 8; |
| 345 | sfixed32 priority = 9; |
| 346 | } |
| 347 | |
| 348 | message SerialNumber { |
| 349 | bytes vendor_id = 1; |
| 350 | bytes vendor_specific = 2; |
| 351 | } |
| 352 | |
| 353 | message PortStatistics { |
| 354 | fixed32 intf_id = 1; |
| 355 | fixed64 rx_bytes = 2; |
| 356 | fixed64 rx_packets = 3; |
| 357 | fixed64 rx_ucast_packets = 4; |
| 358 | fixed64 rx_mcast_packets = 5; |
| 359 | fixed64 rx_bcast_packets = 6; |
| 360 | fixed64 rx_error_packets = 7; |
| 361 | fixed64 tx_bytes = 8; |
| 362 | fixed64 tx_packets = 9; |
| 363 | fixed64 tx_ucast_packets = 10; |
| 364 | fixed64 tx_mcast_packets = 11; |
| 365 | fixed64 tx_bcast_packets = 12; |
| 366 | fixed64 tx_error_packets = 13; |
| 367 | fixed64 rx_crc_errors = 14; |
| 368 | fixed64 bip_errors = 15; |
| 369 | fixed32 timestamp = 16; |
| 370 | } |
| 371 | |
| 372 | message FlowStatistics { |
| 373 | fixed32 flow_id = 1; |
| 374 | fixed64 rx_bytes = 2; |
| 375 | fixed64 rx_packets = 3; |
| 376 | fixed64 tx_bytes = 8; |
| 377 | fixed64 tx_packets = 9; |
| 378 | fixed32 timestamp = 16; |
| 379 | } |
| 380 | |
| 381 | message LosIndication { |
| 382 | fixed32 intf_id = 1; |
| 383 | string status = 2; |
| 384 | } |
| 385 | |
| 386 | message DyingGaspIndication { |
| 387 | fixed32 intf_id = 1; |
| 388 | fixed32 onu_id = 2; |
| 389 | string status = 3; |
| 390 | } |
| 391 | |
| 392 | message OnuAlarmIndication { |
| 393 | fixed32 intf_id = 1; |
| 394 | fixed32 onu_id = 2; |
| 395 | string los_status = 3; |
| 396 | string lob_status = 4; |
| 397 | string lopc_miss_status = 5; |
| 398 | string lopc_mic_error_status = 6; |
| 399 | } |
| 400 | |
| 401 | message OnuStartupFailureIndication { |
| 402 | fixed32 intf_id = 1; |
| 403 | fixed32 onu_id = 2; |
| 404 | string status = 3; |
| 405 | } |
| 406 | |
| 407 | message OnuSignalDegradeIndication { |
| 408 | fixed32 intf_id = 1; |
| 409 | fixed32 onu_id = 2; |
| 410 | string status = 3; |
| 411 | fixed32 inverse_bit_error_rate = 4; |
| 412 | } |
| 413 | |
| 414 | message OnuDriftOfWindowIndication { |
| 415 | fixed32 intf_id = 1; |
| 416 | fixed32 onu_id = 2; |
| 417 | string status = 3; |
| 418 | fixed32 drift = 4; |
| 419 | fixed32 new_eqd = 5; |
| 420 | } |
| 421 | |
| 422 | message OnuLossOfOmciChannelIndication { |
| 423 | fixed32 intf_id = 1; |
| 424 | fixed32 onu_id = 2; |
| 425 | string status = 3; |
| 426 | } |
| 427 | |
| 428 | message OnuSignalsFailureIndication { |
| 429 | fixed32 intf_id = 1; |
| 430 | fixed32 onu_id = 2; |
| 431 | string status = 3; |
| 432 | fixed32 inverse_bit_error_rate = 4; |
| 433 | } |
| 434 | |
| 435 | message OnuTransmissionInterferenceWarning { |
| 436 | fixed32 intf_id = 1; |
| 437 | fixed32 onu_id = 2; |
| 438 | string status = 3; |
| 439 | fixed32 drift = 4; |
| 440 | } |
| 441 | |
| 442 | message OnuActivationFailureIndication { |
| 443 | fixed32 intf_id = 1; |
| 444 | fixed32 onu_id = 2; |
| 445 | } |
| 446 | |
| 447 | message OnuProcessingErrorIndication { |
| 448 | fixed32 intf_id = 1; |
| 449 | fixed32 onu_id = 2; |
| 450 | } |
| 451 | |
| 452 | |
| 453 | message Empty {} |