zoukankan      html  css  js  c++  java
  • frigate_TUNNEL

    #coding=utf-8

    Result=open('result.txt',"w")

    FileTunnel = open('tunnel.txt').readlines()

    New_dict = {}

    UpSum=0

    DownSum=0

    #NumBer=0  #计数次数

    for Line in FileTunnel:  

      #print Line  Protocol = Line.split()[6]   

      OriginalIp = Line.split()[8]  

      UpLoad = Line.split()[10]  

      DownLoad = Line.split()[11]  

      Type = Line.split()[20]  

      Domain = Line.split()[21]  

      if New_dict.has_key(OriginalIp):   

      #NumBer+=1   

        UpSum+=int(UpLoad)   

        DownSum+=int(DownLoad)  

        UpDictValue = Protocol,OriginalIp,UpSum,DownSum,Type,Domain,int(New_dict[OriginalIp][6])+1   

        New_dict[OriginalIp] = UpDictValue   

        #print OriginalIp,int(New_dict[OriginalIp][2]),int(New_dict[OriginalIp][3])  

         continue  

         #print New_dict[OriginalIp],UpSum,DownSum  

      DictValue = Protocol,OriginalIp,UpLoad,DownLoad,Type,Domain,1  

      New_dict[OriginalIp] = DictValue  

      #print "OUTPUT:",DictValue

    #print New_dict["222.186.3.50:80"]

    for x,y in New_dict.items():  

    Result.writelines(str(y)+' ')

  • 相关阅读:
    chrome.declarativeWebRequest
    webRequest模块的解读
    C#连接池
    sftp
    Lynx
    LD_PRELOAD & LD_LIBRARY_PATH 动态库路径
    libc.so.6 误删后修复
    man 转 pdf _____ jpg 转 pdf
    here文档
    lsof fuser
  • 原文地址:https://www.cnblogs.com/monsteryang/p/6913979.html
Copyright © 2011-2022 走看看