Skip to content

Commit

Permalink
new routers function
Browse files Browse the repository at this point in the history
  • Loading branch information
edgar-costa committed Nov 18, 2020
1 parent e2278fe commit e6090d9
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions p4utils/utils/topology.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,20 @@ def get_switches_connected_to(self, node):
return [host for host in nodes if self.is_p4switch(host)]


def get_routers_connected_to(self, node):
"""
Returns the routers directly connected to the node
Args:
node:
Returns: list of routers
"""
nodes = self.get_neighbors(node)
return [host for host in nodes if self.is_router(host)]


def get_direct_host_networks_from_switch(self, switch):
"""
Returns all the subnetworks a switch can reach directly
Expand Down

0 comments on commit e6090d9

Please sign in to comment.