mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-11-17 17:10:03 +00:00
added functions dhcp/autoip_supplied_address() to check for the source of address assignemnt (replacement for NETIF_FLAG_DHCP)
This commit is contained in:
parent
737a6921c3
commit
e20a071977
@ -6,6 +6,10 @@ HISTORY
|
||||
|
||||
++ New features:
|
||||
|
||||
2015-04-24: Simon Goldschmidt
|
||||
* dhcp.h/c, autoip.h/.c: added functions dhcp/autoip_supplied_address() to
|
||||
check for the source of address assignemnt (replacement for NETIF_FLAG_DHCP)
|
||||
|
||||
2015-04-10: Simon Goldschmidt
|
||||
* many files: task #13480: added LWIP_IPV4 define - IPv4 can be disabled,
|
||||
leaving an IPv6-only stack
|
||||
|
@ -1820,4 +1820,22 @@ dhcp_option_trailer(struct dhcp *dhcp)
|
||||
}
|
||||
}
|
||||
|
||||
/** check if DHCP supplied netif->ip_addr
|
||||
*
|
||||
* @param netif the netif to check
|
||||
* @return 1 if DHCP supplied netif->ip_addr (states BOUND or RENEWING),
|
||||
* 0 otherwise
|
||||
*/
|
||||
u8_t
|
||||
dhcp_supplied_address(struct netif *netif)
|
||||
{
|
||||
if ((netif != NULL) && (netif->dhcp != NULL)) {
|
||||
if ((netif->dhcp->state == DHCP_BOUND) ||
|
||||
(netif->dhcp->state == DHCP_RENEWING)) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* LWIP_IPV4 && LWIP_DHCP */
|
||||
|
@ -520,4 +520,21 @@ autoip_arp_reply(struct netif *netif, struct etharp_hdr *hdr)
|
||||
}
|
||||
}
|
||||
|
||||
/** check if AutoIP supplied netif->ip_addr
|
||||
*
|
||||
* @param netif the netif to check
|
||||
* @return 1 if AutoIP supplied netif->ip_addr (state BOUND),
|
||||
* 0 otherwise
|
||||
*/
|
||||
u8_t
|
||||
autoip_supplied_address(struct netif *netif)
|
||||
{
|
||||
if ((netif != NULL) && (netif->autoip != NULL)) {
|
||||
if (netif->autoip->state == AUTOIP_STATE_BOUND) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* LWIP_IPV4 && LWIP_AUTOIP */
|
||||
|
@ -112,6 +112,9 @@ void autoip_tmr(void);
|
||||
/** Handle a possible change in the network configuration */
|
||||
void autoip_network_changed(struct netif *netif);
|
||||
|
||||
/** check if AutoIP supplied netif->ip_addr */
|
||||
u8_t autoip_supplied_address(struct netif *netif);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -129,6 +129,9 @@ void dhcp_network_changed(struct netif *netif);
|
||||
void dhcp_arp_reply(struct netif *netif, const ip4_addr_t *addr);
|
||||
#endif
|
||||
|
||||
/** check if DHCP supplied netif->ip_addr */
|
||||
u8_t dhcp_supplied_address(struct netif *netif);
|
||||
|
||||
/** to be called every minute */
|
||||
void dhcp_coarse_tmr(void);
|
||||
/** to be called every half second */
|
||||
|
Loading…
Reference in New Issue
Block a user