From: blackh <gra...@li...> - 2003-11-30 08:50:44
|
blackh Sun Nov 30 00:50:43 2003 EDT Modified files: /grapevine README WARNING /grapevine/debian postinst /grapevine/raisen/grapevine validate-prospective-neighbour.xml Log: More tweaks. Index: grapevine/raisen/grapevine/validate-prospective-neighbour.xml diff -u grapevine/raisen/grapevine/validate-prospective-neighbour.xml:1.7 grapevine/raisen/grapevine/validate-prospective-neighbour.xml:1.8 --- grapevine/raisen/grapevine/validate-prospective-neighbour.xml:1.7 Sat Jul 13 07:11:30 2002 +++ grapevine/raisen/grapevine/validate-prospective-neighbour.xml Sun Nov 30 00:50:43 2003 @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<!-- $Id: validate-prospective-neighbour.xml,v 1.7 2002/07/13 14:11:30 blackh Exp $ --> +<!-- $Id: validate-prospective-neighbour.xml,v 1.8 2003/11/30 08:50:43 blackh Exp $ --> <!DOCTYPE grapevine SYSTEM "../raisen.dtd" [ @@ -18,10 +18,10 @@ --> <grapevine> - <domain name="grapevine.validate-prospective-neighbour" author1="Stephen Blackheath" rev="$Revision: 1.7 $"> + <domain name="grapevine.validate-prospective-neighbour" author1="Stephen Blackheath" rev="$Revision: 1.8 $"> <facts> - <flag verbose="false"/> + <flag verbose="true"/> <!-- Minimum SAHP power value below which nodes are not permitted to join. --> <grapevine.validate-prospective-neighbour.minimum-power value="50000."/> </facts> @@ -53,11 +53,12 @@ noOfNeighbours = validate#noOfNeighbours, farthestDistance = validate#farthestDistance, - + { <flag verbose="true"/>, - println("validate-prospective-neighbour: interface=" ## interfaceID - ## " noOfInterfaces=" ## noOfNeighbours + println("validate-prospective-neighbour: prospect=" ## joinLocation + ## " power=" ## power ## " interface=" ## interfaceID + ## " current no of neighbours=" ## noOfNeighbours ## " farthestDistance=" ## farthestDistance) } || true, @@ -67,15 +68,27 @@ <obj.interface id="[interfaceID]" location="[interfaceLocation]" state="[state]"/>, <!-- A node can't join itself. --> - joinLocation != interfaceLocation, + joinLocation != interfaceLocation || { + <flag verbose="true"/>, + println("validate-prospective-neighbour: rejected - node can't join itself"), + null + }, <!-- Don't allow a neighbour to join an interface of ours that is disconnected. --> - state != "disconnected", + state != "disconnected" || { + <flag verbose="true"/>, + println("validate-prospective-neighbour: rejected - our interface is disconnected"), + null + }, <!-- Power must be greater or equal to the minimum. --> <grapevine.validate-prospective-neighbour.minimum-power value="[minimumPower]"/>, - toBigInteger(power) >= toBigInteger(minimumPower), + toBigInteger(power) >= toBigInteger(minimumPower) || { + <flag verbose="true"/>, + println("validate-prospective-neighbour: rejected - power is less than minimum"), + null + }, <grapevine.vector.space neighbourliness="[maxNoOfNeighbours]"/>, @@ -95,10 +108,19 @@ println("join-transaction: joining node distance = " ## joinerDistance) } || true, - joinerDistance <= farthestDistance + joinerDistance <= farthestDistance || { + <flag verbose="true"/>, + println("validate-prospective-neighbour: rejected - node is not within the definitive zone"), + null + }, }, - validate#verdict = "yes" + validate#verdict = "yes", + { + <flag verbose="true"/>, + println("validate-prospective-neighbour: accepted!") + } || true + } || validate#verdict = "no"; |