Newer
Older
class BubbleRouter(CommunityRouter):
def __call__(self, packet):
return packet.destination, 'direct', True
if self.local_community:
best, lp = self.best_lp()
if lp > self.lp():
return best, 'lp', True
elif self.not_local_community:
best, gp = self.best_gp()
if gp > self.gp():
return best, 'gp', True
def on_send_failure(self, target, packet):
self.node.buffer.add(packet)