"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "go/pkg/pass1/mark-disabled.go" between
Netspoc-6.026.tar.gz and Netspoc-6.027.tar.gz

About: NetSPoC is a network security policy compiler (using its own description language) to manage all the packet filter devices inside your network topology.

mark-disabled.go  (Netspoc-6.026):mark-disabled.go  (Netspoc-6.027)
skipping to change at line 86 skipping to change at line 86
" since it is part of a loop", intf) " since it is part of a loop", intf)
} }
} }
// Delete disabled interfaces from routers. // Delete disabled interfaces from routers.
for _, intf := range disabled { for _, intf := range disabled {
delIntf := func(intf *routerIntf, l intfList) intfList { delIntf := func(intf *routerIntf, l intfList) intfList {
var clean intfList var clean intfList
for _, intf2 := range l { for _, intf2 := range l {
if intf2 != intf { if intf2 != intf {
clean = append(clean, intf2) clean.push(intf2)
} }
} }
return clean return clean
} }
delHW := func(hw *hardware, l []*hardware) []*hardware { delHW := func(hw *hardware, l []*hardware) []*hardware {
var clean []*hardware var clean []*hardware
for _, hw2 := range l { for _, hw2 := range l {
if hw2 != hw { if hw2 != hw {
clean = append(clean, hw2) clean = append(clean, hw2)
} }
skipping to change at line 138 skipping to change at line 138
} }
return clean return clean
} }
a.border = cleanup(a.border) a.border = cleanup(a.border)
a.inclusiveBorder = cleanup(a.inclusiveBorder) a.inclusiveBorder = cleanup(a.inclusiveBorder)
if !ok { if !ok {
a.disabled = true a.disabled = true
} }
} }
} }
rl := getIpv4Ipv6Routers()
// Remove disabled routers
rl := c.allRouters
sort.Slice(rl, func(i, j int) bool { sort.Slice(rl, func(i, j int) bool {
return rl[i].name < rl[j].name return rl[i].name < rl[j].name
}) })
rl = append(rl, c.routerFragments...) j := 0
for _, r := range rl { for _, r := range rl {
if r.disabled { if r.disabled {
continue continue
} }
c.allRouters = append(c.allRouters, r) rl[j] = r
if r.managed != "" { j++
if r.managed != "" || r.routingOnly {
c.managedRouters = append(c.managedRouters, r) c.managedRouters = append(c.managedRouters, r)
} else if r.routingOnly {
c.routingOnlyRouters = append(c.routingOnlyRouters, r)
} }
} }
c.allRouters = rl[:j]
// Collect vrf instances belonging to one device. // Collect vrf instances belonging to one device.
// Also collect all IPv4 and IPv6 routers with same name. // Also collect all IPv4 and IPv6 routers with same name.
sameIPvDevice := make(map[string][]*router) sameIPvDevice := make(map[string][]*router)
sameDevice := make(map[string][]*router) sameDevice := make(map[string][]*router)
for _, r := range append(c.managedRouters, c.routingOnlyRouters...) { for _, r := range c.managedRouters {
if r.origRouter != nil { if r.origRouter != nil {
continue continue
} }
name := r.deviceName name := r.deviceName
nameIPv := name nameIPv := name
if r.ipV6 { if r.ipV6 {
nameIPv += ",6" nameIPv += ",6"
} }
sameIPvDevice[nameIPv] = append(sameIPvDevice[nameIPv], r) sameIPvDevice[nameIPv] = append(sameIPvDevice[nameIPv], r)
sameDevice[name] = append(sameDevice[name], r) sameDevice[name] = append(sameDevice[name], r)
 End of changes. 7 change blocks. 
9 lines changed or deleted 10 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)