This Page

backend.components — Basic SEER network router

class backend.components.NetworkRouter(name, attributes, cafile, nodefile, required=None)

Base clase for anything that is going to be using sockets.* for creating an app

amADest(msg)

This is how we decide if we need to process the message locally or not. Are we the single destination? Do we have an attribute the same as dest attribute? Is it a broadcast message? If you answered yes to any of these, process locally.

broadcastInfo()

Create a new INFO messages and broadcast it to everyone

connectRequired()

Check for required connections that are not connected and try to connect them

createInfoMessage()
filterAndSendMessage(msg, insock, outsock)

Optional outgoing filter for messages, default is no filtering

handleINFO(sock, msg)

Extract neighbor and responsibility information for later decisions

handleNeighborMessage(sock, msg)
loop()

Primary async loop for users of NetworkRouter

routeMessage(msg, insock=None)

Check message headers for specific destination, route appropriatly

stop()

Try and send anything left in the transmit buffers and then switch the main loop flag

subloop()
class backend.components.NodeInfo(name)

Data storage for entries in the route table

getNeighbors()
hasAttribute(attrib)
update(msg)
class backend.components.RequiredConnection(addrstr)
sameAddr(addrstr)
class backend.components.RotatingUniqueList(listcnt=4)

Provide recording of unique id values that can be timed out in groups for low overhead

cycle()
isNewMessage(id)
class backend.components.RouteTables(name)

Collectes INFO messages and create an internal routing table

addDirect(msg, sock)

Add a new neighbor to our list and the sock to use to talk to it

calculateRoutes()

Standard breadth first walk of network, stopping when we hit a duplicate node

delNeighbor(sock)

Delete the neighbor entry on this sock and recalculate the routes

getGroupPathSockets(attrib)

Get the sockets to broadcast messages for a particular attribute

getNeighborNames()

Get the names of all of our directly connected neighbors

getNeighborSocks()

Get the sock objects of all of our directly connected neighbors

getNextHop(name)

Return the socket for the next hop

processInfo(msg)

Process an incoming INFO message and update the routes

sock2Name(matchsock)

Get the name reported for a particular sock

class backend.components.SegmentedRouter(name, attributes, cafile, nodefile, required, allowedNames, allowedAttributes)

Router that segments part of the network from each other while letting other nodes to talk to anyone

filterAndSendMessage(msg, insock, outsock)

Any messages that are to be sent out a messaging socket go through here first. Filtering works as so: 1. INFO messages that are direct from us are modified when sent to constrained neighbors to not include any neighbor info for other constrained neighbors 2. Any messages comming from a constrained neighbor are never sent to another constrained neighbor

isMaster(sock)

Socks that should not be filtered

class backend.components.UserApp(name, cafile, nodefile)
handleDATA(sock, msg)