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

Node Class Reference

A Node stores all the higher level information about a node in the network. More...

#include <Node.h>

Inheritance diagram for Node::

BasicObject ListenerInterface ObservableInterface List of all members.

Public Methods

 Node ()
 Constructor. More...

 Node (const Node &)
virtual ~Node ()
 Destructor. More...

SocketAddressgetSocketAddress ()
TimeValue getRtt ()
 Get the round trip time to this node. More...

void setRtt (TimeValue)
 Set RTT for this Node. More...

int getVersionNumber ()
 Get the protocol version number this node supports. More...

void setVersionNumber (int)
 Set the protocol version number this node supports. More...

bool isConnected ()
 Return true if we are connected to this Node, false otherwise. More...

bool isNatted ()
 Return true if this node is behing a NAT. More...

bool isTrusted ()
 Return true if this node is trusted peer. More...

bool isFirewalled ()
 Return true if this node is behind a country-wide firewall. More...

bool cantConnect ()
void setSocketAddress (SocketAddress *socketAddress)
 Copies the socket address passed in. More...

void setIsNatted (bool val)
void setIsTrusted (bool val)
void setIsFirewalled (bool val)
void setCantConnect (bool)
bool equals (Node *node)
 returns true if the IP addresses are equal. More...

bool equals (ConnectionInterface *connection)
 Return true if the IP addresses are equal. More...

void handleEvent (ObservableInterface *, int eventType, void *object)
 Passes connection events on to NodeListeners. More...

virtual void toStream (std::ostream &out)

Static Public Attributes

string beginTag = "<Node>"
string endTag = "</Node>"
string TRUSTED_TAG = "isTrusted"
string FIREWALL_TAG = "isFirewalled"
string NAT_TAG = "isNatted"
string SOCKET_ADDRESS_TAG = "socketAddress"
string RTT_TAG = "rtt"
string VERSION_TAG = "version"

Protected Attributes

SocketAddress m_socketAddress
TimeValue m_rtt
 Average RTT to this node. More...

bool m_isNatted
 true if the node is NATed. More...

bool m_isFirewalled
 true if the node is firewalled. More...

bool m_isTrusted
 true if we trust the node. More...

int m_versionNumber
 the protocol version number this node supports. More...

bool m_isConnected
bool m_cantConnect

Friends

std::istream & operator>> (std::istream &in, Node &node)
 Read in a Node configuration. More...


Detailed Description

A Node stores all the higher level information about a node in the network.

Definition at line 18 of file Node.h.


Constructor & Destructor Documentation

Node::Node
 

Constructor.

Definition at line 21 of file Node.cpp.

Node::Node const Node & src
 

Definition at line 32 of file Node.cpp.

Node::~Node [virtual]
 

Destructor.

Definition at line 45 of file Node.cpp.


Member Function Documentation

bool Node::cantConnect
 

Definition at line 137 of file Node.cpp.

Referenced by Catcher::getUnconnectedNode().

bool Node::equals ConnectionInterface * connection
 

Return true if the IP addresses are equal.

Definition at line 240 of file Node.cpp.

bool Node::equals Node * node
 

returns true if the IP addresses are equal.

Definition at line 231 of file Node.cpp.

Referenced by LinkLayerInterface::broadcast(), LinkLayerInterface::close(), VirtualCircuitTable::findByDest(), VirtualCircuitTable::findBySrc(), VirtualCircuitTable::findNode(), LinkLayerInterface::getRandomNeighbor(), VirtualCircuitTable::isThisPacketForMe(), NetworkLayer::isThisPacketForMe(), VirtualCircuitTable::remove(), and LinkLayerInterface::sendPacket().

TimeValue Node::getRtt
 

Get the round trip time to this node.

Definition at line 166 of file Node.cpp.

Referenced by NetworkLayer::handlePongPacket().

SocketAddress * Node::getSocketAddress
 

Definition at line 50 of file Node.cpp.

Referenced by NodeManagerCommand::addNode(), Catcher::addNode(), LinkLayerInterface::connect(), NodeManagerCommand::displayNode(), ConnectionManagerCommand::displayNode(), VisualizerFrame::drawNodes(), equals(), VirtualCircuitTable::findByDest(), VirtualCircuitTable::findBySrc(), VirtualCircuitTable::findNode(), UserConfiguration::generateNodeHtmlInterface(), SummaryScreenCommand::getHtmlInterface(), Catcher::lookup(), LinkLayerInterface::peerConnectImpl(), VirtualCircuitTable::remove(), BasicConfigurationCommand::run(), and VirtualCircuitTableEntry::toStream().

int Node::getVersionNumber
 

Get the protocol version number this node supports.

Definition at line 68 of file Node.cpp.

void Node::handleEvent ObservableInterface * connection,
int eventType,
void * object
[virtual]
 

Passes connection events on to NodeListeners.

Reimplemented from ListenerInterface.

Definition at line 152 of file Node.cpp.

bool Node::isConnected
 

Return true if we are connected to this Node, false otherwise.

Definition at line 59 of file Node.cpp.

Referenced by NodeManagerCommand::displayNode(), Catcher::getUnconnectedNode(), and NodeManagerCommand::run().

bool Node::isFirewalled
 

Return true if this node is behind a country-wide firewall.

Definition at line 104 of file Node.cpp.

Referenced by NodeManagerCommand::displayNode(), ConnectionManagerCommand::displayNode(), VisualizerFrame::drawNodes(), UserConfiguration::generateNodeHtmlInterface(), and SummaryScreenCommand::getHtmlInterface().

bool Node::isNatted
 

Return true if this node is behing a NAT.

Definition at line 86 of file Node.cpp.

Referenced by NodeManagerCommand::displayNode(), ConnectionManagerCommand::displayNode(), VisualizerFrame::drawNodes(), UserConfiguration::generateNodeHtmlInterface(), and SummaryScreenCommand::getHtmlInterface().

bool Node::isTrusted
 

Return true if this node is trusted peer.

Definition at line 95 of file Node.cpp.

Referenced by NodeManagerCommand::displayNode(), ConnectionManagerCommand::displayNode(), and UserConfiguration::generateNodeHtmlInterface().

void Node::setCantConnect bool value
 

Definition at line 143 of file Node.cpp.

Referenced by LinkLayerInterface::connect(), and LinkLayerInterface::peerConnectImpl().

void Node::setIsFirewalled bool val
 

Definition at line 131 of file Node.cpp.

Referenced by Node(), NetworkLayer::handleImHerePacket(), operator>>(), and UserConfiguration::setNode().

void Node::setIsNatted bool val
 

Definition at line 119 of file Node.cpp.

Referenced by Node(), NetworkLayer::handleImHerePacket(), operator>>(), and UserConfiguration::setNode().

void Node::setIsTrusted bool val
 

Definition at line 125 of file Node.cpp.

Referenced by Node(), NetworkLayer::handleImHerePacket(), operator>>(), and UserConfiguration::setNode().

void Node::setRtt TimeValue value
 

Set RTT for this Node.

Definition at line 175 of file Node.cpp.

Referenced by NetworkLayer::handlePongPacket().

void Node::setSocketAddress SocketAddress * socketAddress
 

Copies the socket address passed in.

Definition at line 113 of file Node.cpp.

Referenced by Config::Config(), LinkLayerInterface::accept(), NetworkLayer::handleImHerePacket(), operator>>(), and UserConfiguration::setNode().

void Node::setVersionNumber int value
 

Set the protocol version number this node supports.

Definition at line 77 of file Node.cpp.

Referenced by Node(), NetworkLayer::handleImHerePacket(), and operator>>().

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

Reimplemented from BasicObject.

Definition at line 215 of file Node.cpp.


Friends And Related Function Documentation

std::istream& operator>> std::istream & in,
Node & node
[friend]
 

Read in a Node configuration.

Definition at line 183 of file Node.cpp.


Member Data Documentation

string Node::FIREWALL_TAG = "isFirewalled" [static]
 

Definition at line 12 of file Node.cpp.

string Node::NAT_TAG = "isNatted" [static]
 

Definition at line 13 of file Node.cpp.

string Node::RTT_TAG = "rtt" [static]
 

Definition at line 15 of file Node.cpp.

string Node::SOCKET_ADDRESS_TAG = "socketAddress" [static]
 

Definition at line 14 of file Node.cpp.

string Node::TRUSTED_TAG = "isTrusted" [static]
 

Definition at line 11 of file Node.cpp.

string Node::VERSION_TAG = "version" [static]
 

Definition at line 16 of file Node.cpp.

string Node::beginTag = "<Node>" [static]
 

Definition at line 9 of file Node.cpp.

string Node::endTag = "</Node>" [static]
 

Definition at line 10 of file Node.cpp.

bool Node::m_cantConnect [protected]
 

Definition at line 97 of file Node.h.

bool Node::m_isConnected [protected]
 

Definition at line 95 of file Node.h.

bool Node::m_isFirewalled [protected]
 

true if the node is firewalled.

Definition at line 87 of file Node.h.

bool Node::m_isNatted [protected]
 

true if the node is NATed.

Definition at line 84 of file Node.h.

bool Node::m_isTrusted [protected]
 

true if we trust the node.

Definition at line 90 of file Node.h.

TimeValue Node::m_rtt [protected]
 

Average RTT to this node.

Definition at line 81 of file Node.h.

SocketAddress Node::m_socketAddress [protected]
 

Definition at line 78 of file Node.h.

int Node::m_versionNumber [protected]
 

the protocol version number this node supports.

Definition at line 93 of file Node.h.


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