summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-11-21 10:16:19 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-11-21 10:16:19 -0600
commitbd2bbbd424a653830e8dc43ce8c8de63a35311ed (patch)
tree731c850a6d1deef3d33a0d3965c9a61059809588
parent2738a387a55890dbef3519154b5044d262009635 (diff)
downloadnuttx-bd2bbbd424a653830e8dc43ce8c8de63a35311ed.tar.gz
nuttx-bd2bbbd424a653830e8dc43ce8c8de63a35311ed.tar.bz2
nuttx-bd2bbbd424a653830e8dc43ce8c8de63a35311ed.zip
apps/examples/bridge: Lots of fixes. I think it is working although I have still have host firewall issues in testing
-rw-r--r--apps/examples/bridge/Kconfig24
-rw-r--r--apps/examples/bridge/Makefile12
-rw-r--r--apps/examples/bridge/bridge_main.c109
-rw-r--r--apps/examples/bridge/host_main.c12
-rw-r--r--apps/examples/bridge/host_net1.c4
-rw-r--r--apps/examples/bridge/host_net2.c4
-rw-r--r--nuttx/configs/sam4e-ek/README.txt4
-rw-r--r--nuttx/configs/sama5d3-xplained/bridge/defconfig10
-rw-r--r--nuttx/configs/sama5d4-ek/bridge/defconfig14
9 files changed, 122 insertions, 71 deletions
diff --git a/apps/examples/bridge/Kconfig b/apps/examples/bridge/Kconfig
index facd5b185..ee77358f2 100644
--- a/apps/examples/bridge/Kconfig
+++ b/apps/examples/bridge/Kconfig
@@ -35,12 +35,6 @@ config EXAMPLES_BRIDGE_NET1_RECVPORT
---help---
Network 1 listen port number
-config EXAMPLES_BRIDGE_NET1_SNDPORT
- int "UDP send port"
- default 5472
- ---help---
- Network 2 send port number
-
config EXAMPLES_BRIDGE_NET1_IOBUFIZE
int "UDP I/O buffer size"
default 1024
@@ -93,6 +87,12 @@ config EXAMPLES_BRIDGE_NET1_IPHOST
---help---
IP address of network 1 for the host
+config EXAMPLES_BRIDGE_NET1_HOSTPORT
+ int "Host listen port"
+ default 5472
+ ---help---
+ Port number used by the host on network 1
+
config EXAMPLES_BRIDGE_NET1_STACKSIZE
int "Network 1 daemon stacksize"
default 2048
@@ -117,12 +117,6 @@ config EXAMPLES_BRIDGE_NET2_RECVPORT
---help---
Network 1 listen port number
-config EXAMPLES_BRIDGE_NET2_SNDPORT
- int "UDP send port"
- default 5474
- ---help---
- Network 2 send port number
-
config EXAMPLES_BRIDGE_NET2_IOBUFIZE
int "UDP I/O buffer size"
default 1024
@@ -175,6 +169,12 @@ config EXAMPLES_BRIDGE_NET2_IPHOST
---help---
IP address of network 2 for the host
+config EXAMPLES_BRIDGE_NET2_HOSTPORT
+ int "Host listen port"
+ default 5474
+ ---help---
+ Port number used by the host on network 2
+
config EXAMPLES_BRIDGE_NET2_STACKSIZE
int "Network 2 daemon stacksize"
default 2048
diff --git a/apps/examples/bridge/Makefile b/apps/examples/bridge/Makefile
index c9fd5200c..345d080f5 100644
--- a/apps/examples/bridge/Makefile
+++ b/apps/examples/bridge/Makefile
@@ -105,19 +105,23 @@ $(TARG_COBJS) $(TARG_MAINOBJ): %$(OBJEXT): %.c
$(call COMPILE, $<, $@)
$(HOST_OBJS): %.o: %.c
- $(HOSTCC) -c $(HOSTCFLAGS) $< -o $@
+ @echo "CC: $<"
+ $(Q) $(HOSTCC) -c $(HOSTCFLAGS) $< -o $@
$(TARG_BIN): $(TARG_OBJS)
$(call ARCHIVE, $(TARG_BIN), $(TARG_OBJS))
bridge_config.h: $(TOPDIR)/include/nuttx/config.h
- cp $(TOPDIR)/include/nuttx/config.h bridge_config.h
+ @echo "CP: brigetconfig.h"
+ $(Q) cp $(TOPDIR)/include/nuttx/config.h bridge_config.h
$(HOST_BIN1): bridge_config.h $(HOST_OBJS1)
- $(HOSTCC) $(HOSTLDFLAGS) $(HOST_OBJS1) -o $@
+ @echo "LD: $@"
+ $(Q) $(HOSTCC) $(HOSTLDFLAGS) $(HOST_OBJS1) -o $@
$(HOST_BIN2): bridge_config.h $(HOST_OBJS2)
- $(HOSTCC) $(HOSTLDFLAGS) $(HOST_OBJS2) -o $@
+ @echo "LD: $@"
+ $(Q) $(HOSTCC) $(HOSTLDFLAGS) $(HOST_OBJS2) -o $@
.built: $(TARG_BIN) $(HOST_BIN1) $(HOST_BIN2)
@touch .built
diff --git a/apps/examples/bridge/bridge_main.c b/apps/examples/bridge/bridge_main.c
index 7608b9a35..78ee23a60 100644
--- a/apps/examples/bridge/bridge_main.c
+++ b/apps/examples/bridge/bridge_main.c
@@ -332,9 +332,10 @@ printf("NET2: Configuring %s\n", CONFIG_EXAMPLES_BRIDGE_NET2_IFNAME);
static int bridge_net1_worker(int argc, char *argv[])
{
- struct sockaddr_in recvaddr;
- struct sockaddr_in listenaddr;
- struct sockaddr_in sendaddr;
+ struct sockaddr_in receiver;
+ struct sockaddr_in sender;
+ struct sockaddr_in fromaddr;
+ struct sockaddr_in toaddr;
socklen_t addrlen;
in_addr_t tmpaddr;
ssize_t nrecvd;
@@ -347,7 +348,11 @@ static int bridge_net1_worker(int argc, char *argv[])
/* Create a UDP receive socket on network 1 */
- printf("NET1: Create receive socket\n");
+ tmpaddr = ntohl(g_net1_ipaddr);
+ printf("NET1: Create receive socket: %d.%d.%d.%d:%d\n",
+ tmpaddr >> 24, (tmpaddr >> 16) & 0xff,
+ (tmpaddr >> 8) & 0xff, tmpaddr & 0xff,
+ CONFIG_EXAMPLES_BRIDGE_NET1_RECVPORT);
recvsd = socket(PF_INET, SOCK_DGRAM, 0);
if (recvsd < 0)
@@ -367,11 +372,11 @@ static int bridge_net1_worker(int argc, char *argv[])
/* Bind the socket to a local address */
- listenaddr.sin_family = AF_INET;
- listenaddr.sin_port = HTONS(CONFIG_EXAMPLES_BRIDGE_NET1_RECVPORT);
- listenaddr.sin_addr.s_addr = g_net1_ipaddr;
+ receiver.sin_family = AF_INET;
+ receiver.sin_port = HTONS(CONFIG_EXAMPLES_BRIDGE_NET1_RECVPORT);
+ receiver.sin_addr.s_addr = g_net1_ipaddr;
- if (bind(recvsd, (struct sockaddr*)&listenaddr, sizeof(struct sockaddr_in)) < 0)
+ if (bind(recvsd, (struct sockaddr*)&receiver, sizeof(struct sockaddr_in)) < 0)
{
fprintf(stderr, "NET1 ERROR: bind failure: %d\n", errno);
goto errout_with_recvsd;
@@ -379,7 +384,10 @@ static int bridge_net1_worker(int argc, char *argv[])
/* Create a UDP send socket on network 2 */
- printf("NET1: Create send socket\n");
+ tmpaddr = ntohl(g_net2_ipaddr);
+ printf("NET1: Create send socket: %d.%d.%d.%d:INPORT_ANY\n",
+ tmpaddr >> 24, (tmpaddr >> 16) & 0xff,
+ (tmpaddr >> 8) & 0xff, tmpaddr & 0xff);
sndsd = socket(PF_INET, SOCK_DGRAM, 0);
if (sndsd < 0)
@@ -399,11 +407,11 @@ static int bridge_net1_worker(int argc, char *argv[])
/* Bind the socket to a local address */
- sendaddr.sin_family = AF_INET;
- sendaddr.sin_port = HTONS(CONFIG_EXAMPLES_BRIDGE_NET1_SNDPORT);
- sendaddr.sin_addr.s_addr = g_net2_ipaddr;
+ sender.sin_family = AF_INET;
+ sender.sin_port = 0;
+ sender.sin_addr.s_addr = g_net2_ipaddr;
- if (bind(sndsd, (struct sockaddr*)&sendaddr, sizeof(struct sockaddr_in)) < 0)
+ if (bind(sndsd, (struct sockaddr*)&sender, sizeof(struct sockaddr_in)) < 0)
{
printf("NET1: bind failure: %d\n", errno);
goto errout_with_sendsd;
@@ -420,14 +428,14 @@ static int bridge_net1_worker(int argc, char *argv[])
addrlen = sizeof(struct sockaddr_in);
nrecvd = recvfrom(recvsd, g_net1_buffer, CONFIG_EXAMPLES_BRIDGE_NET1_IOBUFIZE, 0,
- (FAR struct sockaddr*)&recvaddr, &addrlen);
+ (FAR struct sockaddr*)&fromaddr, &addrlen);
- tmpaddr = ntohl(recvaddr.sin_addr.s_addr);
+ tmpaddr = ntohl(fromaddr.sin_addr.s_addr);
printf("NET1: Received %d bytes from %d.%d.%d.%d:%d\n",
nrecvd,
tmpaddr >> 24, (tmpaddr >> 16) & 0xff,
(tmpaddr >> 8) & 0xff, tmpaddr & 0xff,
- ntohs(recvaddr.sin_port));
+ ntohs(fromaddr.sin_port));
/* Check for a receive error or zero bytes received. The negative
* return value indicates a receive error; Zero would mean that the
@@ -452,9 +460,20 @@ static int bridge_net1_worker(int argc, char *argv[])
/* Send the newly received packet out network 2 */
- printf("NET1: Sending %d bytes on network 2\n", nrecvd);
+ printf("NET1: Sending %d bytes on network 2: %d.%d.%d.%d:%d\n",
+ nrecvd,
+ CONFIG_EXAMPLES_BRIDGE_NET2_IPHOST >> 24,
+ (CONFIG_EXAMPLES_BRIDGE_NET2_IPHOST >> 16) & 0xff,
+ (CONFIG_EXAMPLES_BRIDGE_NET2_IPHOST >> 8) & 0xff,
+ CONFIG_EXAMPLES_BRIDGE_NET2_IPHOST & 0xff,
+ CONFIG_EXAMPLES_BRIDGE_NET2_HOSTPORT);
+
+ toaddr.sin_family = AF_INET;
+ toaddr.sin_port = htons(CONFIG_EXAMPLES_BRIDGE_NET2_HOSTPORT);
+ toaddr.sin_addr.s_addr = htonl(CONFIG_EXAMPLES_BRIDGE_NET2_IPHOST);
+
nsent = sendto(sndsd, g_net1_buffer, nrecvd, 0,
- (struct sockaddr*)&sendaddr, sizeof(struct sockaddr_in));
+ (struct sockaddr*)&toaddr, sizeof(struct sockaddr_in));
/* Check for send errors */
@@ -488,9 +507,10 @@ errout_with_recvsd:
static int bridge_net2_worker(int argc, char *argv[])
{
- struct sockaddr_in recvaddr;
- struct sockaddr_in listenaddr;
- struct sockaddr_in sendaddr;
+ struct sockaddr_in receiver;
+ struct sockaddr_in sender;
+ struct sockaddr_in fromaddr;
+ struct sockaddr_in toaddr;
socklen_t addrlen;
in_addr_t tmpaddr;
ssize_t nrecvd;
@@ -503,7 +523,11 @@ static int bridge_net2_worker(int argc, char *argv[])
/* Create a UDP receive socket on network 2 */
- printf("NET2: Create receive socket\n");
+ tmpaddr = ntohl(g_net2_ipaddr);
+ printf("NET2: Create receive socket: %d.%d.%d.%d:%d\n",
+ tmpaddr >> 24, (tmpaddr >> 16) & 0xff,
+ (tmpaddr >> 8) & 0xff, tmpaddr & 0xff,
+ CONFIG_EXAMPLES_BRIDGE_NET2_RECVPORT);
recvsd = socket(PF_INET, SOCK_DGRAM, 0);
if (recvsd < 0)
@@ -523,11 +547,11 @@ static int bridge_net2_worker(int argc, char *argv[])
/* Bind the socket to a local address */
- listenaddr.sin_family = AF_INET;
- listenaddr.sin_port = HTONS(CONFIG_EXAMPLES_BRIDGE_NET2_RECVPORT);
- listenaddr.sin_addr.s_addr = g_net2_ipaddr;
+ receiver.sin_family = AF_INET;
+ receiver.sin_port = HTONS(CONFIG_EXAMPLES_BRIDGE_NET2_RECVPORT);
+ receiver.sin_addr.s_addr = g_net2_ipaddr;
- if (bind(recvsd, (struct sockaddr*)&listenaddr, sizeof(struct sockaddr_in)) < 0)
+ if (bind(recvsd, (struct sockaddr*)&receiver, sizeof(struct sockaddr_in)) < 0)
{
fprintf(stderr, "NET2 ERROR: bind failure: %d\n", errno);
goto errout_with_recvsd;
@@ -535,7 +559,10 @@ static int bridge_net2_worker(int argc, char *argv[])
/* Create a UDP send socket on network 1 */
- printf("NET2: Create send socket\n");
+ tmpaddr = ntohl(g_net1_ipaddr);
+ printf("NET2: Create send socket: %d.%d.%d.%d:INPORT_ANY\n",
+ tmpaddr >> 24, (tmpaddr >> 16) & 0xff,
+ (tmpaddr >> 8) & 0xff, tmpaddr & 0xff);
sndsd = socket(PF_INET, SOCK_DGRAM, 0);
if (sndsd < 0)
@@ -555,11 +582,11 @@ static int bridge_net2_worker(int argc, char *argv[])
/* Bind the socket to a local address */
- sendaddr.sin_family = AF_INET;
- sendaddr.sin_port = HTONS(CONFIG_EXAMPLES_BRIDGE_NET2_SNDPORT);
- sendaddr.sin_addr.s_addr = g_net1_ipaddr;
+ sender.sin_family = AF_INET;
+ sender.sin_port = 0;
+ sender.sin_addr.s_addr = g_net1_ipaddr;
- if (bind(sndsd, (struct sockaddr*)&sendaddr, sizeof(struct sockaddr_in)) < 0)
+ if (bind(sndsd, (struct sockaddr*)&sender, sizeof(struct sockaddr_in)) < 0)
{
printf("NET2: bind failure: %d\n", errno);
goto errout_with_sendsd;
@@ -576,14 +603,14 @@ static int bridge_net2_worker(int argc, char *argv[])
addrlen = sizeof(struct sockaddr_in);
nrecvd = recvfrom(recvsd, g_net2_buffer, CONFIG_EXAMPLES_BRIDGE_NET2_IOBUFIZE, 0,
- (FAR struct sockaddr*)&recvaddr, &addrlen);
+ (FAR struct sockaddr*)&fromaddr, &addrlen);
- tmpaddr = ntohl(recvaddr.sin_addr.s_addr);
+ tmpaddr = ntohl(fromaddr.sin_addr.s_addr);
printf("NET2: Received %d bytes from %d.%d.%d.%d:%d\n",
nrecvd,
tmpaddr >> 24, (tmpaddr >> 16) & 0xff,
(tmpaddr >> 8) & 0xff, tmpaddr & 0xff,
- ntohs(recvaddr.sin_port));
+ ntohs(fromaddr.sin_port));
/* Check for a receive error or zero bytes received. The negative
* return value indicates a receive error; Zero would mean that the
@@ -609,8 +636,20 @@ static int bridge_net2_worker(int argc, char *argv[])
/* Send the newly received packet out network 1 */
printf("NET2: Sending %d bytes on network 1\n", nrecvd);
+ printf("NET1: Sending %d bytes on network 1: %d.%d.%d.%d:%d\n",
+ nrecvd,
+ CONFIG_EXAMPLES_BRIDGE_NET1_IPHOST >> 24,
+ (CONFIG_EXAMPLES_BRIDGE_NET1_IPHOST >> 16) & 0xff,
+ (CONFIG_EXAMPLES_BRIDGE_NET1_IPHOST >> 8) & 0xff,
+ CONFIG_EXAMPLES_BRIDGE_NET1_IPHOST & 0xff,
+ CONFIG_EXAMPLES_BRIDGE_NET1_HOSTPORT);
+
+ toaddr.sin_family = AF_INET;
+ toaddr.sin_port = htons(CONFIG_EXAMPLES_BRIDGE_NET1_HOSTPORT);
+ toaddr.sin_addr.s_addr = htonl(CONFIG_EXAMPLES_BRIDGE_NET1_IPHOST);
+
nsent = sendto(sndsd, g_net2_buffer, nrecvd, 0,
- (struct sockaddr*)&sendaddr, sizeof(struct sockaddr_in));
+ (struct sockaddr*)&toaddr, sizeof(struct sockaddr_in));
/* Check for send errors */
diff --git a/apps/examples/bridge/host_main.c b/apps/examples/bridge/host_main.c
index 4542b4e75..0a8c3f970 100644
--- a/apps/examples/bridge/host_main.c
+++ b/apps/examples/bridge/host_main.c
@@ -76,8 +76,8 @@ int main(int argc, char *argv[])
{
struct sockaddr_in receiver;
struct sockaddr_in sender;
- struct sockaddr_in toaddr;
struct sockaddr_in fromaddr;
+ struct sockaddr_in toaddr;
socklen_t addrlen;
in_addr_t tmpaddr;
ssize_t nrecvd;
@@ -124,7 +124,7 @@ int main(int argc, char *argv[])
/* Create a UDP receive socket */
printf(LABEL "Create receive socket: IPHOST=%08x RECVPORT=%d\n",
- EXAMPLES_BRIDGE_RECV_IPHOST, EXAMPLES_BRIDGE_SEND_SNDPORT);
+ EXAMPLES_BRIDGE_RECV_IPHOST, EXAMPLES_BRIDGE_SEND_HOSTPORT);
recvsd = socket(PF_INET, SOCK_DGRAM, 0);
if (recvsd < 0)
@@ -145,7 +145,7 @@ int main(int argc, char *argv[])
/* Bind the socket to a local address */
receiver.sin_family = AF_INET;
- receiver.sin_port = htons(EXAMPLES_BRIDGE_SEND_SNDPORT);
+ receiver.sin_port = htons(EXAMPLES_BRIDGE_SEND_HOSTPORT);
receiver.sin_addr.s_addr = htonl(EXAMPLES_BRIDGE_RECV_IPHOST);
if (bind(recvsd, (struct sockaddr*)&receiver, sizeof(struct sockaddr_in)) < 0)
@@ -158,11 +158,11 @@ int main(int argc, char *argv[])
printf(LABEL "Sending %lu bytes: IPTARGET=%08x PORT=%d\n",
sizeof(g_sndmessage),
- CONFIG_EXAMPLES_BRIDGE_NET1_IPADDR, CONFIG_EXAMPLES_BRIDGE_NET1_RECVPORT);
+ EXAMPLES_BRIDGE_RECV_IPADDR, EXAMPLES_BRIDGE_RECV_RECVPORT);
toaddr.sin_family = AF_INET;
- toaddr.sin_port = htons(CONFIG_EXAMPLES_BRIDGE_NET1_RECVPORT);
- toaddr.sin_addr.s_addr = htonl(CONFIG_EXAMPLES_BRIDGE_NET1_IPADDR);
+ toaddr.sin_port = htons(EXAMPLES_BRIDGE_RECV_RECVPORT);
+ toaddr.sin_addr.s_addr = htonl(EXAMPLES_BRIDGE_RECV_IPADDR);
nsent = sendto(sndsd, g_sndmessage, sizeof(g_sndmessage), 0,
(struct sockaddr*)&toaddr, sizeof(struct sockaddr_in));
diff --git a/apps/examples/bridge/host_net1.c b/apps/examples/bridge/host_net1.c
index 8f9c85f29..343f25e4a 100644
--- a/apps/examples/bridge/host_net1.c
+++ b/apps/examples/bridge/host_net1.c
@@ -48,7 +48,6 @@
#define EXAMPLES_BRIDGE_SEND_IFNAME CONFIG_EXAMPLES_BRIDGE_NET1_IFNAME
#define EXAMPLES_BRIDGE_SEND_RECVPORT CONFIG_EXAMPLES_BRIDGE_NET1_RECVPORT
-#define EXAMPLES_BRIDGE_SEND_SNDPORT CONFIG_EXAMPLES_BRIDGE_NET1_SNDPORT
#define EXAMPLES_BRIDGE_SEND_IOBUFIZE CONFIG_EXAMPLES_BRIDGE_NET1_IOBUFIZE
#ifdef CONFIG_EXAMPLES_BRIDGE_NET1_NOMAC
# define EXAMPLES_BRIDGE_SEND_NOMAC
@@ -58,6 +57,7 @@
#define EXAMPLES_BRIDGE_SEND_DRIPADDR CONFIG_EXAMPLES_BRIDGE_NET1_DRIPADDR
#define EXAMPLES_BRIDGE_SEND_NETMASK CONFIG_EXAMPLES_BRIDGE_NET1_NETMASK
#define EXAMPLES_BRIDGE_SEND_IPHOST CONFIG_EXAMPLES_BRIDGE_NET1_IPHOST
+#define EXAMPLES_BRIDGE_SEND_HOSTPORT CONFIG_EXAMPLES_BRIDGE_NET1_HOSTPORT
#define EXAMPLES_BRIDGE_SEND_STACKSIZE CONFIG_EXAMPLES_BRIDGE_NET1_STACKSIZE
#define EXAMPLES_BRIDGE_SEND_PRIORITY CONFIG_EXAMPLES_BRIDGE_NET1_PRIORITY
@@ -65,7 +65,6 @@
#define EXAMPLES_BRIDGE_RECV_IFNAME CONFIG_EXAMPLES_BRIDGE_NET2_IFNAME
#define EXAMPLES_BRIDGE_RECV_RECVPORT CONFIG_EXAMPLES_BRIDGE_NET2_RECVPORT
-#define EXAMPLES_BRIDGE_RECV_SNDPORT CONFIG_EXAMPLES_BRIDGE_NET2_SNDPORT
#define EXAMPLES_BRIDGE_RECV_IOBUFIZE CONFIG_EXAMPLES_BRIDGE_NET2_IOBUFIZE
#ifdef CONFIG_EXAMPLES_BRIDGE_NET2_NOMAC
# define EXAMPLES_BRIDGE_RECV_NOMAC
@@ -75,6 +74,7 @@
#define EXAMPLES_BRIDGE_RECV_DRIPADDR CONFIG_EXAMPLES_BRIDGE_NET2_DRIPADDR
#define EXAMPLES_BRIDGE_RECV_NETMASK CONFIG_EXAMPLES_BRIDGE_NET2_NETMASK
#define EXAMPLES_BRIDGE_RECV_IPHOST CONFIG_EXAMPLES_BRIDGE_NET2_IPHOST
+#define EXAMPLES_BRIDGE_RECV_HOSTPORT CONFIG_EXAMPLES_BRIDGE_NET2_HOSTPORT
#define EXAMPLES_BRIDGE_RECV_STACKSIZE CONFIG_EXAMPLES_BRIDGE_NET2_STACKSIZE
#define EXAMPLES_BRIDGE_RECV_PRIORITY CONFIG_EXAMPLES_BRIDGE_NET2_PRIORITY
diff --git a/apps/examples/bridge/host_net2.c b/apps/examples/bridge/host_net2.c
index 32fdaa6ed..79c6a3aca 100644
--- a/apps/examples/bridge/host_net2.c
+++ b/apps/examples/bridge/host_net2.c
@@ -48,7 +48,6 @@
#define EXAMPLES_BRIDGE_SEND_IFNAME CONFIG_EXAMPLES_BRIDGE_NET2_IFNAME
#define EXAMPLES_BRIDGE_SEND_RECVPORT CONFIG_EXAMPLES_BRIDGE_NET2_RECVPORT
-#define EXAMPLES_BRIDGE_SEND_SNDPORT CONFIG_EXAMPLES_BRIDGE_NET2_SNDPORT
#define EXAMPLES_BRIDGE_SEND_IOBUFIZE CONFIG_EXAMPLES_BRIDGE_NET2_IOBUFIZE
#ifdef CONFIG_EXAMPLES_BRIDGE_NET2_NOMAC
# define EXAMPLES_BRIDGE_SEND_NOMAC
@@ -58,6 +57,7 @@
#define EXAMPLES_BRIDGE_SEND_DRIPADDR CONFIG_EXAMPLES_BRIDGE_NET2_DRIPADDR
#define EXAMPLES_BRIDGE_SEND_NETMASK CONFIG_EXAMPLES_BRIDGE_NET2_NETMASK
#define EXAMPLES_BRIDGE_SEND_IPHOST CONFIG_EXAMPLES_BRIDGE_NET2_IPHOST
+#define EXAMPLES_BRIDGE_SEND_HOSTPORT CONFIG_EXAMPLES_BRIDGE_NET2_HOSTPORT
#define EXAMPLES_BRIDGE_SEND_STACKSIZE CONFIG_EXAMPLES_BRIDGE_NET2_STACKSIZE
#define EXAMPLES_BRIDGE_SEND_PRIORITY CONFIG_EXAMPLES_BRIDGE_NET2_PRIORITY
@@ -65,7 +65,6 @@
#define EXAMPLES_BRIDGE_RECV_IFNAME CONFIG_EXAMPLES_BRIDGE_NET1_IFNAME
#define EXAMPLES_BRIDGE_RECV_RECVPORT CONFIG_EXAMPLES_BRIDGE_NET1_RECVPORT
-#define EXAMPLES_BRIDGE_RECV_SNDPORT CONFIG_EXAMPLES_BRIDGE_NET1_SNDPORT
#define EXAMPLES_BRIDGE_RECV_IOBUFIZE CONFIG_EXAMPLES_BRIDGE_NET1_IOBUFIZE
#ifdef CONFIG_EXAMPLES_BRIDGE_NET1_NOMAC
# define EXAMPLES_BRIDGE_RECV_NOMAC
@@ -75,6 +74,7 @@
#define EXAMPLES_BRIDGE_RECV_DRIPADDR CONFIG_EXAMPLES_BRIDGE_NET1_DRIPADDR
#define EXAMPLES_BRIDGE_RECV_NETMASK CONFIG_EXAMPLES_BRIDGE_NET1_NETMASK
#define EXAMPLES_BRIDGE_RECV_IPHOST CONFIG_EXAMPLES_BRIDGE_NET1_IPHOST
+#define EXAMPLES_BRIDGE_RECV_HOSTPORT CONFIG_EXAMPLES_BRIDGE_NET1_HOSTPORT
#define EXAMPLES_BRIDGE_RECV_STACKSIZE CONFIG_EXAMPLES_BRIDGE_NET1_STACKSIZE
#define EXAMPLES_BRIDGE_RECV_PRIORITY CONFIG_EXAMPLES_BRIDGE_NET1_PRIORITY
diff --git a/nuttx/configs/sam4e-ek/README.txt b/nuttx/configs/sam4e-ek/README.txt
index 5c11dad6c..48efd2dd5 100644
--- a/nuttx/configs/sam4e-ek/README.txt
+++ b/nuttx/configs/sam4e-ek/README.txt
@@ -1350,7 +1350,9 @@ Configurations
This delay will be especially long if the board is not connected to
a network because additional time will be required to fail with
- timeout errors. This delay can be eliminated, however, if you enable an NSH initialization option as described above in a paragraph entitled, "Network Initialization Thread."
+ timeout errors. This delay can be eliminated, however, if you enable
+ an NSH initialization option as described above in a paragraph
+ entitled, "Network Initialization Thread."
STATUS:
2014-3-13: The basic NSH serial console is working. Network support
diff --git a/nuttx/configs/sama5d3-xplained/bridge/defconfig b/nuttx/configs/sama5d3-xplained/bridge/defconfig
index 0fa04e646..6cace6f43 100644
--- a/nuttx/configs/sama5d3-xplained/bridge/defconfig
+++ b/nuttx/configs/sama5d3-xplained/bridge/defconfig
@@ -650,8 +650,10 @@ CONFIG_NET_ICMP=y
CONFIG_NET_ARP=y
CONFIG_NET_ARPTAB_SIZE=16
CONFIG_NET_ARP_MAXAGE=120
-CONFIG_NET_ARP_IPIN=y
-# CONFIG_NET_ARP_SEND is not set
+# CONFIG_NET_ARP_IPIN is not set
+CONFIG_NET_ARP_SEND=y
+CONFIG_ARP_SEND_MAXTRIES=5
+CONFIG_ARP_SEND_DELAYMSEC=20
#
# Network I/O Buffer Support
@@ -805,7 +807,6 @@ CONFIG_EXAMPLES_BRIDGE=y
#
CONFIG_EXAMPLES_BRIDGE_NET1_IFNAME="eth0"
CONFIG_EXAMPLES_BRIDGE_NET1_RECVPORT=5471
-CONFIG_EXAMPLES_BRIDGE_NET1_SNDPORT=5472
CONFIG_EXAMPLES_BRIDGE_NET1_IOBUFIZE=1024
# CONFIG_EXAMPLES_BRIDGE_NET1_DHCPC is not set
CONFIG_EXAMPLES_BRIDGE_NET1_NOMAC=y
@@ -814,6 +815,7 @@ CONFIG_EXAMPLES_BRIDGE_NET1_IPADDR=0x0a000002
CONFIG_EXAMPLES_BRIDGE_NET1_DRIPADDR=0x0a000001
CONFIG_EXAMPLES_BRIDGE_NET1_NETMASK=0xffffff00
CONFIG_EXAMPLES_BRIDGE_NET1_IPHOST=0x0a000001
+CONFIG_EXAMPLES_BRIDGE_NET1_HOSTPORT=5472
CONFIG_EXAMPLES_BRIDGE_NET1_STACKSIZE=2048
CONFIG_EXAMPLES_BRIDGE_NET1_PRIORITY=100
@@ -822,7 +824,6 @@ CONFIG_EXAMPLES_BRIDGE_NET1_PRIORITY=100
#
CONFIG_EXAMPLES_BRIDGE_NET2_IFNAME="eth1"
CONFIG_EXAMPLES_BRIDGE_NET2_RECVPORT=5473
-CONFIG_EXAMPLES_BRIDGE_NET2_SNDPORT=5474
CONFIG_EXAMPLES_BRIDGE_NET2_IOBUFIZE=1024
# CONFIG_EXAMPLES_BRIDGE_NET2_DHCPC is not set
CONFIG_EXAMPLES_BRIDGE_NET2_NOMAC=y
@@ -831,6 +832,7 @@ CONFIG_EXAMPLES_BRIDGE_NET2_IPADDR=0x0a000003
CONFIG_EXAMPLES_BRIDGE_NET2_DRIPADDR=0x0a000001
CONFIG_EXAMPLES_BRIDGE_NET2_NETMASK=0xffffff00
CONFIG_EXAMPLES_BRIDGE_NET2_IPHOST=0x0a000001
+CONFIG_EXAMPLES_BRIDGE_NET2_HOSTPORT=5474
CONFIG_EXAMPLES_BRIDGE_NET2_STACKSIZE=2048
CONFIG_EXAMPLES_BRIDGE_NET2_PRIORITY=100
# CONFIG_EXAMPLES_BUTTONS is not set
diff --git a/nuttx/configs/sama5d4-ek/bridge/defconfig b/nuttx/configs/sama5d4-ek/bridge/defconfig
index 43c079a0c..4d7c88fe3 100644
--- a/nuttx/configs/sama5d4-ek/bridge/defconfig
+++ b/nuttx/configs/sama5d4-ek/bridge/defconfig
@@ -264,7 +264,7 @@ CONFIG_SAMA5_EMAC1_PHYSR_100FD=0x6
# CONFIG_SAMA5_EMACB_PREALLOCATE is not set
# CONFIG_SAMA5_EMACB_NBC is not set
CONFIG_SAMA5_EMAC0_ISETH0=y
-# CONFIG_SAMA5_EMAC0_ISETH1 is not set
+# CONFIG_SAMA5_EMAC1_ISETH0 is not set
#
# External Memory Configuration
@@ -681,8 +681,10 @@ CONFIG_NET_ICMP=y
CONFIG_NET_ARP=y
CONFIG_NET_ARPTAB_SIZE=16
CONFIG_NET_ARP_MAXAGE=120
-CONFIG_NET_ARP_IPIN=y
-# CONFIG_NET_ARP_SEND is not set
+# CONFIG_NET_ARP_IPIN is not set
+CONFIG_NET_ARP_SEND=y
+CONFIG_ARP_SEND_MAXTRIES=5
+CONFIG_ARP_SEND_DELAYMSEC=20
#
# Network I/O Buffer Support
@@ -836,7 +838,6 @@ CONFIG_EXAMPLES_BRIDGE=y
#
CONFIG_EXAMPLES_BRIDGE_NET1_IFNAME="eth0"
CONFIG_EXAMPLES_BRIDGE_NET1_RECVPORT=5471
-CONFIG_EXAMPLES_BRIDGE_NET1_SNDPORT=5472
CONFIG_EXAMPLES_BRIDGE_NET1_IOBUFIZE=1024
# CONFIG_EXAMPLES_BRIDGE_NET1_DHCPC is not set
CONFIG_EXAMPLES_BRIDGE_NET1_NOMAC=y
@@ -844,6 +845,8 @@ CONFIG_EXAMPLES_BRIDGE_NET1_MACADDR=0x00e0deadbeef
CONFIG_EXAMPLES_BRIDGE_NET1_IPADDR=0x0a000002
CONFIG_EXAMPLES_BRIDGE_NET1_DRIPADDR=0x0a000001
CONFIG_EXAMPLES_BRIDGE_NET1_NETMASK=0xffffff00
+CONFIG_EXAMPLES_BRIDGE_NET1_IPHOST=0x0a000001
+CONFIG_EXAMPLES_BRIDGE_NET1_HOSTPORT=5472
CONFIG_EXAMPLES_BRIDGE_NET1_STACKSIZE=2048
CONFIG_EXAMPLES_BRIDGE_NET1_PRIORITY=100
@@ -852,7 +855,6 @@ CONFIG_EXAMPLES_BRIDGE_NET1_PRIORITY=100
#
CONFIG_EXAMPLES_BRIDGE_NET2_IFNAME="eth1"
CONFIG_EXAMPLES_BRIDGE_NET2_RECVPORT=5473
-CONFIG_EXAMPLES_BRIDGE_NET2_SNDPORT=5474
CONFIG_EXAMPLES_BRIDGE_NET2_IOBUFIZE=1024
# CONFIG_EXAMPLES_BRIDGE_NET2_DHCPC is not set
CONFIG_EXAMPLES_BRIDGE_NET2_NOMAC=y
@@ -860,6 +862,8 @@ CONFIG_EXAMPLES_BRIDGE_NET2_MACADDR=0x00e0f00dface
CONFIG_EXAMPLES_BRIDGE_NET2_IPADDR=0x0a000003
CONFIG_EXAMPLES_BRIDGE_NET2_DRIPADDR=0x0a000001
CONFIG_EXAMPLES_BRIDGE_NET2_NETMASK=0xffffff00
+CONFIG_EXAMPLES_BRIDGE_NET2_IPHOST=0x0a000001
+CONFIG_EXAMPLES_BRIDGE_NET2_HOSTPORT=5474
CONFIG_EXAMPLES_BRIDGE_NET2_STACKSIZE=2048
CONFIG_EXAMPLES_BRIDGE_NET2_PRIORITY=100
# CONFIG_EXAMPLES_BUTTONS is not set