diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-12-15 22:21:32 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-12-15 22:21:32 +0000 |
commit | fdaf3f62925632d5c98d019511acd22934653b0c (patch) | |
tree | 58b6b3d05b1657301b7fb43bcfd1ba4915e423b7 | |
parent | 06f42a77c40e148fb5dd7c8a6684ee0197832ab8 (diff) | |
download | nuttx-fdaf3f62925632d5c98d019511acd22934653b0c.tar.gz nuttx-fdaf3f62925632d5c98d019511acd22934653b0c.tar.bz2 nuttx-fdaf3f62925632d5c98d019511acd22934653b0c.zip |
Fix compile problen with CONFIG_NET_ARP_IPIN
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4188 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r-- | nuttx/ChangeLog | 1 | ||||
-rwxr-xr-x | nuttx/configs/stm3240g-eval/dhcpd/defconfig | 12 | ||||
-rwxr-xr-x | nuttx/configs/stm3240g-eval/nettest/defconfig | 12 | ||||
-rwxr-xr-x | nuttx/configs/stm3240g-eval/nsh/defconfig | 12 | ||||
-rwxr-xr-x | nuttx/configs/stm3240g-eval/ostest/defconfig | 12 | ||||
-rw-r--r-- | nuttx/net/send.c | 2 | ||||
-rw-r--r-- | nuttx/net/uip/uip_arp.c | 30 |
7 files changed, 53 insertions, 28 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 053d4f8ba..36b550384 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -2267,3 +2267,4 @@ Broke out separate drivers to handle the very different RTC implementations in the STM32 F1 and F4 family. * arch/arm/srcm/stm32/stm32f10xxx_rtc.c: STM32 F4 RTC is functional (12/14/2011) + * net/uip-arp.c: Fix compilation issue with CONFIG_NET_ARP_IPIN diff --git a/nuttx/configs/stm3240g-eval/dhcpd/defconfig b/nuttx/configs/stm3240g-eval/dhcpd/defconfig index c2f3440f3..3675f5b85 100755 --- a/nuttx/configs/stm3240g-eval/dhcpd/defconfig +++ b/nuttx/configs/stm3240g-eval/dhcpd/defconfig @@ -718,9 +718,13 @@ CONFIG_MMCSD_HAVECARDDETECT=n # CONFIG_NET_PINGADDRCONF - Use "ping" packet for setting IP address # CONFIG_NET_STATISTICS - uIP statistics on or off # CONFIG_NET_RECEIVE_WINDOW - The size of the advertised receiver's window -# CONFIG_NET_ARPTAB_SIZE - The size of the ARP table # CONFIG_NET_BROADCAST - Broadcast support -# CONFIG_NET_FWCACHE_SIZE - number of packets to remember when looking for duplicates +# 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_MULTICAST - Outgoing multi-cast address support +# CONFIG_NET_FWCACHE_SIZE - number of packets to remember when +# looking for duplicates # CONFIG_NET=y CONFIG_NET_NOINTS=n @@ -743,8 +747,10 @@ CONFIG_NET_ICMP_PING=n #CONFIG_NET_PINGADDRCONF=0 CONFIG_NET_STATISTICS=n #CONFIG_NET_RECEIVE_WINDOW= -#CONFIG_NET_ARPTAB_SIZE=8 CONFIG_NET_BROADCAST=y +#CONFIG_NET_ARPTAB_SIZE=8 +CONFIG_NET_ARP_IPIN=n +CONFIG_NET_MULTICAST=n #CONFIG_NET_FWCACHE_SIZE=2 # diff --git a/nuttx/configs/stm3240g-eval/nettest/defconfig b/nuttx/configs/stm3240g-eval/nettest/defconfig index 94b8075db..6884ad3d7 100755 --- a/nuttx/configs/stm3240g-eval/nettest/defconfig +++ b/nuttx/configs/stm3240g-eval/nettest/defconfig @@ -718,9 +718,13 @@ CONFIG_MMCSD_HAVECARDDETECT=n # CONFIG_NET_PINGADDRCONF - Use "ping" packet for setting IP address # CONFIG_NET_STATISTICS - uIP statistics on or off # CONFIG_NET_RECEIVE_WINDOW - The size of the advertised receiver's window -# CONFIG_NET_ARPTAB_SIZE - The size of the ARP table # CONFIG_NET_BROADCAST - Broadcast support -# CONFIG_NET_FWCACHE_SIZE - number of packets to remember when looking for duplicates +# 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_MULTICAST - Outgoing multi-cast address support +# CONFIG_NET_FWCACHE_SIZE - number of packets to remember when +# looking for duplicates # CONFIG_NET=y CONFIG_NET_NOINTS=n @@ -743,8 +747,10 @@ CONFIG_NET_ICMP_PING=n #CONFIG_NET_PINGADDRCONF=0 CONFIG_NET_STATISTICS=n #CONFIG_NET_RECEIVE_WINDOW= -#CONFIG_NET_ARPTAB_SIZE=8 CONFIG_NET_BROADCAST=n +#CONFIG_NET_ARPTAB_SIZE=8 +CONFIG_NET_ARP_IPIN=n +CONFIG_NET_MULTICAST=n #CONFIG_NET_FWCACHE_SIZE=2 # diff --git a/nuttx/configs/stm3240g-eval/nsh/defconfig b/nuttx/configs/stm3240g-eval/nsh/defconfig index 3424ec322..52a7ccfa3 100755 --- a/nuttx/configs/stm3240g-eval/nsh/defconfig +++ b/nuttx/configs/stm3240g-eval/nsh/defconfig @@ -723,9 +723,13 @@ CONFIG_MMCSD_HAVECARDDETECT=n # CONFIG_NET_PINGADDRCONF - Use "ping" packet for setting IP address # CONFIG_NET_STATISTICS - uIP statistics on or off # CONFIG_NET_RECEIVE_WINDOW - The size of the advertised receiver's window -# CONFIG_NET_ARPTAB_SIZE - The size of the ARP table # CONFIG_NET_BROADCAST - Broadcast support -# CONFIG_NET_FWCACHE_SIZE - number of packets to remember when looking for duplicates +# 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_MULTICAST - Outgoing multi-cast address support +# CONFIG_NET_FWCACHE_SIZE - number of packets to remember when +# looking for duplicates # CONFIG_NET=y CONFIG_NET_NOINTS=n @@ -748,8 +752,10 @@ CONFIG_NET_ICMP_PING=y #CONFIG_NET_PINGADDRCONF=0 CONFIG_NET_STATISTICS=y #CONFIG_NET_RECEIVE_WINDOW= -#CONFIG_NET_ARPTAB_SIZE=8 CONFIG_NET_BROADCAST=n +#CONFIG_NET_ARPTAB_SIZE=8 +CONFIG_NET_ARP_IPIN=n +CONFIG_NET_MULTICAST=n #CONFIG_NET_FWCACHE_SIZE=2 # diff --git a/nuttx/configs/stm3240g-eval/ostest/defconfig b/nuttx/configs/stm3240g-eval/ostest/defconfig index 8acda4c6b..2b51d88c7 100755 --- a/nuttx/configs/stm3240g-eval/ostest/defconfig +++ b/nuttx/configs/stm3240g-eval/ostest/defconfig @@ -681,9 +681,13 @@ CONFIG_MMCSD_HAVECARDDETECT=n # CONFIG_NET_PINGADDRCONF - Use "ping" packet for setting IP address # CONFIG_NET_STATISTICS - uIP statistics on or off # CONFIG_NET_RECEIVE_WINDOW - The size of the advertised receiver's window -# CONFIG_NET_ARPTAB_SIZE - The size of the ARP table # CONFIG_NET_BROADCAST - Broadcast support -# CONFIG_NET_FWCACHE_SIZE - number of packets to remember when looking for duplicates +# 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_MULTICAST - Outgoing multi-cast address support +# CONFIG_NET_FWCACHE_SIZE - number of packets to remember when +# looking for duplicates # CONFIG_NET=n CONFIG_NET_NOINTS=n @@ -703,8 +707,10 @@ CONFIG_NET_ICMP_PING=n #CONFIG_NET_PINGADDRCONF=0 CONFIG_NET_STATISTICS=y #CONFIG_NET_RECEIVE_WINDOW= -#CONFIG_NET_ARPTAB_SIZE=8 CONFIG_NET_BROADCAST=n +#CONFIG_NET_ARPTAB_SIZE=8 +CONFIG_NET_ARP_IPIN=n +CONFIG_NET_MULTICAST=n #CONFIG_NET_FWCACHE_SIZE=2 # diff --git a/nuttx/net/send.c b/nuttx/net/send.c index 0b2f3739c..4eceddffc 100644 --- a/nuttx/net/send.c +++ b/nuttx/net/send.c @@ -51,7 +51,7 @@ #include <nuttx/clock.h> #include <net/uip/uip-arch.h> -#ifndef CONFIG_NET_ARP_IPIN +#ifdef CONFIG_NET_ARP_IPIN # include <net/uip/uip-arp.h> #endif diff --git a/nuttx/net/uip/uip_arp.c b/nuttx/net/uip/uip_arp.c index 03a68ec2f..2428ba128 100644 --- a/nuttx/net/uip/uip_arp.c +++ b/nuttx/net/uip/uip_arp.c @@ -3,7 +3,7 @@ * Implementation of the ARP Address Resolution Protocol. * * Copyright (C) 2007-2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Author: Gregory Nutt <gnutt@nuttx.org> * * Based on uIP which also has a BSD style license: * @@ -81,8 +81,8 @@ #define RASIZE 4 /* Size of ROUTER ALERT */ #define ETHBUF ((struct uip_eth_hdr *)&dev->d_buf[0]) -#define ARPBUF ((struct arp_hdr *)&dev->d_buf[UIP_LLH_LEN]) -#define IPBUF ((struct ethip_hdr *)&dev->d_buf[UIP_LLH_LEN]) +#define ARPBUF ((struct arp_hdr_s *)&dev->d_buf[UIP_LLH_LEN]) +#define IPBUF ((struct arp_iphdr_s *)&dev->d_buf[UIP_LLH_LEN]) /**************************************************************************** * Private Types @@ -90,7 +90,7 @@ /* ARP header -- Size 28 bytes */ -struct arp_hdr +struct arp_hdr_s { uint16_t ah_hwtype; /* 16-bit Hardware type (Ethernet=0x001) */ uint16_t ah_protocol; /* 16-bit Protocol type (IP=0x0800) */ @@ -105,7 +105,7 @@ struct arp_hdr /* IP header -- Size 20 or 24 bytes */ -struct ethip_hdr +struct arp_iphdr_s { uint8_t eh_vhl; /* 8-bit Version (4) and header length (5 or 6) */ uint8_t eh_tos; /* 8-bit Type of service (e.g., 6=TCP) */ @@ -155,7 +155,7 @@ static const uint8_t g_multicast_ethaddr[3] = {0x01, 0x00, 0x5e}; ****************************************************************************/ #if defined(CONFIG_NET_DUMPARP) && defined(CONFIG_DEBUG) -static void uip_arp_dump(struct arp_hdr *arp) +static void uip_arp_dump(struct arp_hdr_s *arp) { nlldbg(" HW type: %04x Protocol: %04x\n", arp->ah_hwtype, arp->ah_protocol);\ @@ -200,10 +200,10 @@ void uip_arp_ipin(struct uip_driver_s *dev) * 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)) + srcipaddr = uip_ip4addr_conv(IPBUF->eh_srcipaddr); + if (!uip_ipaddr_maskcmp(srcipaddr, dev->d_ipaddr, dev->d_netmask)) { - uip_arp_update(IPBUF->srcipaddr, ETHBUF->src); + uip_arp_update(IPBUF->eh_srcipaddr, ETHBUF->src); } } #endif /* CONFIG_NET_ARP_IPIN */ @@ -231,10 +231,10 @@ void uip_arp_ipin(struct uip_driver_s *dev) void uip_arp_arpin(struct uip_driver_s *dev) { - struct arp_hdr *parp = ARPBUF; + struct arp_hdr_s *parp = ARPBUF; in_addr_t ipaddr; - if (dev->d_len < (sizeof(struct arp_hdr) + UIP_LLH_LEN)) + if (dev->d_len < (sizeof(struct arp_hdr_s) + UIP_LLH_LEN)) { nlldbg("Too small\n"); dev->d_len = 0; @@ -273,7 +273,7 @@ void uip_arp_arpin(struct uip_driver_s *dev) uip_arp_dump(parp); peth->type = HTONS(UIP_ETHTYPE_ARP); - dev->d_len = sizeof(struct arp_hdr) + UIP_LLH_LEN; + dev->d_len = sizeof(struct arp_hdr_s) + UIP_LLH_LEN; } break; @@ -320,9 +320,9 @@ void uip_arp_arpin(struct uip_driver_s *dev) void uip_arp_out(struct uip_driver_s *dev) { const struct arp_entry *tabptr = NULL; - struct arp_hdr *parp = ARPBUF; + struct arp_hdr_s *parp = ARPBUF; struct uip_eth_hdr *peth = ETHBUF; - struct ethip_hdr *pip = IPBUF; + struct arp_iphdr_s *pip = IPBUF; in_addr_t ipaddr; in_addr_t destipaddr; @@ -411,7 +411,7 @@ void uip_arp_out(struct uip_driver_s *dev) uip_arp_dump(parp); peth->type = HTONS(UIP_ETHTYPE_ARP); - dev->d_len = sizeof(struct arp_hdr) + UIP_LLH_LEN; + dev->d_len = sizeof(struct arp_hdr_s) + UIP_LLH_LEN; return; } |