Shad Ansari | 05d6a6e | 2018-04-06 23:17:50 +0000 | [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 ActivateOnu(Onu) returns (Empty) { |
| 22 | option (google.api.http) = { |
| 23 | post: "/v1/EnableOnu" |
| 24 | body: "*" |
| 25 | }; |
| 26 | } |
| 27 | |
| 28 | rpc OmciMsgOut(OmciMsg) returns (Empty) { |
| 29 | option (google.api.http) = { |
| 30 | post: "/v1/OmciMsgOut" |
| 31 | body: "*" |
| 32 | }; |
| 33 | } |
| 34 | |
| 35 | rpc FlowAdd(Flow) returns (Empty) { |
| 36 | option (google.api.http) = { |
| 37 | post: "/v1/FlowAdd" |
| 38 | body: "*" |
| 39 | }; |
| 40 | } |
| 41 | |
| 42 | rpc EnableIndication(Empty) returns (stream Indication) {} |
| 43 | } |
| 44 | |
| 45 | message Indication { |
| 46 | oneof data { |
| 47 | OltIndication olt_ind = 1; |
| 48 | IntfIndication intf_ind = 2; |
| 49 | IntfOperIndication intf_oper_ind = 3; |
| 50 | OnuDiscIndication onu_disc_ind = 4; |
| 51 | OnuIndication onu_ind = 5; |
| 52 | OmciIndication omci_ind = 6; |
Shad Ansari | f32ebd9 | 2018-04-23 18:52:26 +0000 | [diff] [blame] | 53 | PacketIndication pkt_ind = 7; |
Shad Ansari | 05d6a6e | 2018-04-06 23:17:50 +0000 | [diff] [blame] | 54 | } |
| 55 | } |
| 56 | |
| 57 | message OltIndication { |
| 58 | string oper_state = 1; // up, down |
| 59 | } |
| 60 | |
| 61 | message IntfIndication { |
| 62 | fixed32 intf_id = 1; |
| 63 | string oper_state = 2; // up, down |
| 64 | } |
| 65 | |
| 66 | message OnuDiscIndication { |
| 67 | fixed32 intf_id = 1; |
| 68 | SerialNumber serial_number = 2; |
| 69 | } |
| 70 | |
| 71 | message OnuIndication { |
| 72 | fixed32 intf_id = 1; |
| 73 | fixed32 onu_id = 2; |
| 74 | string oper_state = 3; // up, down |
| 75 | SerialNumber serial_number = 4; |
| 76 | } |
| 77 | |
| 78 | message IntfOperIndication { |
| 79 | string type = 1; // nni, pon |
| 80 | fixed32 intf_id = 2; |
| 81 | string oper_state = 3; // up, down |
| 82 | } |
| 83 | |
| 84 | message OmciIndication { |
| 85 | fixed32 intf_id = 1; |
| 86 | fixed32 onu_id = 2; |
| 87 | bytes pkt = 3; |
| 88 | } |
| 89 | |
Shad Ansari | 6b5b367 | 2018-04-23 18:44:15 +0000 | [diff] [blame] | 90 | message PacketIndication { |
Shad Ansari | 235a44a | 2018-04-23 17:53:20 +0000 | [diff] [blame] | 91 | fixed32 intf_id = 1; |
| 92 | fixed32 gemport_id = 2; |
| 93 | fixed32 flow_id = 3; |
Shad Ansari | 6b5b367 | 2018-04-23 18:44:15 +0000 | [diff] [blame] | 94 | bytes pkt = 4; |
Shad Ansari | 235a44a | 2018-04-23 17:53:20 +0000 | [diff] [blame] | 95 | } |
| 96 | |
Shad Ansari | 05d6a6e | 2018-04-06 23:17:50 +0000 | [diff] [blame] | 97 | message Onu { |
| 98 | fixed32 intf_id = 1; |
| 99 | fixed32 onu_id = 2; |
| 100 | SerialNumber serial_number = 3; |
| 101 | } |
| 102 | |
| 103 | message OmciMsg { |
| 104 | fixed32 intf_id = 1; |
| 105 | fixed32 onu_id = 2; |
| 106 | bytes pkt = 3; |
| 107 | } |
| 108 | |
| 109 | message Classifier { |
| 110 | fixed32 o_tpid = 1; |
| 111 | fixed32 o_vid = 2; |
| 112 | fixed32 i_tpid = 3; |
| 113 | fixed32 i_vid = 4; |
| 114 | fixed32 o_pbits = 5; |
| 115 | fixed32 i_pbits = 6; |
| 116 | fixed32 eth_type = 7; |
| 117 | bytes dst_mac = 8; |
| 118 | bytes src_mac = 9; |
| 119 | fixed32 ip_proto = 10; |
| 120 | fixed32 dst_ip = 11; |
| 121 | fixed32 src_ip = 12; |
| 122 | fixed32 src_port = 13; |
| 123 | fixed32 dst_port = 14; |
Shad Ansari | 0077c55 | 2018-04-23 22:48:07 +0000 | [diff] [blame^] | 124 | string pkt_tag_type = 15; // untagged, single_tag, double_tag |
Shad Ansari | 05d6a6e | 2018-04-06 23:17:50 +0000 | [diff] [blame] | 125 | } |
| 126 | |
Shad Ansari | 1b3c94d | 2018-04-23 22:46:54 +0000 | [diff] [blame] | 127 | message ActionCmd { |
Shad Ansari | 05d6a6e | 2018-04-06 23:17:50 +0000 | [diff] [blame] | 128 | bool add_outer_tag = 1; |
| 129 | bool remove_outer_tag = 2; |
| 130 | bool trap_to_host = 3; |
| 131 | } |
| 132 | |
| 133 | message Action { |
| 134 | ActionCmd cmd = 1; |
| 135 | fixed32 o_vid = 2; |
| 136 | fixed32 o_pbits = 3; |
| 137 | fixed32 o_tpid = 4; |
| 138 | fixed32 i_vid = 5; |
| 139 | fixed32 i_pbits = 6; |
| 140 | fixed32 i_tpid = 7; |
| 141 | } |
| 142 | |
| 143 | message Flow { |
| 144 | fixed32 access_intf_id = 1; |
| 145 | fixed32 onu_id = 2; |
| 146 | fixed32 flow_id = 3; |
| 147 | string flow_type = 4; // upstream, downstream, broadcast, multicast |
| 148 | fixed32 network_intf_id = 5; |
| 149 | fixed32 gemport_id = 6; |
| 150 | Classifier classifier = 7; |
| 151 | Action action = 8; |
| 152 | } |
| 153 | |
| 154 | message SerialNumber { |
| 155 | bytes vendor_id = 1; |
| 156 | bytes vendor_specific = 2; |
| 157 | } |
| 158 | |
| 159 | message Empty {} |