Esempio n. 1
0
 def init(cls):
     "Initialize Mininet"
     if cls.inited:
         return
     ensureRoot()
     fixLimits()
     cls.inited = True
Esempio n. 2
0
 def init( cls ):
     "Initialize Mininet"
     if cls.inited:
         return
     ensureRoot()
     fixLimits()
     cls.inited = True
Esempio n. 3
0
  def __init__(self, topo, controller, switch=Switch, rate=None):
    if os.getuid() != 0:
      print colored('Please run as root.', 'red')
      sys.exit(-1)
    
    fixLimits()
    # use our own host definition
    self.host = Host
    # but user supplied switch :p
    self.switch = switch
    
    self.next_host_id = 1
    self.next_switch_id = 1

    self.hosts = []
    self.switches = []
    self.controllers = []
    self.name_to_node = {}

    self.topo = topo
    self.rate = rate