29#ifndef _NB_DHCP_CLIENT_H
30#define _NB_DHCP_CLIENT_H
39#define DHCP_NOTNEEDED (1)
40#define DHCP_FALLBACK (2)
41#define DHCP_FAILED (-1)
43#define DHCP_LINK_DOWN_RESTART_TICKS (5 * TICKS_PER_SECOND)
48#define SDHCP_NOTSTARTED 0
49#define SDHCP_DISCOVER 1
56#define SDHCP_RELEASE 8
57#define SBOOTP_TRANSMITTING 9
59#define SDHCP_FAILED 11
78 volatile int DhcpPendingPacket;
79 uint32_t DhcpLeasePendingStart;
80 uint32_t DhcpLeaseDuration;
82 void CreateDhcpRenewMsg(DHCPMessage &NewMsg);
83 void CreateDhcpReleaseMsg(DHCPMessage &NewMsg);
84 BOOLEAN BootpConfig(DHCPMessage &Msg);
85 BOOLEAN DhcpConfig(DHCPMessage &Msg);
86 void UpdateIPRuntimeVars(BOOLEAN release);
87 void ReTransmitPacket(uint32_t xid = 0);
88 void CreateBootpMsg(DHCPMessage &NewMsg);
89 uint32_t GetNextEventIntervalSecs();
91 BOOL bProcessThisDhcp;
93 uint32_t m_LinkChangeTick;
95 virtual void TimeElementEvent();
105 uint32_t DhcpLeaseStart;
106 uint32_t DhcpLeaseTime;
107 uint32_t DhcpRenewTime;
108 uint32_t DhcpRebindTime;
251 void PrintDhcpState(
int state);
256 static void staticDHCPPacket(
PoolPtr p);
258 void StopProcessing();
263 void (*leaseExpiredCallback)(
DhcpObject *dhcpClient);
264 void (*DHCPFailedCallback)(
DhcpObject *dhcpClient);
265 void (*leaseObtainedCallback)(
DhcpObject *dhcpClient);
267 void LinkNotify(
bool link);
270 friend void PrintDhcpState(
int state);
DHCP client class.
Definition dhcpclient.h:71
uint32_t GetDhcpRenewTime()
Returns number of seconds remaining before the lease will be renewed.
Definition dhcpclient.h:218
uint32_t GetRemainingDhcpLeaseTime()
Returns number of seconds remaining for current lease.
bool bDoFallBack()
Returns true if a DHCP fallback event has occurred.
void RebindDHCP()
Manually force a DHCP rebind of a lease.
BOOL ValidDhcpLease()
Returns the status of a DHCP lease.
void RestartDHCP()
Manually stop are resetart the DHCP client.
void StopDHCP()
Manually stop the DHCP client and release the DHCP lease.
uint32_t GetDhcpRebindTime()
Returns number of seconds remaining before the current lease will have to rebind.
Definition dhcpclient.h:228
int32_t GetDHCPState()
Returns current state of the DHCP lease.
uint32_t GetDhcpExpirationTime()
Returns number of seconds remaining before the current lease will expire.
Definition dhcpclient.h:238
void StartDHCP()
Manually start the DHCP Client.
void RenewDHCP()
Manually force a DHCP renew of a lease.
Used to store and manipulate IPv4 addresses in dual stack mode.
Definition nettypes.h:225
Network interface configuration block class for interface control and configuration.
Definition netinterface.h:245
#define TICKS_PER_SECOND
System clock ticks per second.
Definition constants.h:49
int32_t GetIntefaceDHCPState(int interface=0)
Returns current state of the DHCP lease, with optional interface parameter.
int32_t WaitForDHCPInterface(int interface=0, uint16_t TicksToWait=10 *TICKS_PER_SECOND)
Wait until a DHCP lease is obtained, or the timeout occurs.
Main buffer structure for network and serial communication.
Definition buffers.h:90