Maros Ondrejicka | ffa3f60 | 2023-01-26 10:07:29 +0100 | [diff] [blame] | 1 | package main |
| 2 | |
| 3 | import ( |
Filip Tehlar | 671cf51 | 2023-01-31 10:34:18 +0100 | [diff] [blame] | 4 | "flag" |
Maros Ondrejicka | ffa3f60 | 2023-01-26 10:07:29 +0100 | [diff] [blame] | 5 | "fmt" |
| 6 | "io/ioutil" |
| 7 | "os" |
Maros Ondrejicka | a2d5262 | 2023-02-24 11:26:39 +0100 | [diff] [blame] | 8 | "time" |
Maros Ondrejicka | ffa3f60 | 2023-01-26 10:07:29 +0100 | [diff] [blame] | 9 | |
| 10 | "github.com/edwarnicke/exechelper" |
| 11 | "github.com/stretchr/testify/assert" |
| 12 | "github.com/stretchr/testify/suite" |
Maros Ondrejicka | ffa3f60 | 2023-01-26 10:07:29 +0100 | [diff] [blame] | 13 | "gopkg.in/yaml.v3" |
| 14 | ) |
| 15 | |
Maros Ondrejicka | 2908f8c | 2023-02-02 08:58:04 +0100 | [diff] [blame] | 16 | const ( |
Filip Tehlar | 608d006 | 2023-04-28 10:29:47 +0200 | [diff] [blame] | 17 | DEFAULT_NETWORK_NUM int = 1 |
Maros Ondrejicka | 2908f8c | 2023-02-02 08:58:04 +0100 | [diff] [blame] | 18 | ) |
| 19 | |
Maros Ondrejicka | e7625d0 | 2023-02-28 16:55:01 +0100 | [diff] [blame] | 20 | var isPersistent = flag.Bool("persist", false, "persists topology config") |
| 21 | var isVerbose = flag.Bool("verbose", false, "verbose test output") |
| 22 | var isUnconfiguring = flag.Bool("unconfigure", false, "remove topology") |
| 23 | var isVppDebug = flag.Bool("debug", false, "attach gdb to vpp") |
Filip Tehlar | 608d006 | 2023-04-28 10:29:47 +0200 | [diff] [blame] | 24 | var nConfiguredCpus = flag.Int("cpus", 1, "number of CPUs assigned to vpp") |
Maros Ondrejicka | ffa3f60 | 2023-01-26 10:07:29 +0100 | [diff] [blame] | 25 | |
| 26 | type HstSuite struct { |
| 27 | suite.Suite |
Maros Ondrejicka | 2908f8c | 2023-02-02 08:58:04 +0100 | [diff] [blame] | 28 | containers map[string]*Container |
| 29 | volumes []string |
| 30 | netConfigs []NetConfig |
Maros Ondrejicka | 40cba40 | 2023-02-23 13:19:15 +0100 | [diff] [blame] | 31 | netInterfaces map[string]*NetInterface |
Maros Ondrejicka | 2908f8c | 2023-02-02 08:58:04 +0100 | [diff] [blame] | 32 | addresser *Addresser |
Maros Ondrejicka | a2d5262 | 2023-02-24 11:26:39 +0100 | [diff] [blame] | 33 | testIds map[string]string |
Filip Tehlar | 608d006 | 2023-04-28 10:29:47 +0200 | [diff] [blame] | 34 | cpuAllocator *CpuAllocatorT |
| 35 | cpuContexts []*CpuContext |
| 36 | cpuPerVpp int |
| 37 | } |
| 38 | |
| 39 | func (s *HstSuite) SetupSuite() { |
| 40 | var err error |
| 41 | s.cpuAllocator, err = CpuAllocator() |
| 42 | if err != nil { |
| 43 | s.FailNow("failed to init cpu allocator: %v", err) |
| 44 | } |
| 45 | s.cpuPerVpp = *nConfiguredCpus |
| 46 | } |
| 47 | |
| 48 | func (s *HstSuite) AllocateCpus() []int { |
| 49 | cpuCtx, err := s.cpuAllocator.Allocate(s.cpuPerVpp) |
| 50 | s.assertNil(err) |
| 51 | s.AddCpuContext(cpuCtx) |
| 52 | return cpuCtx.cpus |
| 53 | } |
| 54 | |
| 55 | func (s *HstSuite) AddCpuContext(cpuCtx *CpuContext) { |
| 56 | s.cpuContexts = append(s.cpuContexts, cpuCtx) |
Maros Ondrejicka | ffa3f60 | 2023-01-26 10:07:29 +0100 | [diff] [blame] | 57 | } |
| 58 | |
| 59 | func (s *HstSuite) TearDownSuite() { |
Maros Ondrejicka | ffa3f60 | 2023-01-26 10:07:29 +0100 | [diff] [blame] | 60 | s.unconfigureNetworkTopology() |
| 61 | } |
| 62 | |
| 63 | func (s *HstSuite) TearDownTest() { |
Maros Ondrejicka | e7625d0 | 2023-02-28 16:55:01 +0100 | [diff] [blame] | 64 | if *isPersistent { |
Maros Ondrejicka | ffa3f60 | 2023-01-26 10:07:29 +0100 | [diff] [blame] | 65 | return |
| 66 | } |
Filip Tehlar | 608d006 | 2023-04-28 10:29:47 +0200 | [diff] [blame] | 67 | for _, c := range s.cpuContexts { |
| 68 | c.Release() |
| 69 | } |
Maros Ondrejicka | e7625d0 | 2023-02-28 16:55:01 +0100 | [diff] [blame] | 70 | s.resetContainers() |
| 71 | s.removeVolumes() |
Maros Ondrejicka | ffa3f60 | 2023-01-26 10:07:29 +0100 | [diff] [blame] | 72 | } |
| 73 | |
Maros Ondrejicka | af004dd | 2023-02-27 16:52:57 +0100 | [diff] [blame] | 74 | func (s *HstSuite) skipIfUnconfiguring() { |
Maros Ondrejicka | e7625d0 | 2023-02-28 16:55:01 +0100 | [diff] [blame] | 75 | if *isUnconfiguring { |
Maros Ondrejicka | af004dd | 2023-02-27 16:52:57 +0100 | [diff] [blame] | 76 | s.skip("skipping to unconfigure") |
| 77 | } |
| 78 | } |
| 79 | |
Maros Ondrejicka | ffa3f60 | 2023-01-26 10:07:29 +0100 | [diff] [blame] | 80 | func (s *HstSuite) SetupTest() { |
Maros Ondrejicka | af004dd | 2023-02-27 16:52:57 +0100 | [diff] [blame] | 81 | s.skipIfUnconfiguring() |
Maros Ondrejicka | e7625d0 | 2023-02-28 16:55:01 +0100 | [diff] [blame] | 82 | s.setupVolumes() |
| 83 | s.setupContainers() |
Maros Ondrejicka | ffa3f60 | 2023-01-26 10:07:29 +0100 | [diff] [blame] | 84 | } |
| 85 | |
Maros Ondrejicka | e7625d0 | 2023-02-28 16:55:01 +0100 | [diff] [blame] | 86 | func (s *HstSuite) setupVolumes() { |
Maros Ondrejicka | ffa3f60 | 2023-01-26 10:07:29 +0100 | [diff] [blame] | 87 | for _, volume := range s.volumes { |
| 88 | cmd := "docker volume create --name=" + volume |
| 89 | s.log(cmd) |
| 90 | exechelper.Run(cmd) |
| 91 | } |
| 92 | } |
| 93 | |
Maros Ondrejicka | e7625d0 | 2023-02-28 16:55:01 +0100 | [diff] [blame] | 94 | func (s *HstSuite) setupContainers() { |
Maros Ondrejicka | ffa3f60 | 2023-01-26 10:07:29 +0100 | [diff] [blame] | 95 | for _, container := range s.containers { |
Filip Tehlar | 608d006 | 2023-04-28 10:29:47 +0200 | [diff] [blame] | 96 | if !container.isOptional { |
Maros Ondrejicka | ffa3f60 | 2023-01-26 10:07:29 +0100 | [diff] [blame] | 97 | container.run() |
| 98 | } |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | func (s *HstSuite) hstFail() { |
| 103 | s.T().FailNow() |
| 104 | } |
| 105 | |
| 106 | func (s *HstSuite) assertNil(object interface{}, msgAndArgs ...interface{}) { |
| 107 | if !assert.Nil(s.T(), object, msgAndArgs...) { |
| 108 | s.hstFail() |
| 109 | } |
| 110 | } |
| 111 | |
| 112 | func (s *HstSuite) assertNotNil(object interface{}, msgAndArgs ...interface{}) { |
| 113 | if !assert.NotNil(s.T(), object, msgAndArgs...) { |
| 114 | s.hstFail() |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | func (s *HstSuite) assertEqual(expected, actual interface{}, msgAndArgs ...interface{}) { |
| 119 | if !assert.Equal(s.T(), expected, actual, msgAndArgs...) { |
| 120 | s.hstFail() |
| 121 | } |
| 122 | } |
| 123 | |
| 124 | func (s *HstSuite) assertNotEqual(expected, actual interface{}, msgAndArgs ...interface{}) { |
| 125 | if !assert.NotEqual(s.T(), expected, actual, msgAndArgs...) { |
| 126 | s.hstFail() |
| 127 | } |
| 128 | } |
| 129 | |
| 130 | func (s *HstSuite) assertContains(testString, contains interface{}, msgAndArgs ...interface{}) { |
| 131 | if !assert.Contains(s.T(), testString, contains, msgAndArgs...) { |
| 132 | s.hstFail() |
| 133 | } |
| 134 | } |
| 135 | |
| 136 | func (s *HstSuite) assertNotContains(testString, contains interface{}, msgAndArgs ...interface{}) { |
| 137 | if !assert.NotContains(s.T(), testString, contains, msgAndArgs...) { |
| 138 | s.hstFail() |
| 139 | } |
| 140 | } |
| 141 | |
Maros Ondrejicka | 2ddb2fd | 2023-02-15 17:44:46 +0100 | [diff] [blame] | 142 | func (s *HstSuite) assertNotEmpty(object interface{}, msgAndArgs ...interface{}) { |
| 143 | if !assert.NotEmpty(s.T(), object, msgAndArgs...) { |
| 144 | s.hstFail() |
| 145 | } |
| 146 | } |
| 147 | |
Maros Ondrejicka | ffa3f60 | 2023-01-26 10:07:29 +0100 | [diff] [blame] | 148 | func (s *HstSuite) log(args ...any) { |
Maros Ondrejicka | e7625d0 | 2023-02-28 16:55:01 +0100 | [diff] [blame] | 149 | if *isVerbose { |
Maros Ondrejicka | af004dd | 2023-02-27 16:52:57 +0100 | [diff] [blame] | 150 | s.T().Helper() |
Maros Ondrejicka | ffa3f60 | 2023-01-26 10:07:29 +0100 | [diff] [blame] | 151 | s.T().Log(args...) |
| 152 | } |
| 153 | } |
| 154 | |
| 155 | func (s *HstSuite) skip(args ...any) { |
| 156 | s.log(args...) |
| 157 | s.T().SkipNow() |
| 158 | } |
| 159 | |
Filip Tehlar | 608d006 | 2023-04-28 10:29:47 +0200 | [diff] [blame] | 160 | func (s *HstSuite) SkipIfMultiWorker(args ...any) { |
| 161 | if *nConfiguredCpus > 1 { |
| 162 | s.skip("test case not supported with multiple vpp workers") |
| 163 | } |
| 164 | } |
| 165 | |
Maros Ondrejicka | e7625d0 | 2023-02-28 16:55:01 +0100 | [diff] [blame] | 166 | func (s *HstSuite) resetContainers() { |
Maros Ondrejicka | ffa3f60 | 2023-01-26 10:07:29 +0100 | [diff] [blame] | 167 | for _, container := range s.containers { |
| 168 | container.stop() |
| 169 | } |
| 170 | } |
| 171 | |
Maros Ondrejicka | e7625d0 | 2023-02-28 16:55:01 +0100 | [diff] [blame] | 172 | func (s *HstSuite) removeVolumes() { |
Maros Ondrejicka | ffa3f60 | 2023-01-26 10:07:29 +0100 | [diff] [blame] | 173 | for _, volumeName := range s.volumes { |
| 174 | cmd := "docker volume rm " + volumeName |
| 175 | exechelper.Run(cmd) |
| 176 | os.RemoveAll(volumeName) |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | func (s *HstSuite) getContainerByName(name string) *Container { |
| 181 | return s.containers[name] |
| 182 | } |
| 183 | |
Maros Ondrejicka | 2908f8c | 2023-02-02 08:58:04 +0100 | [diff] [blame] | 184 | /* |
| 185 | * Create a copy and return its address, so that individial tests which call this |
| 186 | * are not able to modify the original container and affect other tests by doing that |
| 187 | */ |
| 188 | func (s *HstSuite) getTransientContainerByName(name string) *Container { |
Maros Ondrejicka | ffa3f60 | 2023-01-26 10:07:29 +0100 | [diff] [blame] | 189 | containerCopy := *s.containers[name] |
| 190 | return &containerCopy |
| 191 | } |
| 192 | |
| 193 | func (s *HstSuite) loadContainerTopology(topologyName string) { |
Maros Ondrejicka | e7625d0 | 2023-02-28 16:55:01 +0100 | [diff] [blame] | 194 | data, err := ioutil.ReadFile(containerTopologyDir + topologyName + ".yaml") |
Maros Ondrejicka | ffa3f60 | 2023-01-26 10:07:29 +0100 | [diff] [blame] | 195 | if err != nil { |
| 196 | s.T().Fatalf("read error: %v", err) |
| 197 | } |
| 198 | var yamlTopo YamlTopology |
| 199 | err = yaml.Unmarshal(data, &yamlTopo) |
| 200 | if err != nil { |
| 201 | s.T().Fatalf("unmarshal error: %v", err) |
| 202 | } |
| 203 | |
| 204 | for _, elem := range yamlTopo.Volumes { |
| 205 | volumeMap := elem["volume"].(VolumeConfig) |
| 206 | hostDir := volumeMap["host-dir"].(string) |
| 207 | s.volumes = append(s.volumes, hostDir) |
| 208 | } |
| 209 | |
| 210 | s.containers = make(map[string]*Container) |
| 211 | for _, elem := range yamlTopo.Containers { |
Maros Ondrejicka | e7625d0 | 2023-02-28 16:55:01 +0100 | [diff] [blame] | 212 | newContainer, err := newContainer(elem) |
Maros Ondrejicka | ffa3f60 | 2023-01-26 10:07:29 +0100 | [diff] [blame] | 213 | newContainer.suite = s |
| 214 | if err != nil { |
| 215 | s.T().Fatalf("container config error: %v", err) |
| 216 | } |
Maros Ondrejicka | ffa3f60 | 2023-01-26 10:07:29 +0100 | [diff] [blame] | 217 | s.containers[newContainer.name] = newContainer |
| 218 | } |
| 219 | } |
| 220 | |
| 221 | func (s *HstSuite) loadNetworkTopology(topologyName string) { |
Maros Ondrejicka | e7625d0 | 2023-02-28 16:55:01 +0100 | [diff] [blame] | 222 | data, err := ioutil.ReadFile(networkTopologyDir + topologyName + ".yaml") |
Maros Ondrejicka | ffa3f60 | 2023-01-26 10:07:29 +0100 | [diff] [blame] | 223 | if err != nil { |
| 224 | s.T().Fatalf("read error: %v", err) |
| 225 | } |
| 226 | var yamlTopo YamlTopology |
| 227 | err = yaml.Unmarshal(data, &yamlTopo) |
| 228 | if err != nil { |
| 229 | s.T().Fatalf("unmarshal error: %v", err) |
| 230 | } |
| 231 | |
Maros Ondrejicka | e7625d0 | 2023-02-28 16:55:01 +0100 | [diff] [blame] | 232 | s.addresser = newAddresser(s) |
Maros Ondrejicka | 40cba40 | 2023-02-23 13:19:15 +0100 | [diff] [blame] | 233 | s.netInterfaces = make(map[string]*NetInterface) |
Maros Ondrejicka | ffa3f60 | 2023-01-26 10:07:29 +0100 | [diff] [blame] | 234 | for _, elem := range yamlTopo.Devices { |
| 235 | switch elem["type"].(string) { |
| 236 | case NetNs: |
| 237 | { |
Maros Ondrejicka | e7625d0 | 2023-02-28 16:55:01 +0100 | [diff] [blame] | 238 | if namespace, err := newNetNamespace(elem); err == nil { |
Maros Ondrejicka | 2908f8c | 2023-02-02 08:58:04 +0100 | [diff] [blame] | 239 | s.netConfigs = append(s.netConfigs, &namespace) |
Maros Ondrejicka | ffa3f60 | 2023-01-26 10:07:29 +0100 | [diff] [blame] | 240 | } else { |
| 241 | s.T().Fatalf("network config error: %v", err) |
| 242 | } |
| 243 | } |
Maros Ondrejicka | 40cba40 | 2023-02-23 13:19:15 +0100 | [diff] [blame] | 244 | case Veth, Tap: |
Maros Ondrejicka | ffa3f60 | 2023-01-26 10:07:29 +0100 | [diff] [blame] | 245 | { |
Maros Ondrejicka | e7625d0 | 2023-02-28 16:55:01 +0100 | [diff] [blame] | 246 | if netIf, err := newNetworkInterface(elem, s.addresser); err == nil { |
Maros Ondrejicka | 40cba40 | 2023-02-23 13:19:15 +0100 | [diff] [blame] | 247 | s.netConfigs = append(s.netConfigs, netIf) |
| 248 | s.netInterfaces[netIf.Name()] = netIf |
Maros Ondrejicka | ffa3f60 | 2023-01-26 10:07:29 +0100 | [diff] [blame] | 249 | } else { |
| 250 | s.T().Fatalf("network config error: %v", err) |
| 251 | } |
| 252 | } |
| 253 | case Bridge: |
| 254 | { |
Maros Ondrejicka | e7625d0 | 2023-02-28 16:55:01 +0100 | [diff] [blame] | 255 | if bridge, err := newBridge(elem); err == nil { |
Maros Ondrejicka | 2908f8c | 2023-02-02 08:58:04 +0100 | [diff] [blame] | 256 | s.netConfigs = append(s.netConfigs, &bridge) |
Maros Ondrejicka | ffa3f60 | 2023-01-26 10:07:29 +0100 | [diff] [blame] | 257 | } else { |
| 258 | s.T().Fatalf("network config error: %v", err) |
| 259 | } |
| 260 | } |
| 261 | } |
| 262 | } |
| 263 | } |
| 264 | |
| 265 | func (s *HstSuite) configureNetworkTopology(topologyName string) { |
| 266 | s.loadNetworkTopology(topologyName) |
| 267 | |
Maros Ondrejicka | e7625d0 | 2023-02-28 16:55:01 +0100 | [diff] [blame] | 268 | if *isUnconfiguring { |
Maros Ondrejicka | af004dd | 2023-02-27 16:52:57 +0100 | [diff] [blame] | 269 | return |
| 270 | } |
| 271 | |
Maros Ondrejicka | 2908f8c | 2023-02-02 08:58:04 +0100 | [diff] [blame] | 272 | for _, nc := range s.netConfigs { |
Maros Ondrejicka | e7625d0 | 2023-02-28 16:55:01 +0100 | [diff] [blame] | 273 | if err := nc.configure(); err != nil { |
Maros Ondrejicka | ffa3f60 | 2023-01-26 10:07:29 +0100 | [diff] [blame] | 274 | s.T().Fatalf("network config error: %v", err) |
| 275 | } |
| 276 | } |
| 277 | } |
| 278 | |
| 279 | func (s *HstSuite) unconfigureNetworkTopology() { |
Maros Ondrejicka | e7625d0 | 2023-02-28 16:55:01 +0100 | [diff] [blame] | 280 | if *isPersistent { |
Maros Ondrejicka | ffa3f60 | 2023-01-26 10:07:29 +0100 | [diff] [blame] | 281 | return |
| 282 | } |
Maros Ondrejicka | 2908f8c | 2023-02-02 08:58:04 +0100 | [diff] [blame] | 283 | for _, nc := range s.netConfigs { |
Maros Ondrejicka | e7625d0 | 2023-02-28 16:55:01 +0100 | [diff] [blame] | 284 | nc.unconfigure() |
Maros Ondrejicka | ffa3f60 | 2023-01-26 10:07:29 +0100 | [diff] [blame] | 285 | } |
| 286 | } |
| 287 | |
Maros Ondrejicka | a2d5262 | 2023-02-24 11:26:39 +0100 | [diff] [blame] | 288 | func (s *HstSuite) getTestId() string { |
| 289 | testName := s.T().Name() |
| 290 | |
| 291 | if s.testIds == nil { |
| 292 | s.testIds = map[string]string{} |
| 293 | } |
| 294 | |
| 295 | if _, ok := s.testIds[testName]; !ok { |
Filip Tehlar | 75776f0 | 2023-03-24 13:47:45 +0100 | [diff] [blame] | 296 | s.testIds[testName] = time.Now().Format("2006-01-02_15-04-05") |
Maros Ondrejicka | a2d5262 | 2023-02-24 11:26:39 +0100 | [diff] [blame] | 297 | } |
| 298 | |
| 299 | return s.testIds[testName] |
| 300 | } |
| 301 | |
Maros Ondrejicka | 300f70d | 2023-02-21 10:53:20 +0100 | [diff] [blame] | 302 | type AddressCounter = int |
| 303 | |
Maros Ondrejicka | 2908f8c | 2023-02-02 08:58:04 +0100 | [diff] [blame] | 304 | type Addresser struct { |
Maros Ondrejicka | 300f70d | 2023-02-21 10:53:20 +0100 | [diff] [blame] | 305 | networks map[int]AddressCounter |
| 306 | suite *HstSuite |
Maros Ondrejicka | 2908f8c | 2023-02-02 08:58:04 +0100 | [diff] [blame] | 307 | } |
| 308 | |
Maros Ondrejicka | e7625d0 | 2023-02-28 16:55:01 +0100 | [diff] [blame] | 309 | func (a *Addresser) addNetwork(networkNumber int) { |
Maros Ondrejicka | 300f70d | 2023-02-21 10:53:20 +0100 | [diff] [blame] | 310 | a.networks[networkNumber] = 1 |
| 311 | } |
| 312 | |
Maros Ondrejicka | e7625d0 | 2023-02-28 16:55:01 +0100 | [diff] [blame] | 313 | func (a *Addresser) newIp4Address(inputNetworkNumber ...int) (string, error) { |
Maros Ondrejicka | 300f70d | 2023-02-21 10:53:20 +0100 | [diff] [blame] | 314 | var networkNumber int = 0 |
| 315 | if len(inputNetworkNumber) > 0 { |
| 316 | networkNumber = inputNetworkNumber[0] |
Maros Ondrejicka | ffa3f60 | 2023-01-26 10:07:29 +0100 | [diff] [blame] | 317 | } |
| 318 | |
Maros Ondrejicka | 300f70d | 2023-02-21 10:53:20 +0100 | [diff] [blame] | 319 | if _, ok := a.networks[networkNumber]; !ok { |
Maros Ondrejicka | e7625d0 | 2023-02-28 16:55:01 +0100 | [diff] [blame] | 320 | a.addNetwork(networkNumber) |
Maros Ondrejicka | ffa3f60 | 2023-01-26 10:07:29 +0100 | [diff] [blame] | 321 | } |
Maros Ondrejicka | 300f70d | 2023-02-21 10:53:20 +0100 | [diff] [blame] | 322 | |
| 323 | numberOfAddresses := a.networks[networkNumber] |
| 324 | |
| 325 | if numberOfAddresses == 254 { |
| 326 | return "", fmt.Errorf("no available IPv4 addresses") |
| 327 | } |
| 328 | |
| 329 | address := fmt.Sprintf("10.10.%v.%v/24", networkNumber, numberOfAddresses) |
| 330 | a.networks[networkNumber] = numberOfAddresses + 1 |
| 331 | |
| 332 | return address, nil |
Maros Ondrejicka | 2908f8c | 2023-02-02 08:58:04 +0100 | [diff] [blame] | 333 | } |
Maros Ondrejicka | ffa3f60 | 2023-01-26 10:07:29 +0100 | [diff] [blame] | 334 | |
Maros Ondrejicka | e7625d0 | 2023-02-28 16:55:01 +0100 | [diff] [blame] | 335 | func newAddresser(suite *HstSuite) *Addresser { |
Maros Ondrejicka | 2908f8c | 2023-02-02 08:58:04 +0100 | [diff] [blame] | 336 | var addresser = new(Addresser) |
| 337 | addresser.suite = suite |
Maros Ondrejicka | 300f70d | 2023-02-21 10:53:20 +0100 | [diff] [blame] | 338 | addresser.networks = make(map[int]AddressCounter) |
Maros Ondrejicka | e7625d0 | 2023-02-28 16:55:01 +0100 | [diff] [blame] | 339 | addresser.addNetwork(0) |
Maros Ondrejicka | 2908f8c | 2023-02-02 08:58:04 +0100 | [diff] [blame] | 340 | return addresser |
Maros Ondrejicka | ffa3f60 | 2023-01-26 10:07:29 +0100 | [diff] [blame] | 341 | } |