"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "go/pkg/pass1/path-walk.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.

path-walk.go  (Netspoc-6.032):path-walk.go  (Netspoc-6.033)
skipping to change at line 34 skipping to change at line 34
if intf := obj.getToZone1(); intf != nil { if intf := obj.getToZone1(); intf != nil {
obj = intf.toZone1 obj = intf.toZone1
} else { } else {
return obj.(*zone) return obj.(*zone)
} }
} }
} }
//############################################################################# //#############################################################################
// Purpose : Provide path node objects for objects specified as src or dst. // Purpose : Provide path node objects for objects specified as src or dst.
// Parameter : Source or destination object from an elementary rule. // Parameter : Source or destination object.
// Returns : Reference to zone or router of the given object or reference // Returns : Zone or router of the given object or
// to object itself, if it is a pathrestricted interface. // the object itself, if it is a pathrestricted interface.
// Results : Return value for given object is stored in obj2path lookup hash.
func (obj *network) getPathNode() pathStore { func (obj *network) getPathNode() pathStore {
return obj.zone return obj.zone
} }
func (obj *subnet) getPathNode() pathStore { func (obj *subnet) getPathNode() pathStore {
return obj.network.zone return obj.network.zone
} }
func (obj *routerIntf) getPathNode() pathStore { func (obj *routerIntf) getPathNode() pathStore {
router := obj.router router := obj.router
if router.managed != "" || router.semiManaged { if router.managed != "" || router.semiManaged {
skipping to change at line 70 skipping to change at line 69
} else { } else {
return main.router return main.router
} }
} else { } else {
// Unmanaged routers are part of zone objects. // Unmanaged routers are part of zone objects.
return obj.network.zone return obj.network.zone
} }
} }
// This is used, if called from pathAutoIntfs. // This is used, if called from findAutoInterfaces.
func (obj *router) getPathNode() pathStore { func (obj *router) getPathNode() pathStore {
if obj.managed != "" || obj.semiManaged { if obj.managed != "" || obj.semiManaged {
return obj return obj
} else { } else {
return obj.interfaces[0].network.zone return obj.interfaces[0].network.zone
} }
} }
// This is used, if pathWalk is called from findActiveRoutes.
func (obj *zone) getPathNode() pathStore {
return obj
}
// This is used in cut-netspoc and if pathWalk is called early to // This is used in cut-netspoc and if pathWalk is called early to
// expand auto interfaces. // expand auto interfaces.
func (obj *host) getPathNode() pathStore { func (obj *host) getPathNode() pathStore {
return obj.network.zone return obj.network.zone
} }
// This is used, if called from expandAutoIntfWithDstList. // This is used, if called from expandAutoIntfWithDstList.
func (obj *autoIntf) getPathNode() pathStore { func (obj *autoIntf) getPathNode() pathStore {
object := obj.object return obj.object.getPathNode()
switch x := object.(type) {
case *network:
// This will be refined later, if real interface is known.
return x.zone
case *router:
if x.managed != "" || x.semiManaged {
// This will be refined later, if real interface has path
restriction.
return x
} else {
// Take arbitrary interface to find zone.
return x.interfaces[0].network.zone
}
}
return nil
} }
type navigation map[*loop]map[*loop]bool type navigation map[*loop]map[*loop]bool
type intfPair [2]*routerIntf type intfPair [2]*routerIntf
type intfPairs []intfPair type intfPairs []intfPair
type loopPath struct { type loopPath struct {
enter intfList enter intfList
leave intfList leave intfList
routerTuples intfPairs routerTuples intfPairs
 End of changes. 4 change blocks. 
29 lines changed or deleted 5 lines changed or added

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