Revision f0f9907b mininet/nodelib.py

View differences:

mininet/nodelib.py
6 6

  
7 7
from mininet.node import Node, Switch
8 8
from mininet.log import setLogLevel, info
9
from mininet.moduledeps import pathCheck
10

  
9 11

  
10 12
class LinuxBridge( Switch ):
11 13
    "Linux Bridge (with optional spanning tree)"
......
31 33
            return True
32 34
    
33 35
    def start( self, controllers ):
36
        "Start Linux bridge"
34 37
        self.cmd( 'ifconfig', self, 'down' )
35 38
        self.cmd( 'brctl delbr', self )
36 39
        self.cmd( 'brctl addbr', self )
......
43 46
        self.cmd( 'ifconfig', self, 'up' )
44 47

  
45 48
    def stop( self ):
49
        "Stop Linux bridge"
46 50
        self.cmd( 'ifconfig', self, 'down' )
47 51
        self.cmd( 'brctl delbr', self )
48 52

  
53
    def dpctl( self, *args ):
54
        "Run brctl command"
55
        return self.cmd( 'brctl', *args )
56

  
57
    @classmethod
58
    def setup( cls ):
59
        "Make sure our class dependencies are available"
60
        pathCheck( 'brctl', moduleName='bridge-utils' )
61

  
62

  
49 63
class NAT( Node ):
50 64
    """NAT: Provides connectivity to external network"""
51 65

  

Also available in: Unified diff