Matteo Scandolo | 84f7d48 | 2019-08-08 19:00:47 -0700 | [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 bbsim; |
| 17 | |
Pragya Arya | 8bdb453 | 2020-03-02 17:08:09 +0530 | [diff] [blame] | 18 | import "voltha_protos/openolt.proto"; |
Anand S Katti | 0954135 | 2020-01-29 15:54:01 +0530 | [diff] [blame] | 19 | import "voltha_protos/tech_profile.proto"; |
Matteo Scandolo | 10f965c | 2019-09-24 10:40:46 -0700 | [diff] [blame] | 20 | // Models |
| 21 | |
Matteo Scandolo | 84f7d48 | 2019-08-08 19:00:47 -0700 | [diff] [blame] | 22 | message PONPort { |
| 23 | int32 ID = 1; |
| 24 | string OperState = 2; |
| 25 | } |
| 26 | |
| 27 | message NNIPort { |
| 28 | int32 ID = 1; |
| 29 | string OperState = 2; |
| 30 | } |
| 31 | |
| 32 | message Olt { |
| 33 | int32 ID = 1; |
Matteo Scandolo | 8df63df | 2019-09-12 10:34:32 -0700 | [diff] [blame] | 34 | string SerialNumber = 2; |
| 35 | string OperState = 3; |
| 36 | string InternalState = 4; |
rajesh | f921f88 | 2020-03-06 18:24:28 +0530 | [diff] [blame] | 37 | string IP = 7; |
Matteo Scandolo | 8df63df | 2019-09-12 10:34:32 -0700 | [diff] [blame] | 38 | repeated NNIPort NNIPorts = 5; |
| 39 | repeated PONPort PONPorts = 6; |
Matteo Scandolo | 9a3518c | 2019-08-13 14:36:01 -0700 | [diff] [blame] | 40 | } |
| 41 | |
| 42 | message ONU { |
| 43 | int32 ID = 1; |
| 44 | string SerialNumber = 2; |
| 45 | string OperState = 3; |
| 46 | string InternalState = 4; |
| 47 | int32 PonPortID = 5; |
Matteo Scandolo | 4b3fc7e | 2019-09-17 16:49:54 -0700 | [diff] [blame] | 48 | int32 STag = 6; |
| 49 | int32 CTag = 7; |
| 50 | string HwAddress = 8; |
Matteo Scandolo | 2742870 | 2019-10-11 16:21:16 -0700 | [diff] [blame] | 51 | int32 PortNo = 9; |
Matteo Scandolo | 9a3518c | 2019-08-13 14:36:01 -0700 | [diff] [blame] | 52 | } |
| 53 | |
Anand S Katti | 0954135 | 2020-01-29 15:54:01 +0530 | [diff] [blame] | 54 | message ONUTrafficSchedulers { |
| 55 | tech_profile.TrafficSchedulers traffSchedulers = 1; |
| 56 | } |
| 57 | |
Matteo Scandolo | 9a3518c | 2019-08-13 14:36:01 -0700 | [diff] [blame] | 58 | message ONUs { |
| 59 | repeated ONU items = 1; |
Matteo Scandolo | 84f7d48 | 2019-08-08 19:00:47 -0700 | [diff] [blame] | 60 | } |
| 61 | |
Matteo Scandolo | 10f965c | 2019-09-24 10:40:46 -0700 | [diff] [blame] | 62 | // Inputs |
| 63 | |
| 64 | message ONURequest { |
| 65 | string SerialNumber = 1; |
| 66 | } |
| 67 | |
Pragya Arya | bd731ec | 2020-02-11 16:38:17 +0530 | [diff] [blame^] | 68 | message PONRequest { |
| 69 | uint32 PonPortId = 1; |
| 70 | } |
| 71 | |
Scott Baker | 41724b8 | 2020-01-21 19:54:53 -0800 | [diff] [blame] | 72 | // Alarms |
| 73 | |
| 74 | message AlarmType { |
| 75 | // These types correspond to the messages permitted in the oneof |
| 76 | // in AlarmIndication in the openolt protos |
| 77 | enum Types { |
| 78 | LOS = 0; // LOS is an OLT alarm for an entire PON |
| 79 | DYING_GASP = 1; |
| 80 | ONU_ALARM = 2; |
| 81 | ONU_STARTUP_FAILURE = 3; |
| 82 | ONU_SIGNAL_DEGRADE = 4; |
| 83 | ONU_DRIFT_OF_WINDOW = 5; |
| 84 | ONU_LOSS_OF_OMCI_CHANNEL = 6; |
| 85 | ONU_SIGNALS_FAILURE = 7; |
| 86 | ONU_TRANSMISSION_INTERFERENCE_WARNING = 8; |
| 87 | ONU_ACTIVATION_FAILURE = 9; |
| 88 | ONU_PROCESSING_ERROR = 10; |
| 89 | ONU_LOSS_OF_KEY_SYNC_FAILURE = 11; |
| 90 | ONU_ITU_PON_STATS = 12; |
| 91 | |
| 92 | // These break out ONU_ALARM, which is a single message, but |
| 93 | // includes statuses for these six alarms. |
| 94 | ONU_ALARM_LOS = 13; |
| 95 | ONU_ALARM_LOB = 14; |
| 96 | ONU_ALARM_LOPC_MISS = 15; |
| 97 | ONU_ALARM_LOPC_MIC_ERROR = 16; |
| 98 | ONU_ALARM_LOFI = 17; |
| 99 | ONU_ALARM_LOAMI = 18; |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | message AlarmParameter { |
| 104 | string Key = 1; |
| 105 | string Value = 2; |
| 106 | } |
| 107 | |
Anand S Katti | 86552f9 | 2020-03-03 21:56:32 +0530 | [diff] [blame] | 108 | // ONUAlarmRequest includes fields common to every Onu alarm, |
Anand S Katti | 0954135 | 2020-01-29 15:54:01 +0530 | [diff] [blame] | 109 | // plus an optional list of AlarmParameter list that can be used |
Scott Baker | 41724b8 | 2020-01-21 19:54:53 -0800 | [diff] [blame] | 110 | // to set additional fields in alarms that support them. |
Anand S Katti | 86552f9 | 2020-03-03 21:56:32 +0530 | [diff] [blame] | 111 | message ONUAlarmRequest { |
Pragya Arya | 694ece0 | 2020-02-07 13:03:47 +0530 | [diff] [blame] | 112 | string AlarmType = 1; // name of alarm to raise |
Scott Baker | 41724b8 | 2020-01-21 19:54:53 -0800 | [diff] [blame] | 113 | string SerialNumber = 2; // serial number of ONU |
| 114 | string Status = 3; // status of Alarm |
| 115 | repeated AlarmParameter Parameters = 4; // optional list of additional parameters |
| 116 | } |
| 117 | |
Anand S Katti | 86552f9 | 2020-03-03 21:56:32 +0530 | [diff] [blame] | 118 | // OLT alarm request |
| 119 | message OLTAlarmRequest { |
| 120 | uint32 InterfaceID = 1; // Switch Interface Id |
| 121 | string InterfaceType = 2; // PON or NNI Type |
| 122 | string Status = 3; // Interface Operstatus |
| 123 | } |
| 124 | |
Matteo Scandolo | 10f965c | 2019-09-24 10:40:46 -0700 | [diff] [blame] | 125 | // Utils |
| 126 | |
Matteo Scandolo | 84f7d48 | 2019-08-08 19:00:47 -0700 | [diff] [blame] | 127 | message VersionNumber { |
| 128 | string version = 1; |
| 129 | string buildTime = 2; |
| 130 | string commitHash = 3; |
| 131 | string gitStatus = 4; |
| 132 | } |
| 133 | |
Matteo Scandolo | 2bf742a | 2019-10-01 11:33:34 -0700 | [diff] [blame] | 134 | message LogLevel { |
| 135 | string level = 1; |
| 136 | bool caller = 2; |
| 137 | } |
| 138 | |
Matteo Scandolo | 10f965c | 2019-09-24 10:40:46 -0700 | [diff] [blame] | 139 | message Response { |
| 140 | int32 status_code = 1; |
| 141 | string message = 2; |
| 142 | } |
| 143 | |
Arjun E K | 57a7fcb | 2020-01-30 06:44:45 +0000 | [diff] [blame] | 144 | enum SubActionTypes { |
| 145 | JOIN = 0; |
| 146 | LEAVE = 1; |
Arjun E K | dd443f0 | 2020-02-07 15:24:01 +0000 | [diff] [blame] | 147 | JOINV3 = 2; |
Arjun E K | 57a7fcb | 2020-01-30 06:44:45 +0000 | [diff] [blame] | 148 | } |
| 149 | |
| 150 | message IgmpRequest { |
| 151 | ONURequest OnuReq = 1; |
| 152 | SubActionTypes SubActionVal = 2; |
| 153 | } |
| 154 | |
Pragya Arya | 8bdb453 | 2020-03-02 17:08:09 +0530 | [diff] [blame] | 155 | message Flows { |
| 156 | uint32 flow_count = 1; |
| 157 | repeated openolt.Flow flows = 2; |
| 158 | } |
| 159 | |
Matteo Scandolo | 84f7d48 | 2019-08-08 19:00:47 -0700 | [diff] [blame] | 160 | message Empty {} |
| 161 | |
| 162 | service BBSim { |
| 163 | rpc Version(Empty) returns (VersionNumber) {} |
Pragya Arya | bd731ec | 2020-02-11 16:38:17 +0530 | [diff] [blame^] | 164 | rpc SetLogLevel(LogLevel) returns (LogLevel) {} |
| 165 | |
Matteo Scandolo | 84f7d48 | 2019-08-08 19:00:47 -0700 | [diff] [blame] | 166 | rpc GetOlt(Empty) returns (Olt) {} |
Zdravko Bozakov | 681364d | 2019-11-10 14:28:46 +0100 | [diff] [blame] | 167 | rpc PoweronOlt(Empty) returns (Response) {} |
| 168 | rpc ShutdownOlt(Empty) returns (Response) {} |
| 169 | rpc RebootOlt(Empty) returns (Response) {} |
Pragya Arya | bd731ec | 2020-02-11 16:38:17 +0530 | [diff] [blame^] | 170 | |
Matteo Scandolo | d2ca2c7 | 2019-10-04 16:50:22 -0700 | [diff] [blame] | 171 | rpc GetONU(ONURequest) returns (ONU) {} |
Pragya Arya | bd731ec | 2020-02-11 16:38:17 +0530 | [diff] [blame^] | 172 | rpc GetONUs(Empty) returns (ONUs) {} |
| 173 | |
Matteo Scandolo | 10f965c | 2019-09-24 10:40:46 -0700 | [diff] [blame] | 174 | rpc ShutdownONU (ONURequest) returns (Response) {} |
Pragya Arya | bd731ec | 2020-02-11 16:38:17 +0530 | [diff] [blame^] | 175 | rpc ShutdownAllONUs (Empty) returns (Response) {} |
| 176 | rpc ShutdownONUsOnPON(PONRequest) returns (Response) {} |
| 177 | |
Matteo Scandolo | 10f965c | 2019-09-24 10:40:46 -0700 | [diff] [blame] | 178 | rpc PoweronONU (ONURequest) returns (Response) {} |
Pragya Arya | bd731ec | 2020-02-11 16:38:17 +0530 | [diff] [blame^] | 179 | rpc PoweronAllONUs (Empty) returns (Response) {} |
| 180 | rpc PoweronONUsOnPON(PONRequest) returns (Response) {} |
| 181 | |
Matteo Scandolo | e383d5d | 2019-10-25 14:47:27 -0700 | [diff] [blame] | 182 | rpc RestartEapol (ONURequest) returns (Response) {} |
| 183 | rpc RestartDhcp (ONURequest) returns (Response) {} |
Anand S Katti | 86552f9 | 2020-03-03 21:56:32 +0530 | [diff] [blame] | 184 | rpc SetOnuAlarmIndication (ONUAlarmRequest) returns (Response) {} |
| 185 | rpc SetOltAlarmIndication (OLTAlarmRequest) returns (Response) {} |
Pragya Arya | 8bdb453 | 2020-03-02 17:08:09 +0530 | [diff] [blame] | 186 | rpc GetFlows(ONURequest) returns(Flows) {} |
Arjun E K | 57a7fcb | 2020-01-30 06:44:45 +0000 | [diff] [blame] | 187 | rpc ChangeIgmpState (IgmpRequest) returns (Response) {} |
Anand S Katti | 0954135 | 2020-01-29 15:54:01 +0530 | [diff] [blame] | 188 | rpc GetOnuTrafficSchedulers (ONURequest) returns (ONUTrafficSchedulers) {} |
Arjun E K | 57a7fcb | 2020-01-30 06:44:45 +0000 | [diff] [blame] | 189 | } |