mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-04-16 08:43:17 +00:00
All ARP queueing code is now conditionally compiled-in.
This commit is contained in:
parent
4619bbc3ea
commit
bda378bb9f
@ -3,6 +3,9 @@
|
|||||||
* Address Resolution Protocol module for IP over Ethernet
|
* Address Resolution Protocol module for IP over Ethernet
|
||||||
*
|
*
|
||||||
* $Log: etharp.c,v $
|
* $Log: etharp.c,v $
|
||||||
|
* Revision 1.12 2002/11/28 09:26:18 likewise
|
||||||
|
* All ARP queueing code is now conditionally compiled-in.
|
||||||
|
*
|
||||||
* Revision 1.11 2002/11/18 10:31:05 likewise
|
* Revision 1.11 2002/11/18 10:31:05 likewise
|
||||||
* Conditionally have ARP queue outgoing pbufs.
|
* Conditionally have ARP queue outgoing pbufs.
|
||||||
*
|
*
|
||||||
@ -105,7 +108,6 @@ RFC 3220 4.6 IP Mobility Support for IPv4 January 2002
|
|||||||
#ifndef ETHARP_SNOOP_UPDATES
|
#ifndef ETHARP_SNOOP_UPDATES
|
||||||
# define ETHARP_SNOOP_UPDATES 0
|
# define ETHARP_SNOOP_UPDATES 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#define HWTYPE_ETHERNET 1
|
#define HWTYPE_ETHERNET 1
|
||||||
|
|
||||||
@ -129,7 +131,9 @@ struct etharp_entry {
|
|||||||
struct ip_addr ipaddr;
|
struct ip_addr ipaddr;
|
||||||
struct eth_addr ethaddr;
|
struct eth_addr ethaddr;
|
||||||
enum etharp_state state;
|
enum etharp_state state;
|
||||||
|
#if ARP_QUEUEING
|
||||||
struct pbuf *p;
|
struct pbuf *p;
|
||||||
|
#endif
|
||||||
u8_t ctime;
|
u8_t ctime;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -177,9 +181,11 @@ etharp_tmr(void)
|
|||||||
(ctime - arp_table[i].ctime >= ARP_MAXPENDING)) {
|
(ctime - arp_table[i].ctime >= ARP_MAXPENDING)) {
|
||||||
DEBUGF(ETHARP_DEBUG, ("etharp_timer: expired pending entry %u - dequeueing %p.\n", i, arp_table[i].p));
|
DEBUGF(ETHARP_DEBUG, ("etharp_timer: expired pending entry %u - dequeueing %p.\n", i, arp_table[i].p));
|
||||||
arp_table[i].state = ETHARP_STATE_EMPTY;
|
arp_table[i].state = ETHARP_STATE_EMPTY;
|
||||||
|
#if ARP_QUEUEING
|
||||||
/* remove any queued packet */
|
/* remove any queued packet */
|
||||||
pbuf_free(arp_table[i].p);
|
pbuf_free(arp_table[i].p);
|
||||||
arp_table[i].p = NULL;
|
arp_table[i].p = NULL;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -240,8 +246,10 @@ static struct pbuf *
|
|||||||
update_arp_entry(struct ip_addr *ipaddr, struct eth_addr *ethaddr, u8_t flags)
|
update_arp_entry(struct ip_addr *ipaddr, struct eth_addr *ethaddr, u8_t flags)
|
||||||
{
|
{
|
||||||
u8_t i, k;
|
u8_t i, k;
|
||||||
struct pbuf *p;
|
|
||||||
struct eth_hdr *ethhdr;
|
struct eth_hdr *ethhdr;
|
||||||
|
#if ARP_QUEUEING
|
||||||
|
struct pbuf *p;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Walk through the ARP mapping table and try to find an entry to
|
/* Walk through the ARP mapping table and try to find an entry to
|
||||||
update. If none is found, the IP -> MAC address mapping is
|
update. If none is found, the IP -> MAC address mapping is
|
||||||
@ -270,6 +278,7 @@ update_arp_entry(struct ip_addr *ipaddr, struct eth_addr *ethaddr, u8_t flags)
|
|||||||
}
|
}
|
||||||
arp_table[i].ctime = ctime;
|
arp_table[i].ctime = ctime;
|
||||||
arp_table[i].state = ETHARP_STATE_STABLE;
|
arp_table[i].state = ETHARP_STATE_STABLE;
|
||||||
|
#if ARP_QUEUEING
|
||||||
p = arp_table[i].p;
|
p = arp_table[i].p;
|
||||||
// queued packet present? */
|
// queued packet present? */
|
||||||
if(p != NULL) {
|
if(p != NULL) {
|
||||||
@ -288,6 +297,10 @@ update_arp_entry(struct ip_addr *ipaddr, struct eth_addr *ethaddr, u8_t flags)
|
|||||||
}
|
}
|
||||||
/* return queued packet, if any */
|
/* return queued packet, if any */
|
||||||
return p;
|
return p;
|
||||||
|
#else
|
||||||
|
/* ARP queueing disabled */
|
||||||
|
return NULL;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user