summaryrefslogtreecommitdiffstats
path: root/src/include/gpxe
diff options
context:
space:
mode:
authorMichael Brown2007-08-02 15:51:03 +0200
committerMichael Brown2007-08-02 15:51:03 +0200
commit9fd6a0418f38461d6d87f2c88785028d65fd6a1c (patch)
treebfd75ca6c34652464d2e9b02fe4cc06b210e444c /src/include/gpxe
parentUse otherwise-useless byte in DHCP feature option as a version number (diff)
downloadipxe-9fd6a0418f38461d6d87f2c88785028d65fd6a1c.tar.gz
ipxe-9fd6a0418f38461d6d87f2c88785028d65fd6a1c.tar.xz
ipxe-9fd6a0418f38461d6d87f2c88785028d65fd6a1c.zip
Allowed zero-cost enforced ordering of features in startup banner
list. Added FEATURE() macros to most relevant (non-driver) files.
Diffstat (limited to 'src/include/gpxe')
-rw-r--r--src/include/gpxe/features.h83
1 files changed, 51 insertions, 32 deletions
diff --git a/src/include/gpxe/features.h b/src/include/gpxe/features.h
index b8d2d6044..a520131f1 100644
--- a/src/include/gpxe/features.h
+++ b/src/include/gpxe/features.h
@@ -12,6 +12,17 @@
*/
/**
+ * @defgroup featurecat Feature categories
+ * @{
+ */
+
+#define FEATURE_PROTOCOL 01 /**< Network protocols */
+#define FEATURE_IMAGE 02 /**< Image formats */
+#define FEATURE_MISC 03 /**< Miscellaneous */
+
+/** @} */
+
+/**
* @defgroup dhcpfeatures DHCP feature option tags
*
* DHCP feature option tags are Etherboot encapsulated options in the
@@ -20,50 +31,58 @@
* @{
*/
-/** PXE API extensions */
-#define DHCP_EB_FEATURE_PXE_EXT 0x10
-
-/** iSCSI */
-#define DHCP_EB_FEATURE_ISCSI 0x11
-
-/** AoE */
-#define DHCP_EB_FEATURE_AOE 0x12
-
-/** HTTP */
-#define DHCP_EB_FEATURE_HTTP 0x13
-
-/** HTTPS */
-#define DHCP_EB_FEATURE_HTTPS 0x14
+#define DHCP_EB_FEATURE_PXE_EXT 0x10 /**< PXE API extensions */
+#define DHCP_EB_FEATURE_ISCSI 0x11 /**< iSCSI protocol */
+#define DHCP_EB_FEATURE_AOE 0x12 /**< AoE protocol */
+#define DHCP_EB_FEATURE_HTTP 0x13 /**< HTTP protocol */
+#define DHCP_EB_FEATURE_HTTPS 0x14 /**< HTTPS protocol */
+#define DHCP_EB_FEATURE_TFTP 0x15 /**< TFTP protocol */
+#define DHCP_EB_FEATURE_FTP 0x16 /**< FTP protocol */
+#define DHCP_EB_FEATURE_DNS 0x17 /**< DNS protocol */
+#define DHCP_EB_FEATURE_BZIMAGE 0x18 /**< bzImage format */
+#define DHCP_EB_FEATURE_MULTIBOOT 0x19 /**< Multiboot format */
+#define DHCP_EB_FEATURE_NBI 0x20 /**< NBI format */
+#define DHCP_EB_FEATURE_PXE 0x21 /**< PXE format */
/** @} */
/** Declare a feature code for DHCP */
-#define __dhcp_feature __table ( uint8_t, dhcp_features, 01 )
+#define __dhcp_feature( category ) \
+ __table ( uint8_t, dhcp_features, category )
/** Construct a DHCP feature table entry */
-#define DHCP_FEATURE( feature_opt, version ) \
- _DHCP_FEATURE ( OBJECT, feature_opt, version )
-#define _DHCP_FEATURE( _name, feature_opt, version ) \
- __DHCP_FEATURE ( _name, feature_opt, version )
-#define __DHCP_FEATURE( _name, feature_opt, version ) \
- uint8_t __dhcp_feature_ ## _name [] __dhcp_feature = { \
- feature_opt, DHCP_BYTE ( version ) \
+#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 ) \
};
+/** A named feature */
+struct feature {
+ /** Feature name */
+ char *name;
+};
+
/** Declare a named feature */
-#define __feature_name __table ( char *, features, 01 )
+#define __feature_name( category ) \
+ __table ( struct feature, features, category )
/** Construct a named feature */
-#define FEATURE_NAME( text ) \
- _FEATURE_NAME ( OBJECT, text )
-#define _FEATURE_NAME( _name, text ) \
- __FEATURE_NAME ( _name, text )
-#define __FEATURE_NAME( _name, text ) \
- char * __feature_ ## _name __feature_name = text;
+#define FEATURE_NAME( category, text ) \
+ _FEATURE_NAME ( category, OBJECT, text )
+#define _FEATURE_NAME( category, _name, text ) \
+ __FEATURE_NAME ( category, _name, text )
+#define __FEATURE_NAME( category, _name, text ) \
+ struct feature __feature_ ## _name __feature_name ( category ) = { \
+ .name = text, \
+ };
/** Declare a feature */
-#define FEATURE( text, feature_opt, version ) \
- FEATURE_NAME ( text ); \
- DHCP_FEATURE ( feature_opt, version );
+#define FEATURE( category, text, feature_opt, version ) \
+ FEATURE_NAME ( category, text ); \
+ DHCP_FEATURE ( category, feature_opt, version );
#endif /* _GPXE_FEATURES_H */