Changeset 151 for trunk

Show
Ignore:
Timestamp:
01/14/11 14:21:44 (12 years ago)
Author:
andreu
Message:

Warning at beginning fixed

Location:
trunk/tool
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/tool/renetcolGUI.py

    r148 r151  
    4545import commands 
    4646from optparse import OptionParser 
     47 
     48global localAddr, localPort, os_type 
    4749 
    4850########### DEFAULT VALUES, YOU MUST CHANGE IT ############################### 
     
    11871189     
    11881190if __name__ == "__main__": 
    1189     global window, mainTT, comboRouter, os_type, printShit 
    1190     global localAddr, localPort 
     1191    global window, mainTT, comboRouter, printShit 
    11911192     
    11921193    gtk.gdk.threads_init() 
  • trunk/tool/renetcolRC.py

    r150 r151  
    44##  Authors: ANDREU Francois-Xavier  
    55  
    6 ##  Copyright (C) 2010 GIP RENATER  
     6##  Copyright (C) 2010-2011 GIP RENATER  
    77  
    88 
     
    3939from optparse import OptionParser 
    4040 
     41global localAddr, localPort 
     42global rrt, record, record_file_name 
     43 
    4144########### DEFAULT VALUES, YOU MUST CHANGE IT ############################### 
    4245IPversion = 4 
     
    5457printValue =      [ 0,1,1,0,1,0,0,1,1,0, # 0 to 9 
    5558                    0,1,1,0,0,0,1,1,0,0, # 10... 
    56                     1,0,0,0,0,0,0,1,1,0, # 
     59                    0,1,0,0,0,0,0,1,1,0, # 
    5760                    0,0,0,0,0,0,0,0,0,0, # 
    5861                    0,0,0,0,0,0,1,1,0,0, # 
     
    97100                    0,0,0,0,0,0,0,0,0,0 # 130 to 139 
    98101                    ] 
    99 fieldsName =  [ "","IN_BYT","IN_PKTS","","PROT","TOS","TCP_FL","S_PORT","IPv4@S","S_MASK", 
     102fieldsName =  [ "","IN_BYTES","IN_PKTS","","PROT","TOS","TCP_FL","S_PORT","IPv4@S","S_MASK", 
    100103                "InSNMP","D_PORT","IPv4@D","D_MASK","OutSNMP","NextHop","S_AS","D_AS","","", 
    101                 "TTL","TTL","","","","","","IPv6@S","IPv6@D","IPv6_S_MASK", 
     104                "LT","AGE","","","","","","IPv6@S","IPv6@D","IPv6_S_MASK", 
    102105                "IPv6_D_MASK","","","","","","","","","", 
    103106                "","","","","","","M_T_L_T","M_T_L_@","","", 
    104107                "","","","","","","","","","", 
    105                 "","","","","","","","","","ROUTER", 
     108                "","","","","","","","","","ROUTER;TIMESTAMP", 
    106109                "M_L_1","M_L_2","M_L_3","M_L_4","M_L_5","M_L_6","M_L_7","M_L_8","M_L_9","M_L_10", 
    107110                "","","","","","","","","","", # 80 to 89 
     
    125128router=0 
    126129tpl_def = {} 
    127 os_type = 0 
    128130oldTpl = 0 
    129131oldTplW = 0 
     
    297299        strFlow = "" 
    298300        strField = "" 
    299         underscore_line = "" 
     301        underscore_line = "#" 
    300302        flowCptW+=1 
    301303        if (flowCptW%6 == 0 or oldTplW != self.flow[0]): 
    302 ##        if (flowCpt%100 == 0):  
     304##        if (flowCpt%100 == 0): 
     305            strField = "#" 
    303306            flowCptW = 0 
    304307            for i in range (0, len(tpl_def[self.flow[0]])): 
     
    323326                        else: 
    324327                            tabNb = int((16-l)/8) + 1 
    325                         for j in range (0, tabNb):  
    326                             strField += ";" 
     328                        #for j in range (0, tabNb):  
     329                        strField += ";" 
    327330                        for k in range (0, 16): 
    328331                            underscore_line += "-" 
     
    350353                    record_file.write(strField) 
    351354                    record_file.write("\n") 
    352                     record_file.write(underscore_line) 
    353                     record_file.write("\n") 
     355#                    record_file.write(underscore_line) 
     356#                    record_file.write("\n") 
    354357        for i in range (0, len(tpl_def[self.flow[0]])): 
    355358            f = tpl_def[self.flow[0]][i][0] 
     
    565568if __name__ == "__main__": 
    566569    global comboRouter, os_type, printShit 
    567     global localAddr, localPort 
    568     global rrt, record, record_file_name 
    569  
     570 
     571    os_type = 0 
    570572    print "" 
    571573    print "" 
     
    589591 
    590592    parser = OptionParser() 
    591     parser.add_option("-o", "--output", dest="out", help ="Output filename prefix, ex: \"/tmp/myrecord\", timestamp will be add to the filename") 
     593    parser.add_option("-o", "--output", dest="out", help ="Output filename prefix, ex: \"/tmp/myrecord\", timestamp will be added to the filename") 
    592594    parser.add_option("-t", "--time", dest="tim", help ="Round robin interval (in seconde), default is \"3600\" for 1h") 
    593595    (options, args) = parser.parse_args() 
     
    606608    print "" 
    607609    print "" 
    608     print " ---------------------------------------" 
    609     print "  STARTING RECORD ROTATION" 
    610     print "  with following parameters:" 
    611     print "  output filename prefix :",outputFileName 
    612     print "  interval: ",rrt, " seconds" 
    613     print " ---------------------------------------" 
     610    print "---------------------------------------" 
     611    print " STARTING RECORD ROTATION" 
     612    print " with following parameters:" 
     613    print " output filename prefix :",outputFileName 
     614    print " interval: ",rrt, " seconds" 
     615    print "---------------------------------------" 
    614616    now2 = time.time() 
    615617    reste = rrt-(operator.mod(now2,rrt))