blob: 3e7218185e0fef88ce32e0363acdd20c0f0a5998 [file] [log] [blame]
Shad Ansari19249582018-04-30 04:31:00 +00001// 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
15syntax = "proto3";
16package openolt;
17import "google/api/annotations.proto";
18
19service 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 Palpacuerb78def42018-06-07 12:55:26 -040042 rpc UplinkPacketOut(UplinkPacket) returns (Empty) {
43 option (google.api.http) = {
44 post: "/v1/UplinkPacketOut"
45 body: "*"
46 };
47 }
48
Shad Ansari19249582018-04-30 04:31:00 +000049 rpc FlowAdd(Flow) returns (Empty) {
50 option (google.api.http) = {
51 post: "/v1/FlowAdd"
52 body: "*"
53 };
54 }
55
nick7be062f2018-05-25 17:52:56 -040056 rpc HeartbeatCheck(Empty) returns (Heartbeat) {
57 option (google.api.http) = {
58 post: "/v1/HeartbeatCheck"
59 body: "*"
60 };
61 }
62
Nicolas Palpacuer0f19b1a2018-06-07 17:29:31 -040063
Shad Ansari19249582018-04-30 04:31:00 +000064 rpc EnableIndication(Empty) returns (stream Indication) {}
65}
66
67message Indication {
68 oneof data {
69 OltIndication olt_ind = 1;
70 IntfIndication intf_ind = 2;
71 IntfOperIndication intf_oper_ind = 3;
72 OnuDiscIndication onu_disc_ind = 4;
73 OnuIndication onu_ind = 5;
74 OmciIndication omci_ind = 6;
75 PacketIndication pkt_ind = 7;
Nicolas Palpacuer0f19b1a2018-06-07 17:29:31 -040076 PortStatistics port_stats = 8;
77 FlowStatistics flow_stats = 9;
Shad Ansari19249582018-04-30 04:31:00 +000078 }
79}
80
81message OltIndication {
82 string oper_state = 1; // up, down
Shad Ansari19249582018-04-30 04:31:00 +000083}
84
85message IntfIndication {
86 fixed32 intf_id = 1;
87 string oper_state = 2; // up, down
88}
89
90message OnuDiscIndication {
91 fixed32 intf_id = 1;
92 SerialNumber serial_number = 2;
93}
94
95message OnuIndication {
96 fixed32 intf_id = 1;
97 fixed32 onu_id = 2;
98 string oper_state = 3; // up, down
Shad Ansarife9d9422018-05-22 23:25:02 +000099 string admin_state = 5; // up, down
100 SerialNumber serial_number = 4;
Shad Ansari19249582018-04-30 04:31:00 +0000101}
102
103message IntfOperIndication {
104 string type = 1; // nni, pon
105 fixed32 intf_id = 2;
106 string oper_state = 3; // up, down
107}
108
109message OmciIndication {
110 fixed32 intf_id = 1;
111 fixed32 onu_id = 2;
112 bytes pkt = 3;
113}
114
115message PacketIndication {
116 fixed32 intf_id = 1;
117 fixed32 gemport_id = 2;
118 fixed32 flow_id = 3;
119 bytes pkt = 4;
120}
121
nick7be062f2018-05-25 17:52:56 -0400122message Heartbeat {
123 fixed32 heartbeat_signature = 1;
124}
125
Shad Ansari19249582018-04-30 04:31:00 +0000126message Onu {
127 fixed32 intf_id = 1;
128 fixed32 onu_id = 2;
129 SerialNumber serial_number = 3;
130}
131
132message OmciMsg {
133 fixed32 intf_id = 1;
134 fixed32 onu_id = 2;
135 bytes pkt = 3;
136}
137
138message OnuPacket {
139 fixed32 intf_id = 1;
140 fixed32 onu_id = 2;
141 bytes pkt = 3;
142}
143
Nicolas Palpacuerb78def42018-06-07 12:55:26 -0400144message UplinkPacket {
145 fixed32 intf_id = 1;
146 bytes pkt = 2;
147}
148
Shad Ansari19249582018-04-30 04:31:00 +0000149message Classifier {
150 fixed32 o_tpid = 1;
151 fixed32 o_vid = 2;
152 fixed32 i_tpid = 3;
153 fixed32 i_vid = 4;
154 fixed32 o_pbits = 5;
155 fixed32 i_pbits = 6;
156 fixed32 eth_type = 7;
157 bytes dst_mac = 8;
158 bytes src_mac = 9;
159 fixed32 ip_proto = 10;
160 fixed32 dst_ip = 11;
161 fixed32 src_ip = 12;
162 fixed32 src_port = 13;
163 fixed32 dst_port = 14;
164 string pkt_tag_type = 15; // untagged, single_tag, double_tag
165}
166
167message ActionCmd {
168 bool add_outer_tag = 1;
169 bool remove_outer_tag = 2;
170 bool trap_to_host = 3;
171}
172
173message Action {
174 ActionCmd cmd = 1;
175 fixed32 o_vid = 2;
176 fixed32 o_pbits = 3;
177 fixed32 o_tpid = 4;
178 fixed32 i_vid = 5;
179 fixed32 i_pbits = 6;
180 fixed32 i_tpid = 7;
181}
182
183message Flow {
184 fixed32 access_intf_id = 1;
185 fixed32 onu_id = 2;
186 fixed32 flow_id = 3;
187 string flow_type = 4; // upstream, downstream, broadcast, multicast
188 fixed32 network_intf_id = 5;
189 fixed32 gemport_id = 6;
190 Classifier classifier = 7;
191 Action action = 8;
192}
193
194message SerialNumber {
195 bytes vendor_id = 1;
196 bytes vendor_specific = 2;
197}
198
Nicolas Palpacuer0f19b1a2018-06-07 17:29:31 -0400199message PortStatistics {
200 fixed32 intf_id = 1;
201 fixed64 rx_bytes = 2;
202 fixed64 rx_packets = 3;
203 fixed64 rx_ucast_packets = 4;
204 fixed64 rx_mcast_packets = 5;
205 fixed64 rx_bcast_packets = 6;
206 fixed64 rx_error_packets = 7;
207 fixed64 tx_bytes = 8;
208 fixed64 tx_packets = 9;
209 fixed64 tx_ucast_packets = 10;
210 fixed64 tx_mcast_packets = 11;
211 fixed64 tx_bcast_packets = 12;
212 fixed64 tx_error_packets = 13;
213 fixed64 rx_crc_errors = 14;
214 fixed64 bip_errors = 15;
215 fixed32 timestamp = 16;
216}
217
218message FlowStatistics {
219 fixed32 flow_id = 1;
220 fixed64 rx_bytes = 2;
221 fixed64 rx_packets = 3;
222 fixed64 tx_bytes = 8;
223 fixed64 tx_packets = 9;
224 fixed32 timestamp = 16;
225}
226
Shad Ansari19249582018-04-30 04:31:00 +0000227message Empty {}