[dhcp] Include gPXE version number within DHCP request
This commit is contained in:
parent
3e220aa73e
commit
ba1016f378
|
@ -123,6 +123,7 @@ MM_VERSION = $(VERSION_MAJOR).$(VERSION_MINOR)
|
||||||
VERSION = $(MM_VERSION).$(VERSION_PATCH)$(EXTRAVERSION)
|
VERSION = $(MM_VERSION).$(VERSION_PATCH)$(EXTRAVERSION)
|
||||||
CFLAGS += -DVERSION_MAJOR=$(VERSION_MAJOR) \
|
CFLAGS += -DVERSION_MAJOR=$(VERSION_MAJOR) \
|
||||||
-DVERSION_MINOR=$(VERSION_MINOR) \
|
-DVERSION_MINOR=$(VERSION_MINOR) \
|
||||||
|
-DVERSION_PATCH=$(VERSION_PATCH) \
|
||||||
-DVERSION=\"$(VERSION)\"
|
-DVERSION=\"$(VERSION)\"
|
||||||
IDENT = '$(@F) $(VERSION) (GPL) etherboot.org'
|
IDENT = '$(@F) $(VERSION) (GPL) etherboot.org'
|
||||||
version :
|
version :
|
||||||
|
|
|
@ -260,6 +260,9 @@ struct dhcp_packet;
|
||||||
*/
|
*/
|
||||||
#define DHCP_EB_REVERSE_PASSWORD DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0xc1 )
|
#define DHCP_EB_REVERSE_PASSWORD DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0xc1 )
|
||||||
|
|
||||||
|
/** gPXE version number */
|
||||||
|
#define DHCP_EB_VERSION DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0xeb )
|
||||||
|
|
||||||
/** iSCSI primary target IQN */
|
/** iSCSI primary target IQN */
|
||||||
#define DHCP_ISCSI_PRIMARY_TARGET_IQN 201
|
#define DHCP_ISCSI_PRIMARY_TARGET_IQN 201
|
||||||
|
|
||||||
|
|
|
@ -51,17 +51,16 @@
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
/** Declare a feature code for DHCP */
|
/** Declare a feature code for DHCP */
|
||||||
#define __dhcp_feature( category ) \
|
#define __dhcp_feature __table ( uint8_t, dhcp_features, 01 )
|
||||||
__table ( uint8_t, dhcp_features, category )
|
|
||||||
|
|
||||||
/** Construct a DHCP feature table entry */
|
/** Construct a DHCP feature table entry */
|
||||||
#define DHCP_FEATURE( category, feature_opt, version ) \
|
#define DHCP_FEATURE( feature_opt, ... ) \
|
||||||
_DHCP_FEATURE ( category, OBJECT, feature_opt, version )
|
_DHCP_FEATURE ( OBJECT, feature_opt, __VA_ARGS__ )
|
||||||
#define _DHCP_FEATURE( category, _name, feature_opt, version ) \
|
#define _DHCP_FEATURE( _name, feature_opt, ... ) \
|
||||||
__DHCP_FEATURE ( category, _name, feature_opt, version )
|
__DHCP_FEATURE ( _name, feature_opt, __VA_ARGS__ )
|
||||||
#define __DHCP_FEATURE( category, _name, feature_opt, version ) \
|
#define __DHCP_FEATURE( _name, feature_opt, ... ) \
|
||||||
uint8_t __dhcp_feature_ ## _name [] __dhcp_feature ( category ) = { \
|
uint8_t __dhcp_feature_ ## _name [] __dhcp_feature = { \
|
||||||
feature_opt, DHCP_BYTE ( version ) \
|
feature_opt, DHCP_OPTION ( __VA_ARGS__ ) \
|
||||||
};
|
};
|
||||||
|
|
||||||
/** A named feature */
|
/** A named feature */
|
||||||
|
@ -87,6 +86,10 @@ struct feature {
|
||||||
/** Declare a feature */
|
/** Declare a feature */
|
||||||
#define FEATURE( category, text, feature_opt, version ) \
|
#define FEATURE( category, text, feature_opt, version ) \
|
||||||
FEATURE_NAME ( category, text ); \
|
FEATURE_NAME ( category, text ); \
|
||||||
DHCP_FEATURE ( category, feature_opt, version );
|
DHCP_FEATURE ( feature_opt, version );
|
||||||
|
|
||||||
|
/** Declare the version number feature */
|
||||||
|
#define FEATURE_VERSION( ... ) \
|
||||||
|
DHCP_FEATURE ( DHCP_ENCAPSULATED ( DHCP_EB_VERSION ), __VA_ARGS__ )
|
||||||
|
|
||||||
#endif /* _GPXE_FEATURES_H */
|
#endif /* _GPXE_FEATURES_H */
|
||||||
|
|
|
@ -38,6 +38,7 @@
|
||||||
#include <gpxe/dhcp.h>
|
#include <gpxe/dhcp.h>
|
||||||
#include <gpxe/dhcpopts.h>
|
#include <gpxe/dhcpopts.h>
|
||||||
#include <gpxe/dhcppkt.h>
|
#include <gpxe/dhcppkt.h>
|
||||||
|
#include <gpxe/features.h>
|
||||||
|
|
||||||
/** @file
|
/** @file
|
||||||
*
|
*
|
||||||
|
@ -93,6 +94,9 @@ static struct dhcp_options dhcp_request_options = {
|
||||||
static uint8_t dhcp_features[0] __table_start ( uint8_t, dhcp_features );
|
static uint8_t dhcp_features[0] __table_start ( uint8_t, dhcp_features );
|
||||||
static uint8_t dhcp_features_end[0] __table_end ( uint8_t, dhcp_features );
|
static uint8_t dhcp_features_end[0] __table_end ( uint8_t, dhcp_features );
|
||||||
|
|
||||||
|
/** Version number feature */
|
||||||
|
FEATURE_VERSION ( VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH );
|
||||||
|
|
||||||
/** DHCP network device descriptor */
|
/** DHCP network device descriptor */
|
||||||
struct dhcp_netdev_desc {
|
struct dhcp_netdev_desc {
|
||||||
/** Bus type ID */
|
/** Bus type ID */
|
||||||
|
|
Reference in New Issue