Revision c70aab0a

View differences:

mininet/cli.py
148 148
            output( '%s\n' % node )
149 149

  
150 150
    def do_link( self, args ):
151
        "Bring a link up or down."
151
        "Bring link(s) between two nodes up or down."
152 152
        args = args.split()
153 153
        if len(args) != 3:
154
            error( 'invalid number of args: link [up down] end1 end2\n' )
155
        elif args[ 0 ] not in [ 'up', 'down' ]:
156
            error( 'invalid type: link [up down] end1 end2\n' )
154
            error( 'invalid number of args: link end1 end2 [up down]\n' )
155
        elif args[ 2 ] not in [ 'up', 'down' ]:
156
            error( 'invalid type: link end1 end2 [up down]\n' )
157 157
        else:
158
            self.mn.link( *args )
158
            self.mn.configLinkStatus( *args )
159 159

  
160 160
    def do_pause( self, args ):
161 161
        "Temporarily bring a node down."
mininet/net.py
511 511
        "Run iperf UDP test."
512 512
        return self.iperf( l4Type='UDP', udpBw=udpBw )
513 513

  
514
    def link( self, status, src, dst ):
515
        """Change link status.
516
           status: string {up, down}
517
           src: string
518
           dst: string"""
514
    def configLinkStatus( self, src, dst, status ):
515
        """Change status of src <-> dst links.
516
           src: node name
517
           dst: node name
518
           status: string {up, down}"""
519 519
        if src not in self.nameToNode:
520 520
            error( 'src not in network: %s\n' % src )
521 521
        elif dst not in self.nameToNode:

Also available in: Unified diff