Use otherwise-useless byte in DHCP feature option as a version number
authorMichael Brown <mcb30@etherboot.org>
Thu, 2 Aug 2007 03:36:00 +0000 (04:36 +0100)
committerMichael Brown <mcb30@etherboot.org>
Thu, 2 Aug 2007 03:36:00 +0000 (04:36 +0100)
src/include/gpxe/features.h
src/net/aoe.c
src/net/tcp/http.c
src/net/tcp/https.c
src/net/tcp/iscsi.c

index 20cce31..b8d2d60 100644 (file)
 /** AoE */
 #define DHCP_EB_FEATURE_AOE 0x12
 
+/** HTTP */
+#define DHCP_EB_FEATURE_HTTP 0x13
+
+/** HTTPS */
+#define DHCP_EB_FEATURE_HTTPS 0x14
+
 /** @} */
 
 /** Declare a feature code for DHCP */
 #define __dhcp_feature __table ( uint8_t, dhcp_features, 01 )
 
 /** Construct a DHCP feature table entry */
-#define DHCP_FEATURE( feature_opt ) \
-       _DHCP_FEATURE ( OBJECT, feature_opt )
-#define _DHCP_FEATURE( _name, feature_opt ) \
-       __DHCP_FEATURE ( _name, feature_opt )
-#define __DHCP_FEATURE( _name, feature_opt )                   \
+#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 ( 1 )                    \
+               feature_opt, DHCP_BYTE ( version )              \
        };
 
 /** Declare a named feature */
@@ -56,8 +62,8 @@
        char * __feature_ ## _name __feature_name = text;
 
 /** Declare a feature */
-#define FEATURE( text, feature_opt )                           \
+#define FEATURE( text, feature_opt, version )                  \
        FEATURE_NAME ( text );                                  \
-       DHCP_FEATURE ( feature_opt );
+       DHCP_FEATURE ( feature_opt, version );
 
 #endif /* _GPXE_FEATURES_H */
index 5536ae8..2e2199b 100644 (file)
@@ -40,7 +40,7 @@
  *
  */
 
-FEATURE ( "AoE", DHCP_EB_FEATURE_AOE );
+FEATURE ( "AoE", DHCP_EB_FEATURE_AOE, 1 );
 
 struct net_protocol aoe_protocol;
 
index 727c033..0aecc7b 100644 (file)
 #include <gpxe/tcpip.h>
 #include <gpxe/process.h>
 #include <gpxe/linebuf.h>
+#include <gpxe/features.h>
 #include <gpxe/http.h>
 
+FEATURE ( "HTTP", DHCP_EB_FEATURE_HTTP, 1 );
+
 /** HTTP receive state */
 enum http_rx_state {
        HTTP_RX_RESPONSE = 0,
index 148e4bf..a59e94d 100644 (file)
@@ -27,6 +27,9 @@
 #include <gpxe/open.h>
 #include <gpxe/tls.h>
 #include <gpxe/http.h>
+#include <gpxe/features.h>
+
+FEATURE ( "HTTPS", DHCP_EB_FEATURE_HTTPS, 1 );
 
 /**
  * Initiate an HTTPS connection
index 5d8639e..a96331a 100644 (file)
@@ -41,7 +41,7 @@
  *
  */
 
-FEATURE ( "iSCSI", DHCP_EB_FEATURE_ISCSI );
+FEATURE ( "iSCSI", DHCP_EB_FEATURE_ISCSI, 1 );
 
 /** iSCSI initiator name (explicitly specified) */
 static char *iscsi_explicit_initiator_iqn;