Example 4-1. DHCP Packet Fields
typedef struct dhcp { u_int8_t bp_opcode; u_int8_t bp_htype; u_int8_t bp_hlen; u_int8_t bp_hops; u_int32_t bp_xid; u_int16_t bp_secs; u_int16_t bp_flags; ip4_t bp_ciaddr; ip4_t bp_yiaddr; ip4_t bp_siaddr; ip4_t bp_giaddr; u_int8_t bp_chaddr[DHCP_CHADDR_LEN]; char bp_sname[DHCP_SNAME_LEN]; char bp_file[DHCP_FILE_LEN]; u_int8_t bp_options[DHCP_VEND_LEN]; } dhcp_t; |
This is the DHCP packet opcode type. This is typically either a DHCP_REQUEST, DHCP_OFFER, DHCP_REQUEST, or a DHCP_ACK.
This is the hardware address type. This is set to a 1 for 10mb ethernet.
hardware addr length. This is set to 6 for 10mb ethernet.
The number of hops to the gateway. Nilo sets this to zero, it's optionally used by gateways in cross-gateway booting.
This is the Transaction ID. This is a random number, used to match this boot request with the responses it generates.
This is the number of seconds since Nilo booted.
These are the various flags for this packet. (RFC1532 broadcast, etc...)
This is Nilo's IP address, since it's the client. This is filled in when Nilo in a DHCP_REQUEST knows it's own IP number.
This is Nilo's IP address to be filled in by the server when Nilo doesn't know it's own IP address. (ie bp_ciaddr it zero)
This is the server IP address. This is filled in by the server on a DHCP_OFFER.
This is the gateway IP address, which is only used for optional cross-gateway booting.
This is Nilo's ethernet hardware address.
This is the optional server host name as a null terminated string. This is for compatability with older implementations.
This is the boot file name as a fully path qualified, null terminated string. This is the file that will be loaded by the later TFTP session.
These are the DHCP options.