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
00009
00010
00011
00012
00013
00014 FILE_LICENCE ( GPL2_OR_LATER );
00015
00016
00017
00018
00019
00020
00021 #define FEATURE_PROTOCOL 01
00022 #define FEATURE_IMAGE 02
00023 #define FEATURE_MISC 03
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #define DHCP_EB_FEATURE_PXE_EXT 0x10
00037 #define DHCP_EB_FEATURE_ISCSI 0x11
00038 #define DHCP_EB_FEATURE_AOE 0x12
00039 #define DHCP_EB_FEATURE_HTTP 0x13
00040 #define DHCP_EB_FEATURE_HTTPS 0x14
00041 #define DHCP_EB_FEATURE_TFTP 0x15
00042 #define DHCP_EB_FEATURE_FTP 0x16
00043 #define DHCP_EB_FEATURE_DNS 0x17
00044 #define DHCP_EB_FEATURE_BZIMAGE 0x18
00045 #define DHCP_EB_FEATURE_MULTIBOOT 0x19
00046 #define DHCP_EB_FEATURE_SLAM 0x1a
00047 #define DHCP_EB_FEATURE_SRP 0x1b
00048 #define DHCP_EB_FEATURE_NBI 0x20
00049 #define DHCP_EB_FEATURE_PXE 0x21
00050 #define DHCP_EB_FEATURE_ELF 0x22
00051 #define DHCP_EB_FEATURE_COMBOOT 0x23
00052 #define DHCP_EB_FEATURE_EFI 0x24
00053
00054
00055
00056
00057 #define DHCP_FEATURES __table ( uint8_t, "dhcp_features" )
00058
00059
00060 #define __dhcp_feature __table_entry ( DHCP_FEATURES, 01 )
00061
00062
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
00073 struct feature {
00074
00075 char *name;
00076 };
00077
00078
00079 #define FEATURES __table ( struct feature, "features" )
00080
00081
00082 #define __feature_name( category ) __table_entry ( FEATURES, category )
00083
00084
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
00095 #define FEATURE( category, text, feature_opt, version ) \
00096 FEATURE_NAME ( category, text ); \
00097 DHCP_FEATURE ( feature_opt, version );
00098
00099
00100 #define FEATURE_VERSION( ... ) \
00101 DHCP_FEATURE ( DHCP_ENCAPSULATED ( DHCP_EB_VERSION ), __VA_ARGS__ )
00102
00103 #endif