blob: 5167f2c945eb040f6c9aa2e8383919910f5bd5eb [file] [log] [blame]
Matteo Scandolo84f7d482019-08-08 19:00:47 -07001// 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 bbsim;
17
Pragya Arya8bdb4532020-03-02 17:08:09 +053018import "voltha_protos/openolt.proto";
Anand S Katti09541352020-01-29 15:54:01 +053019import "voltha_protos/tech_profile.proto";
Matteo Scandolo10f965c2019-09-24 10:40:46 -070020// Models
21
Matteo Scandolo84f7d482019-08-08 19:00:47 -070022message PONPort {
23 int32 ID = 1;
24 string OperState = 2;
25}
26
27message NNIPort {
28 int32 ID = 1;
29 string OperState = 2;
30}
31
32message Olt {
33 int32 ID = 1;
Matteo Scandolo8df63df2019-09-12 10:34:32 -070034 string SerialNumber = 2;
35 string OperState = 3;
36 string InternalState = 4;
rajeshf921f882020-03-06 18:24:28 +053037 string IP = 7;
Matteo Scandolo8df63df2019-09-12 10:34:32 -070038 repeated NNIPort NNIPorts = 5;
39 repeated PONPort PONPorts = 6;
Matteo Scandolo9a3518c2019-08-13 14:36:01 -070040}
41
42message ONU {
43 int32 ID = 1;
44 string SerialNumber = 2;
45 string OperState = 3;
46 string InternalState = 4;
47 int32 PonPortID = 5;
Matteo Scandolo4b3fc7e2019-09-17 16:49:54 -070048 int32 STag = 6;
49 int32 CTag = 7;
50 string HwAddress = 8;
Matteo Scandolo27428702019-10-11 16:21:16 -070051 int32 PortNo = 9;
Matteo Scandolo9a3518c2019-08-13 14:36:01 -070052}
53
Anand S Katti09541352020-01-29 15:54:01 +053054message ONUTrafficSchedulers {
55 tech_profile.TrafficSchedulers traffSchedulers = 1;
56}
57
Matteo Scandolo9a3518c2019-08-13 14:36:01 -070058message ONUs {
59 repeated ONU items = 1;
Matteo Scandolo84f7d482019-08-08 19:00:47 -070060}
61
Matteo Scandolo10f965c2019-09-24 10:40:46 -070062// Inputs
63
64message ONURequest {
65 string SerialNumber = 1;
66}
67
Scott Baker41724b82020-01-21 19:54:53 -080068// Alarms
69
70message AlarmType {
71 // These types correspond to the messages permitted in the oneof
72 // in AlarmIndication in the openolt protos
73 enum Types {
74 LOS = 0; // LOS is an OLT alarm for an entire PON
75 DYING_GASP = 1;
76 ONU_ALARM = 2;
77 ONU_STARTUP_FAILURE = 3;
78 ONU_SIGNAL_DEGRADE = 4;
79 ONU_DRIFT_OF_WINDOW = 5;
80 ONU_LOSS_OF_OMCI_CHANNEL = 6;
81 ONU_SIGNALS_FAILURE = 7;
82 ONU_TRANSMISSION_INTERFERENCE_WARNING = 8;
83 ONU_ACTIVATION_FAILURE = 9;
84 ONU_PROCESSING_ERROR = 10;
85 ONU_LOSS_OF_KEY_SYNC_FAILURE = 11;
86 ONU_ITU_PON_STATS = 12;
87
88 // These break out ONU_ALARM, which is a single message, but
89 // includes statuses for these six alarms.
90 ONU_ALARM_LOS = 13;
91 ONU_ALARM_LOB = 14;
92 ONU_ALARM_LOPC_MISS = 15;
93 ONU_ALARM_LOPC_MIC_ERROR = 16;
94 ONU_ALARM_LOFI = 17;
95 ONU_ALARM_LOAMI = 18;
96 }
97}
98
99message AlarmParameter {
100 string Key = 1;
101 string Value = 2;
102}
103
Anand S Katti86552f92020-03-03 21:56:32 +0530104// ONUAlarmRequest includes fields common to every Onu alarm,
Anand S Katti09541352020-01-29 15:54:01 +0530105// plus an optional list of AlarmParameter list that can be used
Scott Baker41724b82020-01-21 19:54:53 -0800106// to set additional fields in alarms that support them.
Anand S Katti86552f92020-03-03 21:56:32 +0530107message ONUAlarmRequest {
Pragya Arya694ece02020-02-07 13:03:47 +0530108 string AlarmType = 1; // name of alarm to raise
Scott Baker41724b82020-01-21 19:54:53 -0800109 string SerialNumber = 2; // serial number of ONU
110 string Status = 3; // status of Alarm
111 repeated AlarmParameter Parameters = 4; // optional list of additional parameters
112}
113
Anand S Katti86552f92020-03-03 21:56:32 +0530114// OLT alarm request
115message OLTAlarmRequest {
116 uint32 InterfaceID = 1; // Switch Interface Id
117 string InterfaceType = 2; // PON or NNI Type
118 string Status = 3; // Interface Operstatus
119}
120
Matteo Scandolo10f965c2019-09-24 10:40:46 -0700121// Utils
122
Matteo Scandolo84f7d482019-08-08 19:00:47 -0700123message VersionNumber {
124 string version = 1;
125 string buildTime = 2;
126 string commitHash = 3;
127 string gitStatus = 4;
128}
129
Matteo Scandolo2bf742a2019-10-01 11:33:34 -0700130message LogLevel {
131 string level = 1;
132 bool caller = 2;
133}
134
Matteo Scandolo10f965c2019-09-24 10:40:46 -0700135message Response {
136 int32 status_code = 1;
137 string message = 2;
138}
139
Arjun E K57a7fcb2020-01-30 06:44:45 +0000140enum SubActionTypes {
141 JOIN = 0;
142 LEAVE = 1;
Arjun E Kdd443f02020-02-07 15:24:01 +0000143 JOINV3 = 2;
Arjun E K57a7fcb2020-01-30 06:44:45 +0000144}
145
146message IgmpRequest {
147 ONURequest OnuReq = 1;
148 SubActionTypes SubActionVal = 2;
149}
150
Pragya Arya8bdb4532020-03-02 17:08:09 +0530151message Flows {
152 uint32 flow_count = 1;
153 repeated openolt.Flow flows = 2;
154}
155
Matteo Scandolo84f7d482019-08-08 19:00:47 -0700156message Empty {}
157
158service BBSim {
159 rpc Version(Empty) returns (VersionNumber) {}
160 rpc GetOlt(Empty) returns (Olt) {}
Zdravko Bozakov681364d2019-11-10 14:28:46 +0100161 rpc PoweronOlt(Empty) returns (Response) {}
162 rpc ShutdownOlt(Empty) returns (Response) {}
163 rpc RebootOlt(Empty) returns (Response) {}
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700164 rpc GetONUs(Empty) returns (ONUs) {}
Matteo Scandolod2ca2c72019-10-04 16:50:22 -0700165 rpc GetONU(ONURequest) returns (ONU) {}
Matteo Scandolo2bf742a2019-10-01 11:33:34 -0700166 rpc SetLogLevel(LogLevel) returns (LogLevel) {}
Matteo Scandolo10f965c2019-09-24 10:40:46 -0700167 rpc ShutdownONU (ONURequest) returns (Response) {}
168 rpc PoweronONU (ONURequest) returns (Response) {}
Matteo Scandoloe383d5d2019-10-25 14:47:27 -0700169 rpc RestartEapol (ONURequest) returns (Response) {}
170 rpc RestartDhcp (ONURequest) returns (Response) {}
Anand S Katti86552f92020-03-03 21:56:32 +0530171 rpc SetOnuAlarmIndication (ONUAlarmRequest) returns (Response) {}
172 rpc SetOltAlarmIndication (OLTAlarmRequest) returns (Response) {}
Pragya Arya8bdb4532020-03-02 17:08:09 +0530173 rpc GetFlows(ONURequest) returns(Flows) {}
Arjun E K57a7fcb2020-01-30 06:44:45 +0000174 rpc ChangeIgmpState (IgmpRequest) returns (Response) {}
Anand S Katti09541352020-01-29 15:54:01 +0530175 rpc GetOnuTrafficSchedulers (ONURequest) returns (ONUTrafficSchedulers) {}
Arjun E K57a7fcb2020-01-30 06:44:45 +0000176}