iPXE
dhcp.h
Go to the documentation of this file.
1 #ifndef _IPXE_DHCP_H
2 #define _IPXE_DHCP_H
3 
4 /** @file
5  *
6  * Dynamic Host Configuration Protocol
7  *
8  */
9 
10 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11 
12 #include <stdint.h>
13 #include <stdarg.h>
14 #include <ipxe/in.h>
15 #include <ipxe/list.h>
16 #include <ipxe/refcnt.h>
17 #include <ipxe/tables.h>
18 #include <ipxe/uuid.h>
19 #include <ipxe/netdevice.h>
20 
21 struct interface;
22 struct dhcp_options;
23 struct dhcp_packet;
24 
25 /** BOOTP/DHCP server port */
26 #define BOOTPS_PORT 67
27 
28 /** BOOTP/DHCP client port */
29 #define BOOTPC_PORT 68
30 
31 /** PXE server port */
32 #define PXE_PORT 4011
33 
34 /** Construct a tag value for an encapsulated option
35  *
36  * This tag value can be passed to Etherboot functions when searching
37  * for DHCP options in order to search for a tag within an
38  * encapsulated options block.
39  */
40 #define DHCP_ENCAP_OPT( encapsulator, encapsulated ) \
41  ( ( (encapsulator) << 8 ) | (encapsulated) )
42 /** Extract encapsulating option block tag from encapsulated tag value */
43 #define DHCP_ENCAPSULATOR( encap_opt ) ( (encap_opt) >> 8 )
44 /** Extract encapsulated option tag from encapsulated tag value */
45 #define DHCP_ENCAPSULATED( encap_opt ) ( (encap_opt) & 0xff )
46 /** Option is encapsulated */
47 #define DHCP_IS_ENCAP_OPT( opt ) DHCP_ENCAPSULATOR( opt )
48 
49 /**
50  * @defgroup dhcpopts DHCP option tags
51  * @{
52  */
53 
54 /** Padding
55  *
56  * This tag does not have a length field; it is always only a single
57  * byte in length.
58  */
59 #define DHCP_PAD 0
60 
61 /** Minimum normal DHCP option */
62 #define DHCP_MIN_OPTION 1
63 
64 /** Subnet mask */
65 #define DHCP_SUBNET_MASK 1
66 
67 /** Routers */
68 #define DHCP_ROUTERS 3
69 
70 /** DNS servers */
71 #define DHCP_DNS_SERVERS 6
72 
73 /** Syslog servers */
74 #define DHCP_LOG_SERVERS 7
75 
76 /** Host name */
77 #define DHCP_HOST_NAME 12
78 
79 /** Domain name */
80 #define DHCP_DOMAIN_NAME 15
81 
82 /** Root path */
83 #define DHCP_ROOT_PATH 17
84 
85 /** Maximum transmission unit */
86 #define DHCP_MTU 26
87 
88 /** NTP servers */
89 #define DHCP_NTP_SERVERS 42
90 
91 /** Vendor encapsulated options */
92 #define DHCP_VENDOR_ENCAP 43
93 
94 /** PXE boot server discovery control */
95 #define DHCP_PXE_DISCOVERY_CONTROL DHCP_ENCAP_OPT ( DHCP_VENDOR_ENCAP, 6 )
96 
97 /** PXE boot server discovery control bits */
99  /** Inhibit broadcast discovery */
101  /** Inhibit multicast discovery */
103  /** Accept only servers in DHCP_PXE_BOOT_SERVERS list */
105  /** Skip discovery if filename present */
107 };
108 
109 /** PXE boot server multicast address */
110 #define DHCP_PXE_BOOT_SERVER_MCAST DHCP_ENCAP_OPT ( DHCP_VENDOR_ENCAP, 7 )
111 
112 /** PXE boot servers */
113 #define DHCP_PXE_BOOT_SERVERS DHCP_ENCAP_OPT ( DHCP_VENDOR_ENCAP, 8 )
114 
115 /** PXE boot server */
117  /** "Type" */
119  /** Number of IPv4 addresses */
121  /** IPv4 addresses */
122  struct in_addr ip[0];
123 } __attribute__ (( packed ));
124 
125 /** PXE boot menu */
126 #define DHCP_PXE_BOOT_MENU DHCP_ENCAP_OPT ( DHCP_VENDOR_ENCAP, 9 )
127 
128 /** PXE boot menu */
130  /** "Type" */
132  /** Description length */
134  /** Description */
135  char desc[0];
136 } __attribute__ (( packed ));
137 
138 /** PXE boot menu prompt */
139 #define DHCP_PXE_BOOT_MENU_PROMPT DHCP_ENCAP_OPT ( DHCP_VENDOR_ENCAP, 10 )
140 
141 /** PXE boot menu prompt */
143  /** Timeout
144  *
145  * A value of 0 means "time out immediately and select first
146  * boot item, without displaying the prompt". A value of 255
147  * means "display menu immediately with no timeout". Any
148  * other value means "display prompt, wait this many seconds
149  * for keypress, if key is F8, display menu, otherwise select
150  * first boot item".
151  */
153  /** Prompt to press F8 */
154  char prompt[0];
155 } __attribute__ (( packed ));
156 
157 /** PXE boot menu item */
158 #define DHCP_PXE_BOOT_MENU_ITEM DHCP_ENCAP_OPT ( DHCP_VENDOR_ENCAP, 71 )
159 
160 /** PXE boot menu item */
162  /** "Type"
163  *
164  * This field actually identifies the specific boot server (or
165  * cluster of boot servers offering identical boot files).
166  */
168  /** "Layer"
169  *
170  * Just don't ask.
171  */
173 } __attribute__ (( packed ));
174 
175 /** Requested IP address */
176 #define DHCP_REQUESTED_ADDRESS 50
177 
178 /** Lease time */
179 #define DHCP_LEASE_TIME 51
180 
181 /** Option overloading
182  *
183  * The value of this option is the bitwise-OR of zero or more
184  * DHCP_OPTION_OVERLOAD_XXX constants.
185  */
186 #define DHCP_OPTION_OVERLOAD 52
187 
188 /** The "file" field is overloaded to contain extra DHCP options */
189 #define DHCP_OPTION_OVERLOAD_FILE 1
190 
191 /** The "sname" field is overloaded to contain extra DHCP options */
192 #define DHCP_OPTION_OVERLOAD_SNAME 2
193 
194 /** DHCP message type */
195 #define DHCP_MESSAGE_TYPE 53
196 #define DHCPNONE 0
197 #define DHCPDISCOVER 1
198 #define DHCPOFFER 2
199 #define DHCPREQUEST 3
200 #define DHCPDECLINE 4
201 #define DHCPACK 5
202 #define DHCPNAK 6
203 #define DHCPRELEASE 7
204 #define DHCPINFORM 8
205 
206 /** DHCP server identifier */
207 #define DHCP_SERVER_IDENTIFIER 54
208 
209 /** Parameter request list */
210 #define DHCP_PARAMETER_REQUEST_LIST 55
211 
212 /** Maximum DHCP message size */
213 #define DHCP_MAX_MESSAGE_SIZE 57
214 
215 /** Vendor class identifier */
216 #define DHCP_VENDOR_CLASS_ID 60
217 
218 /** Vendor class identifier for PXE clients */
219 #define DHCP_VENDOR_PXECLIENT( arch, ndi ) \
220  'P', 'X', 'E', 'C', 'l', 'i', 'e', 'n', 't', ':', \
221  'A', 'r', 'c', 'h', ':', DHCP_VENDOR_PXECLIENT_ARCH ( arch ), \
222  ':', 'U', 'N', 'D', 'I', ':', DHCP_VENDOR_PXECLIENT_UNDI ( ndi )
223 
224 /** Vendor class identifier architecture for PXE clients */
225 #define DHCP_VENDOR_PXECLIENT_ARCH( arch ) \
226  ( '0' + ( ( (arch) / 10000 ) % 10 ) ), \
227  ( '0' + ( ( (arch) / 1000 ) % 10 ) ), \
228  ( '0' + ( ( (arch) / 100 ) % 10 ) ), \
229  ( '0' + ( ( (arch) / 10 ) % 10 ) ), \
230  ( '0' + ( ( (arch) / 1 ) % 10 ) )
231 
232 /** Vendor class identifier UNDI version for PXE clients */
233 #define DHCP_VENDOR_PXECLIENT_UNDI( type, major, minor ) \
234  DHCP_VENDOR_PXECLIENT_UNDI_VERSION ( major ), \
235  DHCP_VENDOR_PXECLIENT_UNDI_VERSION ( minor )
236 #define DHCP_VENDOR_PXECLIENT_UNDI_VERSION( version ) \
237  ( '0' + ( ( (version) / 100 ) % 10 ) ), \
238  ( '0' + ( ( (version) / 10 ) % 10 ) ), \
239  ( '0' + ( ( (version) / 1 ) % 10 ) )
240 
241 /** Client identifier */
242 #define DHCP_CLIENT_ID 61
243 
244 /** Client identifier */
246  /** Link-layer protocol */
248  /** Link-layer address */
250 } __attribute__ (( packed ));
251 
252 /** TFTP server name
253  *
254  * This option replaces the fixed "sname" field, when that field is
255  * used to contain overloaded options.
256  */
257 #define DHCP_TFTP_SERVER_NAME 66
258 
259 /** Bootfile name
260  *
261  * This option replaces the fixed "file" field, when that field is
262  * used to contain overloaded options.
263  */
264 #define DHCP_BOOTFILE_NAME 67
265 
266 /** User class identifier */
267 #define DHCP_USER_CLASS_ID 77
268 
269 /** Client system architecture */
270 #define DHCP_CLIENT_ARCHITECTURE 93
271 
272 /** DHCP client architecture */
275 } __attribute__ (( packed ));
276 
277 /** DHCP client architecture values
278  *
279  * These are originally defined by the PXE specification, redefined by
280  * RFC4578, redefined again by RFC5970, and now maintained in the IANA
281  * DHCPv6 parameters registry.
282  */
284  /** Intel x86 PC */
286  /** NEC/PC98 */
288  /** EFI Itanium */
290  /** DEC Alpha */
292  /** Arc x86 */
294  /** Intel Lean Client */
296  /** EFI IA32 */
298  /** EFI x86-64 */
300  /** EFI Xscale */
302  /** EFI BC */
304  /** EFI 32-bit ARM */
306  /** EFI 64-bit ARM */
308  /** EFI 32-bit RISC-V */
310  /** EFI 64-bit RISC-V */
312  /** EFI 128-bit RISC-V */
314  /** EFI 32-bit MIPS */
316  /** EFI 64-bit MIPS */
318  /** EFI 32-bit Sunway */
320  /** EFI 64-bit Sunway */
322  /** EFI 32-bit LoongArch */
324  /** EFI 64-bit LoongArch */
326 };
327 
328 /** Client network device interface */
329 #define DHCP_CLIENT_NDI 94
330 
331 /** UUID client identifier */
332 #define DHCP_CLIENT_UUID 97
333 
334 /** UUID client identifier */
336  /** Identifier type */
338  /** UUID */
339  union uuid uuid;
340 } __attribute__ (( packed ));
341 
342 #define DHCP_CLIENT_UUID_TYPE 0
343 
344 /** DNS domain search list */
345 #define DHCP_DOMAIN_SEARCH 119
346 
347 /** Classless static routes */
348 #define DHCP_STATIC_ROUTES 121
349 
350 /** Etherboot-specific encapsulated options
351  *
352  * This encapsulated options field is used to contain all options
353  * specific to Etherboot (i.e. not assigned by IANA or other standards
354  * bodies).
355  */
356 #define DHCP_EB_ENCAP 175
357 
358 /** Priority of this options block
359  *
360  * This is a signed 8-bit integer field indicating the priority of
361  * this block of options. It can be used to specify the relative
362  * priority of multiple option blocks (e.g. options from non-volatile
363  * storage versus options from a DHCP server).
364  */
365 #define DHCP_EB_PRIORITY DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0x01 )
366 
367 /** "Your" IP address
368  *
369  * This option is used internally to contain the value of the "yiaddr"
370  * field, in order to provide a consistent approach to storing and
371  * processing options. It should never be present in a DHCP packet.
372  */
373 #define DHCP_EB_YIADDR DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0x02 )
374 
375 /** "Server" IP address
376  *
377  * This option is used internally to contain the value of the "siaddr"
378  * field, in order to provide a consistent approach to storing and
379  * processing options. It should never be present in a DHCP packet.
380  */
381 #define DHCP_EB_SIADDR DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0x03 )
382 
383 /** Keep SAN drive registered
384  *
385  * If set to a non-zero value, iPXE will not detach any SAN drive
386  * after failing to boot from it. (This option is required in order
387  * to perform an installation direct to an iSCSI target.)
388  */
389 #define DHCP_EB_KEEP_SAN DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0x08 )
390 
391 /** Skip booting from SAN drive
392  *
393  * If set to a non-zero value, iPXE will skip booting from any SAN
394  * drive. (This option is sometimes required in conjunction with @c
395  * DHCP_EB_KEEP_SAN in order to perform an installation direct to an
396  * iSCSI target.)
397  */
398 #define DHCP_EB_SKIP_SAN_BOOT DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0x09 )
399 
400 /*
401  * Tags in the range 0x10-0x4f are reserved for feature markers
402  *
403  */
404 
405 /** Scriptlet
406  *
407  * If a scriptlet exists, it will be executed in place of the usual
408  * call to autoboot()
409  */
410 #define DHCP_EB_SCRIPTLET DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0x51 )
411 
412 /** Encrypted syslog server */
413 #define DHCP_EB_SYSLOGS_SERVER DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0x55 )
414 
415 /** Trusted root certficate fingerprints */
416 #define DHCP_EB_TRUST DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0x5a )
417 
418 /** Client certficate */
419 #define DHCP_EB_CERT DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0x5b )
420 
421 /** Client private key */
422 #define DHCP_EB_KEY DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0x5c )
423 
424 /** Cross-signed certificate source */
425 #define DHCP_EB_CROSS_CERT DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0x5d )
426 
427 /** Skip PXE DHCP protocol extensions such as ProxyDHCP
428  *
429  * If set to a non-zero value, iPXE will not wait for ProxyDHCP offers
430  * and will ignore any PXE-specific DHCP options that it receives.
431  */
432 #define DHCP_EB_NO_PXEDHCP DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0xb0 )
433 
434 /** Network device descriptor
435  *
436  * Byte 0 is the bus type ID; remaining bytes depend on the bus type.
437  *
438  * PCI devices:
439  * Byte 0 : 1 (PCI)
440  * Byte 1 : PCI vendor ID MSB
441  * Byte 2 : PCI vendor ID LSB
442  * Byte 3 : PCI device ID MSB
443  * Byte 4 : PCI device ID LSB
444  */
445 #define DHCP_EB_BUS_ID DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0xb1 )
446 
447 /** Network device descriptor */
449  /** Bus type ID */
451  /** Vendor ID */
453  /** Device ID */
455 } __attribute__ (( packed ));
456 
457 /** Use cached network settings (obsolete; do not reuse this value) */
458 #define DHCP_EB_USE_CACHED DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0xb2 )
459 
460 /** SAN retry count
461  *
462  * This is the maximum number of times that SAN operations will be
463  * retried.
464  */
465 #define DHCP_EB_SAN_RETRY DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0xbb )
466 
467 /** SAN filename
468  *
469  * This is the path of the bootloader within the SAN device.
470  */
471 #define DHCP_EB_SAN_FILENAME DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0xbc )
472 
473 /** SAN drive number
474  *
475  * This is the drive number for a SAN-hooked drive. For BIOS, 0x80 is
476  * the first hard disk, 0x81 is the second hard disk, etc.
477  */
478 #define DHCP_EB_SAN_DRIVE DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0xbd )
479 
480 /** Username
481  *
482  * This will be used as the username for any required authentication.
483  * It is expected that this option's value will be held in
484  * non-volatile storage, rather than transmitted as part of a DHCP
485  * packet.
486  */
487 #define DHCP_EB_USERNAME DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0xbe )
488 
489 /** Password
490  *
491  * This will be used as the password for any required authentication.
492  * It is expected that this option's value will be held in
493  * non-volatile storage, rather than transmitted as part of a DHCP
494  * packet.
495  */
496 #define DHCP_EB_PASSWORD DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0xbf )
497 
498 /** Reverse username
499  *
500  * This will be used as the reverse username (i.e. the username
501  * provided by the server) for any required authentication. It is
502  * expected that this option's value will be held in non-volatile
503  * storage, rather than transmitted as part of a DHCP packet.
504  */
505 #define DHCP_EB_REVERSE_USERNAME DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0xc0 )
506 
507 /** Reverse password
508  *
509  * This will be used as the reverse password (i.e. the password
510  * provided by the server) for any required authentication. It is
511  * expected that this option's value will be held in non-volatile
512  * storage, rather than transmitted as part of a DHCP packet.
513  */
514 #define DHCP_EB_REVERSE_PASSWORD DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0xc1 )
515 
516 /** User ID
517  *
518  * This will be used as the user id for AUTH_SYS based authentication in NFS.
519  */
520 #define DHCP_EB_UID DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0xc2 )
521 
522 /** Group ID
523  *
524  * This will be used as the group id for AUTH_SYS based authentication in NFS.
525  */
526 #define DHCP_EB_GID DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0xc3 )
527 
528 /** iPXE version number */
529 #define DHCP_EB_VERSION DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0xeb )
530 
531 /** iSCSI primary target IQN */
532 #define DHCP_ISCSI_PRIMARY_TARGET_IQN 201
533 
534 /** iSCSI secondary target IQN */
535 #define DHCP_ISCSI_SECONDARY_TARGET_IQN 202
536 
537 /** iSCSI initiator IQN */
538 #define DHCP_ISCSI_INITIATOR_IQN 203
539 
540 /** Maximum normal DHCP option */
541 #define DHCP_MAX_OPTION 254
542 
543 /** End of options
544  *
545  * This tag does not have a length field; it is always only a single
546  * byte in length.
547  */
548 #define DHCP_END 255
549 
550 /** @} */
551 
552 /** Construct a DHCP option from a list of bytes */
553 #define DHCP_OPTION( ... ) VA_ARG_COUNT ( __VA_ARGS__ ), __VA_ARGS__
554 
555 /** Construct a DHCP option from a list of characters */
556 #define DHCP_STRING( ... ) DHCP_OPTION ( __VA_ARGS__ )
557 
558 /** Construct a byte-valued DHCP option */
559 #define DHCP_BYTE( value ) DHCP_OPTION ( value )
560 
561 /** Construct a word-valued DHCP option */
562 #define DHCP_WORD( value ) DHCP_OPTION ( ( ( (value) >> 8 ) & 0xff ), \
563  ( ( (value) >> 0 ) & 0xff ) )
564 
565 /** Construct a dword-valued DHCP option */
566 #define DHCP_DWORD( value ) DHCP_OPTION ( ( ( (value) >> 24 ) & 0xff ), \
567  ( ( (value) >> 16 ) & 0xff ), \
568  ( ( (value) >> 8 ) & 0xff ), \
569  ( ( (value) >> 0 ) & 0xff ) )
570 
571 /** Construct a DHCP encapsulated options field */
572 #define DHCP_ENCAP( ... ) DHCP_OPTION ( __VA_ARGS__, DHCP_END )
573 
574 /**
575  * A DHCP option
576  *
577  * DHCP options consist of a mandatory tag, a length field that is
578  * mandatory for all options except @c DHCP_PAD and @c DHCP_END, and a
579  * payload.
580  */
581 struct dhcp_option {
582  /** Tag
583  *
584  * Must be a @c DHCP_XXX value.
585  */
587  /** Length
588  *
589  * This is the length of the data field (i.e. excluding the
590  * tag and length fields). For the two tags @c DHCP_PAD and
591  * @c DHCP_END, the length field is implicitly zero and is
592  * also missing, i.e. these DHCP options are only a single
593  * byte in length.
594  */
596  /** Option data */
598 } __attribute__ (( packed ));
599 
600 /**
601  * Length of a DHCP option header
602  *
603  * The header is the portion excluding the data, i.e. the tag and the
604  * length.
605  */
606 #define DHCP_OPTION_HEADER_LEN ( offsetof ( struct dhcp_option, data ) )
607 
608 /** Maximum length for a single DHCP option */
609 #define DHCP_MAX_LEN 0xff
610 
611 /**
612  * A DHCP header
613  *
614  */
615 struct dhcphdr {
616  /** Operation
617  *
618  * This must be either @c BOOTP_REQUEST or @c BOOTP_REPLY.
619  */
621  /** Hardware address type
622  *
623  * This is an ARPHRD_XXX constant. Note that ARPHRD_XXX
624  * constants are nominally 16 bits wide; this could be
625  * considered to be a bug in the BOOTP/DHCP specification.
626  */
628  /** Hardware address length */
630  /** Number of hops from server */
632  /** Transaction ID */
634  /** Seconds since start of acquisition */
636  /** Flags */
638  /** "Client" IP address
639  *
640  * This is filled in if the client already has an IP address
641  * assigned and can respond to ARP requests.
642  */
643  struct in_addr ciaddr;
644  /** "Your" IP address
645  *
646  * This is the IP address assigned by the server to the client.
647  */
648  struct in_addr yiaddr;
649  /** "Server" IP address
650  *
651  * This is the IP address of the next server to be used in the
652  * boot process.
653  */
654  struct in_addr siaddr;
655  /** "Gateway" IP address
656  *
657  * This is the IP address of the DHCP relay agent, if any.
658  */
659  struct in_addr giaddr;
660  /** Client hardware address */
662  /** Server host name (null terminated)
663  *
664  * This field may be overridden and contain DHCP options
665  */
666  char sname[64];
667  /** Boot file name (null terminated)
668  *
669  * This field may be overridden and contain DHCP options
670  */
671  char file[128];
672  /** DHCP magic cookie
673  *
674  * Must have the value @c DHCP_MAGIC_COOKIE.
675  */
677  /** DHCP options
678  *
679  * Variable length; extends to the end of the packet. Minimum
680  * length (for the sake of sanity) is 1, to allow for a single
681  * @c DHCP_END tag.
682  */
684 };
685 
686 /** Opcode for a request from client to server */
687 #define BOOTP_REQUEST 1
688 
689 /** Opcode for a reply from server to client */
690 #define BOOTP_REPLY 2
691 
692 /** BOOTP reply must be broadcast
693  *
694  * Clients that cannot accept unicast BOOTP replies must set this
695  * flag.
696  */
697 #define BOOTP_FL_BROADCAST 0x8000
698 
699 /** DHCP magic cookie */
700 #define DHCP_MAGIC_COOKIE 0x63825363UL
701 
702 /** DHCP minimum packet length
703  *
704  * This is the mandated minimum packet length that a DHCP participant
705  * must be prepared to receive.
706  */
707 #define DHCP_MIN_LEN 552
708 
709 /** Settings block name used for DHCP responses */
710 #define DHCP_SETTINGS_NAME "dhcp"
711 
712 /** Settings block name used for ProxyDHCP responses */
713 #define PROXYDHCP_SETTINGS_NAME "proxydhcp"
714 
715 /** Setting block name used for BootServerDHCP responses */
716 #define PXEBS_SETTINGS_NAME "pxebs"
717 
718 extern uint32_t dhcp_last_xid;
719 extern int dhcp_create_packet ( struct dhcp_packet *dhcppkt,
720  struct net_device *netdev, uint8_t msgtype,
721  uint32_t xid, const void *options,
722  size_t options_len, void *data,
723  size_t max_len );
724 extern int dhcp_create_request ( struct dhcp_packet *dhcppkt,
725  struct net_device *netdev,
726  unsigned int msgtype, uint32_t xid,
727  struct in_addr ciaddr,
728  void *data, size_t max_len );
729 extern int start_dhcp ( struct interface *job, struct net_device *netdev );
730 extern int start_pxebs ( struct interface *job, struct net_device *netdev,
731  unsigned int pxe_type );
732 
733 #endif /* _IPXE_DHCP_H */
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
EFI 64-bit RISC-V.
Definition: dhcp.h:311
#define __attribute__(x)
Definition: compiler.h:10
EFI 32-bit LoongArch.
Definition: dhcp.h:323
unsigned short uint16_t
Definition: stdint.h:11
DHCP client architecture.
Definition: dhcp.h:273
A DHCP packet.
Definition: dhcppkt.h:20
uint8_t timeout
Timeout.
Definition: dhcp.h:152
uint8_t data[0]
Option data.
Definition: dhcp.h:597
uint8_t num_ip
Number of IPv4 addresses.
Definition: dhcp.h:120
uint8_t type
Bus type ID.
Definition: dhcp.h:450
uint16_t type
"Type"
Definition: dhcp.h:118
A universally unique ID.
Definition: uuid.h:15
PXE boot menu prompt.
Definition: dhcp.h:142
int dhcp_create_request(struct dhcp_packet *dhcppkt, struct net_device *netdev, unsigned int msgtype, uint32_t xid, struct in_addr ciaddr, void *data, size_t max_len)
Create DHCP request packet.
Definition: dhcp.c:1007
uint8_t htype
Hardware address type.
Definition: dhcp.h:627
Universally unique IDs.
dhcp_client_architecture_values
DHCP client architecture values.
Definition: dhcp.h:283
uint8_t options[0]
DHCP options.
Definition: dhcp.h:683
uint32_t xid
Transaction ID.
Definition: dhcp.h:633
uint16_t secs
Seconds since start of acquisition.
Definition: dhcp.h:635
EFI 64-bit MIPS.
Definition: dhcp.h:317
int start_dhcp(struct interface *job, struct net_device *netdev)
Start DHCP state machine on a network device.
Definition: dhcp.c:1357
uint8_t tag
Tag.
Definition: dhcp.h:586
uint16_t layer
"Layer"
Definition: dhcp.h:172
uint8_t len
Length.
Definition: dhcp.h:595
uint16_t type
"Type"
Definition: dhcp.h:131
dhcp_pxe_discovery_control
PXE boot server discovery control bits.
Definition: dhcp.h:98
uint16_t type
"Type"
Definition: dhcp.h:167
EFI 64-bit Sunway.
Definition: dhcp.h:321
uint16_t flags
Flags.
Definition: dhcp.h:637
#define MAX_LL_ADDR_LEN
Maximum length of a link-layer address.
Definition: netdevice.h:36
uint8_t op
Operation.
Definition: dhcp.h:620
An object interface.
Definition: interface.h:124
uint32_t dhcp_last_xid
Most recent DHCP transaction ID.
Definition: dhcp.c:124
static int options
Definition: 3c515.c:286
uint8_t ll_addr[MAX_LL_ADDR_LEN]
Link-layer address.
Definition: dhcp.h:249
static struct net_device * netdev
Definition: gdbudp.c:52
int dhcp_create_packet(struct dhcp_packet *dhcppkt, struct net_device *netdev, uint8_t msgtype, uint32_t xid, const void *options, size_t options_len, void *data, size_t max_len)
Create a DHCP packet.
Definition: dhcp.c:944
struct in_addr ciaddr
"Client" IP address
Definition: dhcp.h:643
struct in_addr siaddr
"Server" IP address
Definition: dhcp.h:654
EFI 64-bit LoongArch.
Definition: dhcp.h:325
Linked lists.
struct in_addr ip[0]
IPv4 addresses.
Definition: dhcp.h:122
EFI 32-bit MIPS.
Definition: dhcp.h:315
IP address structure.
Definition: in.h:41
Client identifier.
Definition: dhcp.h:245
int start_pxebs(struct interface *job, struct net_device *netdev, unsigned int pxe_type)
Start PXE Boot Server Discovery on a network device.
Definition: dhcp.c:1447
uint8_t chaddr[16]
Client hardware address.
Definition: dhcp.h:661
uint16_t device
Device ID.
Definition: dhcp.h:454
char prompt[0]
Prompt to press F8.
Definition: dhcp.h:154
A network device.
Definition: netdevice.h:352
Network device descriptor.
Definition: dhcp.h:448
char desc[0]
Description.
Definition: dhcp.h:135
unsigned char uint8_t
Definition: stdint.h:10
struct in_addr yiaddr
"Your" IP address
Definition: dhcp.h:648
Intel Lean Client.
Definition: dhcp.h:295
unsigned int uint32_t
Definition: stdint.h:12
Accept only servers in DHCP_PXE_BOOT_SERVERS list.
Definition: dhcp.h:104
uint8_t hops
Number of hops from server.
Definition: dhcp.h:631
Inhibit broadcast discovery.
Definition: dhcp.h:100
EFI 32-bit ARM.
Definition: dhcp.h:305
EFI 64-bit ARM.
Definition: dhcp.h:307
UUID client identifier.
Definition: dhcp.h:335
A DHCP header.
Definition: dhcp.h:615
Network device management.
PXE boot menu item.
Definition: dhcp.h:161
uint8_t type
Identifier type.
Definition: dhcp.h:337
Skip discovery if filename present.
Definition: dhcp.h:106
A DHCP option.
Definition: dhcp.h:581
char sname[64]
Server host name (null terminated)
Definition: dhcp.h:666
Reference counting.
uint8_t data[48]
Additional event data.
Definition: ena.h:22
char file[128]
Boot file name (null terminated)
Definition: dhcp.h:671
uint32_t magic
DHCP magic cookie.
Definition: dhcp.h:676
Linker tables.
EFI 128-bit RISC-V.
Definition: dhcp.h:313
EFI 32-bit RISC-V.
Definition: dhcp.h:309
uint16_t vendor
Vendor ID.
Definition: dhcp.h:452
uint8_t hlen
Hardware address length.
Definition: dhcp.h:629
PXE boot menu.
Definition: dhcp.h:129
struct in_addr giaddr
"Gateway" IP address
Definition: dhcp.h:659
PXE boot server.
Definition: dhcp.h:116
uint8_t desc_len
Description length.
Definition: dhcp.h:133
EFI 32-bit Sunway.
Definition: dhcp.h:319
Inhibit multicast discovery.
Definition: dhcp.h:102
uint8_t ll_proto
Link-layer protocol.
Definition: dhcp.h:247
A DHCP options block.
Definition: dhcpopts.h:15