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 | #include <bsp.h> |
---|
9 | |
---|
10 | #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER |
---|
11 | #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER |
---|
12 | #define CONFIGURE_RTEMS_INIT_TASKS_TABLE |
---|
13 | #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 20 |
---|
14 | #define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM |
---|
15 | |
---|
16 | #define CONFIGURE_EXECUTIVE_RAM_SIZE (512*1024) |
---|
17 | #define CONFIGURE_MAXIMUM_SEMAPHORES 20 |
---|
18 | #define CONFIGURE_MAXIMUM_TASKS 20 |
---|
19 | |
---|
20 | #define CONFIGURE_INIT_TASK_STACK_SIZE (10*1024) |
---|
21 | #define CONFIGURE_INIT_TASK_PRIORITY 120 |
---|
22 | #define CONFIGURE_INIT_TASK_INITIAL_MODES (RTEMS_PREEMPT | \ |
---|
23 | RTEMS_NO_TIMESLICE | \ |
---|
24 | RTEMS_NO_ASR | \ |
---|
25 | RTEMS_INTERRUPT_LEVEL(0)) |
---|
26 | |
---|
27 | #define CONFIGURE_INIT |
---|
28 | |
---|
29 | rtems_task Init( |
---|
30 | rtems_task_argument argument |
---|
31 | ); |
---|
32 | |
---|
33 | /* configuration information */ |
---|
34 | |
---|
35 | #include <rtems/confdefs.h> |
---|
36 | |
---|
37 | #include <errno.h> |
---|
38 | #include <time.h> |
---|
39 | |
---|
40 | #include <stdio.h> |
---|
41 | #include <rtems/rtems_bsdnet.h> |
---|
42 | #include <rtems/ftpd.h> |
---|
43 | #include <rtems/untar.h> |
---|
44 | |
---|
45 | |
---|
46 | #include <rtems/error.h> |
---|
47 | #include <rpc/rpc.h> |
---|
48 | #include <netinet/in.h> |
---|
49 | #include <time.h> |
---|
50 | |
---|
51 | #include <arpa/inet.h> |
---|
52 | #include <sys/socket.h> |
---|
53 | #include "networkconfig.h" |
---|
54 | |
---|
55 | #include <rtems_webserver.h> |
---|
56 | |
---|
57 | #define ARGUMENT 0 |
---|
58 | |
---|
59 | extern int _binary_tarfile_start; |
---|
60 | extern int _binary_tarfile_size; |
---|
61 | |
---|
62 | struct rtems_ftpd_configuration rtems_ftpd_configuration = { |
---|
63 | 10, /* FTPD task priority */ |
---|
64 | 1024, /* Maximum buffersize for hooks */ |
---|
65 | 80, /* Well-known port */ |
---|
66 | NULL /* List of hooks */ |
---|
67 | }; |
---|
68 | |
---|
69 | /* |
---|
70 | * Settings for the Application Profiles: |
---|
71 | * |
---|
72 | * Base Networking Profile - neither |
---|
73 | * FTP Server Profile - include ftpd |
---|
74 | * Web Server Profile -include httpd |
---|
75 | */ |
---|
76 | |
---|
77 | #define INCLUDE_FTPD 0 |
---|
78 | #define INCLUDE_HTTPD 1 |
---|
79 | |
---|
80 | /* XXX until binutils are rebuilt */ |
---|
81 | |
---|
82 | int _binary_tarfile_start; |
---|
83 | int _binary_tarfile_size; |
---|
84 | |
---|
85 | rtems_task Init( |
---|
86 | rtems_task_argument argument |
---|
87 | ) |
---|
88 | { |
---|
89 | rtems_status_code status; |
---|
90 | |
---|
91 | rtems_bsdnet_initialize_network (); |
---|
92 | |
---|
93 | #if INCLUDE_FTPD |
---|
94 | status = Untar_FromMemory((void *)(&_binary_tarfile_start), |
---|
95 | (size_t)&_binary_tarfile_size); |
---|
96 | rtems_initialize_ftpd(); |
---|
97 | |
---|
98 | #endif |
---|
99 | |
---|
100 | #if INCLUDE_HTTPD |
---|
101 | status = Untar_FromMemory((void *)(&_binary_tarfile_start), |
---|
102 | (size_t)&_binary_tarfile_size); |
---|
103 | rtems_initialize_webserver(); |
---|
104 | #endif |
---|
105 | |
---|
106 | #if 0 |
---|
107 | status = rtems_task_delete( RTEMS_SELF ); |
---|
108 | #endif |
---|
109 | } |
---|
110 | |
---|
111 | |
---|
112 | |
---|
113 | |
---|