Revision d7e5dfc5

View differences:

mininet/link.py
33 33

  
34 34
    "Basic interface object that can configure itself."
35 35

  
36
    def __init__( self, name, node=None, link=None, **kwargs ):
36
    def __init__( self, name, node=None, port=None, link=None, **kwargs ):
37 37
        """name: interface name (e.g. h1-eth0)
38 38
           node: owning node (where this intf most likely lives)
39 39
           link: parent link if we're part of a link
......
43 43
        self.link = link
44 44
        self.mac, self.ip, self.prefixLen = None, None, None
45 45
        # Add to node (and move ourselves if necessary )
46
        node.addIntf( self )
46
        node.addIntf( self, port=port )
47 47
        self.config( **kwargs )
48 48

  
49 49
    def cmd( self, *args, **kwargs ):
......
163 163
        # Does it help to sleep to let things run?
164 164
        sleep( 0.001 )
165 165

  
166
    def __repr__( self ):
167
        return '<%s %s>' % ( self.__class__.__name__, self.name )
168

  
166 169
    def __str__( self ):
167 170
        return self.name
168 171

  
......
339 342
        if not params2:
340 343
            params2 = {}
341 344

  
342
        intf1 = cls1( name=intfName1, node=node1, link=self, **params1  )
343
        intf2 = cls2( name=intfName2, node=node2, link=self, **params2 )
345
        intf1 = cls1( name=intfName1, node=node1, port=port1,
346
                      link=self, **params1  )
347
        intf2 = cls2( name=intfName2, node=node2, port=port2,
348
                      link=self, **params2 )
344 349

  
345 350
        # All we are is dust in the wind, and our two interfaces
346 351
        self.intf1, self.intf2 = intf1, intf2

Also available in: Unified diff