Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [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 | package openolt; |
| 17 | import "google/api/annotations.proto"; |
| 18 | |
| 19 | service Openolt { |
| 20 | |
| 21 | rpc DisableOlt(Empty) returns (Empty) { |
| 22 | option (google.api.http) = { |
| 23 | post: "/v1/Disable" |
| 24 | body: "*" |
| 25 | }; |
| 26 | } |
| 27 | |
| 28 | rpc ReenableOlt(Empty) returns (Empty) { |
| 29 | option (google.api.http) = { |
| 30 | post: "/v1/Reenable" |
| 31 | body: "*" |
| 32 | }; |
| 33 | } |
| 34 | |
| 35 | rpc ActivateOnu(Onu) returns (Empty) { |
| 36 | option (google.api.http) = { |
| 37 | post: "/v1/EnableOnu" |
| 38 | body: "*" |
| 39 | }; |
| 40 | } |
| 41 | |
| 42 | rpc DeactivateOnu(Onu) returns (Empty) { |
| 43 | option (google.api.http) = { |
| 44 | post: "/v1/DisableOnu" |
| 45 | body: "*" |
| 46 | }; |
| 47 | } |
| 48 | |
| 49 | rpc DeleteOnu(Onu) returns (Empty) { |
| 50 | option (google.api.http) = { |
| 51 | post: "/v1/DeleteOnu" |
| 52 | body: "*" |
| 53 | }; |
| 54 | } |
| 55 | |
| 56 | rpc OmciMsgOut(OmciMsg) returns (Empty) { |
| 57 | option (google.api.http) = { |
| 58 | post: "/v1/OmciMsgOut" |
| 59 | body: "*" |
| 60 | }; |
| 61 | } |
| 62 | |
| 63 | rpc OnuPacketOut(OnuPacket) returns (Empty) { |
| 64 | option (google.api.http) = { |
| 65 | post: "/v1/OnuPacketOut" |
| 66 | body: "*" |
| 67 | }; |
| 68 | } |
| 69 | |
| 70 | rpc UplinkPacketOut(UplinkPacket) returns (Empty) { |
| 71 | option (google.api.http) = { |
| 72 | post: "/v1/UplinkPacketOut" |
| 73 | body: "*" |
| 74 | }; |
| 75 | } |
| 76 | |
| 77 | rpc FlowAdd(Flow) returns (Empty) { |
| 78 | option (google.api.http) = { |
| 79 | post: "/v1/FlowAdd" |
| 80 | body: "*" |
| 81 | }; |
| 82 | } |
| 83 | |
| 84 | rpc FlowRemove(Flow) returns (Empty) { |
| 85 | option (google.api.http) = { |
| 86 | post: "/v1/FlowRemove" |
| 87 | body: "*" |
| 88 | }; |
| 89 | } |
| 90 | |
| 91 | rpc HeartbeatCheck(Empty) returns (Heartbeat) { |
| 92 | option (google.api.http) = { |
| 93 | post: "/v1/HeartbeatCheck" |
| 94 | body: "*" |
| 95 | }; |
| 96 | } |
| 97 | |
| 98 | rpc EnablePonIf(Interface) returns (Empty) { |
| 99 | option (google.api.http) = { |
| 100 | post: "/v1/EnablePonIf" |
| 101 | body: "*" |
| 102 | }; |
| 103 | } |
| 104 | |
| 105 | rpc DisablePonIf(Interface) returns (Empty) { |
| 106 | option (google.api.http) = { |
| 107 | post: "/v1/DisablePonIf" |
| 108 | body: "*" |
| 109 | }; |
| 110 | } |
| 111 | |
| 112 | rpc GetDeviceInfo(Empty) returns (DeviceInfo) { |
| 113 | option (google.api.http) = { |
| 114 | post: "/v1/GetDeviceInfo" |
| 115 | body: "*" |
| 116 | }; |
| 117 | } |
| 118 | |
| 119 | rpc Reboot(Empty) returns (Empty) { |
| 120 | option (google.api.http) = { |
| 121 | post: "/v1/Reboot" |
| 122 | body: "*" |
| 123 | }; |
| 124 | } |
| 125 | |
| 126 | rpc CollectStatistics(Empty) returns (Empty) { |
| 127 | option (google.api.http) = { |
| 128 | post: "/v1/CollectStatistics" |
| 129 | body: "*" |
| 130 | }; |
| 131 | } |
| 132 | |
| 133 | rpc CreateTconts(Tconts) returns (Empty) { |
| 134 | option (google.api.http) = { |
| 135 | post: "/v1/CreateTconts" |
| 136 | body: "*" |
| 137 | }; |
| 138 | } |
| 139 | |
| 140 | rpc RemoveTconts(Tconts) returns (Empty) { |
| 141 | option (google.api.http) = { |
| 142 | post: "/v1/RemoveTconts" |
| 143 | body: "*" |
| 144 | }; |
| 145 | } |
| 146 | |
| 147 | rpc EnableIndication(Empty) returns (stream Indication) {} |
| 148 | } |
| 149 | |
| 150 | message Indication { |
| 151 | oneof data { |
| 152 | OltIndication olt_ind = 1; |
| 153 | IntfIndication intf_ind = 2; |
| 154 | IntfOperIndication intf_oper_ind = 3; |
| 155 | OnuDiscIndication onu_disc_ind = 4; |
| 156 | OnuIndication onu_ind = 5; |
| 157 | OmciIndication omci_ind = 6; |
| 158 | PacketIndication pkt_ind = 7; |
| 159 | PortStatistics port_stats = 8; |
| 160 | FlowStatistics flow_stats = 9; |
| 161 | AlarmIndication alarm_ind= 10; |
| 162 | } |
| 163 | } |
| 164 | |
| 165 | message AlarmIndication { |
| 166 | oneof data { |
| 167 | LosIndication los_ind = 1; |
| 168 | DyingGaspIndication dying_gasp_ind = 2; |
| 169 | OnuAlarmIndication onu_alarm_ind = 3; |
| 170 | OnuStartupFailureIndication onu_startup_fail_ind = 4; |
| 171 | OnuSignalDegradeIndication onu_signal_degrade_ind = 5; |
| 172 | OnuDriftOfWindowIndication onu_drift_of_window_ind = 6; |
| 173 | OnuLossOfOmciChannelIndication onu_loss_omci_ind = 7; |
| 174 | OnuSignalsFailureIndication onu_signals_fail_ind = 8; |
| 175 | OnuTransmissionInterferenceWarning onu_tiwi_ind = 9; |
| 176 | OnuActivationFailureIndication onu_activation_fail_ind = 10; |
| 177 | OnuProcessingErrorIndication onu_processing_error_ind = 11; |
| 178 | } |
| 179 | } |
| 180 | |
| 181 | message OltIndication { |
| 182 | string oper_state = 1; // up, down |
| 183 | } |
| 184 | |
| 185 | message IntfIndication { |
| 186 | fixed32 intf_id = 1; |
| 187 | string oper_state = 2; // up, down |
| 188 | } |
| 189 | |
| 190 | message OnuDiscIndication { |
| 191 | fixed32 intf_id = 1; |
| 192 | SerialNumber serial_number = 2; |
| 193 | } |
| 194 | |
| 195 | message OnuIndication { |
| 196 | fixed32 intf_id = 1; |
| 197 | fixed32 onu_id = 2; |
| 198 | string oper_state = 3; // up, down |
| 199 | string admin_state = 5; // up, down |
| 200 | SerialNumber serial_number = 4; |
| 201 | } |
| 202 | |
| 203 | message IntfOperIndication { |
| 204 | string type = 1; // nni, pon |
| 205 | fixed32 intf_id = 2; |
| 206 | string oper_state = 3; // up, down |
| 207 | } |
| 208 | |
| 209 | message OmciIndication { |
| 210 | fixed32 intf_id = 1; |
| 211 | fixed32 onu_id = 2; |
| 212 | bytes pkt = 3; |
| 213 | } |
| 214 | |
| 215 | message PacketIndication { |
| 216 | string intf_type = 5; // nni, pon, unknown |
| 217 | fixed32 intf_id = 1; |
| 218 | fixed32 gemport_id = 2; |
| 219 | fixed32 flow_id = 3; |
| 220 | fixed32 port_no = 6; |
| 221 | fixed64 cookie = 7; |
| 222 | bytes pkt = 4; |
| 223 | } |
| 224 | |
| 225 | message Interface { |
| 226 | fixed32 intf_id = 1; |
| 227 | } |
| 228 | |
| 229 | message Heartbeat { |
| 230 | fixed32 heartbeat_signature = 1; |
| 231 | } |
| 232 | |
| 233 | message Onu { |
| 234 | fixed32 intf_id = 1; |
| 235 | fixed32 onu_id = 2; |
| 236 | SerialNumber serial_number = 3; |
| 237 | fixed32 pir = 4; // peak information rate assigned to onu |
| 238 | } |
| 239 | |
| 240 | message OmciMsg { |
| 241 | fixed32 intf_id = 1; |
| 242 | fixed32 onu_id = 2; |
| 243 | bytes pkt = 3; |
| 244 | } |
| 245 | |
| 246 | message OnuPacket { |
| 247 | fixed32 intf_id = 1; |
| 248 | fixed32 onu_id = 2; |
| 249 | fixed32 port_no = 4; |
| 250 | bytes pkt = 3; |
| 251 | } |
| 252 | |
| 253 | message UplinkPacket { |
| 254 | fixed32 intf_id = 1; |
| 255 | bytes pkt = 2; |
| 256 | } |
| 257 | |
| 258 | message DeviceInfo { |
| 259 | string vendor = 1; |
| 260 | string model = 2; |
| 261 | string hardware_version = 3; |
| 262 | string firmware_version = 4; |
| 263 | string device_id = 16; |
| 264 | string device_serial_number = 17; |
| 265 | |
| 266 | // Total number of pon intf ports on the device |
| 267 | fixed32 pon_ports = 12; |
| 268 | |
| 269 | // If using global per-device technology profile. To be deprecated |
| 270 | string technology = 5; |
| 271 | fixed32 onu_id_start = 6; |
| 272 | fixed32 onu_id_end = 7; |
| 273 | fixed32 alloc_id_start = 8; |
| 274 | fixed32 alloc_id_end = 9; |
| 275 | fixed32 gemport_id_start = 10; |
| 276 | fixed32 gemport_id_end = 11; |
| 277 | fixed32 flow_id_start = 13; |
| 278 | fixed32 flow_id_end = 14; |
| 279 | |
| 280 | message DeviceResourceRanges { |
| 281 | |
| 282 | // List of 0 or more intf_ids that use the same technology and pools. |
| 283 | // If 0 intf_ids supplied, it implies ALL interfaces |
| 284 | repeated fixed32 intf_ids = 1; |
| 285 | |
| 286 | // Technology profile for this pool |
| 287 | string technology = 2; |
| 288 | |
| 289 | message Pool { |
| 290 | enum PoolType { |
| 291 | ONU_ID = 0; |
| 292 | ALLOC_ID = 1; |
| 293 | GEMPORT_ID = 2; |
| 294 | FLOW_ID = 3; |
| 295 | } |
| 296 | |
| 297 | enum SharingType { |
| 298 | DEDICATED_PER_INTF = 0; |
| 299 | SHARED_BY_ALL_INTF_ALL_TECH = 1; // Shared across all interfaces in all technologies in all ranges |
| 300 | SHARED_BY_ALL_INTF_SAME_TECH = 2; // Shared across all interfaces of the same technology used in this range |
| 301 | } |
| 302 | |
| 303 | PoolType type = 1; |
| 304 | SharingType sharing = 2; |
| 305 | fixed32 start = 3; // lower bound on IDs allocated from this pool |
| 306 | fixed32 end = 4; // upper bound on IDs allocated from this pool |
| 307 | } |
| 308 | repeated Pool pools = 3; |
| 309 | } |
| 310 | repeated DeviceResourceRanges ranges = 15; |
| 311 | } |
| 312 | |
| 313 | message Classifier { |
| 314 | fixed32 o_tpid = 1; |
| 315 | fixed32 o_vid = 2; |
| 316 | fixed32 i_tpid = 3; |
| 317 | fixed32 i_vid = 4; |
| 318 | fixed32 o_pbits = 5; |
| 319 | fixed32 i_pbits = 6; |
| 320 | fixed32 eth_type = 7; |
| 321 | bytes dst_mac = 8; |
| 322 | bytes src_mac = 9; |
| 323 | fixed32 ip_proto = 10; |
| 324 | fixed32 dst_ip = 11; |
| 325 | fixed32 src_ip = 12; |
| 326 | fixed32 src_port = 13; |
| 327 | fixed32 dst_port = 14; |
| 328 | string pkt_tag_type = 15; // untagged, single_tag, double_tag |
| 329 | } |
| 330 | |
| 331 | message ActionCmd { |
| 332 | bool add_outer_tag = 1; |
| 333 | bool remove_outer_tag = 2; |
| 334 | bool trap_to_host = 3; |
| 335 | } |
| 336 | |
| 337 | message Action { |
| 338 | ActionCmd cmd = 1; |
| 339 | fixed32 o_vid = 2; |
| 340 | fixed32 o_pbits = 3; |
| 341 | fixed32 o_tpid = 4; |
| 342 | fixed32 i_vid = 5; |
| 343 | fixed32 i_pbits = 6; |
| 344 | fixed32 i_tpid = 7; |
| 345 | } |
| 346 | |
| 347 | message Flow { |
| 348 | sfixed32 access_intf_id = 1; |
| 349 | sfixed32 onu_id = 2; |
| 350 | sfixed32 uni_id = 11; |
| 351 | fixed32 flow_id = 3; |
| 352 | string flow_type = 4; // upstream, downstream, broadcast, multicast |
| 353 | sfixed32 alloc_id = 10; |
| 354 | sfixed32 network_intf_id = 5; |
| 355 | sfixed32 gemport_id = 6; |
| 356 | Classifier classifier = 7; |
| 357 | Action action = 8; |
| 358 | sfixed32 priority = 9; |
| 359 | fixed64 cookie = 12; // must be provided for any flow with trap_to_host action. Returned in PacketIndication |
| 360 | fixed32 port_no = 13; // must be provided for any flow with trap_to_host action. Returned in PacketIndication |
| 361 | } |
| 362 | |
| 363 | message SerialNumber { |
| 364 | bytes vendor_id = 1; |
| 365 | bytes vendor_specific = 2; |
| 366 | } |
| 367 | |
| 368 | message PortStatistics { |
| 369 | fixed32 intf_id = 1; |
| 370 | fixed64 rx_bytes = 2; |
| 371 | fixed64 rx_packets = 3; |
| 372 | fixed64 rx_ucast_packets = 4; |
| 373 | fixed64 rx_mcast_packets = 5; |
| 374 | fixed64 rx_bcast_packets = 6; |
| 375 | fixed64 rx_error_packets = 7; |
| 376 | fixed64 tx_bytes = 8; |
| 377 | fixed64 tx_packets = 9; |
| 378 | fixed64 tx_ucast_packets = 10; |
| 379 | fixed64 tx_mcast_packets = 11; |
| 380 | fixed64 tx_bcast_packets = 12; |
| 381 | fixed64 tx_error_packets = 13; |
| 382 | fixed64 rx_crc_errors = 14; |
| 383 | fixed64 bip_errors = 15; |
| 384 | fixed32 timestamp = 16; |
| 385 | } |
| 386 | |
| 387 | message FlowStatistics { |
| 388 | fixed32 flow_id = 1; |
| 389 | fixed64 rx_bytes = 2; |
| 390 | fixed64 rx_packets = 3; |
| 391 | fixed64 tx_bytes = 8; |
| 392 | fixed64 tx_packets = 9; |
| 393 | fixed32 timestamp = 16; |
| 394 | } |
| 395 | |
| 396 | message LosIndication { |
| 397 | fixed32 intf_id = 1; |
| 398 | string status = 2; |
| 399 | } |
| 400 | |
| 401 | message DyingGaspIndication { |
| 402 | fixed32 intf_id = 1; |
| 403 | fixed32 onu_id = 2; |
| 404 | string status = 3; |
| 405 | } |
| 406 | |
| 407 | message OnuAlarmIndication { |
| 408 | fixed32 intf_id = 1; |
| 409 | fixed32 onu_id = 2; |
| 410 | string los_status = 3; |
| 411 | string lob_status = 4; |
| 412 | string lopc_miss_status = 5; |
| 413 | string lopc_mic_error_status = 6; |
| 414 | } |
| 415 | |
| 416 | message OnuStartupFailureIndication { |
| 417 | fixed32 intf_id = 1; |
| 418 | fixed32 onu_id = 2; |
| 419 | string status = 3; |
| 420 | } |
| 421 | |
| 422 | message OnuSignalDegradeIndication { |
| 423 | fixed32 intf_id = 1; |
| 424 | fixed32 onu_id = 2; |
| 425 | string status = 3; |
| 426 | fixed32 inverse_bit_error_rate = 4; |
| 427 | } |
| 428 | |
| 429 | message OnuDriftOfWindowIndication { |
| 430 | fixed32 intf_id = 1; |
| 431 | fixed32 onu_id = 2; |
| 432 | string status = 3; |
| 433 | fixed32 drift = 4; |
| 434 | fixed32 new_eqd = 5; |
| 435 | } |
| 436 | |
| 437 | message OnuLossOfOmciChannelIndication { |
| 438 | fixed32 intf_id = 1; |
| 439 | fixed32 onu_id = 2; |
| 440 | string status = 3; |
| 441 | } |
| 442 | |
| 443 | message OnuSignalsFailureIndication { |
| 444 | fixed32 intf_id = 1; |
| 445 | fixed32 onu_id = 2; |
| 446 | string status = 3; |
| 447 | fixed32 inverse_bit_error_rate = 4; |
| 448 | } |
| 449 | |
| 450 | message OnuTransmissionInterferenceWarning { |
| 451 | fixed32 intf_id = 1; |
| 452 | fixed32 onu_id = 2; |
| 453 | string status = 3; |
| 454 | fixed32 drift = 4; |
| 455 | } |
| 456 | |
| 457 | message OnuActivationFailureIndication { |
| 458 | fixed32 intf_id = 1; |
| 459 | fixed32 onu_id = 2; |
| 460 | } |
| 461 | |
| 462 | message OnuProcessingErrorIndication { |
| 463 | fixed32 intf_id = 1; |
| 464 | fixed32 onu_id = 2; |
| 465 | } |
| 466 | |
| 467 | enum Direction { |
| 468 | UPSTREAM = 0; |
| 469 | DOWNSTREAM = 1; |
| 470 | BIDIRECTIONAL = 2; |
| 471 | } |
| 472 | |
| 473 | enum SchedulingPolicy { |
| 474 | WRR = 0; |
| 475 | StrictPriority = 1; |
| 476 | Hybrid = 2; |
| 477 | } |
| 478 | |
| 479 | enum AdditionalBW { |
| 480 | AdditionalBW_None = 0; |
| 481 | AdditionalBW_NA = 1; |
| 482 | AdditionalBW_BestEffort = 2; |
| 483 | AdditionalBW_Auto = 3; |
| 484 | } |
| 485 | |
| 486 | enum DiscardPolicy { |
| 487 | TailDrop = 0; |
| 488 | WTailDrop = 1; |
| 489 | Red = 2; |
| 490 | WRed = 3; |
| 491 | } |
| 492 | |
| 493 | enum InferredAdditionBWIndication { |
| 494 | InferredAdditionBWIndication_None = 0; |
| 495 | InferredAdditionBWIndication_Assured = 1; |
| 496 | InferredAdditionBWIndication_BestEffort = 2; |
| 497 | } |
| 498 | |
| 499 | message Scheduler { |
| 500 | Direction direction = 1; |
| 501 | AdditionalBW additional_bw = 2; // Valid on for “direction == Upstream”. |
| 502 | fixed32 priority = 3; |
| 503 | fixed32 weight = 4; |
| 504 | SchedulingPolicy sched_policy = 5; |
| 505 | } |
| 506 | |
| 507 | message TrafficShapingInfo { |
| 508 | fixed32 cir = 1; |
| 509 | fixed32 cbs = 2; |
| 510 | fixed32 pir = 3; |
| 511 | fixed32 pbs = 4; |
| 512 | fixed32 gir = 5; // only if “direction == Upstream ” |
| 513 | InferredAdditionBWIndication add_bw_ind = 6; // only if “direction == Upstream” |
| 514 | } |
| 515 | |
| 516 | message Tcont { |
| 517 | Direction direction = 1; |
| 518 | fixed32 alloc_id = 2; // valid only if “direction == Upstream ” |
| 519 | Scheduler scheduler = 3; |
| 520 | TrafficShapingInfo traffic_shaping_info = 4; |
| 521 | } |
| 522 | |
| 523 | message Tconts { |
| 524 | fixed32 intf_id = 1; |
| 525 | fixed32 onu_id = 2; |
| 526 | fixed32 uni_id = 4; |
| 527 | fixed32 port_no = 5; |
| 528 | repeated Tcont tconts = 3; |
| 529 | } |
| 530 | |
| 531 | message TailDropDiscardConfig { |
| 532 | fixed32 queue_size = 1; |
| 533 | } |
| 534 | |
| 535 | message RedDiscardConfig { |
| 536 | fixed32 min_threshold = 1; |
| 537 | fixed32 max_threshold = 2; |
| 538 | fixed32 max_probability = 3; |
| 539 | } |
| 540 | |
| 541 | message WRedDiscardConfig { |
| 542 | RedDiscardConfig green = 1; |
| 543 | RedDiscardConfig yellow = 2; |
| 544 | RedDiscardConfig red = 3; |
| 545 | } |
| 546 | |
| 547 | message DiscardConfig { |
| 548 | DiscardPolicy discard_policy = 1; |
| 549 | oneof discard_config { |
| 550 | TailDropDiscardConfig tail_drop_discard_config = 2; |
| 551 | RedDiscardConfig red_discard_config = 3; |
| 552 | WRedDiscardConfig wred_discard_config = 4; |
| 553 | } |
| 554 | } |
| 555 | |
| 556 | message Empty {} |