当前位置: 首页>>代码示例>>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;未经允许,请勿转载。