diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 1999-10-28 18:55:25 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 1999-10-28 18:55:25 +0000 |
commit | 40185386b9a3793a3381211f47fb97a0d8728488 (patch) | |
tree | 5de199401a9239bcfd839d5a5b37aacddc6d104c | |
parent | Changed version to 19990820. (diff) | |
download | network-demos-40185386b9a3793a3381211f47fb97a0d8728488.tar.bz2 |
New httpd sample test from Emmanuel Raguet.
-rw-r--r-- | http/Makefile | 67 | ||||
-rw-r--r-- | http/index.html | 15 | ||||
-rw-r--r-- | http/init.c | 86 | ||||
-rw-r--r-- | http/system.h | 33 |
4 files changed, 201 insertions, 0 deletions
diff --git a/http/Makefile b/http/Makefile new file mode 100644 index 0000000..26224d4 --- /dev/null +++ b/http/Makefile @@ -0,0 +1,67 @@ +# +# $Id$ +# + +SAMPLE=http +PGM=${ARCH}/$(SAMPLE).exe + +MANAGERS=io event semaphore timer rate_monotonic + +# 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) + +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 += -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 += +CLOBBER_ADDITIONS += + +all: ${ARCH} $(SRCS) $(PGM) + +${PGM}: $(OBJS) $(LINK_FILES) + tar cf $(ARCH)/tarfile index.html + $(LD) -r -o $(ARCH)/temp.o $(ARCH)/init.o -b binary $(ARCH)/tarfile + $(MV) $(ARCH)/temp.o $(ARCH)/init.o + $(RM) $(ARCH)/temp.o + $(make-exe) + +# Install the program(s), appending _g or _p as appropriate. +# for include files, just use $(INSTALL) +install: all + $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests diff --git a/http/index.html b/http/index.html new file mode 100644 index 0000000..15e5c9f --- /dev/null +++ b/http/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/http/init.c b/http/init.c new file mode 100644 index 0000000..44f9fc8 --- /dev/null +++ b/http/init.c @@ -0,0 +1,86 @@ +/* Init + * + * This routine is the initialization task for this test program. + * + * Don't forget to change the IP addresses + */ + +#define TEST_INIT + +#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_MICROSECONDS_PER_TICK 10486 + +#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 + +#include "system.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; + + printf("\n\n*** HTTP TEST ***\n\r" ); + + /* init_paging(); */ + + rtems_bsdnet_initialize_network (); + + rtems_initialize_ftpd(); + + status = Untar_FromMemory((unsigned char *)(&_binary_tarfile_start), + &_binary_tarfile_size); + + rtems_initialize_webserver(); + + status = rtems_task_delete( RTEMS_SELF ); +} + + + + diff --git a/http/system.h b/http/system.h new file mode 100644 index 0000000..aa9e56c --- /dev/null +++ b/http/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 */ |