Skip to content
Snippets Groups Projects
Commit 73a323f2 authored by Bob Lantz's avatar Bob Lantz
Browse files

Made compatible with rearranged args for createLink.

parent 315cbf9e
No related branches found
No related tags found
No related merge requests found
...@@ -21,8 +21,8 @@ def scratchNet( cname='controller', cargs='ptcp:' ): ...@@ -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 )
......
...@@ -26,17 +26,17 @@ def scratchNetUser( cname='controller', cargs='ptcp:' ): ...@@ -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:' ): ...@@ -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 &' )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment