summaryrefslogtreecommitdiff
path: root/src/libsystemd-dhcp/test-dhcp-client.c
AgeCommit message (Collapse)Author
2013-12-12dhcp: Handle received DHCP Offer messagePatrik Flykt
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-12dhcp: Add timeout and main loop supportPatrik Flykt
Require a main loop to be set when creating a DHCP client. Set up a timer to resend DHCP Discover messages and add a 0-2 second delay to the timeout value. Move to state Selecting after successful sending of a Discover message.
2013-12-12dhcp: Add test for discover DHCP packet creationPatrik Flykt
Set a fake MAC address and emulate raw packet sending. When the buffer containing the Discover message is received, check selected IP and UDP headers and compute IP header and UDP message checksums. Also send the DHCP message for option parsing and expect a successful outcome.
2013-12-12dhcp: Add test function for computing checksumPatrik Flykt
2013-12-12dhcp: Add test for DHCP client initialization and parameter settingPatrik Flykt