blob: 57e1de7452c5f9f6cab27a8c144c9ed156208dce [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
Anand S Katti09541352020-01-29 15:54:01 +053018import "voltha_protos/tech_profile.proto";
Matteo Scandolo10f965c2019-09-24 10:40:46 -070019// Models
20
Matteo Scandolo84f7d482019-08-08 19:00:47 -070021message PONPort {
22 int32 ID = 1;
23 string OperState = 2;
24}
25
26message NNIPort {
27 int32 ID = 1;
28 string OperState = 2;
29}
30
31message Olt {
32 int32 ID = 1;
Matteo Scandolo8df63df2019-09-12 10:34:32 -070033 string SerialNumber = 2;
34 string OperState = 3;
35 string InternalState = 4;
36 repeated NNIPort NNIPorts = 5;
37 repeated PONPort PONPorts = 6;
Matteo Scandolo9a3518c2019-08-13 14:36:01 -070038}
39
40message ONU {
41 int32 ID = 1;
42 string SerialNumber = 2;
43 string OperState = 3;
44 string InternalState = 4;
45 int32 PonPortID = 5;
Matteo Scandolo4b3fc7e2019-09-17 16:49:54 -070046 int32 STag = 6;
47 int32 CTag = 7;
48 string HwAddress = 8;
Matteo Scandolo27428702019-10-11 16:21:16 -070049 int32 PortNo = 9;
Matteo Scandolo9a3518c2019-08-13 14:36:01 -070050}
51
Anand S Katti09541352020-01-29 15:54:01 +053052message ONUTrafficSchedulers {
53 tech_profile.TrafficSchedulers traffSchedulers = 1;
54}
55
Matteo Scandolo9a3518c2019-08-13 14:36:01 -070056message ONUs {
57 repeated ONU items = 1;
Matteo Scandolo84f7d482019-08-08 19:00:47 -070058}
59
Matteo Scandolo10f965c2019-09-24 10:40:46 -070060// Inputs
61
62message ONURequest {
63 string SerialNumber = 1;
64}
65
Scott Baker41724b82020-01-21 19:54:53 -080066// Alarms
67
68message AlarmType {
69 // These types correspond to the messages permitted in the oneof
70 // in AlarmIndication in the openolt protos
71 enum Types {
72 LOS = 0; // LOS is an OLT alarm for an entire PON
73 DYING_GASP = 1;
74 ONU_ALARM = 2;
75 ONU_STARTUP_FAILURE = 3;
76 ONU_SIGNAL_DEGRADE = 4;
77 ONU_DRIFT_OF_WINDOW = 5;
78 ONU_LOSS_OF_OMCI_CHANNEL = 6;
79 ONU_SIGNALS_FAILURE = 7;
80 ONU_TRANSMISSION_INTERFERENCE_WARNING = 8;
81 ONU_ACTIVATION_FAILURE = 9;
82 ONU_PROCESSING_ERROR = 10;
83 ONU_LOSS_OF_KEY_SYNC_FAILURE = 11;
84 ONU_ITU_PON_STATS = 12;
85
86 // These break out ONU_ALARM, which is a single message, but
87 // includes statuses for these six alarms.
88 ONU_ALARM_LOS = 13;
89 ONU_ALARM_LOB = 14;
90 ONU_ALARM_LOPC_MISS = 15;
91 ONU_ALARM_LOPC_MIC_ERROR = 16;
92 ONU_ALARM_LOFI = 17;
93 ONU_ALARM_LOAMI = 18;
94 }
95}
96
97message AlarmParameter {
98 string Key = 1;
99 string Value = 2;
100}
101
Anand S Katti86552f92020-03-03 21:56:32 +0530102// ONUAlarmRequest includes fields common to every Onu alarm,
Anand S Katti09541352020-01-29 15:54:01 +0530103// plus an optional list of AlarmParameter list that can be used
Scott Baker41724b82020-01-21 19:54:53 -0800104// to set additional fields in alarms that support them.
Anand S Katti86552f92020-03-03 21:56:32 +0530105message ONUAlarmRequest {
Pragya Arya694ece02020-02-07 13:03:47 +0530106 string AlarmType = 1; // name of alarm to raise
Scott Baker41724b82020-01-21 19:54:53 -0800107 string SerialNumber = 2; // serial number of ONU
108 string Status = 3; // status of Alarm
109 repeated AlarmParameter Parameters = 4; // optional list of additional parameters
110}
111
Anand S Katti86552f92020-03-03 21:56:32 +0530112// OLT alarm request
113message OLTAlarmRequest {
114 uint32 InterfaceID = 1; // Switch Interface Id
115 string InterfaceType = 2; // PON or NNI Type
116 string Status = 3; // Interface Operstatus
117}
118
Matteo Scandolo10f965c2019-09-24 10:40:46 -0700119// Utils
120
Matteo Scandolo84f7d482019-08-08 19:00:47 -0700121message VersionNumber {
122 string version = 1;
123 string buildTime = 2;
124 string commitHash = 3;
125 string gitStatus = 4;
126}
127
Matteo Scandolo2bf742a2019-10-01 11:33:34 -0700128message LogLevel {
129 string level = 1;
130 bool caller = 2;
131}
132
Matteo Scandolo10f965c2019-09-24 10:40:46 -0700133message Response {
134 int32 status_code = 1;
135 string message = 2;
136}
137
Arjun E K57a7fcb2020-01-30 06:44:45 +0000138enum SubActionTypes {
139 JOIN = 0;
140 LEAVE = 1;
Arjun E Kdd443f02020-02-07 15:24:01 +0000141 JOINV3 = 2;
Arjun E K57a7fcb2020-01-30 06:44:45 +0000142}
143
144message IgmpRequest {
145 ONURequest OnuReq = 1;
146 SubActionTypes SubActionVal = 2;
147}
148
Matteo Scandolo84f7d482019-08-08 19:00:47 -0700149message Empty {}
150
151service BBSim {
152 rpc Version(Empty) returns (VersionNumber) {}
153 rpc GetOlt(Empty) returns (Olt) {}
Zdravko Bozakov681364d2019-11-10 14:28:46 +0100154 rpc PoweronOlt(Empty) returns (Response) {}
155 rpc ShutdownOlt(Empty) returns (Response) {}
156 rpc RebootOlt(Empty) returns (Response) {}
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700157 rpc GetONUs(Empty) returns (ONUs) {}
Matteo Scandolod2ca2c72019-10-04 16:50:22 -0700158 rpc GetONU(ONURequest) returns (ONU) {}
Matteo Scandolo2bf742a2019-10-01 11:33:34 -0700159 rpc SetLogLevel(LogLevel) returns (LogLevel) {}
Matteo Scandolo10f965c2019-09-24 10:40:46 -0700160 rpc ShutdownONU (ONURequest) returns (Response) {}
161 rpc PoweronONU (ONURequest) returns (Response) {}
Matteo Scandoloe383d5d2019-10-25 14:47:27 -0700162 rpc RestartEapol (ONURequest) returns (Response) {}
163 rpc RestartDhcp (ONURequest) returns (Response) {}
Anand S Katti86552f92020-03-03 21:56:32 +0530164 rpc SetOnuAlarmIndication (ONUAlarmRequest) returns (Response) {}
165 rpc SetOltAlarmIndication (OLTAlarmRequest) returns (Response) {}
Arjun E K57a7fcb2020-01-30 06:44:45 +0000166 rpc ChangeIgmpState (IgmpRequest) returns (Response) {}
Anand S Katti09541352020-01-29 15:54:01 +0530167 rpc GetOnuTrafficSchedulers (ONURequest) returns (ONUTrafficSchedulers) {}
Arjun E K57a7fcb2020-01-30 06:44:45 +0000168}