features.h

Go to the documentation of this file.
00001 #ifndef _GPXE_FEATURES_H
00002 #define _GPXE_FEATURES_H
00003 
00004 #include <stdint.h>
00005 #include <gpxe/tables.h>
00006 #include <gpxe/dhcp.h>
00007 
00008 /** @file
00009  *
00010  * Feature list
00011  *
00012  */
00013 
00014 FILE_LICENCE ( GPL2_OR_LATER );
00015 
00016 /**
00017  * @defgroup featurecat Feature categories
00018  * @{
00019  */
00020 
00021 #define FEATURE_PROTOCOL                01 /**< Network protocols */
00022 #define FEATURE_IMAGE                   02 /**< Image formats */
00023 #define FEATURE_MISC                    03 /**< Miscellaneous */
00024 
00025 /** @} */
00026 
00027 /**
00028  * @defgroup dhcpfeatures DHCP feature option tags
00029  *
00030  * DHCP feature option tags are Etherboot encapsulated options in the
00031  * range 0x10-0x7f.
00032  *
00033  * @{
00034  */
00035 
00036 #define DHCP_EB_FEATURE_PXE_EXT         0x10 /**< PXE API extensions */
00037 #define DHCP_EB_FEATURE_ISCSI           0x11 /**< iSCSI protocol */
00038 #define DHCP_EB_FEATURE_AOE             0x12 /**< AoE protocol */
00039 #define DHCP_EB_FEATURE_HTTP            0x13 /**< HTTP protocol */
00040 #define DHCP_EB_FEATURE_HTTPS           0x14 /**< HTTPS protocol */
00041 #define DHCP_EB_FEATURE_TFTP            0x15 /**< TFTP protocol */
00042 #define DHCP_EB_FEATURE_FTP             0x16 /**< FTP protocol */
00043 #define DHCP_EB_FEATURE_DNS             0x17 /**< DNS protocol */
00044 #define DHCP_EB_FEATURE_BZIMAGE         0x18 /**< bzImage format */
00045 #define DHCP_EB_FEATURE_MULTIBOOT       0x19 /**< Multiboot format */
00046 #define DHCP_EB_FEATURE_SLAM            0x1a /**< SLAM protocol */
00047 #define DHCP_EB_FEATURE_SRP             0x1b /**< SRP protocol */
00048 #define DHCP_EB_FEATURE_NBI             0x20 /**< NBI format */
00049 #define DHCP_EB_FEATURE_PXE             0x21 /**< PXE format */
00050 #define DHCP_EB_FEATURE_ELF             0x22 /**< ELF format */
00051 #define DHCP_EB_FEATURE_COMBOOT         0x23 /**< COMBOOT format */
00052 #define DHCP_EB_FEATURE_EFI             0x24 /**< EFI format */
00053 
00054 /** @} */
00055 
00056 /** DHCP feature table */
00057 #define DHCP_FEATURES __table ( uint8_t, "dhcp_features" )
00058 
00059 /** Declare a feature code for DHCP */
00060 #define __dhcp_feature __table_entry ( DHCP_FEATURES, 01 )
00061 
00062 /** Construct a DHCP feature table entry */
00063 #define DHCP_FEATURE( feature_opt, ... )                                    \
00064         _DHCP_FEATURE ( OBJECT, feature_opt, __VA_ARGS__ )
00065 #define _DHCP_FEATURE( _name, feature_opt, ... )                            \
00066         __DHCP_FEATURE ( _name, feature_opt, __VA_ARGS__ )
00067 #define __DHCP_FEATURE( _name, feature_opt, ... )                           \
00068         uint8_t __dhcp_feature_ ## _name [] __dhcp_feature = {              \
00069                 feature_opt, DHCP_OPTION ( __VA_ARGS__ )                    \
00070         };
00071 
00072 /** A named feature */
00073 struct feature {
00074         /** Feature name */
00075         char *name;
00076 };
00077 
00078 /** Named feature table */
00079 #define FEATURES __table ( struct feature, "features" )
00080 
00081 /** Declare a named feature */
00082 #define __feature_name( category ) __table_entry ( FEATURES, category )
00083 
00084 /** Construct a named feature */
00085 #define FEATURE_NAME( category, text )                                      \
00086         _FEATURE_NAME ( category, OBJECT, text )
00087 #define _FEATURE_NAME( category, _name, text )                              \
00088         __FEATURE_NAME ( category, _name, text )
00089 #define __FEATURE_NAME( category, _name, text )                             \
00090         struct feature __feature_ ## _name __feature_name ( category ) = {  \
00091                 .name = text,                                               \
00092         };
00093 
00094 /** Declare a feature */
00095 #define FEATURE( category, text, feature_opt, version )                     \
00096         FEATURE_NAME ( category, text );                                    \
00097         DHCP_FEATURE ( feature_opt, version );
00098 
00099 /** Declare the version number feature */
00100 #define FEATURE_VERSION( ... )                                              \
00101         DHCP_FEATURE ( DHCP_ENCAPSULATED ( DHCP_EB_VERSION ), __VA_ARGS__ )
00102 
00103 #endif /* _GPXE_FEATURES_H */

Generated on Tue Apr 6 20:01:07 2010 for gPXE by  doxygen 1.5.7.1