"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "go/pkg/pass1/path-walk.go" between
Netspoc-6.025.tar.gz and Netspoc-6.026.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.025):path-walk.go  (Netspoc-6.026)
skipping to change at line 575 skipping to change at line 575
startStore = startIntf startStore = startIntf
} }
// Fixup end of path. // Fixup end of path.
if endIntf != nil { if endIntf != nil {
fixupZonePath(endIntf, 1, lPath) fixupZonePath(endIntf, 1, lPath)
endStore = endIntf endStore = endIntf
} }
} }
// Check if path is empty after fixup.
if len(lPath.enter) == 0 {
return false
}
// Store found path. // Store found path.
startStore.setLoopPath(endStore, lPath) startStore.setLoopPath(endStore, lPath)
return true return true
} }
//############################################################################# //#############################################################################
// Purpose : Collect path information through a loop for a pair of // Purpose : Collect path information through a loop for a pair of
// loop nodes (zone or router). // loop nodes (zone or router).
// Store it at the object where loop paths begins. // Store it at the object where loop paths begins.
skipping to change at line 915 skipping to change at line 920
// Parameter : from_store - Object, where path starts. // Parameter : from_store - Object, where path starts.
// to_store - Objects, where path ends // to_store - Objects, where path ends
// Typically both are of type zone or router. // Typically both are of type zone or router.
// For details see description of sub path_walk. // For details see description of sub path_walk.
// Returns : True if valid path is found, False otherwise. // Returns : True if valid path is found, False otherwise.
// Results : The next interface towards to_store is stored in attribute // Results : The next interface towards to_store is stored in attribute
// - {path1} of from_store and // - {path1} of from_store and
// - {path} of subsequent interfaces on path. // - {path} of subsequent interfaces on path.
func pathMark(fromStore, toStore pathStore) bool { func pathMark(fromStore, toStore pathStore) bool {
// debug("path_mark %s --> %s", fromStore.String(), toStore.String() ) // debug("path_mark %s --> %s", fromStore, toStore)
var from, to pathObj var from, to pathObj
switch x := fromStore.(type) { switch x := fromStore.(type) {
case *routerIntf: case *routerIntf:
from = x.router from = x.router
case *router: case *router:
from = x from = x
case *zone: case *zone:
from = x from = x
} }
switch x := toStore.(type) { switch x := toStore.(type) {
skipping to change at line 1094 skipping to change at line 1099
// out - interface loop is left at. // out - interface loop is left at.
// loop_entry - entry object, holding path information. // loop_entry - entry object, holding path information.
// loop_exit - loop exit node. // loop_exit - loop exit node.
// call_at_zone - flag for node function is to be called at // call_at_zone - flag for node function is to be called at
// (1 - zone. 0 - router) // (1 - zone. 0 - router)
// rule - elementary rule providing source and destination. // rule - elementary rule providing source and destination.
// fun - Function to be applied. // fun - Function to be applied.
func loopPathWalk(in, out *routerIntf, loopEntry, loopExit pathStore, callAtZone bool, rule *groupedRule, fun func(r *groupedRule, i, o *routerIntf)) bool { func loopPathWalk(in, out *routerIntf, loopEntry, loopExit pathStore, callAtZone bool, rule *groupedRule, fun func(r *groupedRule, i, o *routerIntf)) bool {
// my info = "loop_path_walk: "; // debug("loop_path_walk: %s->%s=>%s->%s", in, loopEntry, loopExit, out)
// info .= "in->{name}->" if in;
// info .= "loop_entry->{name}=>loop_exit->{name}";
// info .= "->out->{name}" if out;
// debug(info);
lPath := loopEntry.getLoopPath()[loopExit] lPath := loopEntry.getLoopPath()[loopExit]
// Process entry of cyclic graph. // Process entry of cyclic graph.
isRouter := false isRouter := false
switch x := loopEntry.(type) { switch x := loopEntry.(type) {
case *router: case *router:
isRouter = true isRouter = true
case *routerIntf: case *routerIntf:
 End of changes. 3 change blocks. 
6 lines changed or deleted 7 lines changed or added

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