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

Class that implements a table of information on comtrees. More...

#include <ComtreeTable.h>

Collaboration diagram for forest::ComtreeTable:

Classes

struct  ClnkInfo
 comtree link information comtree table entry More...
 
struct  ComtLinkInfo
 
struct  Entry
 
struct  TblEntry
 

Public Member Functions

 ComtreeTable (int, int)
 Constructor for ComtreeTable, allocates space and initializes table. More...
 
 ~ComtreeTable ()
 Destructor for ComtreeTable, frees dynamic storage.
 
bool validComtree (comt_t) const
 Determine if the table has an entry for a given comtree. More...
 
bool validCtx (int) const
 Determine if a comtree index is being used in this table. More...
 
bool validClnk (int, int) const
 Determine if a comtree link number is being used by a given comtree. More...
 
bool checkEntry (int) const
 Perform consistency check on table entry. More...
 
bool inCore (int) const
 Determine if "this node" is in the core of the comtree. More...
 
bool isLink (int, int) const
 Determine if a given link is part of a given comtree. More...
 
bool isRtrLink (int, int) const
 Determine if a given comtree link connects to another router. More...
 
bool isCoreLink (int, int) const
 Determine if a given comtree link connects to a core node. More...
 
int firstComt () const
 Get the first comtree index. More...
 
int nextComt (int) const
 Get the next comtree index. More...
 
int firstComtLink (int) const
 Get a list of comtrees that use a specified link. More...
 
int nextComtLink (int, int) const
 Get the next comtree link number for a given comtree. More...
 
int firstRtrLink (int) const
 Get the first comtree link number going to a router. More...
 
int nextRtrLink (int, int) const
 Get the next comtree link number going to a router. More...
 
int firstCoreLink (int) const
 Get the first comtree link number going to a core router. More...
 
int nextCoreLink (int, int) const
 Get the next comtree link number going to a router. More...
 
int getComtIndex (comt_t) const
 Get the comtree index, based on the comtree number. More...
 
EntrygetEntry (int) const
 Get the comtree table entry for a given comtree, using its index. More...
 
comt_t getComtree (int) const
 Get the comtree number for a given table entry. More...
 
int getLink (int, int) const
 Get the link number for a given comtree link. More...
 
int getPlink (int) const
 Get the parent link for a comtree. More...
 
int getPClink (int) const
 Get the comtree link number for the parent link in a comtree. More...
 
int getLinkCount (int) const
 Get the number of links that belong to this comtree. More...
 
int getClnkNum (int, int) const
 Get the comtree link number for a given (comtree, link) pair. More...
 
ClnkInfogetClnkInfo (int, int) const
 Get the comtree link info for a specfic comtree link. More...
 
int getLinkQ (int, int) const
 Get the queue identifier for a given comtree link. More...
 
fAdr_t getDest (int, int) const
 Get the allowed destination for packets received on a given comtree link. More...
 
RateSpecgetRates (int, int) const
 Get the rate spec for a given comtree link. More...
 
const Dlist & getComtList (int) const
 
int addEntry (comt_t)
 Add a new entry to the table. More...
 
bool removeEntry (int)
 Remove a table entry. More...
 
bool addLink (int, int, bool, bool)
 Add a link to the set of links for a comtree. More...
 
bool removeLink (int, int)
 Remove a comtree link from the set of valid links for a comtree. More...
 
void setCoreFlag (int, bool)
 Set the core flag for a given table entry. More...
 
void setPlink (int, int)
 Set the parent link for a given table entry. More...
 
void setLinkQ (int, int, int)
 Set the queue number for a comtree link. More...
 
void purgeLink (int)
 Remove a link from all comtrees that currently use it. More...
 
bool read (istream &)
 Read comtree table entries from an input stream. More...
 
string toString () const
 Create a string representation of the table. More...
 
string entry2string (int) const
 Create a string representing a table entry. More...
 
 ComtreeTable (int, int, LinkTable *)
 Constructor for ComtreeTable, allocates space and initializes table. More...
 
bool validComtree (comt_t) const
 
bool validComtIndex (int) const
 Determine if a comtree index is being used in this table. More...
 
bool validComtLink (int) const
 Determine if a comtree link number is in use in this table. More...
 
bool checkEntry (int) const
 
bool inCore (int) const
 
bool isLink (int, int) const
 
bool isRtrLink (int, int) const
 
bool isRtrLink (int) const
 Determine if a given comtree link connects to another router. More...
 
bool isCoreLink (int, int) const
 
bool isCoreLink (int) const
 Determine if a given comtree link connects to a core node. More...
 
bool isLocked (int) const
 Determine if a given comtree is locked. More...
 
int firstComtIndex () const
 Get the first comtree index. More...
 
int nextComtIndex (int) const
 Get the next comtree index. More...
 
int getComtIndex (comt_t) const
 
comt_t getComtree (int) const
 
int getLink (int) const
 Get the link number for a given comtree link. More...
 
int getPlink (int) const
 
int getLinkCount (int) const
 
int getComtLink (int, int) const
 Get the comtree link number for a given (comtree, link) pair. More...
 
int getPCLink (int) const
 Get the comtree link number for the parent link in a comtree. More...
 
int getLinkQ (int) const
 Get the queue identifier for a given comtree link. More...
 
fAdr_t getDest (int) const
 Get the allowed destination for packets received on a given comtree link. More...
 
pktx getPrunePkt (int) const
 
RateSpecgetUpperBoundRates (int) const
 Get the rate spec for a given comtree link. More...
 
RateSpecgetRates (int) const
 Get the rate spec for a given comtree link. More...
 
set< int > & getLinks (int) const
 Get a reference to the set of comtree links for a comtree. More...
 
set< int > & getRtrLinks (int) const
 Get a reference to the set of comtree links leading to another router. More...
 
set< int > & getCoreLinks (int) const
 Get a reference to the set of comtree links leading to a core router. More...
 
set< int > & getRteSet (int) const
 Get a reference to the set of routes registered with a comtree link. More...
 
vector< pktx > & getPktNums (int) const
 Get a reference to the set of comtree links leading to a core router. More...
 
int addEntry (comt_t)
 
bool removeEntry (int)
 
bool addLink (int, int, bool, bool)
 
bool removeLink (int, int)
 
void setCoreFlag (int, bool)
 
void setPlink (int, int)
 
void setLock (int, int)
 Set the lock bit for a comtree. More...
 
void setPrunePkt (int, pktx)
 Set the prune request packet number for a comtree. More...
 
void addRequest (int, pktx)
 Register a route with a given comtree link. More...
 
void removeRequest (int, pktx)
 Deegister a route with a given comtree link. More...
 
void setUpperBoundRates (int, RateSpec &)
 
void setLinkQ (int, int)
 Set the queue number for a comtree link. More...
 
void registerRte (int, int)
 Set the incoming bit rate for a comtree link. More...
 
void deregisterRte (int, int)
 Deegister a route with a given comtree link. More...
 
void cleanPktNums (int)
 
bool read (istream &)
 
string & toString (string &) const
 Create a string representation of the table. More...
 
string & entry2string (int, string &) const
 Write a table entry to an output stream. More...
 

Private Member Functions

bool readEntry (istream &)
 helper functions More...
 
void readLinks (istream &, set< int > &)
 Read a list of links from an input stream. More...
 
string links2string (int) const
 
uint64_t key (comt_t) const
 helper functions More...
 
uint64_t key (comt_t, int) const
 Compute key for use with clMap. More...
 
bool readEntry (istream &)
 
void readLinks (istream &, set< int > &)
 
string & links2string (int, string &) const
 

Private Attributes

int maxLnk
 maximum link number
 
int maxCtx
 maximum comtree index More...
 
HashMap< comt_t, Entry,
Hash::u32 > * 
comtMap
 maps comtree number to table entry
 
Dlist * comtList
 comtList[lnk] lists all comtrees More...
 
int maxComtLink
 largest comtLink
 
TblEntrytbl
 
IdMap * comtMap
 maps comtree numbers to indices
 
ComtLinkInfoclTbl
 cLnkTbl[cl] has info on comtLink cl
 
IdMap * clMap
 maps (comtree,link)->comtLink
 
LinkTablelt
 

Detailed Description

Class that implements a table of information on comtrees.

Table entries are accessed using a "comtree index", which can be obtained using the getCtx() method.

Information about the use of a link in a comtree can be accessed using a comtree link number. For example, using the comtree link number, you can get the queue identifier that is used for packets in a given comtree that are sent on on the link. Comtree link numbers can be obtained using the getClnkInfo() method.

Table entries are accessed using a "comtree index", which can be obtained using the getComtIndex() method.

Information about the use of a link in a comtree can be accessed using a comtree link number. For example, using the comtree link number, you can get the queue identifier that is used for packets in a given comtree that are sent on on the link. Comtree link numbers can be obtained using the getComtLink() method.

Definition at line 36 of file ComtreeTable.h.

Constructor & Destructor Documentation

forest::ComtreeTable::ComtreeTable ( int  maxLnk1,
int  maxCtx1 
)

Constructor for ComtreeTable, allocates space and initializes table.

Parameters
maxCtxis the maximum number of entries
lt1is a pointer to the router's link table

Definition at line 17 of file ComtreeTable.cpp.

forest::ComtreeTable::ComtreeTable ( int  maxCtx1,
int  maxComtLink1,
LinkTable lt1 
)

Constructor for ComtreeTable, allocates space and initializes table.

Definition at line 15 of file ComtreeTable.cpp.

Member Function Documentation

int forest::ComtreeTable::addEntry ( comt_t  comt)

Add a new entry to the table.

Attempts to add a new table entry. Can fail if the specified comtree number is already in use, or if the table has run out of space.

Parameters
comtis the number of the comtree for which an entry is to be added
Returns
the index of the new table entry or 0 on failure

Definition at line 80 of file ComtreeTable.cpp.

bool forest::ComtreeTable::addLink ( int  ctx,
int  lnk,
bool  rflg,
bool  cflg 
)

Add a link to the set of links for a comtree.

Add the link to the set of links for a comtree.

Parameters
ctxis comtree index of the comtree to be modified
linkis the number of the link to add
rflgis true if far end of link is another router
cflgis true if far end of link is a core router for this comtree
Returns
true on success, else false
Parameters
ctxis comtree index of the comtree to be modified
linkis the number of the link to add
rflgis true if far end of link is another router
cflgis true if far end of link is a core router for this comtree

Definition at line 37 of file ComtreeTable.cpp.

Here is the call graph for this function:

void forest::ComtreeTable::addRequest ( int  ctx,
pktx  px 
)
inline

Register a route with a given comtree link.

Parameters
cLnkis a valid comtree link number
rtxis an integer that is presumed to be a route index

Definition at line 514 of file ComtreeTableFeng.h.

Here is the call graph for this function:

bool forest::ComtreeTable::checkEntry ( int  ctx) const

Perform consistency check on table entry.

Parameters
ctxis the number of the entry to be checked
Returns
true if the entry is consistent, else false

Definition at line 144 of file ComtreeTable.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void forest::ComtreeTable::deregisterRte ( int  cLnk,
int  rtx 
)
inline

Deegister a route with a given comtree link.

Parameters
cLnkis a valid comtree link number
rtxis an integer that is presumed to be a route index

Definition at line 506 of file ComtreeTableFeng.h.

Here is the call graph for this function:

string & forest::ComtreeTable::entry2string ( int  ctx,
string &  s 
) const

Write a table entry to an output stream.

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

Definition at line 255 of file ComtreeTable.cpp.

Here is the call graph for this function:

string forest::ComtreeTable::entry2string ( int  ctx) const

Create a string representing a table entry.

Parameters
ctxis the comtree index of the comtree to be written
Returns
the string

Definition at line 249 of file ComtreeTable.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

int forest::ComtreeTable::firstComt ( ) const
inline

Get the first comtree index.

This method is used to iterate through all the comtrees. The order of the comtree indices is arbitrary.

Returns
the first comtree index or 0, if no comtrees have been defined

Definition at line 286 of file ComtreeTable.h.

Here is the caller graph for this function:

int forest::ComtreeTable::firstComtIndex ( ) const
inline

Get the first comtree index.

This method is used to iterate through all the comtrees. The order of the comtree indices is arbitrary.

Returns
the first comtree index or 0, if no comtrees have been defined

Definition at line 242 of file ComtreeTableFeng.h.

Here is the caller graph for this function:

int forest::ComtreeTable::firstComtLink ( int  ctx) const
inline

Get a list of comtrees that use a specified link.

Parameters
lnkis a link number
Returns
a constant reference to a list of the comtrees that use lnk. inline const Dlist& getComtList(int lnk) const { return comtList[lnk]; }Get the first comtree link number for a given comtree.
Parameters
ctxis a comtree index
Returns
the first comtree link number for the specified comtree

Definition at line 425 of file ComtreeTable.h.

int forest::ComtreeTable::firstCoreLink ( int  ctx) const
inline

Get the first comtree link number going to a core router.

Parameters
ctxis a comtree index
Returns
the first comtree link number that goes to a core router.

Definition at line 459 of file ComtreeTable.h.

Here is the caller graph for this function:

int forest::ComtreeTable::firstRtrLink ( int  ctx) const
inline

Get the first comtree link number going to a router.

Parameters
ctxis a comtree index
Returns
the first comtree link number that goes to a router.

Definition at line 442 of file ComtreeTable.h.

Here is the caller graph for this function:

ComtreeTable::ClnkInfo & forest::ComtreeTable::getClnkInfo ( int  ctx,
int  cLnk 
) const
inline

Get the comtree link info for a specfic comtree link.

Parameters
ctxis a comtree index
cLnkis a comtree link number for comtree ctx
Returns
a reference to the ClnkInfo object for cLnk.

Definition at line 353 of file ComtreeTable.h.

int forest::ComtreeTable::getClnkNum ( int  comt,
int  lnk 
) const
inline

Get the comtree link number for a given (comtree, link) pair.

Parameters
comtis a comtree number
lnkis a link number
Returns
the comtree link number for the given pair, or 0 if there is no comtree link for the given pair

Definition at line 340 of file ComtreeTable.h.

Here is the caller graph for this function:

int forest::ComtreeTable::getComtIndex ( comt_t  comt) const
inline

Get the comtree index, based on the comtree number.

Parameters
comtis the comtree number
Returns
the comtree index or 0 if not a valid comtree
Parameters
comtis the comtree number
Returns
the comtree index

Definition at line 321 of file ComtreeTable.h.

Here is the caller graph for this function:

int forest::ComtreeTable::getComtLink ( int  comt,
int  lnk 
) const
inline

Get the comtree link number for a given (comtree, link) pair.

Parameters
comtis a comtree number
lnkis a link number
Returns
the comtree link number for the given pair, or 0 if there is no comtree link for the given pair

Definition at line 287 of file ComtreeTableFeng.h.

Here is the call graph for this function:

Here is the caller graph for this function:

comt_t forest::ComtreeTable::getComtree ( int  ctx) const
inline

Get the comtree number for a given table entry.

Parameters
ctxis the comtree index
Returns
the comtree number

Definition at line 305 of file ComtreeTable.h.

Here is the caller graph for this function:

set< int > & forest::ComtreeTable::getCoreLinks ( int  ctx) const
inline

Get a reference to the set of comtree links leading to a core router.

This method is provided to allow the client program to iterate through all the "core links" in the comtree. It must not be used to modify the set of links.

Parameters
ctxis a comtree index
Returns
a reference to a set of integers, each of which is a comtree link number

Definition at line 381 of file ComtreeTableFeng.h.

Here is the caller graph for this function:

fAdr_t forest::ComtreeTable::getDest ( int  cLnk) const
inline

Get the allowed destination for packets received on a given comtree link.

Parameters
cLnkis a comtree link number
Returns
the forest address of the designated "allowed destination" for this link

Definition at line 337 of file ComtreeTableFeng.h.

fAdr_t forest::ComtreeTable::getDest ( int  ctx,
int  cLnk 
) const
inline

Get the allowed destination for packets received on a given comtree link.

Parameters
ctxis a comtree index
cLnkis a comtree link number
Returns
the forest address of the designated "allowed destination" for this link

Definition at line 400 of file ComtreeTable.h.

Here is the caller graph for this function:

ComtreeTable::Entry & forest::ComtreeTable::getEntry ( int  ctx) const
inline

Get the comtree table entry for a given comtree, using its index.

Parameters
ctsis the comtree index
Returns
a reference to the comtree table entry

Definition at line 313 of file ComtreeTable.h.

Here is the caller graph for this function:

int forest::ComtreeTable::getLink ( int  cLnk) const
inline

Get the link number for a given comtree link.

Parameters
cLnkis a comtree link number
Returns
the number of the associated link

Definition at line 320 of file ComtreeTableFeng.h.

int forest::ComtreeTable::getLink ( int  ctx,
int  cLnk 
) const
inline

Get the link number for a given comtree link.

Parameters
ctxis a comtree index
cLnkis a comtree link number
Returns
the number of the associated link

Definition at line 380 of file ComtreeTable.h.

Here is the caller graph for this function:

int forest::ComtreeTable::getLinkCount ( int  ctx) const
inline

Get the number of links that belong to this comtree.

Parameters
ctxis the comtree index
Returns
the number of links in the comtree

Definition at line 329 of file ComtreeTable.h.

int forest::ComtreeTable::getLinkQ ( int  cLnk) const
inline

Get the queue identifier for a given comtree link.

Parameters
cLnkis a comtree link number
Returns
the queue identifier assigned to cLnk

Definition at line 328 of file ComtreeTableFeng.h.

int forest::ComtreeTable::getLinkQ ( int  ctx,
int  cLnk 
) const
inline

Get the queue identifier for a given comtree link.

Parameters
ctxis a comtree index
cLnkis a comtree link number
Returns
the queue identifier assigned to cLnk

Definition at line 390 of file ComtreeTable.h.

Here is the caller graph for this function:

set< int > & forest::ComtreeTable::getLinks ( int  ctx) const
inline

Get a reference to the set of comtree links for a comtree.

This method is provided to allow the client program to iterate through all the links in the comtree. It must not be used to modify the set of links.

Parameters
ctxis a comtree index
Returns
a reference to a set of integers, each of which is a comtree link number

Definition at line 357 of file ComtreeTableFeng.h.

Here is the caller graph for this function:

int forest::ComtreeTable::getPCLink ( int  ctx) const
inline

Get the comtree link number for the parent link in a comtree.

Parameters
ctxis the comtree index
Returns
the comtree link number for the link leading to the parent (in the comtree) of this router; returns 0 if the router is the root of the comtree

Definition at line 305 of file ComtreeTableFeng.h.

Here is the caller graph for this function:

int forest::ComtreeTable::getPClink ( int  ctx) const
inline

Get the comtree link number for the parent link in a comtree.

Parameters
ctxis the comtree index
Returns
the comtree link number for the link leading to the parent (in the comtree) of this router; returns 0 if the router is the root of the comtree

Definition at line 371 of file ComtreeTable.h.

vector< pktx > & forest::ComtreeTable::getPktNums ( int  ctx) const
inline

Get a reference to the set of comtree links leading to a core router.

This method is provided to allow the client program to iterate through all the "core links" in the comtree. It must not be used to modify the set of links.

Parameters
ctxis a comtree index
Returns
a reference to a set of integers, each of which is a comtree link number

Definition at line 393 of file ComtreeTableFeng.h.

int forest::ComtreeTable::getPlink ( int  ctx) const
inline

Get the parent link for a comtree.

Parameters
ctxis the comtree index
Returns
the link leading to the parent (in the comtree) of this router; returns 0 if the router is the root of the comtree

Definition at line 363 of file ComtreeTable.h.

Here is the caller graph for this function:

RateSpec & forest::ComtreeTable::getRates ( int  cLnk) const
inline

Get the rate spec for a given comtree link.

Parameters
cLnkis a comtree link number
Returns
a reference to the rate spec for cLnk

Definition at line 345 of file ComtreeTableFeng.h.

RateSpec & forest::ComtreeTable::getRates ( int  ctx,
int  cLnk 
) const
inline

Get the rate spec for a given comtree link.

Parameters
ctxis a comtree index
cLnkis a comtree link number
Returns
a reference to the rate spec for cLnk

Definition at line 409 of file ComtreeTable.h.

Here is the caller graph for this function:

set< int > & forest::ComtreeTable::getRteSet ( int  cLnk) const
inline

Get a reference to the set of routes registered with a comtree link.

This method is provided to allow the client program to iterate through all the routes that use a comtree link. It must not be used to modify the set of routes.

Parameters
cLnkis a comtree link number
Returns
a reference to a set of integers, each of which is a route index.

Definition at line 409 of file ComtreeTableFeng.h.

set< int > & forest::ComtreeTable::getRtrLinks ( int  ctx) const
inline

Get a reference to the set of comtree links leading to another router.

This method is provided to allow the client program to iterate through all the "router links" in the comtree. It must not be used to modify the set of links.

Parameters
ctxis a comtree index
Returns
a reference to a set of integers, each of which is a comtree link number

Definition at line 369 of file ComtreeTableFeng.h.

Here is the caller graph for this function:

RateSpec & forest::ComtreeTable::getUpperBoundRates ( int  ctx) const
inline

Get the rate spec for a given comtree link.

Parameters
cLnkis a comtree link number
Returns
a reference to the rate spec for cLnk

Definition at line 312 of file ComtreeTableFeng.h.

bool forest::ComtreeTable::inCore ( int  ctx) const
inline

Determine if "this node" is in the core of the comtree.

Parameters
ctxis a comtree index
Returns
true if the router is in the core, else false

Definition at line 243 of file ComtreeTable.h.

Here is the caller graph for this function:

bool forest::ComtreeTable::isCoreLink ( int  cLnk) const
inline

Determine if a given comtree link connects to a core node.

Parameters
cLnkis the comtree link number
Returns
true if the peer node for the link is in the comtree core

Definition at line 217 of file ComtreeTableFeng.h.

bool forest::ComtreeTable::isCoreLink ( int  ctx,
int  lnk 
) const
inline

Determine if a given comtree link connects to a core node.

Determine if a given link connects to a core node.

Parameters
ctxis the comtree index
cLnkis the comtree link number
Returns
true if the peer node for the link is in the comtree core
Parameters
ctxis the comtree index
lnkis the link number
Returns
true if the peer node for the link is in the comtree core

Definition at line 274 of file ComtreeTable.h.

Here is the caller graph for this function:

bool forest::ComtreeTable::isLink ( int  ctx,
int  lnk 
) const
inline

Determine if a given link is part of a given comtree.

Parameters
entryis the comtree index
lnkis the link number
Returns
true if the specified link is part of the comtree

Definition at line 252 of file ComtreeTable.h.

Here is the caller graph for this function:

bool forest::ComtreeTable::isLocked ( int  ctx) const
inline

Determine if a given comtree is locked.

Parameters
ctxis the comtree number
Returns
true if comtree is locked

Definition at line 227 of file ComtreeTableFeng.h.

Here is the call graph for this function:

bool forest::ComtreeTable::isRtrLink ( int  cLnk) const
inline

Determine if a given comtree link connects to another router.

Parameters
cLnkis the comtree index
Returns
true if the specified link connects to another router

Definition at line 197 of file ComtreeTableFeng.h.

bool forest::ComtreeTable::isRtrLink ( int  ctx,
int  lnk 
) const
inline

Determine if a given comtree link connects to another router.

Determine if a given link connects to another router.

Parameters
ctxis the comtree index of the relevant comtree
cLnkis the comtree link index
Returns
true if the specified link connects to another router
Parameters
ctxis the comtree index
lnkis the link number
Returns
true if the specified link connects to another router

Definition at line 263 of file ComtreeTable.h.

Here is the caller graph for this function:

uint64_t forest::ComtreeTable::key ( comt_t  comt) const
inlineprivate

helper functions

Set the outgoing packet rate for a comtree link.

Parameters
cLnkis a comtree link number
pris a packet rate inline void ComtreeTable::setOutPktRate(int cLnk, int pr) { if (validComtLink(cLnk)) clTbl[cLnk].outPktRate = pr; }Compute key for use with comtMap.
comtis a comtree number
Returns
a 64 bit hash key

Definition at line 547 of file ComtreeTableFeng.h.

Here is the caller graph for this function:

uint64_t forest::ComtreeTable::key ( comt_t  comt,
int  lnk 
) const
inlineprivate

Compute key for use with clMap.

Parameters
comtis a comtree number
lnkis a link number
Returns
a 64 bit hash key

Definition at line 556 of file ComtreeTableFeng.h.

int forest::ComtreeTable::nextComt ( int  ctx) const
inline

Get the next comtree index.

This method is used to iterate through all the comtrees. The order of the comtree indices is arbitrary.

Parameters
ctxis a comtree index
Returns
the next comtree index following ctx, or 0 if there is no next index

Definition at line 297 of file ComtreeTable.h.

Here is the caller graph for this function:

int forest::ComtreeTable::nextComtIndex ( int  ctx) const
inline

Get the next comtree index.

This method is used to iterate through all the comtrees. The order of the comtree indices is arbitrary.

Parameters
ctxis a comtree index
Returns
the next comtree index following ctx, or 0 if there is no next index

Definition at line 253 of file ComtreeTableFeng.h.

Here is the caller graph for this function:

int forest::ComtreeTable::nextComtLink ( int  ctx,
int  cLnk 
) const
inline

Get the next comtree link number for a given comtree.

Parameters
ctxis a comtree index
cLnkis a comtree link that is defined for the comtree
Returns
the next comtree link number following cLnk

Definition at line 434 of file ComtreeTable.h.

int forest::ComtreeTable::nextCoreLink ( int  ctx,
int  cLnk 
) const
inline

Get the next comtree link number going to a router.

Parameters
ctxis a comtree index
cLnkis a comtree link that is defined for the comtree
Returns
the next comtree link number following cLnk

Definition at line 468 of file ComtreeTable.h.

Here is the caller graph for this function:

int forest::ComtreeTable::nextRtrLink ( int  ctx,
int  cLnk 
) const
inline

Get the next comtree link number going to a router.

Parameters
ctxis a comtree index
cLnkis a comtree link that is defined for the comtree
Returns
the next comtree link number following cLnk

Definition at line 451 of file ComtreeTable.h.

Here is the caller graph for this function:

void forest::ComtreeTable::purgeLink ( int  lnk)

Remove a link from all comtrees that currently use it.

Caller is assumed to hold locks on the ComtreeTable.

Parameters
lnkis the number of the link to be purged

Definition at line 115 of file ComtreeTable.cpp.

Here is the call graph for this function:

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

Read comtree table entries from an input stream.

The first line of the input must contain an integer, giving the number of entries to be read. The input may include blank lines and comment lines (any text starting with '#'). The operation may fail if the input is misformatted or if an entry does not pass some basic sanity checks. In this case, an error message is printed that identifies the entry on which a problem was detected

Parameters
inis an open input stream
Returns
true on success, false on failure

Definition at line 230 of file ComtreeTable.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool forest::ComtreeTable::readEntry ( istream &  in)
private

helper functions

Read an entry from an input stream and initialize its table entry.

The entry must be on a line by itself (possibly with a trailing comment). An entry consists of a comtree number, a core flag (0 or 1), the link number of the link leading to the parent, and two comma-separated lists of links.

Parameters
inis an open input stream

Definition at line 182 of file ComtreeTable.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void forest::ComtreeTable::readLinks ( istream &  in,
set< int > &  links 
)
private

Read a list of links from an input stream.

The list consists of integers separated by commas. The first number that is not immediately followed by a comma is assumed to be the last one on the list.

Parameters
inis an open input stream
linksis a reference to a set of integers; on return, it will contain the list of link numbers read from the input

Definition at line 172 of file ComtreeTable.cpp.

Here is the call graph for this function:

void forest::ComtreeTable::registerRte ( int  cLnk,
int  rtx 
)
inline

Set the incoming bit rate for a comtree link.

Parameters
cLnkis a comtree link number
bris a bit rate inline void ComtreeTable::setInBitRate(int cLnk, int br) { if (validComtLink(cLnk)) clTbl[cLnk].inBitRate = br; } Set the incoming packet rate for a comtree link.
cLnkis a comtree link number
pris a packet rate inline void ComtreeTable::setInPktRate(int cLnk, int pr) { if (validComtLink(cLnk)) clTbl[cLnk].inPktRate = pr; } Set the outgoing bit rate for a comtree link.
cLnkis a comtree link number
bris a bit rate inline void ComtreeTable::setOutBitRate(int cLnk, int br) { if (validComtLink(cLnk)) clTbl[cLnk].outBitRate = br; }Register a route with a given comtree link.
cLnkis a valid comtree link number
rtxis an integer that is presumed to be a route index

Definition at line 498 of file ComtreeTableFeng.h.

Here is the call graph for this function:

bool forest::ComtreeTable::removeEntry ( int  ctx)

Remove a table entry.

This method removes all comtree links from the comtree, before removing the comtree itself. This requires that the comtree links have previously had all their routes removed.

Parameters
ctxis the index of the entry to be deleted
Returns
true on success, false on failure

This method requires that all links have been previously removed from the comtree;

Parameters
ctxis the index of the entry to be deleted
Returns
true on success, false on failure

Definition at line 93 of file ComtreeTable.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool forest::ComtreeTable::removeLink ( int  ctx,
int  cLnk 
)

Remove a comtree link from the set of valid links for a comtree.

Parameters
ctxis comtree index of the comtree to be modified
cLnkis the number of the comtree link to removed
returntrue on success, false on failure

This method requires that there are no multicast routes registered with this comtree.

Parameters
ctxis comtree index of the comtree to be modified
cLnkis the number of the comtree link to removed
returntrue on success, false on failure

Definition at line 56 of file ComtreeTable.cpp.

Here is the call graph for this function:

void forest::ComtreeTable::removeRequest ( int  ctx,
pktx  px 
)
inline

Deegister a route with a given comtree link.

Parameters
cLnkis a valid comtree link number
rtxis an integer that is presumed to be a route index

Definition at line 530 of file ComtreeTableFeng.h.

void forest::ComtreeTable::setCoreFlag ( int  ctx,
bool  f 
)
inline

Set the core flag for a given table entry.

Parameters
ctxis the comtree index
fis the new value of the core flag for this entry

Definition at line 490 of file ComtreeTable.h.

void forest::ComtreeTable::setLinkQ ( int  cLnk,
int  q 
)
inline

Set the queue number for a comtree link.

Parameters
cLnkis a comtree link number
qis a queue number

Definition at line 466 of file ComtreeTableFeng.h.

Here is the call graph for this function:

void forest::ComtreeTable::setLinkQ ( int  ctx,
int  cLnk,
int  q 
)
inline

Set the queue number for a comtree link.

Parameters
ctxis a comtree index
cLnkis a comtree link number
qis a queue number

Definition at line 499 of file ComtreeTable.h.

Here is the caller graph for this function:

void forest::ComtreeTable::setLock ( int  ctx,
int  lock 
)
inline

Set the lock bit for a comtree.

Parameters
ctxis the comtree index
lockis the lock bit, 1 means the comtree is locked

Definition at line 439 of file ComtreeTableFeng.h.

Here is the call graph for this function:

void forest::ComtreeTable::setPlink ( int  ctx,
int  plink 
)
inline

Set the parent link for a given table entry.

Parameters
ctxis the comtree index
plinkis the number of the link to this router's parent in the comtree

Definition at line 477 of file ComtreeTable.h.

Here is the caller graph for this function:

void forest::ComtreeTable::setPrunePkt ( int  ctx,
pktx  ppkt 
)
inline

Set the prune request packet number for a comtree.

Parameters
ctxis the comtree index

Definition at line 450 of file ComtreeTableFeng.h.

Here is the call graph for this function:

string & forest::ComtreeTable::toString ( string &  s) const

Create a string representation of the table.

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

Definition at line 285 of file ComtreeTable.cpp.

Here is the call graph for this function:

string forest::ComtreeTable::toString ( ) const

Create a string representation of the table.

Returns
the string

Definition at line 262 of file ComtreeTable.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool forest::ComtreeTable::validClnk ( int  ctx,
int  cLnk 
) const
inline

Determine if a comtree link number is being used by a given comtree.

Parameters
ctxis a comtree index
cLnkis a comtree link number
Returns
true if cLnk is a valid comtree link number for the specified comtree, else false

Definition at line 234 of file ComtreeTable.h.

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

Determine if a comtree index is being used in this table.

Parameters
ctsis a comtree index
Returns
true if the table contains an entry matching ctx, else false.

Definition at line 154 of file ComtreeTableFeng.h.

Here is the caller graph for this function:

bool forest::ComtreeTable::validComtLink ( int  cLnk) const
inline

Determine if a comtree link number is in use in this table.

Parameters
cLnkis a comtree link number
Returns
true if cLnk is a valid comtree link number for this table, else false

Definition at line 163 of file ComtreeTableFeng.h.

Here is the caller graph for this function:

bool forest::ComtreeTable::validComtree ( comt_t  comt) const
inline

Determine if the table has an entry for a given comtree.

Parameters
comtis a comtree number
Returns
true if table contains an entry for comt, else false.

Definition at line 216 of file ComtreeTable.h.

bool forest::ComtreeTable::validCtx ( int  ctx) const
inline

Determine if a comtree index is being used in this table.

Parameters
ctxis a comtree index
Returns
true if the table contains an entry matching ctx, else false.

Definition at line 224 of file ComtreeTable.h.

Here is the caller graph for this function:

Member Data Documentation

Dlist* forest::ComtreeTable::comtList
private

comtList[lnk] lists all comtrees

that use lnk

Definition at line 132 of file ComtreeTable.h.

int forest::ComtreeTable::maxCtx
private

maximum comtree index

largest comtree index

Definition at line 129 of file ComtreeTable.h.


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