summaryrefslogtreecommitdiffstats
path: root/src/include/gpxe/dhcp.h
diff options
context:
space:
mode:
authorMichael Brown2008-03-25 21:46:16 +0100
committerMichael Brown2008-03-25 21:46:16 +0100
commit92d15eff30410dcb0ec406e06b131fb7d9179ffd (patch)
tree191d29013372b541d353bbfa55114b8060dd557c /src/include/gpxe/dhcp.h
parent[PXEXT] Avoid returning a false EOF when we have an empty buffer queued (diff)
downloadipxe-92d15eff30410dcb0ec406e06b131fb7d9179ffd.tar.gz
ipxe-92d15eff30410dcb0ec406e06b131fb7d9179ffd.tar.xz
ipxe-92d15eff30410dcb0ec406e06b131fb7d9179ffd.zip
[Settings] Remove assumption that all settings have DHCP tag values
Allow for settings to be described by something other than a DHCP option tag if desirable. Currently used only for the MAC address setting. Separate out fake DHCP packet creation code from dhcp.c to fakedhcp.c. Remove notion of settings from dhcppkt.c. Rationalise dhcp.c to use settings API only for final registration of the DHCP options, rather than using {store,fetch}_setting throughout.
Diffstat (limited to 'src/include/gpxe/dhcp.h')
-rw-r--r--src/include/gpxe/dhcp.h29
1 files changed, 14 insertions, 15 deletions
diff --git a/src/include/gpxe/dhcp.h b/src/include/gpxe/dhcp.h
index bc0e9a3b..94cc2010 100644
--- a/src/include/gpxe/dhcp.h
+++ b/src/include/gpxe/dhcp.h
@@ -15,8 +15,8 @@
struct net_device;
struct job_interface;
+struct dhcp_options;
struct dhcp_packet;
-struct settings;
/** BOOTP/DHCP server port */
#define BOOTPS_PORT 67
@@ -179,15 +179,6 @@ struct settings;
*/
#define DHCP_EB_SIADDR DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 3 )
-/** MAC address
- *
- * This option is used internally to contain the network device
- * hardware address, in order to provide a consistent approach to
- * storing and processing options. It should never be present in a
- * DHCP packet.
- */
-#define DHCP_EB_MAC DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 4 )
-
/*
* Tags in the range 0x10-0x7f are reserved for feature markers
*
@@ -445,11 +436,19 @@ struct dhcphdr {
/** Maximum time that we will wait for ProxyDHCP offers */
#define PROXYDHCP_WAIT_TIME ( TICKS_PER_SEC * 1 )
-extern int create_dhcpdiscover ( struct net_device *netdev,
- void *data, size_t max_len );
-extern int create_dhcpack ( struct net_device *netdev,
- void *data, size_t max_len );
-extern int create_proxydhcpack ( struct net_device *netdev,
+/** Settings block name used for DHCP responses */
+#define DHCP_SETTINGS_NAME "dhcp"
+
+/** Settings block name used for ProxyDHCP responses */
+#define PROXYDHCP_SETTINGS_NAME "proxydhcp"
+
+extern int create_dhcp_packet ( struct dhcp_packet *dhcppkt,
+ struct net_device *netdev, uint8_t msgtype,
+ struct dhcp_options *options,
+ void *data, size_t max_len );
+extern int create_dhcp_request ( struct dhcp_packet *dhcppkt,
+ struct net_device *netdev,
+ struct dhcp_packet *dhcpoffer,
void *data, size_t max_len );
extern int start_dhcp ( struct job_interface *job, struct net_device *netdev );