summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2000-05-23 15:27:59 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2000-05-23 15:27:59 +0000
commitc45080669aef40371d8ef97e9107e8b8095ac624 (patch)
tree09ff2662ec1ac1d8e7851f2cccd9a66ba5409892
parent7c715525bb9bb94c9e82af3a0fcb7fce1148981f (diff)
Do not use a DATA_SINK_HOST on Eric Norum's network. :) Force the
user to define their own. Spotted by Joel, patch from Eric Norum <eric@cls.usask.ca>.
-rw-r--r--netdemo/test.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/netdemo/test.c b/netdemo/test.c
index 0025fe1..b614ce3 100644
--- a/netdemo/test.c
+++ b/netdemo/test.c
@@ -29,7 +29,11 @@
#define NSERVER 2
#define BASE_PORT 24742
-#define DATA_SINK_HOST ((128 << 24) | (233 << 16) | (14 << 8) | 60)
+
+/* #define DATA_SINK_HOST "192.0.0.1" /* YOUR `discard' HOST GOES HERE */
+#ifndef DATA_SINK_HOST
+# error "You must define DATA_SINK_HOST"
+#endif
void showbroad(int s)
{
@@ -93,7 +97,7 @@ showbroad (s);
rtems_panic ("Can't broadcast: %s", strerror (errno));
}
#endif
- farAddr.sin_addr.s_addr = htonl (DATA_SINK_HOST);
+ inet_aton (DATA_SINK_HOST, &farAddr.sin_addr);
#if 1
for (i = 0 ; i < 500 ; i++) {
if (sendto (s, cbuf, sizeof cbuf, 0, (struct sockaddr *)&farAddr, sizeof farAddr) < 0)
@@ -137,7 +141,7 @@ transmitTcp (void)
rtems_panic ("Can't bind socket: %s", strerror (errno));
farAddr.sin_family = AF_INET;
farAddr.sin_port = htons (9); /* The `discard' port */
- farAddr.sin_addr.s_addr = htonl (DATA_SINK_HOST);
+ inet_aton (DATA_SINK_HOST, &farAddr.sin_addr);
printf ("Connect socket.\n");
if (connect (s, (struct sockaddr *)&farAddr, sizeof farAddr) < 0) {
printf ("Can't connect socket: %s\n", strerror (errno));