Shad Ansari | 1924958 | 2018-04-30 04:31:00 +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 OnuPacketOut(OnuPacket) returns (Empty) { |
| 36 | option (google.api.http) = { |
| 37 | post: "/v1/OnuPacketOut" |
| 38 | body: "*" |
| 39 | }; |
| 40 | } |
| 41 | |
Nicolas Palpacuer | b78def4 | 2018-06-07 12:55:26 -0400 | [diff] [blame^] | 42 | rpc UplinkPacketOut(UplinkPacket) returns (Empty) { |
| 43 | option (google.api.http) = { |
| 44 | post: "/v1/UplinkPacketOut" |
| 45 | body: "*" |
| 46 | }; |
| 47 | } |
| 48 | |
Shad Ansari | 1924958 | 2018-04-30 04:31:00 +0000 | [diff] [blame] | 49 | rpc FlowAdd(Flow) returns (Empty) { |
| 50 | option (google.api.http) = { |
| 51 | post: "/v1/FlowAdd" |
| 52 | body: "*" |
| 53 | }; |
| 54 | } |
| 55 | |
nick | 7be062f | 2018-05-25 17:52:56 -0400 | [diff] [blame] | 56 | rpc HeartbeatCheck(Empty) returns (Heartbeat) { |
| 57 | option (google.api.http) = { |
| 58 | post: "/v1/HeartbeatCheck" |
| 59 | body: "*" |
| 60 | }; |
| 61 | } |
| 62 | |
Shad Ansari | 1924958 | 2018-04-30 04:31:00 +0000 | [diff] [blame] | 63 | rpc EnableIndication(Empty) returns (stream Indication) {} |
| 64 | } |
| 65 | |
| 66 | message Indication { |
| 67 | oneof data { |
| 68 | OltIndication olt_ind = 1; |
| 69 | IntfIndication intf_ind = 2; |
| 70 | IntfOperIndication intf_oper_ind = 3; |
| 71 | OnuDiscIndication onu_disc_ind = 4; |
| 72 | OnuIndication onu_ind = 5; |
| 73 | OmciIndication omci_ind = 6; |
| 74 | PacketIndication pkt_ind = 7; |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | message OltIndication { |
| 79 | string oper_state = 1; // up, down |
Shad Ansari | 1924958 | 2018-04-30 04:31:00 +0000 | [diff] [blame] | 80 | } |
| 81 | |
| 82 | message IntfIndication { |
| 83 | fixed32 intf_id = 1; |
| 84 | string oper_state = 2; // up, down |
| 85 | } |
| 86 | |
| 87 | message OnuDiscIndication { |
| 88 | fixed32 intf_id = 1; |
| 89 | SerialNumber serial_number = 2; |
| 90 | } |
| 91 | |
| 92 | message OnuIndication { |
| 93 | fixed32 intf_id = 1; |
| 94 | fixed32 onu_id = 2; |
| 95 | string oper_state = 3; // up, down |
Shad Ansari | fe9d942 | 2018-05-22 23:25:02 +0000 | [diff] [blame] | 96 | string admin_state = 5; // up, down |
| 97 | SerialNumber serial_number = 4; |
Shad Ansari | 1924958 | 2018-04-30 04:31:00 +0000 | [diff] [blame] | 98 | } |
| 99 | |
| 100 | message IntfOperIndication { |
| 101 | string type = 1; // nni, pon |
| 102 | fixed32 intf_id = 2; |
| 103 | string oper_state = 3; // up, down |
| 104 | } |
| 105 | |
| 106 | message OmciIndication { |
| 107 | fixed32 intf_id = 1; |
| 108 | fixed32 onu_id = 2; |
| 109 | bytes pkt = 3; |
| 110 | } |
| 111 | |
| 112 | message PacketIndication { |
| 113 | fixed32 intf_id = 1; |
| 114 | fixed32 gemport_id = 2; |
| 115 | fixed32 flow_id = 3; |
| 116 | bytes pkt = 4; |
| 117 | } |
| 118 | |
nick | 7be062f | 2018-05-25 17:52:56 -0400 | [diff] [blame] | 119 | message Heartbeat { |
| 120 | fixed32 heartbeat_signature = 1; |
| 121 | } |
| 122 | |
Shad Ansari | 1924958 | 2018-04-30 04:31:00 +0000 | [diff] [blame] | 123 | message Onu { |
| 124 | fixed32 intf_id = 1; |
| 125 | fixed32 onu_id = 2; |
| 126 | SerialNumber serial_number = 3; |
| 127 | } |
| 128 | |
| 129 | message OmciMsg { |
| 130 | fixed32 intf_id = 1; |
| 131 | fixed32 onu_id = 2; |
| 132 | bytes pkt = 3; |
| 133 | } |
| 134 | |
| 135 | message OnuPacket { |
| 136 | fixed32 intf_id = 1; |
| 137 | fixed32 onu_id = 2; |
| 138 | bytes pkt = 3; |
| 139 | } |
| 140 | |
Nicolas Palpacuer | b78def4 | 2018-06-07 12:55:26 -0400 | [diff] [blame^] | 141 | message UplinkPacket { |
| 142 | fixed32 intf_id = 1; |
| 143 | bytes pkt = 2; |
| 144 | } |
| 145 | |
Shad Ansari | 1924958 | 2018-04-30 04:31:00 +0000 | [diff] [blame] | 146 | message Classifier { |
| 147 | fixed32 o_tpid = 1; |
| 148 | fixed32 o_vid = 2; |
| 149 | fixed32 i_tpid = 3; |
| 150 | fixed32 i_vid = 4; |
| 151 | fixed32 o_pbits = 5; |
| 152 | fixed32 i_pbits = 6; |
| 153 | fixed32 eth_type = 7; |
| 154 | bytes dst_mac = 8; |
| 155 | bytes src_mac = 9; |
| 156 | fixed32 ip_proto = 10; |
| 157 | fixed32 dst_ip = 11; |
| 158 | fixed32 src_ip = 12; |
| 159 | fixed32 src_port = 13; |
| 160 | fixed32 dst_port = 14; |
| 161 | string pkt_tag_type = 15; // untagged, single_tag, double_tag |
| 162 | } |
| 163 | |
| 164 | message ActionCmd { |
| 165 | bool add_outer_tag = 1; |
| 166 | bool remove_outer_tag = 2; |
| 167 | bool trap_to_host = 3; |
| 168 | } |
| 169 | |
| 170 | message Action { |
| 171 | ActionCmd cmd = 1; |
| 172 | fixed32 o_vid = 2; |
| 173 | fixed32 o_pbits = 3; |
| 174 | fixed32 o_tpid = 4; |
| 175 | fixed32 i_vid = 5; |
| 176 | fixed32 i_pbits = 6; |
| 177 | fixed32 i_tpid = 7; |
| 178 | } |
| 179 | |
| 180 | message Flow { |
| 181 | fixed32 access_intf_id = 1; |
| 182 | fixed32 onu_id = 2; |
| 183 | fixed32 flow_id = 3; |
| 184 | string flow_type = 4; // upstream, downstream, broadcast, multicast |
| 185 | fixed32 network_intf_id = 5; |
| 186 | fixed32 gemport_id = 6; |
| 187 | Classifier classifier = 7; |
| 188 | Action action = 8; |
| 189 | } |
| 190 | |
| 191 | message SerialNumber { |
| 192 | bytes vendor_id = 1; |
| 193 | bytes vendor_specific = 2; |
| 194 | } |
| 195 | |
| 196 | message Empty {} |