summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorMichael Brown2009-01-08 09:39:05 +0100
committerMichael Brown2009-01-08 09:39:05 +0100
commitba1016f3786081652fb02707ddc40a557523e3ff (patch)
tree4c1a732f12488982c57f2f511958ed7b9affc9cc /src/include
parent[main] Print an "initialising devices" banner (diff)
downloadipxe-ba1016f3786081652fb02707ddc40a557523e3ff.tar.gz
ipxe-ba1016f3786081652fb02707ddc40a557523e3ff.tar.xz
ipxe-ba1016f3786081652fb02707ddc40a557523e3ff.zip
[dhcp] Include gPXE version number within DHCP request
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gpxe/dhcp.h3
-rw-r--r--src/include/gpxe/features.h23
2 files changed, 16 insertions, 10 deletions
diff --git a/src/include/gpxe/dhcp.h b/src/include/gpxe/dhcp.h
index e89503d39..cd3964c55 100644
--- a/src/include/gpxe/dhcp.h
+++ b/src/include/gpxe/dhcp.h
@@ -260,6 +260,9 @@ struct dhcp_packet;
*/
#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 */
#define DHCP_ISCSI_PRIMARY_TARGET_IQN 201
diff --git a/src/include/gpxe/features.h b/src/include/gpxe/features.h
index e4d29213b..32c316947 100644
--- a/src/include/gpxe/features.h
+++ b/src/include/gpxe/features.h
@@ -51,17 +51,16 @@
/** @} */
/** Declare a feature code for DHCP */
-#define __dhcp_feature( category ) \
- __table ( uint8_t, dhcp_features, category )
+#define __dhcp_feature __table ( uint8_t, dhcp_features, 01 )
/** Construct a DHCP feature table entry */
-#define DHCP_FEATURE( category, feature_opt, version ) \
- _DHCP_FEATURE ( category, OBJECT, feature_opt, version )
-#define _DHCP_FEATURE( category, _name, feature_opt, version ) \
- __DHCP_FEATURE ( category, _name, feature_opt, version )
-#define __DHCP_FEATURE( category, _name, feature_opt, version ) \
- uint8_t __dhcp_feature_ ## _name [] __dhcp_feature ( category ) = { \
- feature_opt, DHCP_BYTE ( version ) \
+#define DHCP_FEATURE( feature_opt, ... ) \
+ _DHCP_FEATURE ( OBJECT, feature_opt, __VA_ARGS__ )
+#define _DHCP_FEATURE( _name, feature_opt, ... ) \
+ __DHCP_FEATURE ( _name, feature_opt, __VA_ARGS__ )
+#define __DHCP_FEATURE( _name, feature_opt, ... ) \
+ uint8_t __dhcp_feature_ ## _name [] __dhcp_feature = { \
+ feature_opt, DHCP_OPTION ( __VA_ARGS__ ) \
};
/** A named feature */
@@ -87,6 +86,10 @@ struct feature {
/** Declare a feature */
#define FEATURE( category, text, feature_opt, version ) \
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 */