|
@@ -145,6 +145,21 @@ struct dhcpv6_user_class_option {
|
145
|
145
|
/** DHCPv6 user class option */
|
146
|
146
|
#define DHCPV6_USER_CLASS 15
|
147
|
147
|
|
|
148
|
+/** DHCPv6 vendor class option */
|
|
149
|
+#define DHCPV6_VENDOR_CLASS 16
|
|
150
|
+
|
|
151
|
+/** DHCPv6 PXE vendor class
|
|
152
|
+ *
|
|
153
|
+ * The DHCPv6 vendor class includes a field for an IANA enterprise
|
|
154
|
+ * number. The EDK2 codebase uses the value 343, with the comment:
|
|
155
|
+ *
|
|
156
|
+ * TODO: IANA TBD: temporarily using Intel's
|
|
157
|
+ *
|
|
158
|
+ * Since this "temporarily" has applied since at least 2010, we assume
|
|
159
|
+ * that it has become a de facto standard.
|
|
160
|
+ */
|
|
161
|
+#define DHCPV6_VENDOR_CLASS_PXE 343
|
|
162
|
+
|
148
|
163
|
/** DHCPv6 DNS recursive name server option */
|
149
|
164
|
#define DHCPV6_DNS_SERVERS 23
|
150
|
165
|
|
|
@@ -170,13 +185,22 @@ struct dhcpv6_user_class_option {
|
170
|
185
|
*/
|
171
|
186
|
#define DHCPV6_LOG_SERVERS 0xffffffffUL
|
172
|
187
|
|
|
188
|
+/** Construct a DHCPv6 byte value */
|
|
189
|
+#define DHCPV6_BYTE_VALUE( value ) ( (value) & 0xff )
|
|
190
|
+
|
|
191
|
+/** Construct a DHCPv6 word value */
|
|
192
|
+#define DHCPV6_WORD_VALUE( value ) \
|
|
193
|
+ DHCPV6_BYTE_VALUE ( (value) >> 8 ), DHCPV6_BYTE_VALUE ( (value) >> 0 )
|
|
194
|
+
|
|
195
|
+/** Construct a DHCPv6 dword value */
|
|
196
|
+#define DHCPV6_DWORD_VALUE( value ) \
|
|
197
|
+ DHCPV6_WORD_VALUE ( (value) >> 16 ), DHCPV6_WORD_VALUE ( (value) >> 0 )
|
|
198
|
+
|
173
|
199
|
/** Construct a DHCPv6 option code */
|
174
|
|
-#define DHCPV6_CODE( code ) \
|
175
|
|
- ( ( (code) >> 8 ) & 0xff ), ( ( (code) >> 0 ) & 0xff )
|
|
200
|
+#define DHCPV6_CODE( code ) DHCPV6_WORD_VALUE ( code )
|
176
|
201
|
|
177
|
202
|
/** Construct a DHCPv6 option length */
|
178
|
|
-#define DHCPV6_LEN( len ) \
|
179
|
|
- ( ( (len) >> 8 ) & 0xff ), ( ( (len) >> 0 ) & 0xff )
|
|
203
|
+#define DHCPV6_LEN( len ) DHCPV6_WORD_VALUE ( len )
|
180
|
204
|
|
181
|
205
|
/** Construct a DHCPv6 option from a list of bytes */
|
182
|
206
|
#define DHCPV6_OPTION( ... ) \
|
|
@@ -186,16 +210,13 @@ struct dhcpv6_user_class_option {
|
186
|
210
|
#define DHCPV6_STRING( ... ) DHCPV6_OPTION ( __VA_ARGS__ )
|
187
|
211
|
|
188
|
212
|
/** Construct a byte-valued DHCPv6 option */
|
189
|
|
-#define DHCPV6_BYTE( value ) DHCPV6_OPTION ( value )
|
|
213
|
+#define DHCPV6_BYTE( value ) DHCPV6_OPTION ( DHCPV6_BYTE_VALUE ( value ) )
|
190
|
214
|
|
191
|
215
|
/** Construct a word-valued DHCPv6 option */
|
192
|
|
-#define DHCPV6_WORD( value ) DHCPV6_OPTION ( ( ( (value) >> 8 ) & 0xff ), \
|
193
|
|
- ( ( (value) >> 0 ) & 0xff ) )
|
|
216
|
+#define DHCPV6_WORD( value ) DHCPV6_OPTION ( DHCPV6_WORD_VALUE ( value ) )
|
|
217
|
+
|
194
|
218
|
/** Construct a dword-valued DHCPv6 option */
|
195
|
|
-#define DHCPV6_DWORD( value ) DHCPV6_OPTION ( ( ( (value) >> 24 ) & 0xff ), \
|
196
|
|
- ( ( (value) >> 16 ) & 0xff ), \
|
197
|
|
- ( ( (value) >> 8 ) & 0xff ), \
|
198
|
|
- ( ( (value) >> 0 ) & 0xff ) )
|
|
219
|
+#define DHCPV6_DWORD( value ) DHCPV6_OPTION ( DHCPV6_DWORD_VALUE ( value ) )
|
199
|
220
|
|
200
|
221
|
/**
|
201
|
222
|
* Any DHCPv6 option
|