Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Use otherwise-useless byte in DHCP feature option as a version number
  • Loading branch information
Michael Brown committed Aug 2, 2007
1 parent 0acb016 commit 67afe84
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 10 deletions.
22 changes: 14 additions & 8 deletions src/include/gpxe/features.h
Expand Up @@ -29,19 +29,25 @@
/** 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 */
Expand All @@ -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 */
2 changes: 1 addition & 1 deletion src/net/aoe.c
Expand Up @@ -40,7 +40,7 @@
*
*/

FEATURE ( "AoE", DHCP_EB_FEATURE_AOE );
FEATURE ( "AoE", DHCP_EB_FEATURE_AOE, 1 );

struct net_protocol aoe_protocol;

Expand Down
3 changes: 3 additions & 0 deletions src/net/tcp/http.c
Expand Up @@ -40,8 +40,11 @@
#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,
Expand Down
3 changes: 3 additions & 0 deletions src/net/tcp/https.c
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/net/tcp/iscsi.c
Expand Up @@ -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;
Expand Down

0 comments on commit 67afe84

Please sign in to comment.