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