conf: Network - add ability to read/write XML DHCP state

Maintain backwards XML compatibility by assuming existing default values
and only adding the additional XML properties if settings are not
default.

Signed-off-by: TJ <linux@iam.tj>
conf: Network - add pointers to enabled virNetworkIpDef DHCP settings

Having previously introduced DHCP enabled and relay state within the
virNetworkIpDef structure - which can be one of many on each network -
these pointers allow us to track and easily access the DHCP state for
IPv4 and IPv6 when setting up the network without having to iterate
every virNetworkIpDef to find the DHCP state.

Signed-off-by: TJ <linux@iam.tj>
conf: Network - keep track of active DHCP stanza in virNetworkDef

To avoid iterating all virNetworkIpDef entries when determining
DHCP state keep track of the first enabled DHCP stanza in the
network definition itself, for both IPv4 and IPv6.

A by-product of this change is it allows the XML to contain more
than one IP->DHCP stanza. The active DHCP stanza is the first enabled
DHCP stanza.
All other stanzas are retained which adds flexibility when multiple
interfaces and routes might come and go since an alternative DHCP
stanza can be selected and a refresh operation performed without
needing to destroy/edit/start the network.

Signed-off-by: TJ <linux@iam.tj>
network: Bridge - use IPv4 and IPv6 active DHCP stanza pointers

Rather than iterate through virNetworkIPDef arrays multiple times
use the new virNetworkDef ipv4_dhcp and ipv6_dhcp active stanza
pointers.

Signed-off-by: TJ <linux@iam.tj>
network: Bridge - Add support for a DHCP Relay Agent

A DHCP relay daemon will be started that will forward all DHCP/BOOTP
requests on the bridge network via the first declared forward
interface. The relay is broadcast rather than routed so no IP address
is needed on the bridge.

The XML <relay> element's "relay" property of the active DHCP stanza
defaults to 'no'. Set it to 'yes' to enable the relay:

<ip ...>
 <dhcp relay='yes'/>
</ip>

The relay will not be started if the "enable" property is 'no':

<ip ...>
 <dhcp enable='no' relay='yes'/>
</ip>

Signed-off-by: TJ <linux@iam.tj>
network: Bridge - don't offer dnsmasq DHCP services when DHCP relay is enabled

When dnsmasq's DNS services are required but the network is configured
to use a DHCP relay agent (other than dnsmasq's proxy services) the
configuration generated for dnsmasq should not enable DHCP services.

Signed-off-by: TJ <linux@iam.tj>
configure: Add DHCPRELAY to the set of external program definitions

This variable should name the path to the system's DHCP relay daemon.

At this time the expected daemon is "dhcp-helper", a DHCP relay agent
from Simon Kelly, author of dnsmasq.

The supporting code, however, has been designed to work with any
suitable DHCP relay agent. Later patches could allow configuration
of the agent's command-line arguments.

Currently the chosen agent must support:

-b <bridge_interface> (the virtual network to listen on)
-i <physical_interface> (the interface to broadcast on)
-r </path/to/pid.file> (the PID file of the daemon)

Signed-off-by: TJ <linux@iam.tj>
Add copyright attribution for DHCP relay functionality

Signed-off-by: TJ <linux@iam.tj>
docs: Describe the <dhcp> 'enable' and 'relay' attributes

Signed-off-by: TJ <linux@iam.tj>