From 91261b275754e848c153da5369ada8e103f0601f Mon Sep 17 00:00:00 2001
From: Rich Lane <rlane@bigswitch.com>
Date: Thu, 27 Jun 2013 17:56:46 -0700
Subject: [PATCH] IVSSwitch: add support for dpctl

dpctl is not included with IVS. The user will need to obtain it from the
OpenFlow reference repository.
---
 mininet/node.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/mininet/node.py b/mininet/node.py
index edb46de0..0b67a008 100644
--- a/mininet/node.py
+++ b/mininet/node.py
@@ -1055,6 +1055,8 @@ def start( self, controllers ):
                 args.extend( ['-i', intf.name] )
         for c in controllers:
             args.extend( ['-c', '%s:%d' % (c.IP(), c.port)] )
+        if self.listenPort:
+            args.extend( ['--listen', '127.0.0.1:%i' % self.listenPort] )
 
         with open( '/tmp/ivs.%s.log' % self.name, 'w' ) as logfile:
             with open( '/dev/null', 'w' ) as nullfile:
@@ -1080,7 +1082,10 @@ def detach( self, intf ):
 
     def dpctl( self, *args ):
         "Run dpctl command"
-        return "dpctl not supported\n" or args or self # satisfy pylint
+        if not self.listenPort:
+            return "can't run dpctl without passive listening port"
+        return self.cmd( 'dpctl ' + ' '.join( args ) +
+                         ' tcp:127.0.0.1:%i' % self.listenPort )
 
 
 class Controller( Node ):
-- 
GitLab