"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "go/pkg/pass1/mark-secondary-rules.go" between
Netspoc-6.032.tar.gz and Netspoc-6.033.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-secondary-rules.go  (Netspoc-6.032):mark-secondary-rules.go  (Netspoc-6.033)
skipping to change at line 97 skipping to change at line 97
nextZone := outIntf.zone nextZone := outIntf.zone
if nextZone.primaryMark != 0 { if nextZone.primaryMark != 0 {
continue continue
} }
markPrimary(nextZone, mark) markPrimary(nextZone, mark)
} }
} }
} }
func getZone(path pathStore, list []someObj) *zone { func getZone(path pathStore, list []someObj) *zone {
var result *zone
switch x := path.(type) { switch x := path.(type) {
case *zone: case *zone:
return x result = x
case *routerIntf: case *routerIntf:
return x.zone result = x.zone
case *router: case *router:
// src/dst may contain interfaces of different zones with // src/dst may contain interfaces of different zones with
// different values of secondaryMark/primaryMark. // different values of secondaryMark/primaryMark.
// //
// If router is "managed = secondary", choose zone of arbitrary // If router is "managed = secondary", choose zone of arbitrary
// interface, because all zones have identical mark and // interface, because all zones have identical mark and
// for all zones hasSecondary and hasNonPrimary is set. // for all zones hasSecondary and hasNonPrimary is set.
// //
// Loopback interface can be ignored, it has unique mark. // Loopback interface can be ignored, it has unique mark.
if x.managed == "secondary" { if x.managed == "secondary" {
return x.interfaces[0].zone result = x.interfaces[0].zone
break
} }
var z, l *zone var l *zone
for _, obj := range list { for _, obj := range list {
intf := obj.(*routerIntf) intf := obj.(*routerIntf)
z2 := intf.zone
if intf.loopback { if intf.loopback {
l = z2 l = intf.zone
} else if z == nil { } else if result == nil {
z = z2 result = intf.zone
} else if z != z2 { } else if result != intf.zone {
return nil return nil
} }
} }
if z == nil { if result == nil {
return l result = l
} }
return z
} }
return nil return result
} }
type conflictKey = struct { type conflictKey = struct {
isSrc bool isSrc bool
isPrimary bool isPrimary bool
mark int mark int
net *network net *network
} }
type conflictInfo = struct { type conflictInfo = struct {
 End of changes. 10 change blocks. 
13 lines changed or deleted 13 lines changed or added

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