From 5cb4a5424dc609148f3ba3f635e2eba4fd3f0657 Mon Sep 17 00:00:00 2001 From: Gregory Gee Date: Sat, 3 May 2014 16:21:53 -0400 Subject: [PATCH] Add ability for for OVS switch start connect to controllers using protocols other than TCP. net.addController( 'c0', protocol='ssl' ) This now allows OVS to connect to a controller using SSL. The default of protocol is 'tcp' as it currently is. --- mininet/node.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mininet/node.py b/mininet/node.py index 6f765fc..27d1e16 100644 --- a/mininet/node.py +++ b/mininet/node.py @@ -1048,7 +1048,7 @@ class OVSSwitch( Switch ): # Interfaces and controllers intfs = ' '.join( '-- add-port %s %s ' % ( self, intf ) for intf in self.intfList() if not intf.IP() ) - clist = ' '.join( 'tcp:%s:%d' % ( c.IP(), c.port ) + clist = ' '.join( '%s:%s:%d' % ( c.protocol, c.IP(), c.port ) for c in controllers ) if self.listenPort: clist += ' ptcp:%s' % self.listenPort @@ -1154,12 +1154,13 @@ class Controller( Node ): def __init__( self, name, inNamespace=False, command='controller', cargs='-v ptcp:%d', cdir=None, ip="127.0.0.1", - port=6633, **params ): + port=6633, protocol='tcp', **params ): self.command = command self.cargs = cargs self.cdir = cdir self.ip = ip self.port = port + self.protocol = protocol Node.__init__( self, name, inNamespace=inNamespace, ip=ip, **params ) self.cmd( 'ifconfig lo up' ) # Shouldn't be necessary