iPXE
Data Fields
dhcphdr Struct Reference

A DHCP header. More...

#include <dhcp.h>

Data Fields

uint8_t op
 Operation. More...
 
uint8_t htype
 Hardware address type. More...
 
uint8_t hlen
 Hardware address length. More...
 
uint8_t hops
 Number of hops from server. More...
 
uint32_t xid
 Transaction ID. More...
 
uint16_t secs
 Seconds since start of acquisition. More...
 
uint16_t flags
 Flags. More...
 
struct in_addr ciaddr
 "Client" IP address More...
 
struct in_addr yiaddr
 "Your" IP address More...
 
struct in_addr siaddr
 "Server" IP address More...
 
struct in_addr giaddr
 "Gateway" IP address More...
 
uint8_t chaddr [16]
 Client hardware address. More...
 
char sname [64]
 Server host name (null terminated) More...
 
char file [128]
 Boot file name (null terminated) More...
 
uint32_t magic
 DHCP magic cookie. More...
 
uint8_t options [0]
 DHCP options. More...
 

Detailed Description

A DHCP header.

Definition at line 613 of file dhcp.h.

Field Documentation

◆ op

uint8_t dhcphdr::op

Operation.

This must be either BOOTP_REQUEST or BOOTP_REPLY.

Definition at line 618 of file dhcp.h.

Referenced by dhcp_create_packet().

◆ htype

uint8_t dhcphdr::htype

Hardware address type.

This is an ARPHRD_XXX constant. Note that ARPHRD_XXX constants are nominally 16 bits wide; this could be considered to be a bug in the BOOTP/DHCP specification.

Definition at line 625 of file dhcp.h.

Referenced by dhcp_create_packet().

◆ hlen

uint8_t dhcphdr::hlen

Hardware address length.

Definition at line 627 of file dhcp.h.

Referenced by dhcp_create_packet().

◆ hops

uint8_t dhcphdr::hops

Number of hops from server.

Definition at line 629 of file dhcp.h.

◆ xid

uint32_t dhcphdr::xid

Transaction ID.

Definition at line 631 of file dhcp.h.

Referenced by dhcp_create_packet(), dhcp_deliver(), and dhcpv6_tx().

◆ secs

uint16_t dhcphdr::secs

Seconds since start of acquisition.

Definition at line 633 of file dhcp.h.

Referenced by dhcp_tx().

◆ flags

uint16_t dhcphdr::flags

Flags.

Definition at line 635 of file dhcp.h.

Referenced by dhcp_create_packet().

◆ ciaddr

struct in_addr dhcphdr::ciaddr

"Client" IP address

This is filled in if the client already has an IP address assigned and can respond to ARP requests.

Definition at line 641 of file dhcp.h.

Referenced by create_fakepxebsack(), and dhcp_create_request().

◆ yiaddr

struct in_addr dhcphdr::yiaddr

"Your" IP address

This is the IP address assigned by the server to the client.

Definition at line 646 of file dhcp.h.

Referenced by dhcp_discovery_rx(), and dhcp_request_rx().

◆ siaddr

struct in_addr dhcphdr::siaddr

"Server" IP address

This is the IP address of the next server to be used in the boot process.

Definition at line 652 of file dhcp.h.

Referenced by dhcp_deliver(), and dhcp_has_pxeopts().

◆ giaddr

struct in_addr dhcphdr::giaddr

"Gateway" IP address

This is the IP address of the DHCP relay agent, if any.

Definition at line 657 of file dhcp.h.

◆ chaddr

uint8_t dhcphdr::chaddr[16]

Client hardware address.

Definition at line 659 of file dhcp.h.

Referenced by cachedhcp_apply(), dhcp_create_packet(), and dhcp_deliver().

◆ sname

char dhcphdr::sname[64]

Server host name (null terminated)

This field may be overridden and contain DHCP options

Definition at line 664 of file dhcp.h.

◆ file

char dhcphdr::file[128]

Boot file name (null terminated)

This field may be overridden and contain DHCP options

Definition at line 669 of file dhcp.h.

◆ magic

uint32_t dhcphdr::magic

DHCP magic cookie.

Must have the value DHCP_MAGIC_COOKIE.

Definition at line 674 of file dhcp.h.

Referenced by dhcp_create_packet().

◆ options

uint8_t dhcphdr::options[0]

DHCP options.

Variable length; extends to the end of the packet. Minimum length (for the sake of sanity) is 1, to allow for a single DHCP_END tag.

Definition at line 681 of file dhcp.h.

Referenced by dhcp_create_packet(), dhcppkt_init(), and dhcpv6_rx().


The documentation for this struct was generated from the following file: