當前位置: 首頁>>代碼示例>>Python>>正文


Python PacketList.timeskew_graph方法代碼示例

本文整理匯總了Python中scapy.plist.PacketList.timeskew_graph方法的典型用法代碼示例。如果您正苦於以下問題:Python PacketList.timeskew_graph方法的具體用法?Python PacketList.timeskew_graph怎麽用?Python PacketList.timeskew_graph使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在scapy.plist.PacketList的用法示例。


在下文中一共展示了PacketList.timeskew_graph方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _packetlist_timeskew_graph

# 需要導入模塊: from scapy.plist import PacketList [as 別名]
# 或者: from scapy.plist.PacketList import timeskew_graph [as 別名]
def _packetlist_timeskew_graph(self, ip, **kargs):
    """Tries to graph the timeskew between the timestamps and real time for a given ip"""
    res = map(lambda x: self._elt2pkt(x), self.res)
    b = filter(lambda x:x.haslayer(IP) and x.getlayer(IP).src == ip and x.haslayer(TCP), res)
    c = []
    for p in b:
        opts = p.getlayer(TCP).options
        for o in opts:
            if o[0] == "Timestamp":
                c.append((p.time,o[1][0]))
    if not c:
        warning("No timestamps found in packet list")
        return
    #d = map(lambda (x,y): (x%2000,((x-c[0][0])-((y-c[0][1])/1000.0))),c)
    d = map(lambda a: (a[0]%2000,((a[0]-c[0][0])-((a[1]-c[0][1])/1000.0))),c)
    return plt.plot(d, **kargs)

#PacketList.timeskew_graph = types.MethodType(_packetlist_timeskew_graph, None)


### Create a new packet list 
開發者ID:entynetproject,項目名稱:arissploit,代碼行數:23,代碼來源:inet.py

示例2: defragment

# 需要導入模塊: from scapy.plist import PacketList [as 別名]
# 或者: from scapy.plist.PacketList import timeskew_graph [as 別名]
def defragment(plist):
    """defragment(plist) -> plist defragmented as much as possible """
    return _defrag_logic(plist, complete=True)


# Add timeskew_graph() method to PacketList 
開發者ID:secdev,項目名稱:scapy,代碼行數:8,代碼來源:inet.py


注:本文中的scapy.plist.PacketList.timeskew_graph方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。