def generate(self, kind=""): td = self.getSection('Application') f = td['interface'] if (f == 'CLI'): retval = CLI.CLI() else: td = self.getSection('GUI') di = int(td['intervaldata']) si = int(td['intervalscreen']) ri = int(td['intervalrequest']) oi = int(td['lines_output']) retval = GUI.GUI(di, si, ri, oi) return retval
def Main(): """ Choose the test file you want to run here """ # class Main: # public final class Main # def __init__(self): # public static void main(String[] args) # return # # def main(self, *args): # try: CLI.CLI().runCLI(args) # CLI.runCLISim(args);
net.addLink (h2, SwitchList [n-1], cls = TCLink, ** linkBW) para i no alcance (n * 2-2): se i == (n-1): net.addLink (SwitchList [0], SwitchList [i + 1], cls = TCLink, ** linkBW) elif i! = (n-1) e i! = (n * 2-2-1): net.addLink (SwitchList [i], SwitchList [i + 1], cls = TCLink, ** linkBW) outro: net.addLink (SwitchList [i], SwitchList [n-1], cls = TCLink, ** linkBW) imprimir "*** Rede inicial" net.build () c0.start () para sw in SwitchList: sw.start ([c0]) # usando o arp estático, os hosts não precisam executar o protocolo arp. Acelere a emulação. h1.cmd ('arp -s' + h2.IP () + '' + h2.MAC ()) h1.cmdPrint ('arp -n') h2.cmd ('arp -s' + h1.IP () + '' + h1.MAC ()) h2.cmdPrint ('arp -n') #print "*** Running CLI" CLI (rede) imprimir "*** parar a rede" net.stop () se __name__ == '__main__': setLogLevel ('info') topologia ()
class __init__(object): """description of class""" #Start main menu CLI.CLI().start()
#! /usr/bin/env python3 import network import CLI if __name__ == '__main__': t = CLI.CLI(1,'172.30.0.121',10000) t.start()
#! /usr/bin/env python import network import CLI if __name__ == '__main__': sites = [(1, 'localhost', 9991), (2, 'localhost', 9992), (3, 'localhost', 9993), (4, 'localhost', 9994), (5, 'localhost', 9995)] t = CLI.CLI(3, sites, 'localhost', 9993, 'localhost', 9999) t.start()
#! /usr/bin/env python3 import network import CLI if __name__ == '__main__': t = CLI.CLI(1, '172.30.0.51', 10000) t.start()
#! /usr/bin/env python3 import network import CLI if __name__ == '__main__': t = CLI.CLI(1,'172.30.0.76',10000) t.start()
def main(): cli = CLI.CLI() cli.parser()
d = DBInterface() s = PeriscopeQuery(1250502) d.add_router_result(s) # item = d.sql("SELECT * FROM router_info WHERE caida_id=5533437") # for thing in item: # print(thing) exit(0) query = PeriscopeQuery() ## create query object hosts = query.get_lg_nodes() # add all nodes query.traceroute( destination= "162.151.38.197", ## perform traceroute from each host to 162.151.38.197 hosts=hosts, verbose=True) query.check_status(verbose=True) ## check status of request with Periscope API s = StorageInterface() ## save query s.save_query(query) exit(0) ###################### CLI ######################## CLI().cmdloop() exit(0)
rqpath1 = "DGET " + rqpathptr + "/" UFTPC_Send(socket_info,rqpath1) def UFTP_Client(): #when client starts up: request server IP/UDP Port and establish socket socket_info = UFTPC_Get_Socket() socket_info[0].bind(('',0)) rqpath = UFTP_DLL.Client_InitTree() rqpathptr = UFTP_DLL.Client_StringAt(rqpath).decode("utf-8") UFTPC_Init_Tree(socket_info,rqpathptr) UFTPC_CLI(socket_info) if __name__ == "__main__": try: #grab CLI object for setting variables CLI_Class = CLI.CLI() #ask user if debugs should be enabled flag = input("Debug? <y/n> ").lower() if(flag == 'y'): #if debugs are to be enabled, set appropriate flags debug=1 CLI_Class.debug = 1 UFTP_Sockets.debug = 1 else: #if debugs are not to be enabled, clear appropriate flags debug=0 CLI_Class.debug = 0 client_send_port = 0 sys.exit(UFTP_Client()) except SystemExit: print('Quit the Thread.')