Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial PcapNG file format support #185

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

martinling
Copy link
Member

This draft PR adds initial support for the PcapNG file format.

The following features are supported:

  • Saving captures to a file with:
    • Native endianness
    • A single section header
    • A single interface with the USB_2_0 link type only
    • Nanosecond timestamp resolution
  • Loading captures from files with:
    • Any endianness
    • A single section header
    • A single interface with one of the following link types:
      • USB_2_0
      • USB_2_0_HIGH_SPEED
      • USB_2_0_FULL_SPEED
      • USB_2_0_LOW_SPEED
    • Any timestamp resolution

@martinling
Copy link
Member Author

Added support for metadata:

  • Storing metadata about the current capture in a CaptureMetadata type.
  • Loading and saving metadata in PcapNG files.
  • Generating appropriate metadata for Cynthion captures.
  • A UI dialog for viewing the capture metadata and editing the comment field.

Some further steps here are blocked on external issues:

  1. It's not currently possible to save the comment field in the section header, due to a lifetime issue in the pcap-file crate, which I have submitted a fix for:
    Support non-static lifetimes for PcapNgWriter blocks courvoif/pcap-file#41

  2. I'd like the user to be able to select between the generic USB_2_0 link type and the speed-specific e.g. USB_2_0_HIGH_SPEED link types when saving, as applicable to the current capture. This choice applies to both the Pcap and PcapNG formats, so would be best offered as an extra dropdown in the save dialog. This is blocked on a gtk4-rs bug which I've had a fix merged for, but we're still waiting on a new release before we can use it:
    Fix segfault in FileChooserExtManual::add_choice() gtk-rs/gtk4-rs#1834

@martinling
Copy link
Member Author

My gtk4-rs fix is now released in 0.9.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant