forest-net
an overlay networks for large-scale virtual worlds
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator
forest::ComtInfo Class Reference

Maintains information about the comtrees in a Forest network. More...

#include <ComtInfo.h>

Collaboration diagram for forest::ComtInfo:

Classes

struct  ComtLeafInfo
 
struct  ComtreeInfo
 
struct  ComtRtrInfo
 

Public Member Functions

 ComtInfo (int, NetInfo &)
 Constructor for ComtInfo, allocates space and initializes private data. More...
 
 ~ComtInfo ()
 Destructor for ComtInfo class. More...
 
bool init ()
 Initialize locks and condition variables. More...
 
bool validComtree (int) const
 Check to see if a given comtree number is valid. More...
 
bool validComtIndex (int) const
 Check to see if a given comtree index is valid. More...
 
bool isComtNode (int, int) const
 Determine if a node belongs to a comtree or not. More...
 
bool isComtRtr (int, int) const
 Determine if a node is a router in a comtree or not. More...
 
bool isComtLeaf (int, int) const
 Determine if a node is a leaf in a comtree. More...
 
bool isCoreNode (int, fAdr_t) const
 Determine if a router is a core node in a specified comtree. More...
 
bool isComtLink (int, int) const
 Determine if a link is in a specified comtree. More...
 
int firstComtree ()
 Get the first comtree in the list of valid comtrees and lock it. More...
 
int nextComtree (int)
 Get the next comtree in the list of valid comtrees and lock it. More...
 
fAdr_t firstCore (int) const
 Get the forest address of the first core node in a comtree. More...
 
fAdr_t nextCore (int, fAdr_t) const
 Get the forest address of the next core node in a comtree. More...
 
fAdr_t firstRouter (int) const
 Get the forest address of the first router in a comtree. More...
 
fAdr_t nextRouter (int, fAdr_t) const
 Get the forest address of the next router in a comtree. More...
 
fAdr_t firstLeaf (int) const
 Get the forest address of the first leaf in a comtree. More...
 
fAdr_t nextLeaf (int, fAdr_t) const
 Get the forest address of the next leaf in a comtree. More...
 
int getComtIndex (int)
 Get the comtree index for a given comtree and lock the comtree. More...
 
int getComtree (int) const
 Get the comtree number for the comtree with a given index. More...
 
fAdr_t getOwner (int) const
 Get the owner of a comtree with specified index. More...
 
fAdr_t getRoot (int) const
 Get the comtree root for the comtree with a given index. More...
 
bool getConfigMode (int) const
 get the backbone configuration mode of a comtree. More...
 
RateSpecgetDefLeafRates (int)
 Get the default RateSpecs for access links in a comtree. More...
 
RateSpecgetDefBbRates (int)
 Get the default RateSpecs for backbone links in a comtree. More...
 
fAdr_t getChild (int, int) const
 Get the child endpoint of a link in a comtree. More...
 
int getPlink (int, fAdr_t) const
 Get the link to a parent of a node in a comtree. More...
 
fAdr_t getParent (int, fAdr_t) const
 Get the parent of a comtree node. More...
 
int getLinkCnt (int, fAdr_t) const
 Get the number of links in a comtree that are incident to a router. More...
 
bool isFrozen (int, fAdr_t) const
 Determine if the rates for a comtree backbone link are frozen. More...
 
RateSpecgetLinkRates (int, int) const
 Get the RateSpec for a comtree link. More...
 
int addComtree (int)
 Add a new comtree. More...
 
bool removeComtree (int)
 Remove a comtree. More...
 
bool setRoot (int, fAdr_t)
 Set the root node of a comtree. More...
 
bool setOwner (int, fAdr_t)
 Set the owner of a comtree. More...
 
void setConfigMode (int, bool)
 Set the backbone configuration mode of a comtree. More...
 
bool addNode (int, fAdr_t)
 Add a new node to a comtree. More...
 
bool removeNode (int, fAdr_t)
 Remove a node from a comtree. More...
 
bool addCoreNode (int, fAdr_t)
 Set the default RateSpecs for a comtree. More...
 
bool removeCoreNode (int, fAdr_t)
 Remove a core node from a comtree. More...
 
bool setPlink (int, fAdr_t, int)
 Set the parent link of a router in the comtree. More...
 
bool setParent (int, fAdr_t, fAdr_t, int)
 Set the parent of a leaf in the comtree. More...
 
void freeze (int, fAdr_t)
 Freeze the rate of a comtree link. More...
 
void thaw (int, fAdr_t)
 Thaw (unfreeze) the rate of a comtree link. More...
 
bool setAllComtRates ()
 Set rates for links in all comtrees. More...
 
bool setComtRates (int)
 Compute rates for all links in a comtree and allocate capacity of network links. More...
 
void setAutoConfigRates (int)
 Set the backbone link capacities for an auto-configured comtree. More...
 
bool checkComtRates (int)
 Check that there is sufficient capacity available for all links in a comtree. More...
 
int findPath (int, int, RateSpec &, list< LinkMod > &)
 Find a path from a vertex to a comtree. More...
 
bool findRootPath (int, int, RateSpec &, vector< int > &)
 Find a path from a vertex to the root of a comtree. More...
 
void addPath (int, list< LinkMod > &)
 Add a path from a router to a comtree. More...
 
void removePath (int, list< LinkMod > &)
 Remove a path from a router in a comtree. More...
 
bool adjustSubtreeRates (int, int, RateSpec &)
 Adjust the subtree rates along path to root. More...
 
bool computeMods (int, list< LinkMod > &)
 Compute the change required in the RateSpecs for links in an auto-configured comtree and verify that needed capacity is available. More...
 
bool computeMods (int, fAdr_t, RateSpec &, list< LinkMod > &)
 Compute the change required in the RateSpecs for links in an auto-configured comtree and verify that needed capacity is available. More...
 
void provision (int)
 Provision all links in a comtree, reducing available link capacity. More...
 
void provision (int, list< LinkMod > &)
 Add to the capacity of a list of comtree backbone links and provision required link capacity in the network. More...
 
void unprovision (int)
 Unprovision all links in a comtree,increasing available link capacity. More...
 
void unprovision (int, list< LinkMod > &)
 Reduce the capacity of a list of comtree links and release required link capacity in the network. More...
 
bool read (istream &)
 Read comtrees from an input stream. More...
 
comt_t readComtree (istream &, string &)
 Read a comtree description from an input stream. More...
 
bool readRateSpec (istream &, RateSpec &)
 Read a rate specification. More...
 
bool readLink (istream &, int &, RateSpec &, int &, string &)
 Read a link description from an input stream. More...
 
bool readLinkEndpoint (istream &, string &, int &)
 Read a link endpoint. More...
 
string & link2string (int, int, string &) const
 Create a string representation of a comtree link, including RateSpec. More...
 
string & leafLink2string (int, fAdr_t, string &) const
 Create a string representation of a parent link for a leaf. More...
 
string & comt2string (int, string &) const
 Create a string representation of a comtree. More...
 
string & comtStatus2string (int, string &) const
 Create a string representation of a the status of a comtree. More...
 
string & comtStatus22string (int, string &) const
 
string & toString (string &)
 Create a string representation of the ComtInfo object. More...
 
bool check ()
 Perform consistency check on all comtrees. More...
 
bool checkLinkCounts (int)
 
bool checkSubtreeRates (int)
 
bool checkLinkRates (int)
 
void releaseComtree (int)
 Release a previously locked comtree. More...
 
void lockMap ()
 Lock the data structure. More...
 
void unlockMap ()
 

Private Attributes

int maxComtree
 maximum number of comtrees
 
NetInfonet
 NetInfo data structure for network.
 
ComtreeInfocomtree
 array of comtrees
 
IdMap * comtreeMap
 maps comtree numbers to indices in array
 
pthread_mutex_t mapLock
 locks comtreeMap
 

Detailed Description

Maintains information about the comtrees in a Forest network.

Definition at line 33 of file ComtInfo.h.

Constructor & Destructor Documentation

forest::ComtInfo::ComtInfo ( int  maxComtree1,
NetInfo net1 
)

Constructor for ComtInfo, allocates space and initializes private data.

Parameters
maxNode1is the maximum number of nodes in this ComtInfo object
maxLink1is the maximum number of links in this ComtInfo object
maxRtr1is the maximum number of routers in this ComtInfo object
maxCtl1is the maximum number of controllers in this ComtInfo object
maxComtree1is the maximum number of comtrees in this ComtInfo object

Definition at line 20 of file ComtInfo.cpp.

forest::ComtInfo::~ComtInfo ( )

Destructor for ComtInfo class.

Deallocates all dynamic storage

Definition at line 29 of file ComtInfo.cpp.

Member Function Documentation

int forest::ComtInfo::addComtree ( int  comt)

Add a new comtree.

Defines a new comtree, with attributes left undefined.

Parameters
comtis the comtree number for the new comtree.
Returns
the index of the new comtree on success, else 0; on return, the new comtree is locked

Definition at line 146 of file ComtInfo.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool forest::ComtInfo::addCoreNode ( int  ctx,
fAdr_t  rtrAdr 
)
inline

Set the default RateSpecs for a comtree.

Parameters
ctxis a valid comtree index
bbRatesis a reference to a RateSpec for the new backbone rates
leafRatesis a reference to a RateSpec for the new leaf rates inline void ComtInfo::setDefRates(int ctx, RateSpec& bbRates, RateSpec& leafRates) { comtree[ctx].bbDefRates = bbRates; comtree[ctx].leafDefRates = leafRates; }Add a new core node to a comtree. The new node is required to be a router and if it is not already in the comtree, it is added.
ctxis the comtree index
ris the forest address of the router
Returns
true on success, false on failure

Definition at line 519 of file ComtInfo.h.

Here is the call graph for this function:

Here is the caller graph for this function:

bool forest::ComtInfo::addNode ( int  ctx,
fAdr_t  fa 
)

Add a new node to a comtree.

Parameters
ctxis the comtree index
fais a valid forest address
Returns
true on success, false on failure

Definition at line 188 of file ComtInfo.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void forest::ComtInfo::addPath ( int  ctx,
list< LinkMod > &  path 
)

Add a path from a router to a comtree.

This method adds a list of links to the backbone of an existing comtree, sets their link rates and reserves capacity on the network links; the links are assumed to have sufficient available capacity. Assumes that current thread holds a lock on comtree and NetInfo object.

Parameters
ctxis a valid comtree index for the comtree of interest
pathis a reference to a list of LinkMod objects defining a path in the comtree; the links appear in "bottom-up" order leading from some router outside the comtree to a router in the comtree

Definition at line 1200 of file ComtInfo.cpp.

Here is the call graph for this function:

bool forest::ComtInfo::adjustSubtreeRates ( int  ,
int  ,
RateSpec  
)

Adjust the subtree rates along path to root.

Assumes that current thread holds a lock on comtree and NetInfo object.

Parameters
ctxis a valid comtree index
rtris the forest address of a router in the comtree
rsis a RateSpec that is to be added to the subtree rates at all vertices from rtr to the root
returntrue on success, false on failure

Definition at line 259 of file ComtInfo.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool forest::ComtInfo::check ( )

Perform consistency check on all comtrees.

Returns
true if all comtrees pass all checks, else false

Definition at line 617 of file ComtInfo.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool forest::ComtInfo::checkComtRates ( int  ctx)

Check that there is sufficient capacity available for all links in a comtree.

Requires that rates have been set for all comtree links. Assumes that current thread holds a lock on comtree and NetInfo object.

Parameters
ctxis a valid comtree index
Returns
true if the provisioned rates for the comtree are compatible with the available capacity

Definition at line 944 of file ComtInfo.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool forest::ComtInfo::computeMods ( int  ctx,
list< LinkMod > &  modList 
)

Compute the change required in the RateSpecs for links in an auto-configured comtree and verify that needed capacity is available.

Assumes that current thread holds a lock on comtree and NetInfo object.

Parameters
ctxis the comtree index of the comtree
modListis a list of edges in the comtree and RateSpecs representing the change in rates required at each link in the list; returned RateSpecs may have negative values; list should be empty in top level recursive call
Returns
true if all links in comtree have sufficient available capacity to accommodate the changes

Definition at line 1250 of file ComtInfo.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool forest::ComtInfo::computeMods ( int  ctx,
fAdr_t  radr,
RateSpec rootRates,
list< LinkMod > &  modList 
)

Compute the change required in the RateSpecs for links in an auto-configured comtree and verify that needed capacity is available.

This is a recursive helper method called from the top-level computeMods method. Assumes that current thread holds a lock on comtree, and a lock on the network object.

Parameters
ctxis the comtree index of the comtree
radris the Forest address of the root of the current subtree; should be the comtree root in the top level recursive call
modListis a list of edges in the comtree and RateSpecs representing the change in rates required at each link in the list; returned RateSpecs may have negative values; list should be empty in top level recursive call
Returns
true if all links in comtree have sufficient available capacity to accommodate the changes

Definition at line 1275 of file ComtInfo.cpp.

Here is the call graph for this function:

string & forest::ComtInfo::comt2string ( int  ctx,
string &  s 
) const

Create a string representation of a comtree.

Does not do any locking, so may produce inconsistent results in multi-threaded environment.

Parameters
ctxis the comtree index for a comtree
sis a reference to a string in which result is returned
Returns
a reference to s

Definition at line 1442 of file ComtInfo.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

string & forest::ComtInfo::comtStatus2string ( int  ctx,
string &  s 
) const

Create a string representation of a the status of a comtree.

Shows only the backbone links, but includes link counts for all routers. Does not do any locking, so may produce inconsistent results in multi-threaded environment.

Parameters
ctxis the comtree index for a comtree
sis a reference to a string in which result is returned
Returns
a reference to s

Definition at line 1508 of file ComtInfo.cpp.

Here is the call graph for this function:

int forest::ComtInfo::findPath ( int  ctx,
int  src,
RateSpec rs,
list< LinkMod > &  path 
)

Find a path from a vertex to a comtree.

This method builds a shortest path tree with a given source node. The search is done over all network links that have the available capacity to handle a provided RateSpec. The search halts when it reaches any node in the comtree. The path from source to this node is returned in path. Assumes that current thread holds a lock on comtree and NetInfo object.

Parameters
ctxis a valid comtree index for the comtree of interest
srcis the router at which the path search starts
rsspecifies the rates required on the links in the path
pathis a reference to a list of LinkMod objects which define the path when the method returns; the links are ordered "bottom-up:. @return the router number of the "branchRouter" at which the path ends, or 0 if no path is found

Definition at line 1047 of file ComtInfo.cpp.

Here is the call graph for this function:

bool forest::ComtInfo::findRootPath ( int  ctx,
int  src,
RateSpec rs,
vector< int > &  path 
)

Find a path from a vertex to the root of a comtree.

This method builds a shortest path tree with a given source node. The search is done over all network links that have the available capacity to handle a specified RateSpec. The search halts when it reaches any node in the comtree, then follows the path to the root. This method is not ideal, since it can return paths that do not provide for future growth. It is also not necessarily the best path from a cost standpoint. Assumes that current thread holds a lock on comtree and NetInfo object.

Parameters
ctxis a valid comtree index for the comtree of interest
srcis the router at which the path search starts
rsspecifies the rates required on the links in the path
pathis an integer vector in which the result returned; Values are router local link numbers that define the path in a bottom-up fashion.
Returns
true on success, false on failure

Definition at line 1114 of file ComtInfo.cpp.

Here is the call graph for this function:

int forest::ComtInfo::firstComtree ( )

Get the first comtree in the list of valid comtrees and lock it.

Returns
the ctx of the first valid comtree, or 0 if there is no valid comtree; on return, the comtree is locked

Definition at line 90 of file ComtInfo.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

int forest::ComtInfo::firstCore ( int  ctx) const
inline

Get the forest address of the first core node in a comtree.

Parameters
ctxis a valid comtree index
Returns
the forest address of the first core node in the comtree, or 0 if the comtree index is invalid or no core nodes have been defined

Definition at line 262 of file ComtInfo.h.

Here is the caller graph for this function:

int forest::ComtInfo::firstLeaf ( int  ctx) const
inline

Get the forest address of the first leaf in a comtree.

Parameters
ctxis a valid comtree index
Returns
the forest address of the first leaf in the comtree, or 0 if there is no leaf in the comtree

Definition at line 306 of file ComtInfo.h.

int forest::ComtInfo::firstRouter ( int  ctx) const
inline

Get the forest address of the first router in a comtree.

Parameters
ctxis a valid comtree index
Returns
the forest address of the first router in the comtree, or 0 if there is no router in the comtree

Definition at line 284 of file ComtInfo.h.

void forest::ComtInfo::freeze ( int  ctx,
fAdr_t  rtr 
)
inline

Freeze the rate of a comtree link.

Parameters
ctxis a valid comtree index
rtris a forest address for a router in the comtree; this method freezes the rate of the parent link at rtr

Definition at line 595 of file ComtInfo.h.

fAdr_t forest::ComtInfo::getChild ( int  ctx,
int  lnk 
) const
inline

Get the child endpoint of a link in a comtree.

Parameters
ctxis a valid comtree index
lnkis a link number for a link in the comtree
Returns
the forest address of the child node, or 0 on failure

Definition at line 390 of file ComtInfo.h.

Here is the call graph for this function:

Here is the caller graph for this function:

int forest::ComtInfo::getComtIndex ( int  comt)

Get the comtree index for a given comtree and lock the comtree.

Parameters
isa comtree number (not an index)
Returns
the comtree index associated with the given comtree number, or 0 if the comtree number is not valid; on return the comtree is locked

Definition at line 58 of file ComtInfo.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

int forest::ComtInfo::getComtree ( int  ctx) const
inline

Get the comtree number for the comtree with a given index.

Parameters
ctxis a valid comtree index
returnthe comtree number that is mapped to index c or 0 if c is not a valid index

Definition at line 328 of file ComtInfo.h.

Here is the caller graph for this function:

bool forest::ComtInfo::getConfigMode ( int  ctx) const
inline

get the backbone configuration mode of a comtree.

Parameters
ctxis the index of the comtree
Returns
the backbone configuration mode

Definition at line 486 of file ComtInfo.h.

Here is the caller graph for this function:

RateSpec & forest::ComtInfo::getDefBbRates ( int  ctx)
inline

Get the default RateSpecs for backbone links in a comtree.

Parameters
ctxis a valid comtree index
Returns
a reference to the default rate spec for backbone links

Definition at line 426 of file ComtInfo.h.

Here is the caller graph for this function:

RateSpec & forest::ComtInfo::getDefLeafRates ( int  ctx)
inline

Get the default RateSpecs for access links in a comtree.

Parameters
ctxis a valid comtree index
Returns
a reference to the default rate spec for access links

Definition at line 418 of file ComtInfo.h.

Here is the caller graph for this function:

int forest::ComtInfo::getLinkCnt ( int  ctx,
fAdr_t  rtr 
) const
inline

Get the number of links in a comtree that are incident to a router.

Parameters
ctxis a valid comtree index
rtris the number of a router in the comtree
Returns
the number of links in the comtree incident to rtr or -1 if n is not a node in the comtree

Definition at line 408 of file ComtInfo.h.

RateSpec & forest::ComtInfo::getLinkRates ( int  ,
int   
) const
inline

Get the RateSpec for a comtree link.

The rates represent the amount of network capacity required for this link, given the subtree rates and the backbone configuration mode.

Parameters
ctxis a valid comtree index
fais a forest address for a node in the comtree
Returns
a reference to a rateSpec in for the link from fa to its parent
true on success, false on failure

Definition at line 451 of file ComtInfo.h.

Here is the caller graph for this function:

fAdr_t forest::ComtInfo::getOwner ( int  ctx) const
inline

Get the owner of a comtree with specified index.

Parameters
ctxis a valid comtree index
returnthe forest address of the client that originally created the comtree, or 0 if c is not a valid index

Definition at line 346 of file ComtInfo.h.

Here is the caller graph for this function:

fAdr_t forest::ComtInfo::getParent ( int  ctx,
fAdr_t  fa 
) const
inline

Get the parent of a comtree node.

Parameters
ctxis a valid comtree index
fais the number of a node in the comtree
Returns
the forest address of fa's parent, or 0 if fa has no parent

Definition at line 372 of file ComtInfo.h.

Here is the call graph for this function:

Here is the caller graph for this function:

int forest::ComtInfo::getPlink ( int  ctx,
fAdr_t  nfa 
) const
inline

Get the link to a parent of a node in a comtree.

Parameters
ctxis a valid comtree index
nfais a forest address of a node in the comtree
Returns
the global link number of the link to nfa's parent, if nfa is a router; return the local link number at nfa's parent if nfa is a leaf; return 0 if nfa has no parent

Definition at line 357 of file ComtInfo.h.

Here is the caller graph for this function:

fAdr_t forest::ComtInfo::getRoot ( int  ctx) const
inline

Get the comtree root for the comtree with a given index.

Parameters
ctxis a valid comtree index
returnthe specified root node for the comtree or 0 if c is not a valid index

Definition at line 337 of file ComtInfo.h.

Here is the caller graph for this function:

bool forest::ComtInfo::init ( )

Initialize locks and condition variables.

Definition at line 42 of file ComtInfo.cpp.

bool forest::ComtInfo::isComtLeaf ( int  ,
int   
) const
inline

Determine if a node is a leaf in a comtree.

Parameters
ctxis the comtree index of the comtree of interest
lnis the forest address of a network node
Returns
true if ln is a leaf in the comtree, else false

Definition at line 239 of file ComtInfo.h.

Here is the caller graph for this function:

bool forest::ComtInfo::isComtLink ( int  ctx,
int  lnk 
) const
inline

Determine if a link is in a specified comtree.

Parameters
ctxis a valid comtree index
lnkis a link number
Returns
true if lnk is a link in the comtree with index i, else false

Definition at line 249 of file ComtInfo.h.

Here is the call graph for this function:

Here is the caller graph for this function:

bool forest::ComtInfo::isComtNode ( int  ,
int   
) const
inline

Determine if a node belongs to a comtree or not.

Parameters
ctxis the comtree index of the comtree of interest
fais the forest address of a node that is to be checked for membership in the comtree
Returns
true if n is a node in the comtree, else false

Definition at line 220 of file ComtInfo.h.

Here is the call graph for this function:

Here is the caller graph for this function:

bool forest::ComtInfo::isComtRtr ( int  ,
int   
) const
inline

Determine if a node is a router in a comtree or not.

Parameters
ctxis the comtree index of the comtree of interest
fais the forest address of the node that we want to check in the comtree
Returns
true if fa is a node in the comtree, else false

Definition at line 230 of file ComtInfo.h.

Here is the caller graph for this function:

bool forest::ComtInfo::isCoreNode ( int  ctx,
fAdr_t  r 
) const
inline

Determine if a router is a core node in a specified comtree.

Parameters
ctxis a valid comtree index
ris the forest address of a router
Returns
true if r is a core node in the comtree with index i, else false

Definition at line 210 of file ComtInfo.h.

Here is the caller graph for this function:

bool forest::ComtInfo::isFrozen ( int  ctx,
fAdr_t  rtr 
) const
inline

Determine if the rates for a comtree backbone link are frozen.

Parameters
ctxis a valid comtree index
rtris a forest address for a node in the comtree
Returns
true on if rtr has a parent and the link to its parent is frozen, else false

Definition at line 436 of file ComtInfo.h.

Here is the caller graph for this function:

string & forest::ComtInfo::leafLink2string ( int  ctx,
fAdr_t  leafAdr,
string &  s 
) const

Create a string representation of a parent link for a leaf.

Does not do any locking, so may produce inconsistent results in multi-threaded environment.

Parameters
ctxis the comtree index for a comtree
leafAdris a forest address of a leaf node
sis a reference to a string in which result is returned
Returns
a reference to s

Definition at line 1420 of file ComtInfo.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

string & forest::ComtInfo::link2string ( int  ctx,
int  lnk,
string &  s 
) const

Create a string representation of a comtree link, including RateSpec.

Does not do any locking, so may produce inconsistent results in multi-threaded environment.

Parameters
ctxis the comtree index for a comtree
lnkis a link number for a link in the comtree
sis a reference to a string in which result is returned
Returns
a reference to s

Definition at line 1386 of file ComtInfo.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void forest::ComtInfo::lockMap ( )
inline

Lock the data structure.

More precisely, locks the map from comtrees to comtree index values. The map must be locked when looking up the comtree index and when adding/removing comtrees. This locking is done as needed by other methods. Applications should generally avoid using these methods directly, as uninformed use can cause deadlock.

Definition at line 619 of file ComtInfo.h.

Here is the caller graph for this function:

int forest::ComtInfo::nextComtree ( int  ctx)

Get the next comtree in the list of valid comtrees and lock it.

Parameters
ctxis the index of a valid comtree
Returns
the index of the next comtree in the list of valid comtrees or 0 if there is no next comtree; on return, the lock on ctx is released and the next comtree is locked.

Definition at line 113 of file ComtInfo.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

int forest::ComtInfo::nextCore ( int  ctx,
fAdr_t  rtr 
) const
inline

Get the forest address of the next core node in a comtree.

Parameters
ctxis the comtree index
rtris the forest address of a core node in the comtree
Returns
the forest address of the next core node in the comtree, or 0 if there is no next core node

Definition at line 273 of file ComtInfo.h.

Here is the caller graph for this function:

int forest::ComtInfo::nextLeaf ( int  ctx,
fAdr_t  leaf 
) const
inline

Get the forest address of the next leaf in a comtree.

Parameters
ctxis a valid comtree index
leafis the forest address of a leaf in the comtree
Returns
the forest address of the next leaf in the comtree, or 0 if there is no next leaf

Definition at line 317 of file ComtInfo.h.

int forest::ComtInfo::nextRouter ( int  ctx,
fAdr_t  rtr 
) const
inline

Get the forest address of the next router in a comtree.

Parameters
ctxis a valid comtree index
rtris the forest address of a router in the comtree
Returns
the forest address of the next router in the comtree, or 0 if there is no next router

Definition at line 295 of file ComtInfo.h.

void forest::ComtInfo::provision ( int  ctx)

Provision all links in a comtree, reducing available link capacity.

Assumes that the required network capacity is available and that comtree links are configured with required rates. Assumes that current thread holds a lock on comtree and NetInfo object.

Parameters
ctxis a valid comtree index
Returns
true on success, else false

Definition at line 979 of file ComtInfo.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void forest::ComtInfo::provision ( int  ctx,
list< LinkMod > &  modList 
)

Add to the capacity of a list of comtree backbone links and provision required link capacity in the network.

Assumes that network links have the required capacity and that both endpoints of each link are routers. Assumes that current thread holds a lock on comtree and NetInfo object.

Parameters
ctxis the index of a comptree
modListis a list of link modifications; that is, comtree links that are either to be added or have their rate adjusted. and a RateSpec difference to be added to that link.

Definition at line 1326 of file ComtInfo.cpp.

Here is the call graph for this function:

bool forest::ComtInfo::read ( istream &  in)

Read comtrees from an input stream.

Comtree file contains one of more comtree definitions, where a comtree definition is as shown below

comtNum, owner,root,configMode, backbone rates, leaf rates

comtree(1001, netMgr, r1, manual, (1000,2000,1000,2000),(10,50,25,200), (r1,r2,r3), # core nodes (r1.1,r2.2,(1000,2000,1000,2000)), (r1.2,r3.3,(1000,2000,1000,2000)) ) ; # required after last comtree

The list of core nodes and the list of links may both be omitted. To omit the list of core nodes, while providing the list of links, use a pair of commas after the leaf default rates. In the list of links, the first named node is assumed to be the child of the other node in the comtree. The RateSpec may be omitted, but if provided, the first number is the upstream bit rate, followed by downstream bit rate, upstream packet rate and downstream packet rate.

This method assumes that no other thread currently has access to the ComtInfo object. It should only be used on startup, before other threads are launched.

Definition at line 303 of file ComtInfo.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

comt_t forest::ComtInfo::readComtree ( istream &  in,
string &  errMsg 
)

Read a comtree description from an input stream.

Expects the next nonblank input character to be the opening parenthesis of the comtree description. If a new comtree is read without error, proceeds to allocate and initialize the new comtree. This thread is assumed to be the only one with access to the ComtInfo object at the moment. The method should only be used on startup, before other threads are launched.

Parameters
inis an open input stream
errMsgis a reference to a string used for returning an error message
Returns
the comtree index for the new comtree, or 0 on error

Definition at line 344 of file ComtInfo.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool forest::ComtInfo::readLink ( istream &  in,
int &  lnk,
RateSpec rs,
int &  child,
string &  errMsg 
)

Read a link description from an input stream.

Expects the next nonblank input character to be the opening parenthesis.

Parameters
inis an open input stream
lnkis used to return the link number for the link
rsis used to return the RateSpec for this link
childis used to return the "child" endpoint of the link
errMsgis a reference to a string used for returning an error message
Returns
true on success, false on failure

Definition at line 546 of file ComtInfo.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool forest::ComtInfo::readLinkEndpoint ( istream &  in,
string &  name,
int &  num 
)

Read a link endpoint.

Parameters
inis an open input stream
nameis a reference to a string used to return the endpoint name
numis a reference to an int used to return the local link number
Returns
true on success, false on failure

Definition at line 605 of file ComtInfo.cpp.

Here is the caller graph for this function:

bool forest::ComtInfo::readRateSpec ( istream &  in,
RateSpec rs 
)

Read a rate specification.

Parameters
inis an open input stream
rsis a reference to a RateSpec in which result is returned
Returns
true on success, false on failure

Definition at line 521 of file ComtInfo.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void forest::ComtInfo::releaseComtree ( int  ctx)

Release a previously locked comtree.

Waiting threads are signalled to let them proceed.

Parameters
ctxis the index of a locked comtree.

Definition at line 79 of file ComtInfo.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool forest::ComtInfo::removeComtree ( int  ctx)

Remove a comtree.

Assumes that all bandwidth resources in underlying network have already been released and that the calling thread already holds a lock on the comtree.

Parameters
ctxis the comtree index for a valid comtree to be removed
Returns
true on success, false on failure

Definition at line 168 of file ComtInfo.cpp.

Here is the call graph for this function:

bool forest::ComtInfo::removeCoreNode ( int  ctx,
fAdr_t  rtrAdr 
)
inline

Remove a core node from a comtree.

Really just removes it from mapping.

Parameters
ctxis the comtree index
rtrAdris the forest address of the core node
Returns
true on success, false on failure

Definition at line 533 of file ComtInfo.h.

bool forest::ComtInfo::removeNode ( int  ctx,
fAdr_t  fa 
)

Remove a node from a comtree.

This method will fail if the node is a router with links to children Updates link counts at parent router.

Parameters
ctxis the comtree index
fais the forest address of a comtree node
Returns
true on success, false on failure

Definition at line 223 of file ComtInfo.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void forest::ComtInfo::removePath ( int  ctx,
list< LinkMod > &  path 
)

Remove a path from a router in a comtree.

Assumes that current thread holds a lock on comtree and NetInfo object.

Parameters
ctxis a valid comtree index for the comtree of interest
pathis a list of LinkMod objects defining the path in bottom-up order; the path is assumed to have no "branching links" incident to the path

Definition at line 1226 of file ComtInfo.cpp.

Here is the call graph for this function:

bool forest::ComtInfo::setAllComtRates ( )

Set rates for links in all comtrees.

This involves computing the required rate for each comtree link and allocating the required network capacity.

Returns
true if all comtrees configured successfully, else false

Definition at line 877 of file ComtInfo.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void forest::ComtInfo::setAutoConfigRates ( int  ctx)

Set the backbone link capacities for an auto-configured comtree.

Assumes that current thread holds a lock on comtree, if one is needed.

Parameters
ctxis a valid comtree index
uis a node in the comtree (used in recursive calls)
Returns
true on success, else false

Definition at line 910 of file ComtInfo.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool forest::ComtInfo::setComtRates ( int  ctx)

Compute rates for all links in a comtree and allocate capacity of network links.

This is for use when configuring an entire comtree, not when processing joins/leaves. Assumes that the current thread is the only one with access to object right now.

Parameters
ctxis a valid comtree index
Returns
true on success, false on failure

Definition at line 892 of file ComtInfo.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void forest::ComtInfo::setConfigMode ( int  ctx,
bool  autoConfig 
)
inline

Set the backbone configuration mode of a comtree.

Parameters
ctxis the index of the comtree
autois the new configuration mode
Returns
true on success, false on failure

Definition at line 495 of file ComtInfo.h.

Here is the caller graph for this function:

bool forest::ComtInfo::setOwner ( int  ctx,
fAdr_t  owner 
)
inline

Set the owner of a comtree.

Parameters
ctxis the index of the comtree
owneris the forest address of the comtree owner
Returns
true on success, false on failure

Definition at line 465 of file ComtInfo.h.

Here is the call graph for this function:

Here is the caller graph for this function:

bool forest::ComtInfo::setParent ( int  ctx,
fAdr_t  leaf,
fAdr_t  parent,
int  llnk 
)
inline

Set the parent of a leaf in the comtree.

Parameters
ctxis a valid comtree index
leafis the forest address for a leaf in the comtree
parentis the forest address of the parent node in the comtree
llnkis the local link number that the parent uses to reach leaf
Returns
true on success, false on failure

Definition at line 577 of file ComtInfo.h.

bool forest::ComtInfo::setPlink ( int  ctx,
fAdr_t  rtr,
int  plnk 
)
inline

Set the parent link of a router in the comtree.

Update link counts at router and its parent in the process.

Parameters
ctxis a valid comtree index
rtris the forest address for a router in the comtree
plnkis the link number of a link in the comtree
Returns
true on success, false on failure

Definition at line 545 of file ComtInfo.h.

Here is the call graph for this function:

Here is the caller graph for this function:

bool forest::ComtInfo::setRoot ( int  ctx,
fAdr_t  r 
)
inline

Set the root node of a comtree.

Parameters
ctxis the index of the comtree
ris the forest address of the router the new comtree root
Returns
true on success, false on failure

Definition at line 476 of file ComtInfo.h.

Here is the call graph for this function:

Here is the caller graph for this function:

void forest::ComtInfo::thaw ( int  ctx,
fAdr_t  rtr 
)
inline

Thaw (unfreeze) the rate of a comtree link.

Parameters
ctxis a valid comtree index
rtris a forest address for a router in the comtree; this method unfreezes the rate of the parent link at rtr

Definition at line 606 of file ComtInfo.h.

Here is the caller graph for this function:

string & forest::ComtInfo::toString ( string &  s)

Create a string representation of the ComtInfo object.

Does not do any locking, so may produce inconsistent results in multi-threaded environment.

Parameters
sis a reference to a string in which the result is returned
Returns
a reference to s

Definition at line 1368 of file ComtInfo.cpp.

Here is the call graph for this function:

void forest::ComtInfo::unprovision ( int  ctx)

Unprovision all links in a comtree,increasing available link capacity.

Assumes that current thread holds a lock on comtree and NetInfo object.

Parameters
ctxis a valid comtree index
Returns
true on success, else false

Definition at line 1008 of file ComtInfo.cpp.

Here is the call graph for this function:

void forest::ComtInfo::unprovision ( int  ctx,
list< LinkMod > &  modList 
)

Reduce the capacity of a list of comtree links and release required link capacity in the network.

Assumes that current thread holds a lock on comtree and NetInfo object.

Parameters
ctxis the index of a comptree
modListis a list of nodes, each representing a link in the comtree and a RateSpec difference to be removed from that link.

Definition at line 1347 of file ComtInfo.cpp.

Here is the call graph for this function:

bool forest::ComtInfo::validComtIndex ( int  ctx) const
inline

Check to see if a given comtree index is valid.

ComtInfo uses integer indices in a restricted range to access comtree information efficiently. Users get the comtree index for a given comtree number using the lookupComtree() method.

Parameters
ctxis an integer comtree index
Returns
true if n corresponds to a comtree in the network, else false

Definition at line 200 of file ComtInfo.h.

Here is the caller graph for this function:

bool forest::ComtInfo::validComtree ( int  comt) const
inline

Check to see if a given comtree number is valid.

Parameters
comtis an integer comtree number
Returns
true if comt corresponds to a comtree in the network, else false

Definition at line 188 of file ComtInfo.h.


The documentation for this class was generated from the following files: