#!/usr/bin/python

import sys

from mininet.topo import Topo
from mininet.node import RemoteController, UserSwitch
from mininet.net import Mininet
from mininet.util import irange
from mininet.cli import CLI
from mininet.log import setLogLevel

from optparse import OptionParser


class OltTopo( Topo ):
    "Single switch with OLT port 129 and configurable number of ONU ports"

    def build( self, k=1, **_opts ):
        "k: number of onu"
        self.k = k
        switch = self.addSwitch( 's1' )
        for h in irange( 1, k ):
            host = self.addHost( 'h%s' % h, inNamespace=False )
            self.addLink( host, switch )

        olt_port = self.addHost( 'h129', inNamespace=False )
        self.addLink( olt_port, switch, port2=129 )

if __name__ == '__main__':

    parser = OptionParser()
    parser.add_option("-u", "--user-switch", dest="user_switch", action="store_true",
                      default=False, help="use given user mode switch (CPqD) or mininet")
    (options, args) = parser.parse_args()

    kargs = {}

    if options.user_switch:
        kargs['switch'] = UserSwitch

    setLogLevel('debug')

    topo = OltTopo()
    topo.build(k=2)

    net = Mininet( topo=topo, controller=RemoteController, **kargs )

    net.start()

    CLI( net )

    net.stop()
