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

Dhcp example #670

Open
zszep opened this issue Dec 18, 2023 · 1 comment
Open

Dhcp example #670

zszep opened this issue Dec 18, 2023 · 1 comment

Comments

@zszep
Copy link

zszep commented Dec 18, 2023

Is there any example on how to read and decode dhcp traffic? Couldn't find anything on this site, only the dhcp.rs source code.

@Martichou
Copy link
Contributor

Here you go: (I'll make a PR to add an example)

let ipv4_packet: Ipv4Packet = Ipv4Packet::new(ethernet.payload()).unwrap();
let udp_packet: UdpPacket = UdpPacket::new(ipv4_packet.payload()).unwrap();
let dhcp_packet: DhcpPacket = DhcpPacket::new(udp_packet.payload()).unwrap()

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

No branches or pull requests

2 participants