Scapy

import pandas as pd
from scapy.all import rdpcap
from scapy.all import IP

packets = rdpcap("input.pcap")

records = []
for i, pkt in enumerate(packets):
    if IP in pkt:
        records.append({"idx": i, "time": pkt[IP].time, "src": pkt[IP].src, "dst": pkt[IP].dst, "id": pkt[IP].id, "len": pkt[IP].len})
    else:
        records.append({"idx": i, "time": pkt[IP].time, "src": None, "dst": None, "id": None, "len": None})

df = pd.DataFrame(records)

Daiphys is a professional services company in research and development of leading-edge technologies in science and engineering.
Get started accelerating your business through our deep expertise in R&D with AI, quantum computing, and space development; please get in touch with Daiphys today!

Name*


Email*


Subject


Message*




* Indicates required field

Daiphys Technologies LLC - https://www.daiphys.com/

  • Last modified: 2025/09/22 03:15
  • by Daiphys