[ELF] Add ability to boot ELF images generated by wraplinux and mkelfImage
[people/mdeck/gpxe.git] / src / include / gpxe / features.h
1 #ifndef _GPXE_FEATURES_H
2 #define _GPXE_FEATURES_H
3
4 #include <stdint.h>
5 #include <gpxe/tables.h>
6 #include <gpxe/dhcp.h>
7
8 /** @file
9  *
10  * Feature list
11  *
12  */
13
14 /**
15  * @defgroup featurecat Feature categories
16  * @{
17  */
18
19 #define FEATURE_PROTOCOL                01 /**< Network protocols */
20 #define FEATURE_IMAGE                   02 /**< Image formats */
21 #define FEATURE_MISC                    03 /**< Miscellaneous */
22
23 /** @} */
24
25 /**
26  * @defgroup dhcpfeatures DHCP feature option tags
27  *
28  * DHCP feature option tags are Etherboot encapsulated options in the
29  * range 0x10-0x7f.
30  *
31  * @{
32  */
33
34 #define DHCP_EB_FEATURE_PXE_EXT         0x10 /**< PXE API extensions */
35 #define DHCP_EB_FEATURE_ISCSI           0x11 /**< iSCSI protocol */
36 #define DHCP_EB_FEATURE_AOE             0x12 /**< AoE protocol */
37 #define DHCP_EB_FEATURE_HTTP            0x13 /**< HTTP protocol */
38 #define DHCP_EB_FEATURE_HTTPS           0x14 /**< HTTPS protocol */
39 #define DHCP_EB_FEATURE_TFTP            0x15 /**< TFTP protocol */
40 #define DHCP_EB_FEATURE_FTP             0x16 /**< FTP protocol */
41 #define DHCP_EB_FEATURE_DNS             0x17 /**< DNS protocol */
42 #define DHCP_EB_FEATURE_BZIMAGE         0x18 /**< bzImage format */
43 #define DHCP_EB_FEATURE_MULTIBOOT       0x19 /**< Multiboot format */
44 #define DHCP_EB_FEATURE_NBI             0x20 /**< NBI format */
45 #define DHCP_EB_FEATURE_PXE             0x21 /**< PXE format */
46 #define DHCP_EB_FEATURE_ELF             0x22 /**< ELF format */
47
48 /** @} */
49
50 /** Declare a feature code for DHCP */
51 #define __dhcp_feature( category )                                          \
52          __table ( uint8_t, dhcp_features, category )
53
54 /** Construct a DHCP feature table entry */
55 #define DHCP_FEATURE( category, feature_opt, version )                      \
56         _DHCP_FEATURE ( category, OBJECT, feature_opt, version )
57 #define _DHCP_FEATURE( category, _name, feature_opt, version )              \
58         __DHCP_FEATURE ( category, _name, feature_opt, version )
59 #define __DHCP_FEATURE( category, _name, feature_opt, version )             \
60         uint8_t __dhcp_feature_ ## _name [] __dhcp_feature ( category ) = { \
61                 feature_opt, DHCP_BYTE ( version )                          \
62         };
63
64 /** A named feature */
65 struct feature {
66         /** Feature name */
67         char *name;
68 };
69
70 /** Declare a named feature */
71 #define __feature_name( category )                                          \
72         __table ( struct feature, features, category )
73
74 /** Construct a named feature */
75 #define FEATURE_NAME( category, text )                                      \
76         _FEATURE_NAME ( category, OBJECT, text )
77 #define _FEATURE_NAME( category, _name, text )                              \
78         __FEATURE_NAME ( category, _name, text )
79 #define __FEATURE_NAME( category, _name, text )                             \
80         struct feature __feature_ ## _name __feature_name ( category ) = {  \
81                 .name = text,                                               \
82         };
83
84 /** Declare a feature */
85 #define FEATURE( category, text, feature_opt, version )                     \
86         FEATURE_NAME ( category, text );                                    \
87         DHCP_FEATURE ( category, feature_opt, version );
88
89 #endif /* _GPXE_FEATURES_H */