【问题标题】:Is there an efficienct way to get field offset in pyshark有没有一种有效的方法来获取 pyshark 中的字段偏移
【发布时间】:2019-02-28 10:26:45
【问题描述】:

有没有一种有效的方法来获取使用pyshark 捕获的数据包中某些字段的偏移量? 例如,我需要在整个数据包中或在数据包中的某个层标头中获取源 IP 的偏移量。有可能吗?

【问题讨论】:

    标签: python packet pyshark


    【解决方案1】:

    我能够解决我的问题。这是一个示例代码:

    import pyshark
    
    packets = pyshark.FileCapture(input_file=pcap_file_dir)
    print(int(packets[0].ip.src.pos)) # Prints the offset of source IP
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-08-22
      • 1970-01-01
      • 2011-11-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多