blob: 312d7894512c8f674cd11690b1f7308f4bf9d87d [file] [log] [blame]
Shad Ansari05d6a6e2018-04-06 23:17:50 +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 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
45message 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;
53 }
54}
55
56message OltIndication {
57 string oper_state = 1; // up, down
58}
59
60message IntfIndication {
61 fixed32 intf_id = 1;
62 string oper_state = 2; // up, down
63}
64
65message OnuDiscIndication {
66 fixed32 intf_id = 1;
67 SerialNumber serial_number = 2;
68}
69
70message OnuIndication {
71 fixed32 intf_id = 1;
72 fixed32 onu_id = 2;
73 string oper_state = 3; // up, down
74 SerialNumber serial_number = 4;
75}
76
77message IntfOperIndication {
78 string type = 1; // nni, pon
79 fixed32 intf_id = 2;
80 string oper_state = 3; // up, down
81}
82
83message OmciIndication {
84 fixed32 intf_id = 1;
85 fixed32 onu_id = 2;
86 bytes pkt = 3;
87}
88
89message Onu {
90 fixed32 intf_id = 1;
91 fixed32 onu_id = 2;
92 SerialNumber serial_number = 3;
93}
94
95message OmciMsg {
96 fixed32 intf_id = 1;
97 fixed32 onu_id = 2;
98 bytes pkt = 3;
99}
100
101message Classifier {
102 fixed32 o_tpid = 1;
103 fixed32 o_vid = 2;
104 fixed32 i_tpid = 3;
105 fixed32 i_vid = 4;
106 fixed32 o_pbits = 5;
107 fixed32 i_pbits = 6;
108 fixed32 eth_type = 7;
109 bytes dst_mac = 8;
110 bytes src_mac = 9;
111 fixed32 ip_proto = 10;
112 fixed32 dst_ip = 11;
113 fixed32 src_ip = 12;
114 fixed32 src_port = 13;
115 fixed32 dst_port = 14;
116 string pkt_tag_type = 15; // untagged, single, double
117}
118
119message ActionCmd {
120 bool add_outer_tag = 1;
121 bool remove_outer_tag = 2;
122 bool trap_to_host = 3;
123}
124
125message Action {
126 ActionCmd cmd = 1;
127 fixed32 o_vid = 2;
128 fixed32 o_pbits = 3;
129 fixed32 o_tpid = 4;
130 fixed32 i_vid = 5;
131 fixed32 i_pbits = 6;
132 fixed32 i_tpid = 7;
133}
134
135message Flow {
136 fixed32 access_intf_id = 1;
137 fixed32 onu_id = 2;
138 fixed32 flow_id = 3;
139 string flow_type = 4; // upstream, downstream, broadcast, multicast
140 fixed32 network_intf_id = 5;
141 fixed32 gemport_id = 6;
142 Classifier classifier = 7;
143 Action action = 8;
144}
145
146message SerialNumber {
147 bytes vendor_id = 1;
148 bytes vendor_specific = 2;
149}
150
151message Empty {}