27 #define BOOTPS_PORT 67 30 #define BOOTPC_PORT 68 41 #define DHCP_ENCAP_OPT( encapsulator, encapsulated ) \ 42 ( ( (encapsulator) << 8 ) | (encapsulated) ) 44 #define DHCP_ENCAPSULATOR( encap_opt ) ( (encap_opt) >> 8 ) 46 #define DHCP_ENCAPSULATED( encap_opt ) ( (encap_opt) & 0xff ) 48 #define DHCP_IS_ENCAP_OPT( opt ) DHCP_ENCAPSULATOR( opt ) 63 #define DHCP_MIN_OPTION 1 66 #define DHCP_SUBNET_MASK 1 69 #define DHCP_ROUTERS 3 72 #define DHCP_DNS_SERVERS 6 75 #define DHCP_LOG_SERVERS 7 78 #define DHCP_HOST_NAME 12 81 #define DHCP_DOMAIN_NAME 15 84 #define DHCP_ROOT_PATH 17 90 #define DHCP_NTP_SERVERS 42 93 #define DHCP_VENDOR_ENCAP 43 96 #define DHCP_PXE_DISCOVERY_CONTROL DHCP_ENCAP_OPT ( DHCP_VENDOR_ENCAP, 6 ) 111 #define DHCP_PXE_BOOT_SERVER_MCAST DHCP_ENCAP_OPT ( DHCP_VENDOR_ENCAP, 7 ) 114 #define DHCP_PXE_BOOT_SERVERS DHCP_ENCAP_OPT ( DHCP_VENDOR_ENCAP, 8 ) 127 #define DHCP_PXE_BOOT_MENU DHCP_ENCAP_OPT ( DHCP_VENDOR_ENCAP, 9 ) 140 #define DHCP_PXE_BOOT_MENU_PROMPT DHCP_ENCAP_OPT ( DHCP_VENDOR_ENCAP, 10 ) 159 #define DHCP_PXE_BOOT_MENU_ITEM DHCP_ENCAP_OPT ( DHCP_VENDOR_ENCAP, 71 ) 177 #define DHCP_REQUESTED_ADDRESS 50 180 #define DHCP_LEASE_TIME 51 187 #define DHCP_OPTION_OVERLOAD 52 190 #define DHCP_OPTION_OVERLOAD_FILE 1 193 #define DHCP_OPTION_OVERLOAD_SNAME 2 196 #define DHCP_MESSAGE_TYPE 53 198 #define DHCPDISCOVER 1 200 #define DHCPREQUEST 3 201 #define DHCPDECLINE 4 204 #define DHCPRELEASE 7 208 #define DHCP_SERVER_IDENTIFIER 54 211 #define DHCP_PARAMETER_REQUEST_LIST 55 214 #define DHCP_MAX_MESSAGE_SIZE 57 217 #define DHCP_VENDOR_CLASS_ID 60 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 ) 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 ) ) 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 ) ) 243 #define DHCP_CLIENT_ID 61 258 #define DHCP_TFTP_SERVER_NAME 66 265 #define DHCP_BOOTFILE_NAME 67 268 #define DHCP_USER_CLASS_ID 77 271 #define DHCP_CLIENT_ARCHITECTURE 93 330 #define DHCP_CLIENT_NDI 94 333 #define DHCP_CLIENT_UUID 97 343 #define DHCP_CLIENT_UUID_TYPE 0 346 #define DHCP_DOMAIN_SEARCH 119 354 #define DHCP_EB_ENCAP 175 363 #define DHCP_EB_PRIORITY DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0x01 ) 371 #define DHCP_EB_YIADDR DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0x02 ) 379 #define DHCP_EB_SIADDR DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0x03 ) 387 #define DHCP_EB_KEEP_SAN DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0x08 ) 396 #define DHCP_EB_SKIP_SAN_BOOT DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0x09 ) 408 #define DHCP_EB_SCRIPTLET DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0x51 ) 411 #define DHCP_EB_SYSLOGS_SERVER DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0x55 ) 414 #define DHCP_EB_TRUST DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0x5a ) 417 #define DHCP_EB_CERT DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0x5b ) 420 #define DHCP_EB_KEY DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0x5c ) 423 #define DHCP_EB_CROSS_CERT DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0x5d ) 430 #define DHCP_EB_NO_PXEDHCP DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0xb0 ) 443 #define DHCP_EB_BUS_ID DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0xb1 ) 456 #define DHCP_EB_USE_CACHED DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0xb2 ) 463 #define DHCP_EB_SAN_RETRY DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0xbb ) 469 #define DHCP_EB_SAN_FILENAME DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0xbc ) 476 #define DHCP_EB_SAN_DRIVE DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0xbd ) 485 #define DHCP_EB_USERNAME DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0xbe ) 494 #define DHCP_EB_PASSWORD DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0xbf ) 503 #define DHCP_EB_REVERSE_USERNAME DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0xc0 ) 512 #define DHCP_EB_REVERSE_PASSWORD DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0xc1 ) 518 #define DHCP_EB_UID DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0xc2 ) 524 #define DHCP_EB_GID DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0xc3 ) 527 #define DHCP_EB_VERSION DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0xeb ) 530 #define DHCP_ISCSI_PRIMARY_TARGET_IQN 201 533 #define DHCP_ISCSI_SECONDARY_TARGET_IQN 202 536 #define DHCP_ISCSI_INITIATOR_IQN 203 539 #define DHCP_MAX_OPTION 254 551 #define DHCP_OPTION( ... ) VA_ARG_COUNT ( __VA_ARGS__ ), __VA_ARGS__ 554 #define DHCP_STRING( ... ) DHCP_OPTION ( __VA_ARGS__ ) 557 #define DHCP_BYTE( value ) DHCP_OPTION ( value ) 560 #define DHCP_WORD( value ) DHCP_OPTION ( ( ( (value) >> 8 ) & 0xff ), \ 561 ( ( (value) >> 0 ) & 0xff ) ) 564 #define DHCP_DWORD( value ) DHCP_OPTION ( ( ( (value) >> 24 ) & 0xff ), \ 565 ( ( (value) >> 16 ) & 0xff ), \ 566 ( ( (value) >> 8 ) & 0xff ), \ 567 ( ( (value) >> 0 ) & 0xff ) ) 570 #define DHCP_ENCAP( ... ) DHCP_OPTION ( __VA_ARGS__, DHCP_END ) 604 #define DHCP_OPTION_HEADER_LEN ( offsetof ( struct dhcp_option, data ) ) 607 #define DHCP_MAX_LEN 0xff 685 #define BOOTP_REQUEST 1 688 #define BOOTP_REPLY 2 695 #define BOOTP_FL_BROADCAST 0x8000 698 #define DHCP_MAGIC_COOKIE 0x63825363UL 705 #define DHCP_MIN_LEN 552 708 #define DHCP_SETTINGS_NAME "dhcp" 711 #define PROXYDHCP_SETTINGS_NAME "proxydhcp" 714 #define PXEBS_SETTINGS_NAME "pxebs" 720 size_t options_len,
void *
data,
726 void *
data,
size_t max_len );
729 unsigned int pxe_type );
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
DHCP client architecture.
uint8_t data[0]
Option data.
uint8_t num_ip
Number of IPv4 addresses.
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.
uint8_t htype
Hardware address type.
dhcp_client_architecture_values
DHCP client architecture values.
uint8_t options[0]
DHCP options.
uint32_t xid
Transaction ID.
uint16_t secs
Seconds since start of acquisition.
Access to external ("user") memory.
int start_dhcp(struct interface *job, struct net_device *netdev)
Start DHCP state machine on a network device.
dhcp_pxe_discovery_control
PXE boot server discovery control bits.
#define MAX_LL_ADDR_LEN
Maximum length of a link-layer address.
uint32_t dhcp_last_xid
Most recent DHCP transaction ID.
uint8_t ll_addr[MAX_LL_ADDR_LEN]
Link-layer address.
static struct net_device * netdev
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.
struct in_addr ciaddr
"Client" IP address
struct in_addr siaddr
"Server" IP address
struct in_addr ip[0]
IPv4 addresses.
int start_pxebs(struct interface *job, struct net_device *netdev, unsigned int pxe_type)
Start PXE Boot Server Discovery on a network device.
uint8_t chaddr[16]
Client hardware address.
uint16_t device
Device ID.
Network device descriptor.
struct in_addr yiaddr
"Your" IP address
Accept only servers in DHCP_PXE_BOOT_SERVERS list.
uint8_t hops
Number of hops from server.
Inhibit broadcast discovery.
Network device management.
uint8_t type
Identifier type.
Skip discovery if filename present.
char sname[64]
Server host name (null terminated)
uint8_t data[48]
Additional event data.
char file[128]
Boot file name (null terminated)
uint32_t magic
DHCP magic cookie.
uint16_t vendor
Vendor ID.
uint8_t hlen
Hardware address length.
struct in_addr giaddr
"Gateway" IP address
Inhibit multicast discovery.
uint8_t ll_proto
Link-layer protocol.