summaryrefslogtreecommitdiff
path: root/src/libsystemd-dhcp
AgeCommit message (Collapse)Author
2013-12-12dhcp: Add function for sending a raw packetPatrik Flykt
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-12dhcp: Add test function for computing checksumPatrik Flykt
2013-12-12dhcp: Add option append testsPatrik Flykt
Add checks for invalid lengths and parameters when using the option appending function. Add also checks for adding options, see to it that the resulting array is identical to the array of options added.
2013-12-12dhcp: Add tests for DHCP options, file and sname fieldsPatrik Flykt
Add a structure describing the DHCP file, sname and trailing options fields. Create a messge holding these fields and call the internal option parsing function. In the test callback function verify that only regular options are passed and figure out which part of the DHCP message is the one that is being processed. As the test program knows the full contents of the test options in the test structure, skip all non-regular fields and verify that the option provided to the callback indeed is the one expected. Check also if non-regular option fields are to be ignored in the end of the option field as the callback is not called again and the final check when the whole message has been processed needs to be successful. Add a boolean flag for pretty-printing, anticipate there will be a nice option to toggle it in the future.
2013-12-12dhcp: Add buffer length and invalid cookie tests for DHCP optionsPatrik Flykt
Create an initial simple test program for these two cases.
2013-12-12dhcp: Add option appending and parsingPatrik Flykt
Add functions to append and parse DHCP options. Not all options are passed to the callback function, the ones not exposed are pad, end, message type and overload. If indicated by the overload option, file and sname fields will be examined for more options. The option functions are internal to DHCP, add a new header files for interal function prototypes.
2013-12-12build: Add initial build supportPatrik Flykt
The client test program is the only one to be built so far.
2013-12-12dhcp: Add test for DHCP client initialization and parameter settingPatrik Flykt
2013-12-12dhcp: Add DHCP client initializationPatrik Flykt
Provide functionality for initializing a DHCP client struct, setting interface index, last used address and additional options to request. On initialization the most useful options are added by default.