[Xorp-cvs] XORP cvs commit: xorp/rtrmgr
Pavlin Radoslavov
pavlin@icir.org
Tue, 27 Sep 2005 18:37:32 GMT
CVSROOT: /usr/local/share/doc/apache/cvs
Module name: xorp
Changes by: pavlin@xorpc.icir.org 2005-09-27 18:37:32 UTC
XORP CVS repository
Modified files:
rtrmgr boot.ll boot.yy cli.cc conf_tree.cc conf_tree.hh
conf_tree_node.cc conf_tree_node.hh lex.boot.cc
master_conf_tree.cc master_conf_tree.hh
master_conf_tree_node.cc master_conf_tree_node.hh
slave_conf_tree.cc slave_conf_tree.hh
slave_conf_tree_node.cc slave_conf_tree_node.hh
template_tree_node.cc y.boot_tab.cc y.boot_tab.h
Log message:
Refactor the mechanism for assigning and using the node ID
(given to each node in the configuration tree):
* Previously the node ID was a 64 bit integer: the lower 32 bits
were the client instance ID; the upper 32 bits were the unique
number (unique among all siblings of a parent node in the
configuration tree).
Now the node ID uses the new class ConfigNodeId and is a pair
of two 64 bit integers: the first one is the unique node ID (similar
to the previous solution), and the second one is the unique node
ID of the previous sibling (in the list of ordered siblings).
Note that previously, the ordering of the nodes was implied by the
node number, but now the node ID itself contains the ordering
information. Hence, the unique part of the node ID doesn't have to
be monotonically increasing anymore, and can have any (unique) value.
The reason for using the new scheme is because there was a fundamental
flow in the mechanism for assigning the unique node IDs:
Even though the unique node ID address space was 32 bits, we could
run out of unique node IDs after adding as few as O(log2 N) = 32
new nodes if they are added in a specific order.
Now that we have decoupled the ordering information from the unique
node ID, the assignment of the unique node ID is trivial. In fact,
it will be very easy each node to have a node ID that is unique
across the whole configuration.
* Refactor/simplify the implementation of
ConfigTreeNode::allocate_unique_nodenum()
(now called ConfigTreeNode::allocate_unique_node_id()).
* Fix the bool.ll and boot.yy configuraton parser to understand the
new "<ID> <POSITION>" node ID format. Also, rename token LINENUM
to CONGIG_NODE_ID
* Rename nodenum to node_id to reflect better the functionality.
Also, rename constant NODE_NUMBER to NODE_ID.
[Note: the above scheme was co-designed with Atanu Ghosh.]
Revision Changes Path
1.26 +2 -2; commitid: 189843398a387ea6; xorp/rtrmgr/boot.ll
1.24 +40 -30; commitid: 189843398a387ea6; xorp/rtrmgr/boot.yy
1.95 +4 -4; commitid: 189843398a387ea6; xorp/rtrmgr/cli.cc
1.43 +11 -9; commitid: 189843398a387ea6; xorp/rtrmgr/conf_tree.cc
1.26 +16 -10; commitid: 189843398a387ea6; xorp/rtrmgr/conf_tree.hh
1.86 +94 -95; commitid: 189843398a387ea6; xorp/rtrmgr/conf_tree_node.cc
1.48 +13 -9; commitid: 189843398a387ea6; xorp/rtrmgr/conf_tree_node.hh
1.20 +8512 -8514; commitid: 189843398a387ea6; xorp/rtrmgr/lex.boot.cc
1.61 +3 -3; commitid: 189843398a387ea6; xorp/rtrmgr/master_conf_tree.cc
1.33 +2 -2; commitid: 189843398a387ea6; xorp/rtrmgr/master_conf_tree.hh
1.16 +7 -6; commitid: 189843398a387ea6; xorp/rtrmgr/master_conf_tree_node.cc
1.15 +5 -4; commitid: 189843398a387ea6; xorp/rtrmgr/master_conf_tree_node.hh
1.32 +5 -5; commitid: 189843398a387ea6; xorp/rtrmgr/slave_conf_tree.cc
1.23 +2 -2; commitid: 189843398a387ea6; xorp/rtrmgr/slave_conf_tree.hh
1.24 +10 -9; commitid: 189843398a387ea6; xorp/rtrmgr/slave_conf_tree_node.cc
1.16 +7 -7; commitid: 189843398a387ea6; xorp/rtrmgr/slave_conf_tree_node.hh
1.60 +3 -3; commitid: 189843398a387ea6; xorp/rtrmgr/template_tree_node.cc
1.28 +85 -75; commitid: 189843398a387ea6; xorp/rtrmgr/y.boot_tab.cc
1.11 +1 -1; commitid: 189843398a387ea6; xorp/rtrmgr/y.boot_tab.h