Browse Source

Use otherwise-useless byte in DHCP feature option as a version number

tags/v0.9.3
Michael Brown 17 years ago
parent
commit
67afe84292
5 changed files with 22 additions and 10 deletions
  1. 14
    8
      src/include/gpxe/features.h
  2. 1
    1
      src/net/aoe.c
  3. 3
    0
      src/net/tcp/http.c
  4. 3
    0
      src/net/tcp/https.c
  5. 1
    1
      src/net/tcp/iscsi.c

+ 14
- 8
src/include/gpxe/features.h View File

@@ -29,19 +29,25 @@
29 29
 /** AoE */
30 30
 #define DHCP_EB_FEATURE_AOE 0x12
31 31
 
32
+/** HTTP */
33
+#define DHCP_EB_FEATURE_HTTP 0x13
34
+
35
+/** HTTPS */
36
+#define DHCP_EB_FEATURE_HTTPS 0x14
37
+
32 38
 /** @} */
33 39
 
34 40
 /** Declare a feature code for DHCP */
35 41
 #define __dhcp_feature __table ( uint8_t, dhcp_features, 01 )
36 42
 
37 43
 /** Construct a DHCP feature table entry */
38
-#define DHCP_FEATURE( feature_opt ) \
39
-	_DHCP_FEATURE ( OBJECT, feature_opt )
40
-#define _DHCP_FEATURE( _name, feature_opt ) \
41
-	__DHCP_FEATURE ( _name, feature_opt )
42
-#define __DHCP_FEATURE( _name, feature_opt )			\
44
+#define DHCP_FEATURE( feature_opt, version ) \
45
+	_DHCP_FEATURE ( OBJECT, feature_opt, version )
46
+#define _DHCP_FEATURE( _name, feature_opt, version ) \
47
+	__DHCP_FEATURE ( _name, feature_opt, version )
48
+#define __DHCP_FEATURE( _name, feature_opt, version )		\
43 49
 	uint8_t __dhcp_feature_ ## _name [] __dhcp_feature = {	\
44
-		feature_opt, DHCP_BYTE ( 1 )			\
50
+		feature_opt, DHCP_BYTE ( version )		\
45 51
 	};
46 52
 
47 53
 /** Declare a named feature */
@@ -56,8 +62,8 @@
56 62
 	char * __feature_ ## _name __feature_name = text;
57 63
 
58 64
 /** Declare a feature */
59
-#define FEATURE( text, feature_opt )				\
65
+#define FEATURE( text, feature_opt, version )			\
60 66
 	FEATURE_NAME ( text );					\
61
-	DHCP_FEATURE ( feature_opt );
67
+	DHCP_FEATURE ( feature_opt, version );
62 68
 
63 69
 #endif /* _GPXE_FEATURES_H */

+ 1
- 1
src/net/aoe.c View File

@@ -40,7 +40,7 @@
40 40
  *
41 41
  */
42 42
 
43
-FEATURE ( "AoE", DHCP_EB_FEATURE_AOE );
43
+FEATURE ( "AoE", DHCP_EB_FEATURE_AOE, 1 );
44 44
 
45 45
 struct net_protocol aoe_protocol;
46 46
 

+ 3
- 0
src/net/tcp/http.c View File

@@ -40,8 +40,11 @@
40 40
 #include <gpxe/tcpip.h>
41 41
 #include <gpxe/process.h>
42 42
 #include <gpxe/linebuf.h>
43
+#include <gpxe/features.h>
43 44
 #include <gpxe/http.h>
44 45
 
46
+FEATURE ( "HTTP", DHCP_EB_FEATURE_HTTP, 1 );
47
+
45 48
 /** HTTP receive state */
46 49
 enum http_rx_state {
47 50
 	HTTP_RX_RESPONSE = 0,

+ 3
- 0
src/net/tcp/https.c View File

@@ -27,6 +27,9 @@
27 27
 #include <gpxe/open.h>
28 28
 #include <gpxe/tls.h>
29 29
 #include <gpxe/http.h>
30
+#include <gpxe/features.h>
31
+
32
+FEATURE ( "HTTPS", DHCP_EB_FEATURE_HTTPS, 1 );
30 33
 
31 34
 /**
32 35
  * Initiate an HTTPS connection

+ 1
- 1
src/net/tcp/iscsi.c View File

@@ -41,7 +41,7 @@
41 41
  *
42 42
  */
43 43
 
44
-FEATURE ( "iSCSI", DHCP_EB_FEATURE_ISCSI );
44
+FEATURE ( "iSCSI", DHCP_EB_FEATURE_ISCSI, 1 );
45 45
 
46 46
 /** iSCSI initiator name (explicitly specified) */
47 47
 static char *iscsi_explicit_initiator_iqn;

Loading…
Cancel
Save