Restore uip_arp_ipin()
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3131 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
b0adf7c71b
commit
e2449e9858
|
@ -2921,6 +2921,9 @@ build
|
|||
<li>
|
||||
<code>CONFIG_NET_ARPTAB_SIZE</code>: The size of the ARP table
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NET_ARP_IPIN</code>: Harvest IP/MAC address mappings for the ARP table from incoming IP packets.
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NET_BROADCAST</code>: Incoming UDP broadcast support
|
||||
</li>
|
||||
|
|
8
TODO
8
TODO
|
@ -214,11 +214,9 @@ o Network (net/, drivers/net)
|
|||
Description: Outgoing packets are dropped and overwritten by ARP packets
|
||||
if the destination IP has not been mapped to a MAC. Could
|
||||
improve send() performance by explicitly performing ARP before
|
||||
sending the packet.
|
||||
---
|
||||
Or by enabling arpin() logic. NOTE: From the uIP forum: "You
|
||||
can use the function but it has a bug. You'll need to comment
|
||||
this line: uip_len -= sizeof(struct uip_eth_hdr);"
|
||||
sending the packet (or by enabling CONFIG_NET_ARP_IPIN logic.
|
||||
This could, however have negative impacts on busy networks and
|
||||
could require a large value for CONFIG_NET_ARPTAB_SIZE).
|
||||
Status: Open
|
||||
Priority: Medium
|
||||
|
||||
|
|
|
@ -595,6 +595,8 @@ defconfig -- This is a configuration file similar to the Linux
|
|||
CONFIG_NET_RECEIVE_WINDOW - The size of the advertised receiver's
|
||||
window
|
||||
CONFIG_NET_ARPTAB_SIZE - The size of the ARP table
|
||||
CONFIG_NET_ARP_IPIN - Harvest IP/MAC address mappings from the ARP table
|
||||
from incoming IP packets.
|
||||
CONFIG_NET_BROADCAST - Incoming UDP broadcast support
|
||||
CONFIG_NET_MULTICAST - Outgoing multi-cast address support
|
||||
CONFIG_NET_LLH_LEN - The link level header length
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* include/net/uip/uip-arch.h
|
||||
* Macros and definitions for the ARP module.
|
||||
*
|
||||
* Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007, 2009-2010 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
*
|
||||
* Derived from uIP with has a similar BSD-styple license:
|
||||
|
@ -114,7 +114,7 @@ extern "C" {
|
|||
EXTERN void uip_arp_init(void);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: uip_arp_init
|
||||
* Name: uip_arp_ipin
|
||||
*
|
||||
* Description:
|
||||
* The uip_arp_ipin() function should be called whenever an IP packet
|
||||
|
@ -125,7 +125,11 @@ EXTERN void uip_arp_init(void);
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
#define uip_arp_ipin()
|
||||
#ifdef CONFIG_NET_ARP_IPIN
|
||||
EXTERN void uip_arp_ipin(void);
|
||||
#else
|
||||
# define uip_arp_ipin()
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: uip_arp_arpin
|
||||
|
|
|
@ -176,6 +176,34 @@ static void uip_arp_dump(struct arp_hdr *arp)
|
|||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/* ARP processing for incoming IP packets
|
||||
*
|
||||
* This function should be called by the device driver when an IP packet has
|
||||
* been received. The function will check if the address is in the ARP cache,
|
||||
* and if so the ARP cache entry will be refreshed. If no ARP cache entry was
|
||||
* found, a new one is created.
|
||||
*
|
||||
* This function expects an IP packet with a prepended Ethernet header in the
|
||||
* d_buf[] buffer, and the length of the packet in the variable d_len.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_NET_ARP_IPIN
|
||||
void uip_arp_ipin(void)
|
||||
{
|
||||
in_addr_t srcipaddr;
|
||||
|
||||
/* Only insert/update an entry if the source IP address of the incoming IP
|
||||
* packet comes from a host on the local network.
|
||||
*/
|
||||
|
||||
srcipaddr = uip_ip4addr_conv(IPBUF->srcipaddr);
|
||||
if (!uip_ipaddr_maskcmp(ipaddr, dev->d_ipaddr, dev->d_netmask))
|
||||
{
|
||||
uip_arp_update(IPBUF->srcipaddr, ETHBUF->src);
|
||||
}
|
||||
}
|
||||
#endif /* CONFIG_NET_ARP_IPIN */
|
||||
|
||||
/* ARP processing for incoming ARP packets.
|
||||
*
|
||||
* This function should be called by the device driver when an ARP
|
||||
|
@ -194,7 +222,7 @@ static void uip_arp_dump(struct arp_hdr *arp)
|
|||
*
|
||||
* This function expects an ARP packet with a prepended Ethernet
|
||||
* header in the d_buf[] buffer, and the length of the packet in the
|
||||
* global variable d_len.
|
||||
* variable d_len.
|
||||
*/
|
||||
|
||||
void uip_arp_arpin(struct uip_driver_s *dev)
|
||||
|
|
Loading…
Reference in New Issue