Is there an efficient way to get the offset of some field in a packet captured with pyshark
?
For example, I need to get the offset of the source IP within the whole packet or within some layer header in the packet. Is it possible?
I was able to solve my issue. Here is a sample code:
import pyshark
packets = pyshark.FileCapture(input_file=pcap_file_dir)
print(int(packets[0].ip.src.pos)) # Prints the offset of source IP