[ipv6] Add ndp_tx_router_solicitation() to send router solicitations

Signed-off-by: Michael Brown <mcb30@ipxe.org>
[parseopt] Add parse_timeout()

Parsing a timeout value (specified in milliseconds) into an internal
timeout value measured in timer ticks is a common operation.  Provide
a parse_timeout() value to carry out this conversion automatically.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
[netdevice] Make all net_driver methods optional

Most network upper-layer drivers do not implement all three methods
(probe, notify, and remove).  Save code by making all methods
optional.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
[interface] Default to calling intf_restart() in response to intf_close()

If an object interface does not provide an intf_close() method, then
default to calling intf_restart().  This allows static objects to
safely ignore intf_close(), without needing to add code solely to
ensure that the interface gets unplugged.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
[job] Allow job_progress() to return an ongoing job status code, if known

Some background jobs have a meaningful ongoing status code (e.g. the
current link status for a job waiting for a network link to come up).
Allow this to be exposed via the job_progress() method.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
[monojob] Add timeout parameter to monojob_wait()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
[monojob] Report ongoing job status as overall return status on timeout

If a job times out then use the most recent ongoing error status
reported via job_progress() (if available) as the overall return
status.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
[cmdline] Rewrite "sync" command to use monojob_wait()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
[autoboot] Fix shell banner timeout

Commit 5e1fa5c ("[parseopt] Add parse_timeout()") introduced a
regression causing the shell banner timeout value (calculated in
milliseconds) to be treated as a timer tick count, resulting in a
timeout of approximately two minutes rather than the intended two
seconds.

Reported-by: Christian Hesse <list@eworm.de>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
[ifmgmt] Rewrite iflinkwait() to use monojob_wait()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
[cmdline] Allow "if<xxx>" commands to take options

Allow commands implemented using ifcommon_exec() to accept
command-specific options.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
[netdevice] Add generic concept of a network device configurator

iPXE supports multiple mechanisms for network device configuration:
DHCPv4 for IPv4, FIP for FCoE, and SLAAC for IPv6.  At present, DHCPv4
requires an explicit action (e.g. a "dhcp" command), FIP is initiated
implicitly upon opening a network device, and SLAAC takes place
whenever a RA happens to be received.

Add a generic concept of a network device configurator, which provides
a common interface to triggering configuration and to reporting the
result of the configuration process.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
[dhcp] Add DHCP network device configurator

Provide an interface to DHCP via the generic network device
configurator mechanism.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
[parseopt] Add parse_netdev_configurator()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
[ifmgmt] Add ifconf() to carry out network device configuration

Signed-off-by: Michael Brown <mcb30@ipxe.org>
[autoboot] Use ifconf() to configure network device

Signed-off-by: Michael Brown <mcb30@ipxe.org>
[cmdline] Add "ifconf" command

Signed-off-by: Michael Brown <mcb30@ipxe.org>
[cmdline] Make "dhcp" command a synonym for "ifconf"

Signed-off-by: Michael Brown <mcb30@ipxe.org>
[dhcp] Remove obsolete dhcp() function

All functionality provided by dhcp() has now been obviated by the more
generic ifconf().

Signed-off-by: Michael Brown <mcb30@ipxe.org>
[ipv6] Add IPv6 network device configurator

Include IPv6 within the generic network device configurator
mechanism.  The IPv6 configurator will send a router solicitation and
wait for a router advertisement to be received.  (As per RFC4861
section 6.3.7, we do this even if advertisements have been received
prior to sending the router solicitation.)

Signed-off-by: Michael Brown <mcb30@ipxe.org>