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
 /** AoE */
29
 /** AoE */
30
 #define DHCP_EB_FEATURE_AOE 0x12
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
 /** Declare a feature code for DHCP */
40
 /** Declare a feature code for DHCP */
35
 #define __dhcp_feature __table ( uint8_t, dhcp_features, 01 )
41
 #define __dhcp_feature __table ( uint8_t, dhcp_features, 01 )
36
 
42
 
37
 /** Construct a DHCP feature table entry */
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
 	uint8_t __dhcp_feature_ ## _name [] __dhcp_feature = {	\
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
 /** Declare a named feature */
53
 /** Declare a named feature */
56
 	char * __feature_ ## _name __feature_name = text;
62
 	char * __feature_ ## _name __feature_name = text;
57
 
63
 
58
 /** Declare a feature */
64
 /** Declare a feature */
59
-#define FEATURE( text, feature_opt )				\
65
+#define FEATURE( text, feature_opt, version )			\
60
 	FEATURE_NAME ( text );					\
66
 	FEATURE_NAME ( text );					\
61
-	DHCP_FEATURE ( feature_opt );
67
+	DHCP_FEATURE ( feature_opt, version );
62
 
68
 
63
 #endif /* _GPXE_FEATURES_H */
69
 #endif /* _GPXE_FEATURES_H */

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

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

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

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

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

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

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

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

Loading…
Cancel
Save