-
Notifications
You must be signed in to change notification settings - Fork 1
Support for native vlan id on command line with interfaces #25
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
base: main
Are you sure you want to change the base?
Conversation
…faces on command line.
zonque
left a comment
There was a problem hiding this 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(); |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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".
|
Daniel,
Absolutely. My internal list expands PCAP to:
- play back multiple together (interleave timestamps) - this is where
native was targeted to be added
- write pcap from sources for later review.
Jay
…On Mon, Nov 10, 2025 at 2:45 AM Daniel Mack ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/source.rs
<#25 (comment)>:
> @@ -495,7 +524,7 @@ pub async fn create_pcap_receiver(pcap_path: &str) -> Result<RawSocketReceiver>
}
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) {
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".
—
Reply to this email directly, view it on GitHub
<#25 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABJGJQL5IQFBAJNJVGBHQL34BGDLAVCNFSM6AAAAACLB35PPCVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTINBRGY2DINZXGU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
|
Reviewed the pcap file formats - both original pcap and pcap-ng. My recommendations for the todo list:
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.
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? |
Added support for specifying native vlan on the command line when specifying specific interfaces.