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