source: network-demos/http/init.c @ 058a7a0

4.11network-demos-4-10-branchnetwork-demos-4-8-branchnetwork-demos-4-9-branch
Last change on this file since 058a7a0 was ba33011, checked in by Joel Sherrill <joel.sherrill@…>, on 06/21/07 at 18:26:30

2007-06-21 Joel Sherrill <joel.sherrill@…>

  • init.c: More warnings removed.
  • Property mode set to 100644
File size: 2.8 KB
Line 
1/*  Init
2 *
3 *  This routine is the initialization task for this test program.
4 *
5 *  Don't forget to change the IP addresses
6 */
7
8#define USE_HTTPD
9#define USE_FTPD
10#define TEST_INIT
11
12#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
13#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
14#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
15#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS        20
16#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
17
18#define CONFIGURE_EXECUTIVE_RAM_SIZE    (512*1024)
19#define CONFIGURE_MAXIMUM_SEMAPHORES    20
20#define CONFIGURE_MAXIMUM_TASKS         20
21
22#define CONFIGURE_MICROSECONDS_PER_TICK 10000
23
24#define CONFIGURE_INIT_TASK_STACK_SIZE  (10*1024)
25#define CONFIGURE_INIT_TASK_PRIORITY    120
26#define CONFIGURE_INIT_TASK_INITIAL_MODES (RTEMS_PREEMPT | \
27                                           RTEMS_NO_TIMESLICE | \
28                                           RTEMS_NO_ASR | \
29                                           RTEMS_INTERRUPT_LEVEL(0))
30
31#define CONFIGURE_INIT
32
33#include "system.h"
34
35#include <errno.h>
36#include <time.h>
37
38#include <rtems/confdefs.h>
39#include <stdio.h>
40#include <rtems/rtems_bsdnet.h>
41#include <rtems/ftpd.h>
42#include <rtems/untar.h>
43
44     
45#include <rtems/error.h>
46#include <rpc/rpc.h>
47#include <netinet/in.h>
48#include <time.h>
49
50#include <arpa/inet.h>
51#include <sys/socket.h>
52#include "../networkconfig.h"
53
54#include <rtems_webserver.h>
55
56#define ARGUMENT 0
57
58/*
59 *  The tarfile is built in $(ARCH) so includes whether we were
60 *  built optimized or debug.
61 */
62
63#if defined(USE_FTPD)
64/*
65#if defined(RTEMS_DEBUG)
66extern int _binary_o_debug_tarfile_start;
67extern int _binary_o_debug_tarfile_size;
68#define TARFILE_START _binary_o_debug_tarfile_start
69#define TARFILE_SIZE _binary_o_debug_tarfile_size
70#else
71extern int _binary_o_optimize_tarfile_start;
72extern int _binary_o_optimize_tarfile_size;
73#define TARFILE_START _binary_o_optimize_tarfile_start
74#define TARFILE_SIZE _binary_o_optimize_tarfile_size
75#endif
76*/
77extern int _binary_tarfile_start;
78extern int _binary_tarfile_size;
79#define TARFILE_START _binary_tarfile_start
80#define TARFILE_SIZE _binary_tarfile_size
81#endif
82
83#if defined(USE_FTPD)
84struct rtems_ftpd_configuration rtems_ftpd_configuration = {
85   10,                     /* FTPD task priority            */
86   1024,                   /* Maximum buffersize for hooks  */
87   21,                     /* Well-known port     */
88   NULL                    /* List of hooks       */
89};
90#endif
91rtems_task Init(
92  rtems_task_argument argument
93)
94{
95  rtems_status_code status;
96
97  printf("\n\n*** HTTP TEST ***\n\r" );
98
99  /* init_paging(); */
100
101  rtems_bsdnet_initialize_network ();
102#if defined(USE_FTPD)
103  rtems_initialize_ftpd();
104
105  status = Untar_FromMemory((void *)(&TARFILE_START), (size_t)&TARFILE_SIZE);
106#endif
107   
108#if defined(USE_HTTPD)
109  rtems_initialize_webserver();
110#endif
111
112  status = rtems_task_delete( RTEMS_SELF );
113}
114
115
116
117
Note: See TracBrowser for help on using the repository browser.