def initparser(self, parser): super(ImalseTopoNetnsExperiment, self).initparser(parser) parser.set_defaults( topology_file="./net_config/Inet_small_toposample.txt", topology_type='Inet', ) parser.add_option("-f", "--topology_file", dest="topology_file", help="topology file name, default = %s" % (parser.defaults["topology_file"])) parser.add_option( '-p', '--topology_type', dest="topology_type", help='type of topology file', ) scenario_ops = get_scenario_option() parser.add_option( '-s', '--scenario', dest="scenario", default='ddos_ping_flooding', help= 'specify the scenario you want to execute. Scenearios availiable are: %s' % (scenario_ops), )
def initparser(self, parser): super(ImalseNetnsExperiment, self).initparser(parser) scenario_ops = get_scenario_option() parser.add_option('-s', '--scenario', dest="scenario", default='ddos_ping_flooding', help='specify the scenario you want to execute. Scenearios availiable are: %s'%(scenario_ops), )
def initparser(self, parser): PingCsmaExperiment.initparser(self, parser) parser.set_defaults(simtime = 10, pingcount = 3) parser.add_option("-c", "--pingcount", dest = "pingcount", help = "ping count; default = %s" % parser.defaults["pingcount"]) scenario_ops = get_scenario_option() parser.add_option('-s', '--scenario', dest="scenario", default='None', help='specify the scenario you want to execute. Scenearios availiable are: %s'%(scenario_ops), )
def initparser(self, parser): super(ImalseTopoNetnsExperiment, self).initparser(parser) parser.set_defaults(topology_file="./net_config/Inet_small_toposample.txt", topology_type = 'Inet', ) parser.add_option("-f", "--topology_file", dest = "topology_file", help = "topology file name, default = %s" %(parser.defaults["topology_file"])) parser.add_option('-p', '--topology_type', dest="topology_type", help='type of topology file', ) scenario_ops = get_scenario_option() parser.add_option('-s', '--scenario', dest="scenario", default='ddos_ping_flooding', help='specify the scenario you want to execute. Scenearios availiable are: %s'%(scenario_ops), )
def parse_arguments(): parser = argparse.ArgumentParser(description='imalse') scenario_ops = ut.get_scenario_option() parser.add_argument('-s', '--scenario', default='None', help='specify the scenario you want to execute. Scenearios availiable are: %s'%(scenario_ops ) ) parser.add_argument('-r', '--role', default='None', help='specify the role you want to emulate, 1.[server], 2.[client], 3.[botmaster]' ) args = parser.parse_args() if args.scenario not in scenario_ops: parser.print_help() exit() return args
#!/usr/bin/env python """test all experiments and scenarios""" from subprocess import check_call, Popen from util import get_experiment_option, get_scenario_option exper_options = get_experiment_option() scenario_option = get_scenario_option() skip_expr = ['ImalseTopoHybridExperiment', 'ImalseHybridExperiment'] skip_scen = ['ddos_ping_flooding', 'infecting'] fid = open('test.out', 'w') for exper in exper_options: for scenario in scenario_option: if exper in skip_expr or scenario in skip_scen: print >> fid, 'skipping experiment: [%s], scenario:[%s]' % ( exper, scenario) continue print >> fid, '-' * 100 print >> fid, 'testing experiment: [%s], scenario:[%s]' % (exper, scenario) print >> fid, '-' * 100 check_call(['./simulate.py', '-e', exper, '-s', scenario]) # Popen(['./simulate.py', '-e', exper, '-s', scenario]) fid.close()
#!/usr/bin/env python """test all experiments and scenarios""" from subprocess import check_call, Popen from util import get_experiment_option, get_scenario_option exper_options = get_experiment_option() scenario_option = get_scenario_option() skip_expr = ['ImalseTopoHybridExperiment', 'ImalseHybridExperiment'] skip_scen = ['ddos_ping_flooding', 'infecting'] fid = open ('test.out', 'w') for exper in exper_options: for scenario in scenario_option: if exper in skip_expr or scenario in skip_scen: print >>fid, 'skipping experiment: [%s], scenario:[%s]'%(exper, scenario) continue print >>fid, '-' * 100 print >>fid, 'testing experiment: [%s], scenario:[%s]'%(exper, scenario) print >>fid, '-' * 100 check_call(['./simulate.py', '-e', exper, '-s', scenario]) # Popen(['./simulate.py', '-e', exper, '-s', scenario]) fid.close()