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

Restored accidentally deleted kill %ofpd lines. Added Node.MAC()

parent c246e2d5
No related branches found
No related tags found
No related merge requests found
......@@ -35,10 +35,11 @@
"""
from subprocess import Popen, PIPE, STDOUT
import os
import re
import signal
import select
from subprocess import Popen, PIPE, STDOUT
from time import sleep
from mininet.log import info, error, debug
......@@ -227,7 +228,6 @@ def deleteIntfs( self ):
# However, this takes time, so we're better off removing them
# explicitly so that we won't get errors if we run before they
# have been removed by the kernel. Unfortunately this is very slow.
self.cmd( 'kill %ofprotocol' )
for intf in self.intfs.values():
quietRun( 'ip link del ' + intf )
info( '.' )
......@@ -275,6 +275,15 @@ def IP( self ):
"Return IP address of interface 0"
return self.ips.get( self.intfs.get( 0 , None ), None )
def MAC( self ):
"Return MAC address of interface 0"
ifconfig = self.cmd( 'ifconfig ' + self.intfs[ 0 ] )
macs = re.findall( '..:..:..:..:..:..', ifconfig )
if len( macs ) > 0:
return macs[ 0 ]
else:
return None
def intfIsUp( self, port ):
"""Check if interface for a given port number is up.
port: port number"""
......@@ -388,6 +397,7 @@ def start( self, controllers ):
def stop( self ):
"Terminate kernel datapath."
quietRun( 'dpctl deldp nl:%i' % self.dp )
self.cmd( 'kill %ofprotocol' )
self.deleteIntfs()
class OVSKernelSwitch( Switch ):
......@@ -431,6 +441,7 @@ def start( self, controllers ):
def stop( self ):
"Terminate kernel datapath."
quietRun( 'ovs-dpctl del-dp dp%i' % self.dp )
self.cmd( 'kill %ovs-openflowd' )
self.deleteIntfs()
......
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