[4018538] | 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 | |
---|
[d51d8b5] | 8 | #define USE_HTTPD |
---|
| 9 | #define USE_FTPD |
---|
[4018538] | 10 | #define TEST_INIT |
---|
| 11 | |
---|
[5c663c0] | 12 | #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER |
---|
| 13 | #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER |
---|
[4018538] | 14 | #define CONFIGURE_RTEMS_INIT_TASKS_TABLE |
---|
[1a1b41cd] | 15 | #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 20 |
---|
| 16 | #define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM |
---|
[4018538] | 17 | |
---|
| 18 | #define CONFIGURE_EXECUTIVE_RAM_SIZE (512*1024) |
---|
| 19 | #define CONFIGURE_MAXIMUM_SEMAPHORES 20 |
---|
| 20 | #define CONFIGURE_MAXIMUM_TASKS 20 |
---|
| 21 | |
---|
[7054195] | 22 | #define CONFIGURE_MICROSECONDS_PER_TICK 10000 |
---|
[4018538] | 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 <confdefs.h> |
---|
| 39 | #include <stdio.h> |
---|
| 40 | #include <rtems/rtems_bsdnet.h> |
---|
| 41 | #include <ftpd.h> |
---|
| 42 | |
---|
| 43 | |
---|
| 44 | #include <rtems/error.h> |
---|
| 45 | #include <rpc/rpc.h> |
---|
| 46 | #include <netinet/in.h> |
---|
| 47 | #include <time.h> |
---|
| 48 | |
---|
| 49 | #include <arpa/inet.h> |
---|
| 50 | #include <sys/socket.h> |
---|
| 51 | #include "../networkconfig.h" |
---|
| 52 | |
---|
| 53 | #include <rtems_webserver.h> |
---|
| 54 | |
---|
| 55 | #define ARGUMENT 0 |
---|
| 56 | |
---|
[1a1b41cd] | 57 | /* |
---|
| 58 | * The tarfile is built in $(ARCH) so includes whether we were |
---|
| 59 | * built optimized or debug. |
---|
| 60 | */ |
---|
| 61 | |
---|
[d51d8b5] | 62 | #if defined(USE_FTPD) |
---|
| 63 | /* |
---|
[1a1b41cd] | 64 | #if defined(RTEMS_DEBUG) |
---|
| 65 | extern int _binary_o_debug_tarfile_start; |
---|
| 66 | extern int _binary_o_debug_tarfile_size; |
---|
| 67 | #define TARFILE_START _binary_o_debug_tarfile_start |
---|
| 68 | #define TARFILE_SIZE _binary_o_debug_tarfile_size |
---|
| 69 | #else |
---|
| 70 | extern int _binary_o_optimize_tarfile_start; |
---|
| 71 | extern int _binary_o_optimize_tarfile_size; |
---|
| 72 | #define TARFILE_START _binary_o_optimize_tarfile_start |
---|
| 73 | #define TARFILE_SIZE _binary_o_optimize_tarfile_size |
---|
| 74 | #endif |
---|
[d51d8b5] | 75 | */ |
---|
| 76 | extern int _binary_tarfile_start; |
---|
| 77 | extern int _binary_tarfile_size; |
---|
| 78 | #define TARFILE_START _binary_tarfile_start |
---|
| 79 | #define TARFILE_SIZE _binary_tarfile_size |
---|
| 80 | #endif |
---|
[4018538] | 81 | |
---|
[d51d8b5] | 82 | #if defined(USE_FTPD) |
---|
[4018538] | 83 | struct rtems_ftpd_configuration rtems_ftpd_configuration = { |
---|
| 84 | 10, /* FTPD task priority */ |
---|
| 85 | 1024, /* Maximum buffersize for hooks */ |
---|
[1a1b41cd] | 86 | 21, /* Well-known port */ |
---|
[4018538] | 87 | NULL /* List of hooks */ |
---|
| 88 | }; |
---|
[d51d8b5] | 89 | #endif |
---|
[4018538] | 90 | rtems_task Init( |
---|
| 91 | rtems_task_argument argument |
---|
| 92 | ) |
---|
| 93 | { |
---|
| 94 | rtems_status_code status; |
---|
| 95 | |
---|
| 96 | printf("\n\n*** HTTP TEST ***\n\r" ); |
---|
| 97 | |
---|
| 98 | /* init_paging(); */ |
---|
| 99 | |
---|
| 100 | rtems_bsdnet_initialize_network (); |
---|
[d51d8b5] | 101 | #if defined(USE_FTPD) |
---|
[4018538] | 102 | rtems_initialize_ftpd(); |
---|
| 103 | |
---|
[1a1b41cd] | 104 | status = Untar_FromMemory((unsigned char *)(&TARFILE_START), &TARFILE_SIZE); |
---|
[d51d8b5] | 105 | #endif |
---|
[4018538] | 106 | |
---|
[d51d8b5] | 107 | #if defined(USE_HTTPD) |
---|
[4018538] | 108 | rtems_initialize_webserver(); |
---|
[d51d8b5] | 109 | #endif |
---|
[4018538] | 110 | |
---|
| 111 | status = rtems_task_delete( RTEMS_SELF ); |
---|
| 112 | } |
---|
| 113 | |
---|
| 114 | |
---|
| 115 | |
---|
| 116 | |
---|