mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-25 09:16:20 +00:00
Exported etharp_request().
This commit is contained in:
parent
a23f6afbee
commit
2df9cd7262
@ -93,5 +93,6 @@ void etharp_arp_input(struct netif *netif, struct eth_addr *ethaddr,
|
|||||||
err_t etharp_output(struct netif *netif, struct ip_addr *ipaddr,
|
err_t etharp_output(struct netif *netif, struct ip_addr *ipaddr,
|
||||||
struct pbuf *q);
|
struct pbuf *q);
|
||||||
err_t etharp_query(struct netif *netif, struct ip_addr *ipaddr, struct pbuf *q);
|
err_t etharp_query(struct netif *netif, struct ip_addr *ipaddr, struct pbuf *q);
|
||||||
|
err_t etharp_request(struct netif *netif, struct ip_addr *ipaddr);
|
||||||
|
|
||||||
#endif /* __NETIF_ARP_H__ */
|
#endif /* __NETIF_ARP_H__ */
|
||||||
|
@ -208,10 +208,10 @@ static s8_t find_entry(struct ip_addr *ipaddr, u8_t flags)
|
|||||||
|
|
||||||
for (i = 0; i < ARP_TABLE_SIZE; ++i) {
|
for (i = 0; i < ARP_TABLE_SIZE; ++i) {
|
||||||
/* empty entry? */
|
/* empty entry? */
|
||||||
if ((empty == ARP_TABLE_SIZE) && arp_table[i].state == ETHARP_STATE_EMPTY)) {
|
if (arp_table[i].state == ETHARP_STATE_EMPTY) {
|
||||||
LWIP_DEBUGF(ETHARP_DEBUG, ("find_entry: found empty entry %d\n", i));
|
LWIP_DEBUGF(ETHARP_DEBUG, ("find_entry: found empty entry %d\n", i));
|
||||||
/* remember first empty entry */
|
/* remember first empty entry */
|
||||||
empty = i;
|
if (empty == ARP_TABLE_SIZE) empty = i;
|
||||||
}
|
}
|
||||||
/* pending entry? */
|
/* pending entry? */
|
||||||
else if (arp_table[i].state == ETHARP_STATE_PENDING) {
|
else if (arp_table[i].state == ETHARP_STATE_PENDING) {
|
||||||
@ -701,7 +701,7 @@ err_t etharp_query(struct netif *netif, struct ip_addr *ipaddr, struct pbuf *q)
|
|||||||
result = etharp_request(struct netif *netif, struct ip_addr *ipaddr);
|
result = etharp_request(struct netif *netif, struct ip_addr *ipaddr);
|
||||||
|
|
||||||
/* find entry in ARP cache */
|
/* find entry in ARP cache */
|
||||||
i = find_entry(&arp_table[i].ipaddr, q?ETHARP_INSERT:0);
|
i = find_entry(&arp_table[i].ipaddr, q?ETHARP_CREATE:0);
|
||||||
|
|
||||||
/* could not find or create entry? */
|
/* could not find or create entry? */
|
||||||
if (i < 0) return (err_t)i;
|
if (i < 0) return (err_t)i;
|
||||||
|
Loading…
Reference in New Issue
Block a user