dhcp: Add DHCP protocol structures and initial defines

Create a new directory to host DHCP components.
dhcp: Add DHCP client initialization

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.
dhcp: Add test for DHCP client initialization and parameter setting
build: Add initial build support

The client test program is the only one to be built so far.
dhcp: Add option appending and parsing

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.
dhcp: Add buffer length and invalid cookie tests for DHCP options

Create an initial simple test program for these two cases.
build: Add DHCP option test
dhcp: Add tests for DHCP options, file and sname fields

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.
dhcp: Add option append tests

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.
dhcp: Add test function for computing checksum
shared: Add struct sockaddr_ll to sockaddr_union
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.
dhcp: Add DHCP discover sending

On starting the client, use the supplied interface mac address and create
a transaction id. Puzzle together an IP/UDP/DHCP Discover message, compute
checksums and send it out as a raw packet.

Create an additional function that constructs default options common to
all DHCP messages.

Set the DHCP Client ID option as noticed by Grant Erickson in ConnMan
commit b18d9798b3a0ae46ed87d6d2be8d5a474bf3ab1e:

   "Some Internet gateways and Wi-Fi access points are unhappy when the
    DHCPv4 client-id option (61) is missing and will refuse to issue a
    DHCP lease."
build: Add libsystemd-dhcp
dhcp: Add test for discover DHCP packet creation

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.
dhcp: Support seconds elapsed since start of DHCP negotiation

It was noticed by Grant Erickson in ConnMan commit
95e15c09350acf58d4707056ae2614570883ef66 that:

   "Certain DHCP servers, such as that implemented in Mac OS X
    (< 10.7) for its "Internet Sharing" feature, refuse to issue
    a DHCP lease to clients that have not set a non-zero value
    in their DISCOVER or REQUEST packets."
dhcp: Add function to stop the DHCP client

The client is stopped and brought back to its initial state.
build: Add dependency on libsystemd-bus needed for main loop
dhcp: Add timeout and main loop support

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.
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.