Revision 3f2355a3 mininet/topo.py

View differences:

mininet/topo.py
12 12
'''
13 13

  
14 14
from mininet.util import irange, natural, naturalSeq
15
from mininet.node import NAT
15 16

  
16 17
class MultiGraph( object ):
17 18
    "Utility class to track nodes and edges - replaces networkx.Graph"
......
89 90
        result = self.addNode(name, isSwitch=True, **opts)
90 91
        return result
91 92

  
92
    def addNAT(self, name='nat', connect=True, **opts):
93
    def addNAT(self, name='nat', connect=True, inNamespace=False, **opts):
93 94
        """Convenience method: Add NAT to graph.
94 95
           name: NAT name
95 96
           connect: True will automatically connect to the first switch"""
96
        nat = self.addNode(name, isNAT=True, inNamespace=False)
97
        #nat = self.addNode(name, isNAT=True, inNamespace=False)
98
        nat = self.addNode(name, cls=NAT, inNamespace=inNamespace, hosts=self.hosts(), **opts)
97 99
        if connect:
98 100
            # connect the NAT to the first switch
99 101
            self.addLink(name, self.switches()[ 0 ])

Also available in: Unified diff