mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-05-27 02:26:55 +08:00
Added option LWIP_NETIF_HWADDRHINT (default=off) to cache ARP table indices with each pcb instead of single-entry cache for the complete stack.
This commit is contained in:
@@ -83,7 +83,9 @@ err_t ip_output_if(struct pbuf *p, struct ip_addr *src, struct ip_addr *dest,
|
||||
/* Type Of Service */ \
|
||||
u8_t tos; \
|
||||
/* Time To Live */ \
|
||||
u8_t ttl
|
||||
u8_t ttl; \
|
||||
/* link layer address resolution hint */ \
|
||||
u8_t addr_hint
|
||||
|
||||
/*
|
||||
* Option flags per-socket. These are the same like SO_XXX.
|
||||
|
||||
@@ -69,7 +69,9 @@ extern "C" {
|
||||
/* Type Of Service */ \
|
||||
u8_t tos; \
|
||||
/* Time To Live */ \
|
||||
u8_t ttl
|
||||
u8_t ttl; \
|
||||
/* link layer address resolution hint */ \
|
||||
u8_t addr_hint
|
||||
|
||||
|
||||
/* The IPv6 header. */
|
||||
|
||||
@@ -155,6 +155,9 @@ struct netif {
|
||||
/* This function could be called to add or delete a entry in the multicast filter table of the ethernet MAC.*/
|
||||
err_t (*igmp_mac_filter)( struct netif *netif, struct ip_addr *group, u8_t action);
|
||||
#endif /* LWIP_IGMP */
|
||||
#if LWIP_NETIF_HWADDRHINT
|
||||
u8_t *addr_hint;
|
||||
#endif /* LWIP_NETIF_HWADDRHINT */
|
||||
};
|
||||
|
||||
#if LWIP_SNMP
|
||||
|
||||
@@ -481,6 +481,15 @@
|
||||
#define LWIP_NETIF_CALLBACK 0
|
||||
#endif
|
||||
|
||||
/** Cache link-layer-address hints (e.g. table indices) in struct netif.
|
||||
TCP and UDP can make use of this to prevent scanning the ARP table
|
||||
for every sent packet. While this is faster for big ARP tables or many
|
||||
concurrent connections, it might be contra-productive if having a tiny
|
||||
ARP table only or there never are concurrent connections. */
|
||||
#ifndef LWIP_NETIF_HWADDRHINT
|
||||
#define LWIP_NETIF_HWADDRHINT 0
|
||||
#endif
|
||||
|
||||
/* Support loop interface (127.0.0.1) */
|
||||
#ifndef LWIP_HAVE_LOOPIF
|
||||
#define LWIP_HAVE_LOOPIF 0
|
||||
|
||||
@@ -157,6 +157,11 @@ err_t etharp_raw(struct netif *netif, const struct eth_addr *ethsrc_addr,
|
||||
|
||||
#define eth_addr_cmp(addr1, addr2) (memcmp((addr1)->addr, (addr2)->addr, ETHARP_HWADDR_LEN) == 0)
|
||||
|
||||
/* finally, check some defines */
|
||||
#if ARP_TABLE_SIZE > 0x7f
|
||||
#error ARP_TABLE_SIZE must fit in an s8_t
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user