Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

VirtualCircuitTable Class Reference

This is the routing table for virtual circuits. More...

#include <VirtualCircuitTable.h>

Inheritance diagram for VirtualCircuitTable::

BasicObject List of all members.

Public Methods

 VirtualCircuitTable (Node *myself)
virtual ~VirtualCircuitTable ()
VirtualCircuitTableEntryadd (Node *srcNode, int srcVcn, Node *destNode, int destVcn)
 Add an entry to the front of the table. More...

VirtualCircuitTableEntryfindBySrc (Node *srcNode, int srcVcn)
 Lookup an entry in the virtual circuit table using the source node and source vcn as the key. More...

VirtualCircuitTableEntryfindByDest (Node *destNode, int destVcn)
 Lookup an entry in the virtual circuit table using the destination node and destination vcn as the key. More...

VirtualCircuitTableEntryfindNode (Node *node)
 Find an entry that has the specified node in either src or dest field. More...

bool remove (Node *srcNode, int srcVcn)
 Remove an entry from the table. More...

bool isThisPacketForMe (Node *fromNode, NpPacket *packet)
 This is only for NON-CONNECTION packets. More...

virtual void toStream (std::ostream &out)

Private Methods

VirtualCircuitTableEntrylookUp (int srvVcn, Node *srcNode)

Private Attributes

vector< VirtualCircuitTableEntry *> m_table
Nodem_myself
Mutex m_tableLock

Detailed Description

This is the routing table for virtual circuits.

Definition at line 13 of file VirtualCircuitTable.h.


Constructor & Destructor Documentation

VirtualCircuitTable::VirtualCircuitTable Node * myself
 

Definition at line 10 of file VirtualCircuitTable.cpp.

VirtualCircuitTable::~VirtualCircuitTable [virtual]
 

Definition at line 18 of file VirtualCircuitTable.cpp.


Member Function Documentation

VirtualCircuitTableEntry * VirtualCircuitTable::add Node * srcNode,
int srcVcn,
Node * destNode,
int destVcn
 

Add an entry to the front of the table.

We can get all of the information we need from the packet itself.

Returns:
The entry created in the table.

Definition at line 35 of file VirtualCircuitTable.cpp.

Referenced by NetworkLayer::connectForward(), NetworkLayer::connectTerminate(), NetworkLayer::handleEstablishedPacket(), and NetworkLayer::makeVc().

VirtualCircuitTableEntry * VirtualCircuitTable::findByDest Node * destNode,
int destVcn
 

Lookup an entry in the virtual circuit table using the destination node and destination vcn as the key.

If found, it returns the virtual circuit table entry cooresponding to those keys. If nothing is found, return NULL.

Parameters:
destNode   Used as a lookup key.
destVcn   Used as a lookup key.

Definition at line 98 of file VirtualCircuitTable.cpp.

Referenced by NetworkLayer::handleEstablishedPacket().

VirtualCircuitTableEntry * VirtualCircuitTable::findBySrc Node * srcNode,
int srcVcn
 

Lookup an entry in the virtual circuit table using the source node and source vcn as the key.

If found, it returns the virtual circuit table entry cooresponding to those keys. If nothing is found, return NULL.

Parameters:
srcNode   Used as a lookup key.
srcVcn   Used as a lookup key.

Definition at line 68 of file VirtualCircuitTable.cpp.

Referenced by NetworkLayer::destroyVc(), NetworkLayer::forwardPacket(), NetworkLayer::handleConnectPacket(), NetworkLayer::handleDataPacket(), NetworkLayer::handleFinPacket(), NetworkLayer::hasVc(), isThisPacketForMe(), NetworkLayer::isThisPacketForMe(), and NetworkLayer::send().

VirtualCircuitTableEntry * VirtualCircuitTable::findNode Node * node
 

Find an entry that has the specified node in either src or dest field.

Definition at line 122 of file VirtualCircuitTable.cpp.

Referenced by NetworkLayer::destroyVcsTo().

bool VirtualCircuitTable::isThisPacketForMe Node * fromNode,
NpPacket * packet
 

This is only for NON-CONNECTION packets.

Returns:
true if the destination of this packet is this node.

Definition at line 188 of file VirtualCircuitTable.cpp.

VirtualCircuitTableEntry* VirtualCircuitTable::lookUp int srvVcn,
Node * srcNode
[private]
 

bool VirtualCircuitTable::remove Node * srcNode,
int srcVcn
 

Remove an entry from the table.

Returns:
true if the remove was successful, false otherwise. Should only be unsuccessful when the entry wasnt found.

Definition at line 146 of file VirtualCircuitTable.cpp.

Referenced by NetworkLayer::destroyVc(), NetworkLayer::destroyVcsTo(), and NetworkLayer::handleFinPacket().

void VirtualCircuitTable::toStream std::ostream & out [virtual]
 

Reimplemented from BasicObject.

Definition at line 254 of file VirtualCircuitTable.cpp.

Referenced by operator<<().


Member Data Documentation

Node* VirtualCircuitTable::m_myself [private]
 

Definition at line 52 of file VirtualCircuitTable.h.

vector<VirtualCircuitTableEntry*> VirtualCircuitTable::m_table [private]
 

Definition at line 50 of file VirtualCircuitTable.h.

Mutex VirtualCircuitTable::m_tableLock [private]
 

Definition at line 54 of file VirtualCircuitTable.h.


The documentation for this class was generated from the following files:
Generated at Thu Jul 11 13:32:00 2002 for Peekabooty by doxygen1.2.9 written by Dimitri van Heesch, © 1997-2001