Matteo Scandolo | 40e067f | 2019-10-16 16:59:41 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2018-present Open Networking Foundation |
| 3 | |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package common |
| 18 | |
Zdravko Bozakov | 3ddb245 | 2019-11-29 14:33:41 +0100 | [diff] [blame] | 19 | import ( |
| 20 | "flag" |
| 21 | "fmt" |
| 22 | "io/ioutil" |
| 23 | "net" |
Matteo Scandolo | f65e687 | 2020-04-15 15:18:43 -0700 | [diff] [blame] | 24 | "strings" |
Shrey Baid | 64cda47 | 2020-04-24 18:58:18 +0530 | [diff] [blame] | 25 | |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 26 | "github.com/imdario/mergo" |
Shrey Baid | 64cda47 | 2020-04-24 18:58:18 +0530 | [diff] [blame] | 27 | log "github.com/sirupsen/logrus" |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 28 | "gopkg.in/yaml.v2" |
Matteo Scandolo | f65e687 | 2020-04-15 15:18:43 -0700 | [diff] [blame] | 29 | ) |
Matteo Scandolo | 40e067f | 2019-10-16 16:59:41 -0700 | [diff] [blame] | 30 | |
Matteo Scandolo | f65e687 | 2020-04-15 15:18:43 -0700 | [diff] [blame] | 31 | var tagAllocationValues = []string{ |
| 32 | "unknown", |
| 33 | "shared", |
| 34 | "unique", |
| 35 | } |
| 36 | |
Matteo Scandolo | 9496714 | 2021-05-28 11:37:06 -0700 | [diff] [blame] | 37 | const ( |
| 38 | BP_FORMAT_MEF = "mef" |
| 39 | BP_FORMAT_IETF = "ietf" |
| 40 | ) |
| 41 | |
Matteo Scandolo | f65e687 | 2020-04-15 15:18:43 -0700 | [diff] [blame] | 42 | type TagAllocation int |
| 43 | |
| 44 | func (t TagAllocation) String() string { |
| 45 | return tagAllocationValues[t] |
| 46 | } |
| 47 | |
| 48 | func tagAllocationFromString(s string) (TagAllocation, error) { |
| 49 | for i, v := range tagAllocationValues { |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 50 | if v == strings.TrimSpace(s) { |
Matteo Scandolo | f65e687 | 2020-04-15 15:18:43 -0700 | [diff] [blame] | 51 | return TagAllocation(i), nil |
| 52 | } |
| 53 | } |
| 54 | log.WithFields(log.Fields{ |
| 55 | "ValidValues": strings.Join(tagAllocationValues[1:], ", "), |
| 56 | }).Errorf("%s-is-not-a-valid-tag-allocation", s) |
Shrey Baid | 688b424 | 2020-07-10 20:40:10 +0530 | [diff] [blame] | 57 | return TagAllocation(0), fmt.Errorf("%s-is-not-a-valid-tag-allocation", s) |
Matteo Scandolo | f65e687 | 2020-04-15 15:18:43 -0700 | [diff] [blame] | 58 | } |
| 59 | |
| 60 | const ( |
| 61 | _ TagAllocation = iota |
| 62 | TagAllocationShared |
| 63 | TagAllocationUnique |
| 64 | ) |
| 65 | |
Matteo Scandolo | 40e067f | 2019-10-16 16:59:41 -0700 | [diff] [blame] | 66 | type BBRCliOptions struct { |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 67 | *GlobalConfig |
Matteo Scandolo | 40e067f | 2019-10-16 16:59:41 -0700 | [diff] [blame] | 68 | BBSimIp string |
| 69 | BBSimPort string |
| 70 | BBSimApiPort string |
Matteo Scandolo | f5c537e | 2019-10-28 16:45:57 -0700 | [diff] [blame] | 71 | LogFile string |
Matteo Scandolo | 40e067f | 2019-10-16 16:59:41 -0700 | [diff] [blame] | 72 | } |
| 73 | |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 74 | type GlobalConfig struct { |
Zdravko Bozakov | 3ddb245 | 2019-11-29 14:33:41 +0100 | [diff] [blame] | 75 | BBSim BBSimConfig |
| 76 | Olt OltConfig |
| 77 | BBR BBRConfig |
| 78 | } |
Matteo Scandolo | 40e067f | 2019-10-16 16:59:41 -0700 | [diff] [blame] | 79 | |
Zdravko Bozakov | 3ddb245 | 2019-11-29 14:33:41 +0100 | [diff] [blame] | 80 | type OltConfig struct { |
| 81 | Model string `yaml:"model"` |
| 82 | Vendor string `yaml:"vendor"` |
| 83 | HardwareVersion string `yaml:"hardware_version"` |
| 84 | FirmwareVersion string `yaml:"firmware_version"` |
| 85 | DeviceId string `yaml:"device_id"` |
| 86 | DeviceSerialNumber string `yaml:"device_serial_number"` |
| 87 | PonPorts uint32 `yaml:"pon_ports"` |
| 88 | NniPorts uint32 `yaml:"nni_ports"` |
Elia Battiston | 420c909 | 2022-02-02 12:17:54 +0100 | [diff] [blame] | 89 | NniSpeed uint32 `yaml:"nni_speed"` |
Zdravko Bozakov | 3ddb245 | 2019-11-29 14:33:41 +0100 | [diff] [blame] | 90 | OnusPonPort uint32 `yaml:"onus_per_port"` |
Zdravko Bozakov | 3ddb245 | 2019-11-29 14:33:41 +0100 | [diff] [blame] | 91 | ID int `yaml:"id"` |
| 92 | OltRebootDelay int `yaml:"reboot_delay"` |
Shrey Baid | 688b424 | 2020-07-10 20:40:10 +0530 | [diff] [blame] | 93 | PortStatsInterval int `yaml:"port_stats_interval"` |
Holger Hildebrandt | c10bab1 | 2021-04-27 09:23:48 +0000 | [diff] [blame] | 94 | OmciResponseRate uint8 `yaml:"omci_response_rate"` |
Mahir Gunyel | a1753ae | 2021-06-23 00:24:56 -0700 | [diff] [blame] | 95 | UniPorts uint32 `yaml:"uni_ports"` |
Elia Battiston | ac63b11 | 2022-01-12 18:40:49 +0100 | [diff] [blame] | 96 | PotsPorts uint32 `yaml:"pots_ports"` |
Andrea Campanella | 6f5f355 | 2022-03-10 17:14:25 +0100 | [diff] [blame] | 97 | NniDhcpTrapVid uint32 `yaml:"nni_dhcp_trap_vid"` |
Zdravko Bozakov | 3ddb245 | 2019-11-29 14:33:41 +0100 | [diff] [blame] | 98 | } |
Matteo Scandolo | 40e067f | 2019-10-16 16:59:41 -0700 | [diff] [blame] | 99 | |
Elia Battiston | b7bea22 | 2022-02-18 16:25:00 +0100 | [diff] [blame] | 100 | type PonPortsConfig struct { |
| 101 | Number uint32 `yaml:"num_pon_ports"` |
| 102 | Ranges []PonRangeConfig `yaml:"ranges"` |
| 103 | } |
| 104 | |
| 105 | type IdRange struct { |
| 106 | StartId uint32 `yaml:"start"` |
| 107 | EndId uint32 `yaml:"end"` |
| 108 | } |
| 109 | |
| 110 | type PonTechnology int |
| 111 | |
| 112 | var ponTechnologyValues = []string{ |
| 113 | "GPON", "XGS-PON", |
| 114 | } |
| 115 | |
| 116 | func (t PonTechnology) String() string { |
| 117 | return ponTechnologyValues[t] |
| 118 | } |
| 119 | |
| 120 | const ( |
| 121 | GPON PonTechnology = iota |
| 122 | XGSPON |
| 123 | ) |
| 124 | |
| 125 | func PonTechnologyFromString(s string) (PonTechnology, error) { |
| 126 | for i, val := range ponTechnologyValues { |
| 127 | if val == s { |
| 128 | return PonTechnology(i), nil |
| 129 | } |
| 130 | } |
| 131 | log.WithFields(log.Fields{ |
| 132 | "ValidValues": strings.Join(ponTechnologyValues[:], ", "), |
| 133 | }).Errorf("%s-is-not-a-valid-pon-technology", s) |
| 134 | return -1, fmt.Errorf("%s-is-not-a-valid-pon-technology", s) |
| 135 | } |
| 136 | |
| 137 | //Constants for default allocation ranges |
| 138 | const ( |
| 139 | defaultOnuIdStart = 1 |
| 140 | defaultAllocIdStart = 1024 |
| 141 | defaultGemPortIdPerAllocId = 8 |
| 142 | defaultGemportIdStart = 1024 |
| 143 | ) |
| 144 | |
| 145 | type PonRangeConfig struct { |
| 146 | PonRange IdRange `yaml:"pon_id_range"` |
| 147 | Technology string `yaml:"tech"` |
| 148 | OnuRange IdRange `yaml:"onu_id_range"` |
| 149 | AllocIdRange IdRange `yaml:"alloc_id_range"` |
| 150 | GemportRange IdRange `yaml:"gemport_id_range"` |
| 151 | } |
| 152 | |
| 153 | func GetPonConfigById(id uint32) (*PonRangeConfig, error) { |
| 154 | if PonsConfig == nil { |
| 155 | return nil, fmt.Errorf("pons-config-nil") |
| 156 | } |
| 157 | |
| 158 | for _, r := range PonsConfig.Ranges { |
| 159 | if id >= r.PonRange.StartId && id <= r.PonRange.EndId { |
| 160 | return &r, nil |
| 161 | } |
| 162 | } |
| 163 | |
| 164 | return nil, fmt.Errorf("pon-config-for-id-%d-not-found", id) |
| 165 | } |
| 166 | |
Zdravko Bozakov | 3ddb245 | 2019-11-29 14:33:41 +0100 | [diff] [blame] | 167 | type BBSimConfig struct { |
Matteo Scandolo | cfedba4 | 2022-02-14 16:08:54 -0800 | [diff] [blame] | 168 | ConfigFile string |
| 169 | ServiceConfigFile string |
| 170 | PonsConfigFile string |
| 171 | DhcpRetry bool `yaml:"dhcp_retry"` |
| 172 | AuthRetry bool `yaml:"auth_retry"` |
| 173 | LogLevel string `yaml:"log_level"` |
| 174 | LogCaller bool `yaml:"log_caller"` |
| 175 | Delay int `yaml:"delay"` |
| 176 | CpuProfile *string `yaml:"cpu_profile"` |
| 177 | OpenOltAddress string `yaml:"openolt_address"` |
| 178 | ApiAddress string `yaml:"api_address"` |
| 179 | RestApiAddress string `yaml:"rest_api_address"` |
| 180 | LegacyApiAddress string `yaml:"legacy_api_address"` |
| 181 | LegacyRestApiAddress string `yaml:"legacy_rest_api_address"` |
| 182 | SadisRestAddress string `yaml:"sadis_rest_address"` |
| 183 | SadisServer bool `yaml:"sadis_server"` |
| 184 | KafkaAddress string `yaml:"kafka_address"` |
| 185 | Events bool `yaml:"enable_events"` |
| 186 | ControlledActivation string `yaml:"controlled_activation"` |
| 187 | EnablePerf bool `yaml:"enable_perf"` |
| 188 | KafkaEventTopic string `yaml:"kafka_event_topic"` |
| 189 | DmiServerAddress string `yaml:"dmi_server_address"` |
| 190 | BandwidthProfileFormat string `yaml:"bp_format"` |
Matteo Scandolo | 7011fc9 | 2022-03-16 15:50:15 -0700 | [diff] [blame] | 191 | InjectOmciUnknownMe bool `yaml:"inject_omci_unknown_me"` |
Matteo Scandolo | cfedba4 | 2022-02-14 16:08:54 -0800 | [diff] [blame] | 192 | InjectOmciUnknownAttributes bool `yaml:"inject_omci_unknown_attributes"` |
Zdravko Bozakov | 3ddb245 | 2019-11-29 14:33:41 +0100 | [diff] [blame] | 193 | } |
Matteo Scandolo | c114709 | 2019-10-29 09:38:33 -0700 | [diff] [blame] | 194 | |
Zdravko Bozakov | 3ddb245 | 2019-11-29 14:33:41 +0100 | [diff] [blame] | 195 | type BBRConfig struct { |
| 196 | Log string `yaml:"log"` |
| 197 | LogLevel string `yaml:"log_level"` |
| 198 | LogCaller bool `yaml:"log_caller"` |
| 199 | } |
| 200 | |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 201 | type ServiceYaml struct { |
| 202 | Name string |
| 203 | CTag int `yaml:"c_tag"` |
| 204 | STag int `yaml:"s_tag"` |
| 205 | NeedsEapol bool `yaml:"needs_eapol"` |
Matteo Scandolo | 8a57481 | 2021-05-20 15:18:53 -0700 | [diff] [blame] | 206 | NeedsDhcp bool `yaml:"needs_dhcp"` |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 207 | NeedsIgmp bool `yaml:"needs_igmp"` |
Andrea Campanella | 2989045 | 2022-02-03 16:00:19 +0100 | [diff] [blame] | 208 | NeedsPPPoE bool `yaml:"needs_pppoe"` |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 209 | CTagAllocation string `yaml:"c_tag_allocation"` |
| 210 | STagAllocation string `yaml:"s_tag_allocation"` |
| 211 | TechnologyProfileID int `yaml:"tp_id"` |
| 212 | UniTagMatch int `yaml:"uni_tag_match"` |
| 213 | ConfigureMacAddress bool `yaml:"configure_mac_address"` |
Andrea Campanella | 2989045 | 2022-02-03 16:00:19 +0100 | [diff] [blame] | 214 | EnableMacLearning bool `yaml:"enable_mac_learning"` |
Matteo Scandolo | 8d28137 | 2020-09-03 16:23:37 -0700 | [diff] [blame] | 215 | UsPonCTagPriority uint8 `yaml:"us_pon_c_tag_priority"` |
| 216 | UsPonSTagPriority uint8 `yaml:"us_pon_s_tag_priority"` |
| 217 | DsPonCTagPriority uint8 `yaml:"ds_pon_c_tag_priority"` |
| 218 | DsPonSTagPriority uint8 `yaml:"ds_pon_s_tag_priority"` |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 219 | } |
| 220 | type YamlServiceConfig struct { |
| 221 | Workflow string |
| 222 | Services []ServiceYaml `yaml:"services,flow"` |
Zdravko Bozakov | 3ddb245 | 2019-11-29 14:33:41 +0100 | [diff] [blame] | 223 | } |
| 224 | |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 225 | func (cfg *YamlServiceConfig) String() string { |
| 226 | str := fmt.Sprintf("[workflow: %s, Services: ", cfg.Workflow) |
Zdravko Bozakov | 3ddb245 | 2019-11-29 14:33:41 +0100 | [diff] [blame] | 227 | |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 228 | for _, s := range cfg.Services { |
| 229 | str = fmt.Sprintf("%s[", str) |
| 230 | str = fmt.Sprintf("%sname=%s, c_tag=%d, s_tag=%d, ", |
| 231 | str, s.Name, s.CTag, s.STag) |
| 232 | str = fmt.Sprintf("%sc_tag_allocation=%s, s_tag_allocation=%s, ", |
| 233 | str, s.CTagAllocation, s.STagAllocation) |
| 234 | str = fmt.Sprintf("%sneeds_eapol=%t, needs_dhcp=%t, needs_igmp=%t", |
Matteo Scandolo | 8a57481 | 2021-05-20 15:18:53 -0700 | [diff] [blame] | 235 | str, s.NeedsEapol, s.NeedsDhcp, s.NeedsIgmp) |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 236 | str = fmt.Sprintf("%stp_id=%d, uni_tag_match=%d", |
| 237 | str, s.TechnologyProfileID, s.UniTagMatch) |
| 238 | str = fmt.Sprintf("%s]", str) |
| 239 | } |
| 240 | str = fmt.Sprintf("%s]", str) |
| 241 | return str |
| 242 | } |
| 243 | |
| 244 | var ( |
Elia Battiston | b7bea22 | 2022-02-18 16:25:00 +0100 | [diff] [blame] | 245 | Config *GlobalConfig |
| 246 | Services []ServiceYaml |
| 247 | PonsConfig *PonPortsConfig |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 248 | ) |
| 249 | |
| 250 | // Load the BBSim configuration. This is a combination of CLI parameters and YAML files |
| 251 | // We proceed in this order: |
| 252 | // - Read CLI parameters |
| 253 | // - Using those we read the yaml files (config and services) |
| 254 | // - we merge the configuration (CLI has priority over yaml files) |
| 255 | func LoadConfig() { |
| 256 | |
| 257 | Config = getDefaultOps() |
| 258 | |
| 259 | cliConf := readCliParams() |
| 260 | |
| 261 | yamlConf, err := loadBBSimConf(cliConf.BBSim.ConfigFile) |
| 262 | |
| 263 | if err != nil { |
| 264 | log.WithFields(log.Fields{ |
| 265 | "file": cliConf.BBSim.ConfigFile, |
| 266 | "err": err, |
| 267 | }).Fatal("Can't read config file") |
| 268 | } |
| 269 | |
| 270 | // merging Yaml and Default Values |
| 271 | if err := mergo.Merge(Config, yamlConf, mergo.WithOverride); err != nil { |
| 272 | log.WithFields(log.Fields{ |
| 273 | "err": err, |
| 274 | }).Fatal("Can't merge YAML and Config") |
| 275 | } |
| 276 | |
| 277 | // merging CLI values on top of the yaml ones |
| 278 | if err := mergo.Merge(Config, cliConf, mergo.WithOverride); err != nil { |
| 279 | log.WithFields(log.Fields{ |
| 280 | "err": err, |
| 281 | }).Fatal("Can't merge CLI and Config") |
| 282 | } |
| 283 | |
| 284 | services, err := loadBBSimServices(Config.BBSim.ServiceConfigFile) |
| 285 | |
| 286 | if err != nil { |
| 287 | log.WithFields(log.Fields{ |
| 288 | "file": Config.BBSim.ServiceConfigFile, |
| 289 | "err": err, |
| 290 | }).Fatal("Can't read services file") |
| 291 | } |
| 292 | |
| 293 | Services = services |
| 294 | |
Elia Battiston | b7bea22 | 2022-02-18 16:25:00 +0100 | [diff] [blame] | 295 | //A blank filename means we should fall back to bbsim defaults |
| 296 | if Config.BBSim.PonsConfigFile == "" { |
| 297 | PonsConfig, err = getDefaultPonsConfig() |
| 298 | if err != nil { |
| 299 | log.WithFields(log.Fields{ |
| 300 | "err": err, |
| 301 | }).Fatal("Can't load Pon interfaces defaults.") |
| 302 | } |
| 303 | } else { |
| 304 | PonsConfig, err = loadBBSimPons(Config.BBSim.PonsConfigFile) |
| 305 | |
| 306 | if err != nil { |
| 307 | log.WithFields(log.Fields{ |
| 308 | "file": Config.BBSim.PonsConfigFile, |
| 309 | "err": err, |
| 310 | }).Fatal("Can't read services file") |
| 311 | } |
| 312 | } |
| 313 | |
| 314 | if err := validatePonsConfig(PonsConfig); err != nil { |
| 315 | log.WithFields(log.Fields{ |
| 316 | "file": Config.BBSim.PonsConfigFile, |
| 317 | "err": err, |
| 318 | }).Fatal("Invalid Pon interfaces configuration") |
| 319 | } |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 320 | } |
| 321 | |
| 322 | func readCliParams() *GlobalConfig { |
| 323 | |
Matteo Scandolo | c11074d | 2020-09-14 14:59:24 -0700 | [diff] [blame] | 324 | conf := getDefaultOps() |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 325 | |
| 326 | configFile := flag.String("config", conf.BBSim.ConfigFile, "Configuration file path") |
| 327 | servicesFile := flag.String("services", conf.BBSim.ServiceConfigFile, "Service Configuration file path") |
Elia Battiston | b7bea22 | 2022-02-18 16:25:00 +0100 | [diff] [blame] | 328 | ponsFile := flag.String("pon_port_config_file", conf.BBSim.PonsConfigFile, "Pon Interfaces Configuration file path") |
Matteo Scandolo | 9496714 | 2021-05-28 11:37:06 -0700 | [diff] [blame] | 329 | sadisBpFormat := flag.String("bp_format", conf.BBSim.BandwidthProfileFormat, "Bandwidth profile format, 'mef' or 'ietf'") |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 330 | |
| 331 | olt_id := flag.Int("olt_id", conf.Olt.ID, "OLT device ID") |
| 332 | nni := flag.Int("nni", int(conf.Olt.NniPorts), "Number of NNI ports per OLT device to be emulated") |
Elia Battiston | 420c909 | 2022-02-02 12:17:54 +0100 | [diff] [blame] | 333 | nni_speed := flag.Uint("nni_speed", uint(conf.Olt.NniSpeed), "Reported speed of the NNI ports in Mbps") |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 334 | pon := flag.Int("pon", int(conf.Olt.PonPorts), "Number of PON ports per OLT device to be emulated") |
| 335 | onu := flag.Int("onu", int(conf.Olt.OnusPonPort), "Number of ONU devices per PON port to be emulated") |
Elia Battiston | ac63b11 | 2022-01-12 18:40:49 +0100 | [diff] [blame] | 336 | uni := flag.Int("uni", int(conf.Olt.UniPorts), "Number of Ethernet UNI Ports per ONU device to be emulated") |
| 337 | pots := flag.Int("pots", int(conf.Olt.PotsPorts), "Number of POTS UNI Ports per ONU device to be emulated") |
Andrea Campanella | 6f5f355 | 2022-03-10 17:14:25 +0100 | [diff] [blame] | 338 | NniDchpTrapVid := flag.Int("nni_dhcp_trap_vid", int(conf.Olt.NniDhcpTrapVid), "Vlan to trap the DHCP packets on") |
Mahir Gunyel | a1753ae | 2021-06-23 00:24:56 -0700 | [diff] [blame] | 339 | |
Matteo Scandolo | 9356670 | 2020-09-30 15:19:27 -0700 | [diff] [blame] | 340 | oltRebootDelay := flag.Int("oltRebootDelay", conf.Olt.OltRebootDelay, "Time that BBSim should before restarting after a reboot") |
Holger Hildebrandt | c10bab1 | 2021-04-27 09:23:48 +0000 | [diff] [blame] | 341 | omci_response_rate := flag.Int("omci_response_rate", int(conf.Olt.OmciResponseRate), "Amount of OMCI messages to respond to") |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 342 | |
| 343 | openolt_address := flag.String("openolt_address", conf.BBSim.OpenOltAddress, "IP address:port") |
| 344 | api_address := flag.String("api_address", conf.BBSim.ApiAddress, "IP address:port") |
| 345 | rest_api_address := flag.String("rest_api_address", conf.BBSim.RestApiAddress, "IP address:port") |
amit.ghosh | 258d14c | 2020-10-02 15:13:38 +0200 | [diff] [blame] | 346 | dmi_server_address := flag.String("dmi_server_address", conf.BBSim.DmiServerAddress, "IP address:port") |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 347 | |
| 348 | profileCpu := flag.String("cpuprofile", "", "write cpu profile to file") |
| 349 | |
| 350 | logLevel := flag.String("logLevel", conf.BBSim.LogLevel, "Set the log level (trace, debug, info, warn, error)") |
| 351 | logCaller := flag.Bool("logCaller", conf.BBSim.LogCaller, "Whether to print the caller filename or not") |
| 352 | |
| 353 | delay := flag.Int("delay", conf.BBSim.Delay, "The delay between ONU DISCOVERY batches in milliseconds (1 ONU per each PON PORT at a time") |
| 354 | |
| 355 | controlledActivation := flag.String("ca", conf.BBSim.ControlledActivation, "Set the mode for controlled activation of PON ports and ONUs") |
| 356 | enablePerf := flag.Bool("enableperf", conf.BBSim.EnablePerf, "Setting this flag will cause BBSim to not store data like traffic schedulers, flows of ONUs etc..") |
| 357 | enableEvents := flag.Bool("enableEvents", conf.BBSim.Events, "Enable sending BBSim events on configured kafka server") |
| 358 | kafkaAddress := flag.String("kafkaAddress", conf.BBSim.KafkaAddress, "IP:Port for kafka") |
| 359 | kafkaEventTopic := flag.String("kafkaEventTopic", conf.BBSim.KafkaEventTopic, "Ability to configure the topic on which BBSim publishes events on Kafka") |
| 360 | dhcpRetry := flag.Bool("dhcpRetry", conf.BBSim.DhcpRetry, "Set this flag if BBSim should retry DHCP upon failure until success") |
| 361 | authRetry := flag.Bool("authRetry", conf.BBSim.AuthRetry, "Set this flag if BBSim should retry EAPOL (Authentication) upon failure until success") |
Matteo Scandolo | 7011fc9 | 2022-03-16 15:50:15 -0700 | [diff] [blame] | 362 | injectOmciUnknownMe := flag.Bool("injectOmciUnknownMe", conf.BBSim.InjectOmciUnknownMe, "Generate an extra MibDB packet with ClassID 37 (Intentionally left blank)") |
| 363 | injectOmciUnknownAttributes := flag.Bool("injectOmciUnknownAttributes", conf.BBSim.InjectOmciUnknownAttributes, "Modifies the ONU2-G MibDB packet to add Unknown Attributes") |
Matteo Scandolo | 9356670 | 2020-09-30 15:19:27 -0700 | [diff] [blame] | 364 | |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 365 | flag.Parse() |
| 366 | |
| 367 | conf.Olt.ID = int(*olt_id) |
| 368 | conf.Olt.NniPorts = uint32(*nni) |
Elia Battiston | 420c909 | 2022-02-02 12:17:54 +0100 | [diff] [blame] | 369 | conf.Olt.NniSpeed = uint32(*nni_speed) |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 370 | conf.Olt.PonPorts = uint32(*pon) |
Mahir Gunyel | a1753ae | 2021-06-23 00:24:56 -0700 | [diff] [blame] | 371 | conf.Olt.UniPorts = uint32(*uni) |
Elia Battiston | ac63b11 | 2022-01-12 18:40:49 +0100 | [diff] [blame] | 372 | conf.Olt.PotsPorts = uint32(*pots) |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 373 | conf.Olt.OnusPonPort = uint32(*onu) |
Andrea Campanella | 6f5f355 | 2022-03-10 17:14:25 +0100 | [diff] [blame] | 374 | conf.Olt.NniDhcpTrapVid = uint32(*NniDchpTrapVid) |
Matteo Scandolo | 9356670 | 2020-09-30 15:19:27 -0700 | [diff] [blame] | 375 | conf.Olt.OltRebootDelay = *oltRebootDelay |
Holger Hildebrandt | c10bab1 | 2021-04-27 09:23:48 +0000 | [diff] [blame] | 376 | conf.Olt.OmciResponseRate = uint8(*omci_response_rate) |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 377 | conf.BBSim.ConfigFile = *configFile |
| 378 | conf.BBSim.ServiceConfigFile = *servicesFile |
Elia Battiston | b7bea22 | 2022-02-18 16:25:00 +0100 | [diff] [blame] | 379 | conf.BBSim.PonsConfigFile = *ponsFile |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 380 | conf.BBSim.CpuProfile = profileCpu |
| 381 | conf.BBSim.LogLevel = *logLevel |
| 382 | conf.BBSim.LogCaller = *logCaller |
| 383 | conf.BBSim.Delay = *delay |
| 384 | conf.BBSim.ControlledActivation = *controlledActivation |
| 385 | conf.BBSim.EnablePerf = *enablePerf |
| 386 | conf.BBSim.Events = *enableEvents |
| 387 | conf.BBSim.KafkaAddress = *kafkaAddress |
| 388 | conf.BBSim.OpenOltAddress = *openolt_address |
| 389 | conf.BBSim.ApiAddress = *api_address |
| 390 | conf.BBSim.RestApiAddress = *rest_api_address |
| 391 | conf.BBSim.KafkaEventTopic = *kafkaEventTopic |
| 392 | conf.BBSim.AuthRetry = *authRetry |
| 393 | conf.BBSim.DhcpRetry = *dhcpRetry |
amit.ghosh | 258d14c | 2020-10-02 15:13:38 +0200 | [diff] [blame] | 394 | conf.BBSim.DmiServerAddress = *dmi_server_address |
Matteo Scandolo | 7011fc9 | 2022-03-16 15:50:15 -0700 | [diff] [blame] | 395 | conf.BBSim.InjectOmciUnknownMe = *injectOmciUnknownMe |
Matteo Scandolo | cfedba4 | 2022-02-14 16:08:54 -0800 | [diff] [blame] | 396 | conf.BBSim.InjectOmciUnknownAttributes = *injectOmciUnknownAttributes |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 397 | |
| 398 | // update device id if not set |
| 399 | if conf.Olt.DeviceId == "" { |
| 400 | conf.Olt.DeviceId = net.HardwareAddr{0xA, 0xA, 0xA, 0xA, 0xA, byte(conf.Olt.ID)}.String() |
| 401 | } |
| 402 | |
Matteo Scandolo | 9496714 | 2021-05-28 11:37:06 -0700 | [diff] [blame] | 403 | // check that the BP format is valid |
| 404 | if (*sadisBpFormat != BP_FORMAT_MEF) && (*sadisBpFormat != BP_FORMAT_IETF) { |
| 405 | log.Fatalf("Invalid parameter 'bp_format', supported values are %s and %s, you provided %s", BP_FORMAT_MEF, BP_FORMAT_IETF, *sadisBpFormat) |
| 406 | } |
| 407 | conf.BBSim.BandwidthProfileFormat = *sadisBpFormat |
| 408 | |
Matteo Scandolo | c11074d | 2020-09-14 14:59:24 -0700 | [diff] [blame] | 409 | return conf |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 410 | } |
| 411 | |
| 412 | func getDefaultOps() *GlobalConfig { |
| 413 | |
| 414 | c := &GlobalConfig{ |
Zdravko Bozakov | 3ddb245 | 2019-11-29 14:33:41 +0100 | [diff] [blame] | 415 | BBSimConfig{ |
Elia Battiston | b7bea22 | 2022-02-18 16:25:00 +0100 | [diff] [blame] | 416 | ConfigFile: "configs/bbsim.yaml", |
| 417 | ServiceConfigFile: "configs/att-services.yaml", |
| 418 | // PonsConfigFile is left intentionally blank here |
| 419 | // to use the default values computed at runtime depending |
| 420 | // on the loaded Services |
Matteo Scandolo | cfedba4 | 2022-02-14 16:08:54 -0800 | [diff] [blame] | 421 | PonsConfigFile: "", |
| 422 | LogLevel: "debug", |
| 423 | LogCaller: false, |
| 424 | Delay: 200, |
| 425 | OpenOltAddress: ":50060", |
| 426 | ApiAddress: ":50070", |
| 427 | RestApiAddress: ":50071", |
| 428 | LegacyApiAddress: ":50072", |
| 429 | LegacyRestApiAddress: ":50073", |
| 430 | SadisRestAddress: ":50074", |
| 431 | SadisServer: true, |
| 432 | KafkaAddress: ":9092", |
| 433 | Events: false, |
| 434 | ControlledActivation: "default", |
| 435 | EnablePerf: false, |
| 436 | KafkaEventTopic: "", |
| 437 | DhcpRetry: false, |
| 438 | AuthRetry: false, |
| 439 | DmiServerAddress: ":50075", |
| 440 | BandwidthProfileFormat: BP_FORMAT_MEF, |
Matteo Scandolo | 7011fc9 | 2022-03-16 15:50:15 -0700 | [diff] [blame] | 441 | InjectOmciUnknownMe: false, |
Matteo Scandolo | cfedba4 | 2022-02-14 16:08:54 -0800 | [diff] [blame] | 442 | InjectOmciUnknownAttributes: false, |
Zdravko Bozakov | 3ddb245 | 2019-11-29 14:33:41 +0100 | [diff] [blame] | 443 | }, |
| 444 | OltConfig{ |
| 445 | Vendor: "BBSim", |
| 446 | Model: "asfvolt16", |
| 447 | HardwareVersion: "emulated", |
| 448 | FirmwareVersion: "", |
| 449 | DeviceSerialNumber: "BBSM00000001", |
| 450 | PonPorts: 1, |
| 451 | NniPorts: 1, |
Elia Battiston | 420c909 | 2022-02-02 12:17:54 +0100 | [diff] [blame] | 452 | NniSpeed: 10000, //Mbps |
Zdravko Bozakov | 3ddb245 | 2019-11-29 14:33:41 +0100 | [diff] [blame] | 453 | OnusPonPort: 1, |
Zdravko Bozakov | 3ddb245 | 2019-11-29 14:33:41 +0100 | [diff] [blame] | 454 | ID: 0, |
Matteo Scandolo | 9356670 | 2020-09-30 15:19:27 -0700 | [diff] [blame] | 455 | OltRebootDelay: 60, |
Pragya Arya | 996a089 | 2020-03-09 21:47:52 +0530 | [diff] [blame] | 456 | PortStatsInterval: 20, |
Holger Hildebrandt | c10bab1 | 2021-04-27 09:23:48 +0000 | [diff] [blame] | 457 | OmciResponseRate: 10, |
Mahir Gunyel | a1753ae | 2021-06-23 00:24:56 -0700 | [diff] [blame] | 458 | UniPorts: 4, |
Elia Battiston | ac63b11 | 2022-01-12 18:40:49 +0100 | [diff] [blame] | 459 | PotsPorts: 0, |
Andrea Campanella | 6f5f355 | 2022-03-10 17:14:25 +0100 | [diff] [blame] | 460 | NniDhcpTrapVid: 0, |
Zdravko Bozakov | 3ddb245 | 2019-11-29 14:33:41 +0100 | [diff] [blame] | 461 | }, |
| 462 | BBRConfig{ |
| 463 | LogLevel: "debug", |
| 464 | LogCaller: false, |
| 465 | }, |
| 466 | } |
| 467 | return c |
| 468 | } |
| 469 | |
Elia Battiston | b7bea22 | 2022-02-18 16:25:00 +0100 | [diff] [blame] | 470 | func getDefaultPonsConfig() (*PonPortsConfig, error) { |
| 471 | |
| 472 | if Config == nil { |
| 473 | return nil, fmt.Errorf("Config is nil") |
| 474 | } |
| 475 | if Services == nil { |
| 476 | return nil, fmt.Errorf("Services is nil") |
| 477 | } |
| 478 | |
| 479 | //The default should replicate the old way bbsim used to compute resource ranges based on the configuration |
| 480 | // 1 allocId per Service * UNI |
| 481 | allocIdPerOnu := uint32(Config.Olt.UniPorts * uint32(len(Services))) |
| 482 | return &PonPortsConfig{ |
| 483 | Number: Config.Olt.PonPorts, |
| 484 | Ranges: []PonRangeConfig{ |
| 485 | { |
| 486 | PonRange: IdRange{0, Config.Olt.PonPorts - 1}, |
| 487 | Technology: XGSPON.String(), |
| 488 | // we need one ONU ID available per ONU, but the smaller the range the smaller the pool created in the openolt adapter |
| 489 | OnuRange: IdRange{defaultOnuIdStart, defaultOnuIdStart + (Config.Olt.OnusPonPort - 1)}, |
| 490 | // 1 allocId per Service * UNI * ONU |
| 491 | AllocIdRange: IdRange{defaultAllocIdStart, defaultAllocIdStart + (Config.Olt.OnusPonPort * allocIdPerOnu)}, |
| 492 | // up to 8 gemport-id per tcont/alloc-id |
| 493 | GemportRange: IdRange{defaultGemportIdStart, defaultGemportIdStart + Config.Olt.OnusPonPort*allocIdPerOnu*defaultGemPortIdPerAllocId}, |
| 494 | }, |
| 495 | }, |
| 496 | }, nil |
| 497 | } |
| 498 | |
Zdravko Bozakov | 3ddb245 | 2019-11-29 14:33:41 +0100 | [diff] [blame] | 499 | // LoadBBSimConf loads the BBSim configuration from a YAML file |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 500 | func loadBBSimConf(filename string) (*GlobalConfig, error) { |
Zdravko Bozakov | 3ddb245 | 2019-11-29 14:33:41 +0100 | [diff] [blame] | 501 | yamlConfig := getDefaultOps() |
| 502 | |
| 503 | yamlFile, err := ioutil.ReadFile(filename) |
| 504 | if err != nil { |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 505 | log.WithFields(log.Fields{ |
| 506 | "err": err, |
| 507 | "filename": filename, |
| 508 | }).Error("Cannot load BBSim configuration file. Using defaults.") |
Zdravko Bozakov | 3ddb245 | 2019-11-29 14:33:41 +0100 | [diff] [blame] | 509 | return yamlConfig, nil |
| 510 | } |
| 511 | |
| 512 | err = yaml.Unmarshal(yamlFile, yamlConfig) |
| 513 | if err != nil { |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 514 | return nil, err |
Zdravko Bozakov | 3ddb245 | 2019-11-29 14:33:41 +0100 | [diff] [blame] | 515 | } |
| 516 | |
| 517 | return yamlConfig, nil |
| 518 | } |
| 519 | |
Elia Battiston | b7bea22 | 2022-02-18 16:25:00 +0100 | [diff] [blame] | 520 | // loadBBSimPons loads the configuration of PON interfaces from a YAML file |
| 521 | func loadBBSimPons(filename string) (*PonPortsConfig, error) { |
| 522 | yamlPonsConfig, err := getDefaultPonsConfig() |
| 523 | if err != nil { |
| 524 | log.WithFields(log.Fields{ |
| 525 | "err": err, |
| 526 | }).Error("Can't load Pon interfaces defaults.") |
| 527 | return nil, err |
| 528 | } |
| 529 | |
| 530 | yamlFile, err := ioutil.ReadFile(filename) |
| 531 | if err != nil { |
| 532 | log.WithFields(log.Fields{ |
| 533 | "err": err, |
| 534 | "filename": filename, |
| 535 | }).Error("Cannot load Pon interfaces configuration file. Using defaults.") |
| 536 | return yamlPonsConfig, nil |
| 537 | } |
| 538 | |
| 539 | err = yaml.Unmarshal(yamlFile, yamlPonsConfig) |
| 540 | if err != nil { |
| 541 | return nil, err |
| 542 | } |
| 543 | |
| 544 | return yamlPonsConfig, nil |
| 545 | } |
| 546 | |
| 547 | // validatePonsConfig checks if the configuration to use for the definition of Pon interfaces is valid |
| 548 | func validatePonsConfig(pons *PonPortsConfig) error { |
| 549 | |
| 550 | if pons.Number == 0 { |
| 551 | return fmt.Errorf("no-pon-ports") |
| 552 | } |
| 553 | |
| 554 | definedPorts := make([]int, pons.Number) |
| 555 | |
| 556 | for rIndex, resRange := range pons.Ranges { |
| 557 | if _, err := PonTechnologyFromString(resRange.Technology); err != nil { |
| 558 | return err |
| 559 | } |
| 560 | |
| 561 | if resRange.PonRange.EndId < resRange.PonRange.StartId { |
| 562 | return fmt.Errorf("invalid-pon-ports-limits-in-range-%d", rIndex) |
| 563 | } |
| 564 | |
| 565 | //Keep track of the defined pons |
| 566 | for p := resRange.PonRange.StartId; p <= resRange.PonRange.EndId; p++ { |
| 567 | if p > uint32(len(definedPorts)-1) { |
| 568 | return fmt.Errorf("pon-port-%d-in-range-%d-but-max-is-%d", p, rIndex, pons.Number-1) |
| 569 | } |
| 570 | definedPorts[p]++ |
| 571 | |
| 572 | if definedPorts[p] > 1 { |
| 573 | return fmt.Errorf("pon-port-%d-has-duplicate-definition-in-range-%d", p, rIndex) |
| 574 | } |
| 575 | } |
| 576 | |
| 577 | if resRange.OnuRange.EndId < resRange.OnuRange.StartId { |
| 578 | return fmt.Errorf("invalid-onus-limits-in-range-%d", rIndex) |
| 579 | } |
| 580 | if resRange.AllocIdRange.EndId < resRange.AllocIdRange.StartId { |
| 581 | return fmt.Errorf("invalid-allocid-limits-in-range-%d", rIndex) |
| 582 | } |
| 583 | if resRange.GemportRange.EndId < resRange.GemportRange.StartId { |
| 584 | return fmt.Errorf("invalid-gemport-limits-in-range-%d", rIndex) |
| 585 | } |
| 586 | } |
| 587 | |
| 588 | //Check if the ranges define all the pons |
| 589 | for i, num := range definedPorts { |
| 590 | if num < 1 { |
| 591 | return fmt.Errorf("pon-port-%d-is-not-defined-in-ranges", i) |
| 592 | } |
| 593 | } |
| 594 | |
| 595 | return nil |
| 596 | } |
| 597 | |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 598 | // LoadBBSimServices parses a file describing the services that need to be created for each UNI |
| 599 | func loadBBSimServices(filename string) ([]ServiceYaml, error) { |
Zdravko Bozakov | 3ddb245 | 2019-11-29 14:33:41 +0100 | [diff] [blame] | 600 | |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 601 | yamlServiceCfg := YamlServiceConfig{} |
Zdravko Bozakov | 3ddb245 | 2019-11-29 14:33:41 +0100 | [diff] [blame] | 602 | |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 603 | yamlFile, err := ioutil.ReadFile(filename) |
Matteo Scandolo | f65e687 | 2020-04-15 15:18:43 -0700 | [diff] [blame] | 604 | if err != nil { |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 605 | return nil, err |
Matteo Scandolo | f65e687 | 2020-04-15 15:18:43 -0700 | [diff] [blame] | 606 | } |
| 607 | |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 608 | err = yaml.Unmarshal([]byte(yamlFile), &yamlServiceCfg) |
Matteo Scandolo | f65e687 | 2020-04-15 15:18:43 -0700 | [diff] [blame] | 609 | if err != nil { |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 610 | return nil, err |
Matteo Scandolo | f65e687 | 2020-04-15 15:18:43 -0700 | [diff] [blame] | 611 | } |
| 612 | |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 613 | for _, service := range yamlServiceCfg.Services { |
| 614 | |
| 615 | if service.CTagAllocation == "" || service.STagAllocation == "" { |
| 616 | log.Fatal("c_tag_allocation and s_tag_allocation are mandatory fields") |
| 617 | } |
| 618 | |
| 619 | if _, err := tagAllocationFromString(string(service.CTagAllocation)); err != nil { |
| 620 | log.WithFields(log.Fields{ |
| 621 | "err": err, |
| 622 | }).Fatal("c_tag_allocation is not valid") |
| 623 | } |
Matteo Scandolo | f65e687 | 2020-04-15 15:18:43 -0700 | [diff] [blame] | 624 | } |
| 625 | |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 626 | log.WithFields(log.Fields{ |
| 627 | "services": yamlServiceCfg.String(), |
| 628 | }).Debug("BBSim services description correctly loaded") |
| 629 | return yamlServiceCfg.Services, nil |
Matteo Scandolo | 40e067f | 2019-10-16 16:59:41 -0700 | [diff] [blame] | 630 | } |
| 631 | |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 632 | // This is only used by BBR |
Matteo Scandolo | 40e067f | 2019-10-16 16:59:41 -0700 | [diff] [blame] | 633 | func GetBBROpts() BBRCliOptions { |
| 634 | |
| 635 | bbsimIp := flag.String("bbsimIp", "127.0.0.1", "BBSim IP") |
| 636 | bbsimPort := flag.String("bbsimPort", "50060", "BBSim Port") |
| 637 | bbsimApiPort := flag.String("bbsimApiPort", "50070", "BBSim API Port") |
Matteo Scandolo | f5c537e | 2019-10-28 16:45:57 -0700 | [diff] [blame] | 638 | logFile := flag.String("logfile", "", "Log to a file") |
Matteo Scandolo | 40e067f | 2019-10-16 16:59:41 -0700 | [diff] [blame] | 639 | |
Matteo Scandolo | c11074d | 2020-09-14 14:59:24 -0700 | [diff] [blame] | 640 | LoadConfig() |
Matteo Scandolo | 40e067f | 2019-10-16 16:59:41 -0700 | [diff] [blame] | 641 | |
| 642 | bbrOptions := BBRCliOptions{ |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 643 | Config, |
Matteo Scandolo | 40e067f | 2019-10-16 16:59:41 -0700 | [diff] [blame] | 644 | *bbsimIp, |
| 645 | *bbsimPort, |
| 646 | *bbsimApiPort, |
Matteo Scandolo | f5c537e | 2019-10-28 16:45:57 -0700 | [diff] [blame] | 647 | *logFile, |
Matteo Scandolo | 40e067f | 2019-10-16 16:59:41 -0700 | [diff] [blame] | 648 | } |
| 649 | |
| 650 | return bbrOptions |
| 651 | } |