[pxe] Obey lists of PXE Boot Servers and associated Discovery Control bits

Various combinations of options 43.6, 43.7 and 43.8 dictate which
servers we send Boot Server Discovery requests to, and which servers
we should accept responses from.  Obey these options, and remove the
explicit specification of a single Boot Server from start_pxebs() and
dependent functions.
This commit is contained in:
Michael Brown
2009-02-05 09:30:32 +00:00
parent ff2b308506
commit 881f1f59ef
6 changed files with 195 additions and 62 deletions

View File

@@ -100,6 +100,19 @@ enum dhcp_pxe_discovery_control {
/** PXE boot server multicast address */
#define DHCP_PXE_BOOT_SERVER_MCAST DHCP_ENCAP_OPT ( DHCP_VENDOR_ENCAP, 7 )
/** PXE boot servers */
#define DHCP_PXE_BOOT_SERVERS DHCP_ENCAP_OPT ( DHCP_VENDOR_ENCAP, 8 )
/** PXE boot server */
struct dhcp_pxe_boot_server {
/** "Type" */
uint16_t type;
/** Number of IPv4 addresses */
uint8_t num_ip;
/** IPv4 addresses */
struct in_addr ip[0];
} __attribute__ (( packed ));
/** PXE boot menu */
#define DHCP_PXE_BOOT_MENU DHCP_ENCAP_OPT ( DHCP_VENDOR_ENCAP, 9 )
@@ -574,6 +587,9 @@ struct dhcphdr {
/** Maximum time that we will wait for ProxyDHCP responses */
#define PROXYDHCP_MAX_TIMEOUT ( 2 * TICKS_PER_SEC )
/** Maximum time that we will wait for Boot Server responses */
#define PXEBS_MAX_TIMEOUT ( 3 * TICKS_PER_SEC )
/** Settings block name used for DHCP responses */
#define DHCP_SETTINGS_NAME "dhcp"
@@ -593,6 +609,6 @@ extern int dhcp_create_request ( struct dhcp_packet *dhcppkt,
void *data, size_t max_len );
extern int start_dhcp ( struct job_interface *job, struct net_device *netdev );
extern int start_pxebs ( struct job_interface *job, struct net_device *netdev,
struct in_addr pxe_server, unsigned int pxe_type );
unsigned int pxe_type );
#endif /* _GPXE_DHCP_H */

View File

@@ -10,7 +10,6 @@
struct net_device;
extern int dhcp ( struct net_device *netdev );
extern int pxebs ( struct net_device *netdev, struct in_addr pxe_server,
unsigned int pxe_type );
extern int pxebs ( struct net_device *netdev, unsigned int pxe_type );
#endif /* _USR_DHCPMGMT_H */