Commit graph

2 commits

Author SHA1 Message Date
Patrik Flykt 8c00042c93 dhcp: Handle received DHCP Offer message
Create a function for handling the full IP, UDP and DHCP packet
and tie it to the main loop. Verify IP and UDP headers and checksum.
Creat a new lease structure with using the values supplied in the
DHCP message. Free the lease structure when client is stopped.

Split out socket handling into a creation and a sending part. As a
result modify the test code.
2013-12-12 11:43:34 -05:00
Patrik Flykt 8b4a96932d dhcp: Add function for sending a raw packet
Open a packet socket, create a link level header, send packet and
close socket. Adding it to a separate file makes testing of the
DHCP sending much easier, as the test program can supply any socket
to the DHCP client code.
2013-12-12 11:43:34 -05:00