Hi,
I'm trying to craft a DHCP packet to test my DHCP server.
I recorded some dhcp-requests with a mac and my linux pc with wireshark and now wanted to replay these and want to know why the server sometimes isn't responding.
This is my code:
PacketSender sender("enp0s25");
NetworkInterface iface = NetworkInterface::default_interface();
NetworkInterface::Info info = iface.addresses();
IP pkt = IP("192.168.0.75") / UDP(67, 68) / DHCP();
pkt.rfind_pdu<DHCP>().chaddr(info.hw_addr);
pkt.rfind_pdu<DHCP>().type(DHCP::REQUEST);
pkt.rfind_pdu<DHCP>().add_option(DHCP::DHCP_CLIENT_IDENTIFIER);
pkt.rfind_pdu<DHCP>().end();
sender.send(pkt);
Everything is fine and the server get the message, but now I want to add some data to the option DHCP_CLIENT_IDENTIFIER.
How can I do that?
Karsten