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 automatically externally so we need to account |
---|
60 | * for the leading symbol on the names. |
---|
61 | */ |
---|
62 | #if defined(__sh__) |
---|
63 | #define SYM(_x) _x |
---|
64 | #else |
---|
65 | #define SYM(_x) _ ## _x |
---|
66 | #endif |
---|
67 | |
---|
68 | extern int SYM(binary_tarfile_start); |
---|
69 | extern int SYM(binary_tarfile_size); |
---|
70 | #define TARFILE_START SYM(binary_tarfile_start) |
---|
71 | #define TARFILE_SIZE SYM(binary_tarfile_size) |
---|
72 | |
---|
73 | #if defined(USE_FTPD) |
---|
74 | struct rtems_ftpd_configuration rtems_ftpd_configuration = { |
---|
75 | 10, /* FTPD task priority */ |
---|
76 | 1024, /* Maximum buffersize for hooks */ |
---|
77 | 21, /* Well-known port */ |
---|
78 | NULL /* List of hooks */ |
---|
79 | }; |
---|
80 | #endif |
---|
81 | rtems_task Init( |
---|
82 | rtems_task_argument argument |
---|
83 | ) |
---|
84 | { |
---|
85 | rtems_status_code status; |
---|
86 | |
---|
87 | printf("\n\n*** HTTP TEST ***\n\r" ); |
---|
88 | |
---|
89 | status = Untar_FromMemory((void *)(&TARFILE_START), (size_t)&TARFILE_SIZE); |
---|
90 | |
---|
91 | rtems_bsdnet_initialize_network (); |
---|
92 | #if defined(USE_FTPD) |
---|
93 | rtems_initialize_ftpd(); |
---|
94 | #endif |
---|
95 | |
---|
96 | #if defined(USE_HTTPD) |
---|
97 | rtems_initialize_webserver(); |
---|
98 | #endif |
---|
99 | |
---|
100 | status = rtems_task_delete( RTEMS_SELF ); |
---|
101 | } |
---|
102 | |
---|
103 | |
---|
104 | |
---|
105 | |
---|