diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 1999-11-12 20:14:13 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 1999-11-12 20:14:13 +0000 |
commit | 3d7557e820ca56b4ed83f63a86cc3497f5e8ef3b (patch) | |
tree | cf45565ce766e34513e1e5153baccac1c0bf5051 | |
parent | b9f308a02550f1b9a25ea919053b20972b8b15e1 (diff) |
New test to determine network application sizes.
-rw-r--r-- | netlink/Makefile | 67 | ||||
-rw-r--r-- | netlink/index.html | 15 | ||||
-rw-r--r-- | netlink/init.c | 89 | ||||
-rw-r--r-- | netlink/networkconfig.h | 116 | ||||
-rw-r--r-- | netlink/system.h | 33 |
5 files changed, 320 insertions, 0 deletions
diff --git a/netlink/Makefile b/netlink/Makefile new file mode 100644 index 0000000..0c05a12 --- /dev/null +++ b/netlink/Makefile @@ -0,0 +1,67 @@ +# +# $Id$ +# + +SAMPLE=netlink +PGM=${ARCH}/$(SAMPLE).exe + +MANAGERS=all + +# C source names, if any, go here -- minus the .c +C_PIECES=init +C_FILES=$(C_PIECES:%=%.c) +C_O_FILES=$(C_PIECES:%=${ARCH}/%.o) + +H_FILES= + +DOCTYPES= +DOCS=$(DOCTYPES:%=$(SAMPLE).%) + +SRCS=$(DOCS) $(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES) +OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES) $(ARCH)/tarfile.o + +PRINT_SRCS=$(DOCS) + +PGM=${ARCH}/$(SAMPLE).exe + +include $(RTEMS_MAKEFILE_PATH)/Makefile.inc +include $(RTEMS_CUSTOM) +include $(PROJECT_ROOT)/make/leaf.cfg + +# +# (OPTIONAL) Add local stuff here using += +# + +DEFINES += +CPPFLAGS += +CFLAGS += +CFLAGS_LD += +# CFLAGS_LD += -Wl,--defsym -Wl,HeapSize=0xC0000 +CFLAGS_OPTIMIZE_V += +CFLAGS_DEBUG_V += -v -qrtems_debug + +LD_PATHS += +LD_LIBS += + +# +# Add your list of files to delete here. The config files +# already know how to delete some stuff, so you may want +# to just run 'make clean' first to see what gets missed. +# 'make clobber' already includes 'make clean' +# + +CLEAN_ADDITIONS += tarfile +CLOBBER_ADDITIONS += + +all: ${ARCH} $(SRCS) $(PGM) + +${PGM}: $(OBJS) $(LINK_FILES) + $(make-exe) + +$(ARCH)/tarfile.o: + tar cf tarfile index.html + $(LD) -r -o $(ARCH)/tarfile.o -b binary tarfile + +# Install the program(s), appending _g or _p as appropriate. +# for include files, just use $(INSTALL) +install: all diff --git a/netlink/index.html b/netlink/index.html new file mode 100644 index 0000000..15e5c9f --- /dev/null +++ b/netlink/index.html @@ -0,0 +1,15 @@ +<HTML> +<HEAD><TITLE>RTEMS GoAhead Test Page</TITLE></HEAD> +<BODY BGCOLOR="FFFFFF"> +<A HREF="http://www.oarcorp.com" target="Text Frame"> + <IMG align=right BORDER=0 SRC="oaronly.jpg" ALT="OAR"> </A> +<H1>RTEMS GoAhead Test Page</H1> +<HR> +<BODY> + +<P>Congratulations, you have successfully loaded your first page +from the GoAhead Web Server running on RTEMS.</P> + +<HR> +Copyright © 1988-1999 <A HREF="http://www.oarcorp.com" target="Text Frame">OAR Corporation</A> +</BODY></HTML> diff --git a/netlink/init.c b/netlink/init.c new file mode 100644 index 0000000..8ce7603 --- /dev/null +++ b/netlink/init.c @@ -0,0 +1,89 @@ +/* Init + * + * This routine is the initialization task for this test program. + * + * Don't forget to change the IP addresses + */ + +#include <bsp.h> + +#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER +#define CONFIGURE_RTEMS_INIT_TASKS_TABLE + +#define CONFIGURE_EXECUTIVE_RAM_SIZE (512*1024) +#define CONFIGURE_MAXIMUM_SEMAPHORES 20 +#define CONFIGURE_MAXIMUM_TASKS 20 + +#define CONFIGURE_INIT_TASK_STACK_SIZE (10*1024) +#define CONFIGURE_INIT_TASK_PRIORITY 120 +#define CONFIGURE_INIT_TASK_INITIAL_MODES (RTEMS_PREEMPT | \ + RTEMS_NO_TIMESLICE | \ + RTEMS_NO_ASR | \ + RTEMS_INTERRUPT_LEVEL(0)) + +#define CONFIGURE_INIT + +rtems_task Init( + rtems_task_argument argument +); + +/* configuration information */ + +#include <confdefs.h> + +#include <errno.h> +#include <time.h> + +#include <confdefs.h> +#include <stdio.h> +#include <rtems/rtems_bsdnet.h> +#include <ftpd.h> + + +#include <rtems/error.h> +#include <rpc/rpc.h> +#include <netinet/in.h> +#include <time.h> + +#include <arpa/inet.h> +#include <sys/socket.h> +#include "networkconfig.h" + +#include <rtems_webserver.h> + +#define ARGUMENT 0 + +extern int _binary_tarfile_start; +extern int _binary_tarfile_size; + +struct rtems_ftpd_configuration rtems_ftpd_configuration = { + 10, /* FTPD task priority */ + 1024, /* Maximum buffersize for hooks */ + 80, /* Well-known port */ + NULL /* List of hooks */ +}; + +rtems_task Init( + rtems_task_argument argument +) +{ + rtems_status_code status; + + rtems_bsdnet_initialize_network (); + + rtems_initialize_ftpd(); + + status = Untar_FromMemory((unsigned char *)(&_binary_tarfile_start), + &_binary_tarfile_size); + + rtems_initialize_webserver(); +#if 0 + + status = rtems_task_delete( RTEMS_SELF ); +#endif +} + + + + diff --git a/netlink/networkconfig.h b/netlink/networkconfig.h new file mode 100644 index 0000000..1cf9e56 --- /dev/null +++ b/netlink/networkconfig.h @@ -0,0 +1,116 @@ +/* + * Network configuration + * + ************************************************************ + * EDIT THIS FILE TO REFLECT YOUR NETWORK CONFIGURATION * + * BEFORE RUNNING ANY RTEMS PROGRAMS WHICH USE THE NETWORK! * + ************************************************************ + * + * $Id$ + */ + +#ifndef _RTEMS_NETWORKCONFIG_H_ +#define _RTEMS_NETWORKCONFIG_H_ + +#ifndef RTEMS_BSP_NETWORK_DRIVER_NAME +#warning "RTEMS_BSP_NETWORK_DRIVER_NAME is not defined" +#define RTEMS_BSP_NETWORK_DRIVER_NAME "no_network1" +#endif + +#ifndef RTEMS_BSP_NETWORK_DRIVER_ATTACH +#warning "RTEMS_BSP_NETWORK_DRIVER_ATTACH is not defined" +#define RTEMS_BSP_NETWORK_DRIVER_ATTACH 0 +#endif + +/* #define RTEMS_USE_BOOTP */ + +#include <bsp.h> + +/* + * Define RTEMS_SET_ETHERNET_ADDRESS if you want to specify the + * Ethernet address here. If RTEMS_SET_ETHERNET_ADDRESS is not + * defined the driver will choose an address. + */ +#define RTEMS_SET_ETHERNET_ADDRESS +#if (defined (RTEMS_SET_ETHERNET_ADDRESS)) +/* static char ethernet_address[6] = { 0x08, 0x00, 0x3e, 0x12, 0x28, 0xb1 }; */ +static char ethernet_address[6] = { 0x00, 0x80, 0x7F, 0x22, 0x61, 0x77 }; + +#endif + +/* + * Default network interface + */ +static struct rtems_bsdnet_ifconfig netdriver_config = { +#if 0 + RTEMS_BSP_NETWORK_DRIVER_NAME, /* name */ + RTEMS_BSP_NETWORK_DRIVER_ATTACH, /* attach function */ +#endif + "no driver", /* name */ + NULL, /* attach function */ + + NULL, /* link to next interface */ + +#if (defined (RTEMS_USE_BOOTP)) + NULL, /* BOOTP supplies IP address */ + NULL, /* BOOTP supplies IP net mask */ +#else + "XXX.YYY.ZZZ.XYZ", /* IP address */ + "255.255.255.0", /* IP net mask */ +#endif /* !RTEMS_USE_BOOTP */ + +#if (defined (RTEMS_SET_ETHERNET_ADDRESS)) + ethernet_address, /* Ethernet hardware address */ +#else + NULL, /* Driver supplies hardware address */ +#endif + 0 /* Use default driver parameters */ +}; + +/* + * Network configuration + */ +struct rtems_bsdnet_config rtems_bsdnet_config = { + &netdriver_config, + +#if (defined (RTEMS_USE_BOOTP)) + rtems_bsdnet_do_bootp, +#else + NULL, +#endif + + 0, /* Default network task priority */ + 0, /* Default mbuf capacity */ + 0, /* Default mbuf cluster capacity */ + +#if (!defined (RTEMS_USE_BOOTP)) + "rtems_host", /* Host name */ + "nodomain.com", /* Domain name */ + "XXX.YYY.ZZZ.1", /* Gateway */ + "XXX.YYY.ZZZ.1", /* Log host */ + {"XXX.YYY.ZZZ.1" }, /* Name server(s) */ + + /* + * A real example -- DO NOT USE THIS YOURSELF!!! + */ + +#if 0 + "dy4", /* Host name */ + "NOT_oarcorp.com", /* Domain name */ + "192.168.1.2", /* Gateway */ + "192.168.1.2", /* Log host */ + {"192.168.1.2" }, /* Name server(s) */ +#endif +#endif /* !RTEMS_USE_BOOTP */ + +}; + +/* + * For TFTP test application + */ +#if (!defined (RTEMS_USE_BOOTP)) +#define RTEMS_TFTP_TEST_HOST_NAME "XXX.YYY.ZZZ.XYZ" +#define RTEMS_TFTP_TEST_FILE_NAME "tftptest" +#endif + +#endif /* _RTEMS_NETWORKCONFIG_H_ */ diff --git a/netlink/system.h b/netlink/system.h new file mode 100644 index 0000000..aa9e56c --- /dev/null +++ b/netlink/system.h @@ -0,0 +1,33 @@ +/* system.h + * + * This include file contains information that is included in every + * function in the test set. + * + * COPYRIGHT (c) 1989-1998. + * On-Line Applications Research Corporation (OAR). + * Copyright assigned to U.S. Government, 1994. + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.OARcorp.com/rtems/license.html. + * + * $Id$ + */ + +#include <tmacros.h> + +/* functions */ + +rtems_task Init( + rtems_task_argument argument +); + +/* configuration information */ + +#include <confdefs.h> + +/* global variables */ + +TEST_EXTERN rtems_id Global_variable; /* example global variable */ + +/* end of include file */ |