本文整理汇总了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