[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.
This commit is contained in:
Michael Brown
2008-03-25 20:46:16 +00:00
parent ee5bdb0d75
commit 92d15eff30
24 changed files with 865 additions and 720 deletions
+5 -4
View File
@@ -9,15 +9,12 @@
#include <gpxe/dhcp.h>
#include <gpxe/dhcpopts.h>
#include <gpxe/settings.h>
/**
* A DHCP packet
*
*/
struct dhcp_packet {
/** Settings block */
struct settings settings;
/** The DHCP packet contents */
struct dhcphdr *dhcphdr;
/** Maximum length of the DHCP packet buffer */
@@ -28,7 +25,11 @@ struct dhcp_packet {
struct dhcp_options options;
};
extern void dhcppkt_init ( struct dhcp_packet *dhcppkt, struct refcnt *refcnt,
extern int dhcppkt_store ( struct dhcp_packet *dhcppkt, unsigned int tag,
const void *data, size_t len );
extern int dhcppkt_fetch ( struct dhcp_packet *dhcppkt, unsigned int tag,
void *data, size_t len );
extern void dhcppkt_init ( struct dhcp_packet *dhcppkt,
void *data, size_t len );
#endif /* _GPXE_DHCPPKT_H */