add connected() to LinuxBridge

This commit is contained in:
Bob Lantz
2014-07-15 05:34:32 -07:00
parent 2935000485
commit ece509d579
+7
View File
@@ -26,6 +26,13 @@ class LinuxBridge( Switch ):
LinuxBridge.nextPrio += 1 LinuxBridge.nextPrio += 1
Switch.__init__( self, name, **kwargs ) Switch.__init__( self, name, **kwargs )
def connected( self ):
"Are we forwarding yet?"
if self.stp:
return 'forwarding' in self.cmd( 'brctl showstp', self )
else:
return True
def start( self, controllers ): def start( self, controllers ):
self.cmd( 'ifconfig', self, 'down' ) self.cmd( 'ifconfig', self, 'down' )
self.cmd( 'brctl delbr', self ) self.cmd( 'brctl delbr', self )