Home | Trees | Index | Help |
---|
Package spoon :: Package routing :: Module MeshRouter :: Class MeshRouter |
|
object
--+
|
MeshRouter
This class handles LMTYPE_NETWORK messages and LMTYPE_NETWORK_PROTO messages. LMTYPE_NETWORK_PROTO is handled as a routing update, and LMTYPE_NETWORK will be handled as network traffic to be dealt with or routed.
If there is a SingletonMessaging instance already created (e.g. through the use of the acceptMsg decorator) and messaging is NoneMethod Summary | |
---|---|
__init__(self,
hub,
messaging)
| |
Handles the routing protocol initilization. | |
Called by the SpoonTransportThread when a link message has been received for one of our LMTYPEs. | |
handleNetworkTraffic(self,
t,
obj)
| |
Handles a routing table update, builds the update message and sends it out to all except the src of the update. | |
Removes the transport from the network. | |
Sends a network message to the destination specified. | |
Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
x.__hash__() <==> hash(x) | |
T.__new__(S, ...) -> a new object with type S, a subtype of T | |
helper for pickle | |
helper for pickle | |
x.__repr__() <==> repr(x) | |
x.__setattr__('name', value) <==> x.name = value | |
x.__str__() <==> str(x) |
Instance Variable Summary | |
---|---|
hub : the TransportHub that the router is associated with, should be set at
init time and never changed. | |
nodes : This is the routing table. | |
transports : A set of the transports that are currently active. |
Method Details |
---|
addTransport(self, t, nodeId)Handles the routing protocol initilization. This involves first exchanging routing tables entirely, then updating our routing table as appropriate. While updating our routing table, we need to construct a routing update message and send it to all transports other than the transport being added.
|
handleLinkMessage(self, t, lm)Called by the SpoonTransportThread when a link message has been received for one of our LMTYPEs.
|
handleUpdate(self, t, update, localUpdate=None)Handles a routing table update, builds the update message and sends it out to all except the src of the update.
|
removeTransport(self, t)Removes the transport from the network. This involves figuring out which nodes are now unreachable (any routes we had over that transport), removing any references to the transport from our routing table, and updating our neighbors about our changed routing table.
|
sendNetMsg(self, dst, mtype, obj)Sends a network message to the destination specified. A NetMessage object is constructed from the arguments provided to this method and routed appropriately.
|
Instance Variable Details |
---|
hubthe TransportHub that the router is associated with, should be set at init time and never changed. |
nodesThis is the routing table. It's a dictionary whose keys are node ids, and the values are a tuple consisting of the hop count to the node and the transport used to get there. |
transportsA set of the transports that are currently active. |
Home | Trees | Index | Help |
---|
Generated by Epydoc 2.1 on Sun Nov 26 15:33:58 2006 | http://epydoc.sf.net |