summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcvs2git <rtems-devel@rtems.org>1998-08-08 17:51:31 +0000
committercvs2git <rtems-devel@rtems.org>1998-08-08 17:51:31 +0000
commit2fe49d5d973f4e9e00f57e54a27437f79d712f38 (patch)
tree51487ed903879562ba226711715fd8a221066526
parentc87143a1734b473b7c7e238660e2071d899bbe75 (diff)
This commit was manufactured by cvs2svn to create tag 'netdemos-19980808'.netdemos-19980808
Sprout from ERIC-NORUM 1998-07-30 14:42:29 UTC Joel Sherrill <joel.sherrill@OARcorp.com> 'base from Eric Norum -- Demos.30May1998.tar.gz' Cherrypick from master 1998-08-08 17:51:30 UTC Joel Sherrill <joel.sherrill@OARcorp.com> 'Added print.': DEBUG.hints DEBUG.linux netdemo/Makefile netdemo/README netdemo/init.c netdemo/test.c tftpTest/init.c ttcp/init.c usercfg.h
-rw-r--r--DEBUG.hints14
-rw-r--r--DEBUG.linux12
-rw-r--r--netdemo/Makefile4
-rw-r--r--netdemo/README5
-rw-r--r--netdemo/init.c38
-rw-r--r--netdemo/test.c4
-rw-r--r--tftpTest/init.c9
-rw-r--r--ttcp/init.c20
-rw-r--r--usercfg.h55
9 files changed, 110 insertions, 51 deletions
diff --git a/DEBUG.hints b/DEBUG.hints
new file mode 100644
index 0000000..7eaf057
--- /dev/null
+++ b/DEBUG.hints
@@ -0,0 +1,14 @@
+#
+# $Id$
+#
+
+Debugging Hints
+===============
+If you also define TRACE_NETWORK_DRIVER you'll get a *lot*
+of printout describing each packet as it passes through the stack.
+
+For debugging, I'd suggest breakpoints in the socket receive and transmit
+tasks to trace where you're running. Also, if you have a LANalyzer or
+workstation with `snoop' capability set it up to show all packets to/from the
+hardware (Ethernet) address of your target machine.
+
diff --git a/DEBUG.linux b/DEBUG.linux
new file mode 100644
index 0000000..9e9eeba
--- /dev/null
+++ b/DEBUG.linux
@@ -0,0 +1,12 @@
+#
+# $Id$
+#
+
+TCPDUMP
+=======
+On Linux, you can use the tcpdump utility to examine packets. Something
+like this:
+
+tcpdump -i eth0
+
+tcpdump can filter packets. See the man page for details.
diff --git a/netdemo/Makefile b/netdemo/Makefile
index 4894a7c..fa6acbb 100644
--- a/netdemo/Makefile
+++ b/netdemo/Makefile
@@ -1,3 +1,7 @@
+#
+# $Id$
+#
+
SAMPLE=netdemo
PGM=${ARCH}/$(SAMPLE).exe
diff --git a/netdemo/README b/netdemo/README
index 5f9a303..143b7b6 100644
--- a/netdemo/README
+++ b/netdemo/README
@@ -1,3 +1,7 @@
+#
+# $Id$
+#
+
A simple application to test some of the KA9Q networking code.
**************************
@@ -25,3 +29,4 @@ ADMINISTRATOR TO THE POINT WHERE VICIOUS ATTACKS WILL BE MADE UPON YOU.
the target console.
You can run more than one telnet session at once.
You can use port number 24743 as well.
+
diff --git a/netdemo/init.c b/netdemo/init.c
index 27b5889..b6d42a8 100644
--- a/netdemo/init.c
+++ b/netdemo/init.c
@@ -11,9 +11,16 @@
* University of Saskatchewan
* Saskatoon, Saskatchewan, CANADA
* eric@skatter.usask.ca
+ *
+ * $Id$
+ */
+
+/*
+ * Include user provided information
*/
-/*#define TRACE_NETWORK_DRIVER 1 */
+#include "../usercfg.h"
+
#include <bsp.h>
#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
@@ -43,31 +50,9 @@ rtems_task Init (rtems_task_argument argument);
#include <stdio.h>
#include <rtems_ka9q.h>
-/*
- * Board ethernet address
- * REPLACE THIS WITH YOUR OWN VALUE BEFORE TRYING TO USE THIS PROGRAM!
- */
-#define MY_ETHERNET_ADDRESS "37:1D:3E:21:2B:A5"
-
-/*
- * Some board support packages let the network driver
- * get the Ethernet address from the bootstrap PROM.
- */
-#define MY_ETHERNET_ADDRESS "prom"
-
-/*
- * Use BOOTP to get information about me?
- */
-#define USE_BOOTP 1
#if (defined (USE_BOOTP))
#include <bootp.h>
-#else
-/*
- * Information about me if BOOTP isn't used
- * CHOOSE A VALUE APPROPRIATE TO YOUR NETWORK!
- */
-#define MY_IP_ADDRESS "128.233.14.68"
#endif
/*
@@ -88,18 +73,18 @@ delay_task (int seconds)
rtems_task
Init (rtems_task_argument ignored)
{
- printf( "\n\n*** HELLO WORLD TEST ***\n" );
- printf( "Hello World\n" );
- printf( "*** END OF HELLO WORLD TEST ***\n" );
+ printf( "\n\n*** ETHERNET DEMO TEST ***\n" );
/*
* Start KA9Q
*/
+ puts( "Starting KA9Q" );
rtems_ka9q_start (50);
/*
* Hook up drivers
*/
+ puts( "Attaching to the network" );
#if (defined (USE_BOOTP))
if (rtems_ka9q_execute_command ("attach rtems broadcast y"
" ether " MY_ETHERNET_ADDRESS))
@@ -114,6 +99,7 @@ Init (rtems_task_argument ignored)
/*
* Turn on debugging
*/
+ puts( "Enabling debug mode of KA9Q" );
if (rtems_ka9q_execute_command ("trace rtems input <stdout>")
|| rtems_ka9q_execute_command ("trace rtems output <stdout>")
|| rtems_ka9q_execute_command ("trace rtems ascii <stdout>"))
diff --git a/netdemo/test.c b/netdemo/test.c
index de0ee80..c3d2b15 100644
--- a/netdemo/test.c
+++ b/netdemo/test.c
@@ -11,7 +11,10 @@
* University of Saskatchewan
* Saskatoon, Saskatchewan, CANADA
* eric@skatter.usask.ca
+ *
+ * $Id$
*/
+
#include <stdio.h>
#include <unistd.h>
#include <rtems.h>
@@ -154,6 +157,7 @@ echoTask (rtems_task_argument fd)
int n;
rtems_status_code sc;
+ printf( "echoTask on %d\n", fd );
for (;;) {
#if 0
n = read (fd, cbuf, sizeof cbuf);
diff --git a/tftpTest/init.c b/tftpTest/init.c
index d4b6100..34df675 100644
--- a/tftpTest/init.c
+++ b/tftpTest/init.c
@@ -13,6 +13,8 @@
* eric@skatter.usask.ca
*/
+#include "../usercfg.h"
+
#include <bsp.h>
#include <rtems/error.h>
#include <tftp.h>
@@ -40,13 +42,6 @@ rtems_driver_address_table Device_drivers[] = {
#include <confdefs.h>
-/*
- * Board ethernet address
- * REPLACE THIS WITH YOUR OWN VALUE BEFORE TRYING TO USE THIS PROGRAM!
- */
-#define MY_ETHERNET_ADDRESS "48:3E:3E:21:2E:D5"
-#define MY_ETHERNET_ADDRESS "prom"
-
#include <bootp.h>
extern void testTFTP (void);
diff --git a/ttcp/init.c b/ttcp/init.c
index 7d19353..e3fdd99 100644
--- a/ttcp/init.c
+++ b/ttcp/init.c
@@ -13,6 +13,8 @@
* eric@skatter.usask.ca
*/
+#include "../usercfg.h"
+
/*#define TRACE_SCC1 1 */
#include <bsp.h>
@@ -35,26 +37,8 @@ rtems_task Init (rtems_task_argument argument);
#include <stdio.h>
#include <rtems_ka9q.h>
-/*
- * Board ethernet address
- * REPLACE THIS WITH YOUR OWN VALUE BEFORE TRYING TO USE THIS PROGRAM!
- */
-#define MY_ETHERNET_ADDRESS "3B:1D:3E:21:E2:D5"
-#define MY_ETHERNET_ADDRESS "prom"
-
-/*
- * Use BOOTP to get information about me?
- */
-#define USE_BOOTP 1
-
#if (defined (USE_BOOTP))
#include <bootp.h>
-#else
-/*
- * Information about me if BOOTP isn't used
- * CHOOSE A VALUE APPROPRIATE TO YOUR NETWORK!
- */
-#define MY_IP_ADDRESS "128.233.14.68"
#endif
/*
diff --git a/usercfg.h b/usercfg.h
new file mode 100644
index 0000000..e9d4ae0
--- /dev/null
+++ b/usercfg.h
@@ -0,0 +1,55 @@
+/*
+ * $Id$
+ */
+
+#ifndef __USER_CFG_h
+#define __USER_CFG_h
+
+/*
+ * Board ethernet address
+ * REPLACE THIS WITH YOUR OWN VALUE BEFORE TRYING ANY OF THESE PROGRAMS!!!
+ */
+#define MY_ETHERNET_ADDRESS "00:80:7F:22:61:77"
+
+/*
+ * Some board support packages let the network driver
+ * get the Ethernet address from the bootstrap PROM.
+ */
+/*
+#define MY_ETHERNET_ADDRESS "prom"
+*/
+
+
+/*
+ * Define this if we should use BOOTP to get information about the target?
+ */
+/* #define USE_BOOTP 1 */
+
+/*
+ * If you don't use BOOTP, then you must define MY_IP_ADDRESS.
+ * CHOOSE A VALUE APPROPRIATE TO YOUR NETWORK!
+ */
+
+#define MY_IP_ADDRESS "192.168.1.100"
+
+
+/*
+ * Define this if you want to see debugging messages.
+ */
+
+#define TRACE_NETWORK_DRIVER 1
+
+/*
+ * Do some consistency checking.
+ */
+
+#ifndef MY_ETHERNET_ADDRESS
+#error "Need to define a hardware Ethernet address"
+#endif
+
+#if !defined(USE_BOOTP) && !defined(MY_IP_ADDRESS)
+#error "MY_IP_ADDRESS is not defined"
+#endif
+
+#endif
+/* end of include file */