Changed mininet.link() to mininet.configLinkStatus(src,dst,status)
Also rearranged parameters in link command to mininet> link s1 h2 up To resemble ifconfig a bit more.
This commit is contained in:
+5
-5
@@ -148,14 +148,14 @@ class CLI( Cmd ):
|
||||
output( '%s\n' % node )
|
||||
|
||||
def do_link( self, args ):
|
||||
"Bring a link up or down."
|
||||
"Bring link(s) between two nodes up or down."
|
||||
args = args.split()
|
||||
if len(args) != 3:
|
||||
error( 'invalid number of args: link [up down] end1 end2\n' )
|
||||
elif args[ 0 ] not in [ 'up', 'down' ]:
|
||||
error( 'invalid type: link [up down] end1 end2\n' )
|
||||
error( 'invalid number of args: link end1 end2 [up down]\n' )
|
||||
elif args[ 2 ] not in [ 'up', 'down' ]:
|
||||
error( 'invalid type: link end1 end2 [up down]\n' )
|
||||
else:
|
||||
self.mn.link( *args )
|
||||
self.mn.configLinkStatus( *args )
|
||||
|
||||
def do_pause( self, args ):
|
||||
"Temporarily bring a node down."
|
||||
|
||||
+5
-5
@@ -511,11 +511,11 @@ class Mininet( object ):
|
||||
"Run iperf UDP test."
|
||||
return self.iperf( l4Type='UDP', udpBw=udpBw )
|
||||
|
||||
def link( self, status, src, dst ):
|
||||
"""Change link status.
|
||||
status: string {up, down}
|
||||
src: string
|
||||
dst: string"""
|
||||
def configLinkStatus( self, src, dst, status ):
|
||||
"""Change status of src <-> dst links.
|
||||
src: node name
|
||||
dst: node name
|
||||
status: string {up, down}"""
|
||||
if src not in self.nameToNode:
|
||||
error( 'src not in network: %s\n' % src )
|
||||
elif dst not in self.nameToNode:
|
||||
|
||||
Reference in New Issue
Block a user