struct dhcp_message

Overview

Structure of DHCP message More…

#include <tapi_dhcp.h>

struct dhcp_message {
    // fields

    uint8_t op;
    uint8_t htype;
    uint8_t hlen;
    uint8_t hops;
    uint32_t xid;
    uint16_t secs;
    uint16_t flags;
    uint32_t ciaddr;
    uint32_t yiaddr;
    uint32_t siaddr;
    uint32_t giaddr;
    uint8_t chaddr[DHCPV4_HDR_CHADDR_SIZE];
    uint8_t sname[DHCPV4_HDR_SNAME_SIZE];
    uint8_t file[DHCPV4_HDR_FILE_SIZE];
    bool is_op_set;
    bool is_htype_set;
    bool is_hlen_set;
    bool is_hops_set;
    bool is_xid_set;
    bool is_secs_set;
    bool is_flags_set;
    bool is_ciaddr_set;
    bool is_yiaddr_set;
    bool is_siaddr_set;
    bool is_giaddr_set;
    bool is_chaddr_set;
    bool is_sname_set;
    bool is_file_set;
    struct dhcp_option* opts;
};

Detailed Documentation

Structure of DHCP message

Fields

uint8_t op

Message op code

uint8_t htype

Hardware address type

uint8_t hlen

Hardware address length

uint8_t hops

Client sets to zero, optionally used by relay agents when booting via a relay agent

uint32_t xid

Transaction ID

uint16_t secs

Seconds elapsed since client began address acquisition or renewal process

uint16_t flags

Flags

uint32_t ciaddr

Client IP address

uint32_t yiaddr

‘your’ (client) IP address

uint32_t siaddr

IP address of next server to use in bootstrap

uint32_t giaddr

Relay agent IP address, used in booting via a relay agent

uint8_t chaddr[DHCPV4_HDR_CHADDR_SIZE]

Client hardware address

uint8_t sname[DHCPV4_HDR_SNAME_SIZE]

Server host name

uint8_t file[DHCPV4_HDR_FILE_SIZE]

Boot file name

bool is_op_set

Is message op code has been set

bool is_htype_set

Is message htype has been set

bool is_hlen_set

Is message hlen has been set

bool is_hops_set

Is message hops has been set

bool is_xid_set

Is message xid has been set

bool is_secs_set

Is message secs has been set

bool is_flags_set

Is message flags has been set

bool is_ciaddr_set

Is message ciaddr has been set

bool is_yiaddr_set

Is message yiaddr has been set

bool is_siaddr_set

Is message siaddr has been set

bool is_giaddr_set

Is message giaddr has been set

bool is_chaddr_set

Is message chaddr has been set

bool is_sname_set

Is message sname has been set

bool is_file_set

Is message file has been set

struct dhcp_option* opts

List of DHCP options