Skip to content

Conversation

@jhogg
Copy link
Contributor

@jhogg jhogg commented Nov 4, 2025

Added support for specifying native vlan on the command line when specifying specific interfaces.

Copy link
Collaborator

@zonque zonque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting use case. Could you mention that feature in the README as well please?

src/source.rs Outdated
for ifname in ifnames {
let iface_v4 = iface_addrs_by_name(ifname)?;
interfaces.push((ifname.clone(), iface_v4));
let parts: Vec<&str> = ifname.split(",").collect();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw, according to my brief research, commas are actually allowed in Windows device names 🤦
We should probably use : instead.

Ok(pcap_file::pcapng::Block::SimplePacket(spb)) => {
let packet_data = spb.data;
if let Some(raw_packet) = process_ethernet_packet(&packet_data, "pcap") {
if let Some(raw_packet) = process_ethernet_packet(&packet_data, "pcap", None) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, and I also missed this detail. I really think working with pcap files is immensely helpful, especially for more complex features, and hence we need to have a way to express "this pcap was captured with native VLAN X".

@jhogg
Copy link
Contributor Author

jhogg commented Nov 10, 2025 via email

@jhogg
Copy link
Contributor Author

jhogg commented Nov 27, 2025

Reviewed the pcap file formats - both original pcap and pcap-ng. My recommendations for the todo list:

  • Add support for native vlan to command line when using original pcap format.
  • Submit a request to the draft ietf working group to add if_native_vlan as a defined option to the IDB (interface data block) for pcap-ng and derive it from the idb with command line as a fall back.

https://ietf-opsawg-wg.github.io/draft-ietf-opsawg-pcap/draft-ietf-opsawg-pcapng.html#name-interface-description-block

The -ng format presents some interesting capabilities that it allows capture of multiple interfaces and allowed them to be added and removed during a capture, so a single "native_vlan" option is limiting.

Further discussion on pcap around existing tools or building something to allow editing / combining / splitting pcap-ng files.

…omma) to not conflict with some Windows interface names.
@zonque
Copy link
Collaborator

zonque commented Dec 3, 2025

Reviewed the pcap file formats - both original pcap and pcap-ng. My recommendations for the todo list:

Why not simply patch the VLAN in all packets for both formats in case a native VLAN was specified? We can later revisit the -ng format capabilities.

And could you still add something to the README so we can merge?

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.

2 participants