std1.0.0-beta-7 SafeC docs

std :: net::dhcp

Struct std::DhcpClient

#include <std/net/dhcp.h> source

struct DhcpClient {
    int state;
    unsigned int xid;
    struct DhcpLease lease;
    unsigned char mac[NET_MAC_LEN];
}

Fields

§int statesource
§unsigned int xidsource

transaction ID

§struct DhcpLease leasesource
§unsigned char mac[NET_MAC_LEN]source

Methods

§void discover(&PacketBuf pkt, const unsigned char eth_dst[NET_MAC_LEN])source · definition

Build a DHCPDISCOVER packet.

§void request( &PacketBuf pkt, const unsigned char eth_dst[NET_MAC_LEN], unsigned int offered_ip, unsigned int server_ip, )source · definition

Build a DHCPREQUEST for offered_ip from server_ip.

§int parse_reply(&PacketBuf pkt, unsigned long udp_payload_offset)source · definition

Parse an incoming DHCP reply; fills lease on ACK/OFFER. Returns DHCP_OFFER, DHCP_ACK, DHCP_NAK, or 0 on unrecognised.

§int is_bound() constsource · definition

Is the client bound (has a valid lease)?