Made compatible with rearranged args for createLink.

This commit is contained in:
Bob Lantz
2010-03-09 21:46:32 -08:00
parent 315cbf9e79
commit 73a323f2a2
2 changed files with 10 additions and 10 deletions
+2 -2
View File
@@ -21,8 +21,8 @@ def scratchNet( cname='controller', cargs='ptcp:' ):
h1 = Node( 'h1' ) h1 = Node( 'h1' )
info( "*** Creating links\n" ) info( "*** Creating links\n" )
createLink( node1=h0, port1=0, node2=switch, port2=0 ) createLink( node1=h0, node2=switch, port1=0, port2=0 )
createLink( node1=h1, port1=0, node2=switch, port2=1 ) createLink( node1=h1, node2=switch, port1=0, port2=1 )
info( "*** Configuring hosts\n" ) info( "*** Configuring hosts\n" )
h0.setIP( h0.intfs[ 0 ], '192.168.123.1', 24 ) h0.setIP( h0.intfs[ 0 ], '192.168.123.1', 24 )
+8 -8
View File
@@ -26,17 +26,17 @@ def scratchNetUser( cname='controller', cargs='ptcp:' ):
switch = Node( 's0') switch = Node( 's0')
h0 = Node( 'h0' ) h0 = Node( 'h0' )
h1 = Node( 'h1' ) h1 = Node( 'h1' )
createLink( controller, 0, switch, 0 ) cintf, sintf = createLink( controller, switch )
createLink( h0, 0, switch, 1 ) h0intf, sintf1 = createLink( h0, switch )
createLink( h1, 0, switch, 2 ) h1intf, sintf2 = createLink( h1, switch )
info( '*** Configuring control network\n' ) info( '*** Configuring control network\n' )
controller.setIP( controller.intfs[ 0 ], '10.0.123.1', 24 ) controller.setIP( cintf, '10.0.123.1', 24 )
switch.setIP( switch.intfs[ 0 ], '10.0.123.2', 24 ) switch.setIP( sintf, '10.0.123.2', 24 )
info( '*** Configuring hosts\n' ) info( '*** Configuring hosts\n' )
h0.setIP( h0.intfs[ 0 ], '192.168.123.1', 24 ) h0.setIP( h0intf, '192.168.123.1', 24 )
h1.setIP( h1.intfs[ 0 ], '192.168.123.2', 24 ) h1.setIP( h1intf, '192.168.123.2', 24 )
info( '*** Network state:\n' ) info( '*** Network state:\n' )
for node in controller, switch, h0, h1: for node in controller, switch, h0, h1:
@@ -45,7 +45,7 @@ def scratchNetUser( cname='controller', cargs='ptcp:' ):
info( '*** Starting controller and user datapath\n' ) info( '*** Starting controller and user datapath\n' )
controller.cmd( cname + ' ' + cargs + '&' ) controller.cmd( cname + ' ' + cargs + '&' )
switch.cmd( 'ifconfig lo 127.0.0.1' ) switch.cmd( 'ifconfig lo 127.0.0.1' )
intfs = [ switch.intfs[ port ] for port in ( 1, 2 ) ] intfs = [ sintf1, sintf2 ]
switch.cmd( 'ofdatapath -i ' + ','.join( intfs ) + ' ptcp: &' ) switch.cmd( 'ofdatapath -i ' + ','.join( intfs ) + ' ptcp: &' )
switch.cmd( 'ofprotocol tcp:' + controller.IP() + ' tcp:localhost &' ) switch.cmd( 'ofprotocol tcp:' + controller.IP() + ' tcp:localhost &' )