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 | |
Matteo Scandolo | 10f965c | 2019-09-24 10:40:46 -0700 | [diff] [blame] | 18 | // Models |
| 19 | |
Matteo Scandolo | 84f7d48 | 2019-08-08 19:00:47 -0700 | [diff] [blame] | 20 | message PONPort { |
| 21 | int32 ID = 1; |
| 22 | string OperState = 2; |
| 23 | } |
| 24 | |
| 25 | message NNIPort { |
| 26 | int32 ID = 1; |
| 27 | string OperState = 2; |
| 28 | } |
| 29 | |
| 30 | message Olt { |
| 31 | int32 ID = 1; |
Matteo Scandolo | 8df63df | 2019-09-12 10:34:32 -0700 | [diff] [blame] | 32 | string SerialNumber = 2; |
| 33 | string OperState = 3; |
| 34 | string InternalState = 4; |
| 35 | repeated NNIPort NNIPorts = 5; |
| 36 | repeated PONPort PONPorts = 6; |
Matteo Scandolo | 9a3518c | 2019-08-13 14:36:01 -0700 | [diff] [blame] | 37 | } |
| 38 | |
| 39 | message ONU { |
| 40 | int32 ID = 1; |
| 41 | string SerialNumber = 2; |
| 42 | string OperState = 3; |
| 43 | string InternalState = 4; |
| 44 | int32 PonPortID = 5; |
Matteo Scandolo | 4b3fc7e | 2019-09-17 16:49:54 -0700 | [diff] [blame] | 45 | int32 STag = 6; |
| 46 | int32 CTag = 7; |
| 47 | string HwAddress = 8; |
Matteo Scandolo | 2742870 | 2019-10-11 16:21:16 -0700 | [diff] [blame] | 48 | int32 PortNo = 9; |
Matteo Scandolo | 9a3518c | 2019-08-13 14:36:01 -0700 | [diff] [blame] | 49 | } |
| 50 | |
| 51 | message ONUs { |
| 52 | repeated ONU items = 1; |
Matteo Scandolo | 84f7d48 | 2019-08-08 19:00:47 -0700 | [diff] [blame] | 53 | } |
| 54 | |
Matteo Scandolo | 10f965c | 2019-09-24 10:40:46 -0700 | [diff] [blame] | 55 | // Inputs |
| 56 | |
| 57 | message ONURequest { |
| 58 | string SerialNumber = 1; |
| 59 | } |
| 60 | |
Scott Baker | 41724b8 | 2020-01-21 19:54:53 -0800 | [diff] [blame] | 61 | // Alarms |
| 62 | |
| 63 | message AlarmType { |
| 64 | // These types correspond to the messages permitted in the oneof |
| 65 | // in AlarmIndication in the openolt protos |
| 66 | enum Types { |
| 67 | LOS = 0; // LOS is an OLT alarm for an entire PON |
| 68 | DYING_GASP = 1; |
| 69 | ONU_ALARM = 2; |
| 70 | ONU_STARTUP_FAILURE = 3; |
| 71 | ONU_SIGNAL_DEGRADE = 4; |
| 72 | ONU_DRIFT_OF_WINDOW = 5; |
| 73 | ONU_LOSS_OF_OMCI_CHANNEL = 6; |
| 74 | ONU_SIGNALS_FAILURE = 7; |
| 75 | ONU_TRANSMISSION_INTERFERENCE_WARNING = 8; |
| 76 | ONU_ACTIVATION_FAILURE = 9; |
| 77 | ONU_PROCESSING_ERROR = 10; |
| 78 | ONU_LOSS_OF_KEY_SYNC_FAILURE = 11; |
| 79 | ONU_ITU_PON_STATS = 12; |
| 80 | |
| 81 | // These break out ONU_ALARM, which is a single message, but |
| 82 | // includes statuses for these six alarms. |
| 83 | ONU_ALARM_LOS = 13; |
| 84 | ONU_ALARM_LOB = 14; |
| 85 | ONU_ALARM_LOPC_MISS = 15; |
| 86 | ONU_ALARM_LOPC_MIC_ERROR = 16; |
| 87 | ONU_ALARM_LOFI = 17; |
| 88 | ONU_ALARM_LOAMI = 18; |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | message AlarmParameter { |
| 93 | string Key = 1; |
| 94 | string Value = 2; |
| 95 | } |
| 96 | |
| 97 | // AlarmRequest includes fields common to every alarm, |
| 98 | // plus an optional list of AlarmParemter list that can be used |
| 99 | // to set additional fields in alarms that support them. |
| 100 | message AlarmRequest { |
| 101 | AlarmType.Types AlarmType = 1; // name of alarm to raise |
| 102 | string SerialNumber = 2; // serial number of ONU |
| 103 | string Status = 3; // status of Alarm |
| 104 | repeated AlarmParameter Parameters = 4; // optional list of additional parameters |
| 105 | } |
| 106 | |
Matteo Scandolo | 10f965c | 2019-09-24 10:40:46 -0700 | [diff] [blame] | 107 | // Utils |
| 108 | |
Matteo Scandolo | 84f7d48 | 2019-08-08 19:00:47 -0700 | [diff] [blame] | 109 | message VersionNumber { |
| 110 | string version = 1; |
| 111 | string buildTime = 2; |
| 112 | string commitHash = 3; |
| 113 | string gitStatus = 4; |
| 114 | } |
| 115 | |
Matteo Scandolo | 2bf742a | 2019-10-01 11:33:34 -0700 | [diff] [blame] | 116 | message LogLevel { |
| 117 | string level = 1; |
| 118 | bool caller = 2; |
| 119 | } |
| 120 | |
Matteo Scandolo | 10f965c | 2019-09-24 10:40:46 -0700 | [diff] [blame] | 121 | message Response { |
| 122 | int32 status_code = 1; |
| 123 | string message = 2; |
| 124 | } |
| 125 | |
Arjun E K | 57a7fcb | 2020-01-30 06:44:45 +0000 | [diff] [blame^] | 126 | enum SubActionTypes { |
| 127 | JOIN = 0; |
| 128 | LEAVE = 1; |
| 129 | } |
| 130 | |
| 131 | message IgmpRequest { |
| 132 | ONURequest OnuReq = 1; |
| 133 | SubActionTypes SubActionVal = 2; |
| 134 | } |
| 135 | |
Matteo Scandolo | 84f7d48 | 2019-08-08 19:00:47 -0700 | [diff] [blame] | 136 | message Empty {} |
| 137 | |
| 138 | service BBSim { |
| 139 | rpc Version(Empty) returns (VersionNumber) {} |
| 140 | rpc GetOlt(Empty) returns (Olt) {} |
Zdravko Bozakov | 681364d | 2019-11-10 14:28:46 +0100 | [diff] [blame] | 141 | rpc PoweronOlt(Empty) returns (Response) {} |
| 142 | rpc ShutdownOlt(Empty) returns (Response) {} |
| 143 | rpc RebootOlt(Empty) returns (Response) {} |
Matteo Scandolo | 9a3518c | 2019-08-13 14:36:01 -0700 | [diff] [blame] | 144 | rpc GetONUs(Empty) returns (ONUs) {} |
Matteo Scandolo | d2ca2c7 | 2019-10-04 16:50:22 -0700 | [diff] [blame] | 145 | rpc GetONU(ONURequest) returns (ONU) {} |
Matteo Scandolo | 2bf742a | 2019-10-01 11:33:34 -0700 | [diff] [blame] | 146 | rpc SetLogLevel(LogLevel) returns (LogLevel) {} |
Matteo Scandolo | 10f965c | 2019-09-24 10:40:46 -0700 | [diff] [blame] | 147 | rpc ShutdownONU (ONURequest) returns (Response) {} |
| 148 | rpc PoweronONU (ONURequest) returns (Response) {} |
Matteo Scandolo | e383d5d | 2019-10-25 14:47:27 -0700 | [diff] [blame] | 149 | rpc RestartEapol (ONURequest) returns (Response) {} |
| 150 | rpc RestartDhcp (ONURequest) returns (Response) {} |
Scott Baker | 41724b8 | 2020-01-21 19:54:53 -0800 | [diff] [blame] | 151 | rpc SetAlarmIndication (AlarmRequest) returns (Response) {} |
Arjun E K | 57a7fcb | 2020-01-30 06:44:45 +0000 | [diff] [blame^] | 152 | rpc ChangeIgmpState (IgmpRequest) returns (Response) {} |
| 153 | } |