dhcp_client_misc.c
Go to the documentation of this file.
const char_t * formatSystemTime(systime_t time, char_t *str)
Format system time.
Definition: date_time.c:77
Date and time management.
Debugging facilities.
DHCP client (Dynamic Host Configuration Protocol)
void dhcpClientStateRenewing(DhcpClientContext *context)
RENEWING state.
Definition: dhcp_client_fsm.c:535
void dhcpClientStateInitReboot(DhcpClientContext *context)
INIT-REBOOT state.
Definition: dhcp_client_fsm.c:241
void dhcpClientStateSelecting(DhcpClientContext *context)
SELECTING state.
Definition: dhcp_client_fsm.c:96
void dhcpClientStateRebooting(DhcpClientContext *context)
REBOOTING state.
Definition: dhcp_client_fsm.c:281
void dhcpClientStateProbing(DhcpClientContext *context)
PROBING state.
Definition: dhcp_client_fsm.c:363
void dhcpClientStateAnnouncing(DhcpClientContext *context)
ANNOUNCING state.
Definition: dhcp_client_fsm.c:430
void dhcpClientStateRequesting(DhcpClientContext *context)
REQUESTING state.
Definition: dhcp_client_fsm.c:161
void dhcpClientStateRebinding(DhcpClientContext *context)
REBINDING state.
Definition: dhcp_client_fsm.c:606
DHCP client finite state machine.
void dhcpClientTick(DhcpClientContext *context)
DHCP client timer handler.
Definition: dhcp_client_misc.c:73
void dhcpClientParseNak(DhcpClientContext *context, const DhcpMessage *message, size_t length)
Parse DHCPNAK message.
Definition: dhcp_client_misc.c:1128
error_t dhcpClientSendDecline(DhcpClientContext *context)
Send DHCPDECLINE message.
Definition: dhcp_client_misc.c:496
void dhcpClientParseAck(DhcpClientContext *context, const DhcpMessage *message, size_t length)
Parse DHCPACK message.
Definition: dhcp_client_misc.c:880
error_t dhcpClientSendRelease(DhcpClientContext *context)
Send DHCPRELEASE message.
Definition: dhcp_client_misc.c:608
error_t dhcpClientSendDiscover(DhcpClientContext *context)
Send DHCPDISCOVER message.
Definition: dhcp_client_misc.c:221
void dhcpClientResetConfig(DhcpClientContext *context)
Reset DHCP configuration.
Definition: dhcp_client_misc.c:1337
void dhcpClientCheckTimeout(DhcpClientContext *context)
Manage DHCP configuration timeout.
Definition: dhcp_client_misc.c:1204
void dhcpClientProcessMessage(NetInterface *interface, const IpPseudoHeader *pseudoHeader, const UdpHeader *udpHeader, const NetBuffer *buffer, size_t offset, const NetRxAncillary *ancillary, void *param)
Process incoming DHCP message.
Definition: dhcp_client_misc.c:727
void dhcpClientLinkChangeEvent(DhcpClientContext *context)
Callback function for link change event.
Definition: dhcp_client_misc.c:167
void dhcpClientDumpConfig(DhcpClientContext *context)
Dump DHCP configuration for debugging purpose.
Definition: dhcp_client_misc.c:1376
void dhcpClientParseOffer(DhcpClientContext *context, const DhcpMessage *message, size_t length)
Parse DHCPOFFER message.
Definition: dhcp_client_misc.c:815
error_t dhcpClientSendRequest(DhcpClientContext *context)
Send DHCPREQUEST message.
Definition: dhcp_client_misc.c:335
void dhcpClientChangeState(DhcpClientContext *context, DhcpState newState, systime_t delay)
Update DHCP FSM state.
Definition: dhcp_client_misc.c:1272
uint16_t dhcpClientComputeElapsedTime(DhcpClientContext *context)
Compute the appropriate secs field.
Definition: dhcp_client_misc.c:1249
Helper functions for DHCP client.
error_t dhcpAddOption(DhcpMessage *message, size_t *messageLen, uint8_t optionCode, const void *optionValue, size_t optionLen)
Append an option to a DHCP message.
Definition: dhcp_common.c:56
DhcpOption * dhcpGetOption(const DhcpMessage *message, size_t length, uint8_t optionCode)
Search a DHCP message for a given option.
Definition: dhcp_common.c:118
Definitions common to DHCP client and server.
error_t dhcpDumpMessage(const DhcpMessage *message, size_t length)
Dump DHCP message for debugging purpose.
Definition: dhcp_debug.c:158
Data logging functions for debugging purpose (DHCP)
char_t * ipv4AddrToString(Ipv4Addr ipAddr, char_t *str)
Convert a binary IPv4 address to dot-decimal notation.
Definition: ipv4.c:1636
@ IPV4_ADDR_STATE_VALID
An address assigned to an interface whose use is unrestricted.
Definition: ipv4.h:197
@ IPV4_ADDR_STATE_TENTATIVE
An address whose uniqueness on a link is being verified.
Definition: ipv4.h:196
error_t mdnsResponderStartProbing(MdnsResponderContext *context)
Restart probing process.
Definition: mdns_responder.c:254
mDNS responder (Multicast DNS)
TCP/IP stack core.
void * netBufferAt(const NetBuffer *buffer, size_t offset)
Returns a pointer to the data at the specified position.
Definition: net_mem.c:415
error_t netBufferSetLength(NetBuffer *buffer, size_t length)
Adjust the length of a multi-part buffer.
Definition: net_mem.c:322
size_t netBufferGetLength(const NetBuffer *buffer)
Get the actual length of a multi-part buffer.
Definition: net_mem.c:297
NetInterface * nicGetLogicalInterface(NetInterface *interface)
Retrieve logical interface.
Definition: nic.c:52
NetInterface * nicGetPhysicalInterface(NetInterface *interface)
Retrieve physical interface.
Definition: nic.c:84
void osAcquireMutex(OsMutex *mutex)
Acquire ownership of the specified mutex object.
Definition: os_port_chibios.c:388
void osReleaseMutex(OsMutex *mutex)
Release ownership of the specified mutex object.
Definition: os_port_chibios.c:400
NetBuffer * udpAllocBuffer(size_t length, size_t *offset)
Allocate a buffer to hold a UDP packet.
Definition: udp.c:905
error_t udpSendBuffer(NetInterface *interface, const IpAddr *srcIpAddr, uint16_t srcPort, const IpAddr *destIpAddr, uint16_t destPort, NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary)
Send a UDP datagram.
Definition: udp.c:627