Пример #1
0
 def buildGraph(self):
     graph = GenericGraph()
     for node in self.nodes:
         graph.addVertex(node)
     for link in self.links:
         node1 = link.getSrcNode()
         node2 = link.getDstNode()
         graph.addEdge(node1, node2, link)
     return graph
Пример #2
0
 def buildGraph(self):
     graph = GenericGraph()
     for node in self.nodes:
         graph.addVertex(node)
     for link in self.links:
         node1 = link.getSrcNode()
         node2 = link.getDstNode()
         graph.addEdge(node1,node2,link)
     return graph
Пример #3
0
 def buildGraph(self):
     """
     Build the graph object.
     Idea here is to show (approximately) POP-layer full-mesh connectivity
     :return: net.es.netshell.api.GenericGraph
     """
     graph=GenericGraph()
     for node in self.nodes:
         graph.addVertex(node)
     for link in self.links:
         graph.addEdge(link.getSrcNode(), link.getDstNode(), link)
     return graph
Пример #4
0
 def buildGraph(self):
     """
     Build the graph object.
     It's not exactly clear what we need from the graph object here.
     :return: net.es.netshell.api.GenericGraph
     """
     graph=GenericGraph()
     for node in self.nodes:
         graph.addVertex(node)
     for link in self.links:
         self.addLinkIntoGraph(link, graph)
     return graph
Пример #5
0
        """
        print "not implemented"

    def getPriority(self):
        """
        Returns the priority of the VPN
        :return: a string, "low" or "high"
        """


if __name__ == '__main__':
    h1 = GenericHost("site 1")
    h2 = GenericHost("site 2")
    p1 = GenericPort("eth0")
    p2 = GenericPort("eth0")
    link = GenericLink(h1,p1,h2,p2)

    graph = GenericGraph()
    graph.addVertex(h1)
    graph.addVertex(h2)
    graph.addEdge(h1,h2,link)