Package g4ds :: Module routingtablemanager :: Class RoutingTableManager
[show private | hide private]
[frames | no frames]

Class RoutingTableManager


Holds the routing table in the memory.

Architecture:
  1. For each reachable community we have one entry in the dictionary - key is the community id, value is an ordered list
  2. The ordered list is the list of routing entries with destination community, the key for ordering is the costs for the route.

Method Summary
  __init__(self, loadFromDatabase)
Let's load the routing table here into memory.
  __str__(self)
Some basic information about the object
  addEntry(self, entry, loading, skipMoreExpensive)
Adds an routing entry to the manager.
  applyRoutingTableFromNode(self, peerId, tableXml)
Updates the local routing table with the information from the remote peer about its routes.
  flushTable(self)
Flushes the routing table - the table will be totally empty afterwards.
  getAllEntriesForCommunityPair(self, sourceCommunityId, destinationCommunityId)
Returns all entries for the pair - source commuity - destination community
  getNexthopForCommunity(self, destinationcommunityid, sourcecommunityid)
Returns the member id of the next hop on the route towards the final destination's community.
  getRoutingTableXML(self)
Returns an XML formatted copy of the routing table.
  recalculateRoutingTable(self)
Creates routing entries from the scratch by processing gateway information.

Method Details

__init__(self, loadFromDatabase=1)
(Constructor)

Let's load the routing table here into memory.

__str__(self)
(Informal representation operator)

Some basic information about the object

addEntry(self, entry, loading=0, skipMoreExpensive=1)

Adds an routing entry to the manager.

If loading is false, the new value is written through to the database.
Parameters:
entry - Routing table entry to add
           (type=RoutingTableEntry)
loading - Indicates, whether the change shall be written through to the routing table
           (type=Boolean)
skipMoreExpensive - Inidicates, whether new entries with same src, dst community and same gw but higher costs than current value shall be skipped
           (type=Boolean)

applyRoutingTableFromNode(self, peerId, tableXml)

Updates the local routing table with the information from the remote peer about its routes.

flushTable(self)

Flushes the routing table - the table will be totally empty afterwards.

getAllEntriesForCommunityPair(self, sourceCommunityId, destinationCommunityId)

Returns all entries for the pair - source commuity - destination community

getNexthopForCommunity(self, destinationcommunityid, sourcecommunityid=None)

Returns the member id of the next hop on the route towards the final destination's community.

Automatically, the route with the lowest costs for this destination community is chosen.

If sourcecommunityid is not given, any will be chosen, in fact the one which causes the lowest costs.

getRoutingTableXML(self)

Returns an XML formatted copy of the routing table.

recalculateRoutingTable(self)

Creates routing entries from the scratch by processing gateway information.

The values for directly reachable communities are applied. Furthermore, communities, which may be reached through one community only (1 hop) are put into as well. The rest should be sorted out be the dynamic routing faciliites.

Generated by Epydoc 2.0 on Sat Oct 22 22:52:47 2005 http://epydoc.sf.net