本文整理匯總了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
示例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