blob: f0582f525acb76122916697080dcfe2ea8689021 [file] [log] [blame]
adamdunkels0b5590d2003-09-05 21:16:38 +00001/*
2 * Copyright (c) 2002, Adam Dunkels.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above
11 * copyright notice, this list of conditions and the following
12 * disclaimer in the documentation and/or other materials provided
13 * with the distribution.
14 * 3. All advertising materials mentioning features or use of this
15 * software must display the following acknowledgement:
16 * This product includes software developed by Adam Dunkels.
17 * 4. The name of the author may not be used to endorse or promote
18 * products derived from this software without specific prior
19 * written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
22 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
25 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
27 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
29 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 *
33 * This file is part of the Contiki desktop environment
34 *
35 * $Id: main-rrnet.c,v 1.1 2003/09/05 21:16:38 adamdunkels Exp $
36 *
37 */
38
39#include "ctk.h"
40#include "ctk-draw.h"
41#include "dispatcher.h"
42
43#include "program-handler.h"
44
45#include "uip_main.h"
46#include "uip-signal.h"
47#include "uip.h"
48#include "uip_arp.h"
49#if WITH_TFE
50void tfe_drv_init(void);
51#endif /* WITH_TFE */
52#if WITH_RRNET
53void rrnet_drv_init(void);
54#endif /* WITH_RRNET */
55#include "resolv.h"
56#include "rs232dev.h"
57
58#include "about-dsc.h"
59#include "netconf-dsc.h"
60#include "processes-dsc.h"
61#include "memstat-dsc.h"
62#include "directory-dsc.h"
63#include "wget-dsc.h"
64#include "www-dsc.h"
65
66#include "vnc-dsc.h"
67
68#include "webserver.h"
69
70/*-----------------------------------------------------------------------------------*/
71int
72main(int argc, char **argv)
73{
74 u16_t addr[2];
75
76 c64_dio_init(8);
77
78 dispatcher_init();
79 ctk_init();
80
81 uip_init();
82 uip_signal_init();
83 resolv_init();
84
85 /* XXX: just for making it easier to test. */
86#if 0
87 uip_ipaddr(addr, 193,10,67,150);
88 uip_sethostaddr(addr);
89
90 uip_ipaddr(addr, 193,10,64,1);
91 uip_setdraddr(addr);
92
93 uip_ipaddr(addr, 255,255,252,0);
94 uip_setnetmask(addr);
95
96 uip_ipaddr(addr, 193,10,66,195);
97 resolv_conf(addr);
98
99#else
100 uip_ipaddr(addr, 192,168,254,2);
101 uip_sethostaddr(addr);
102
103 uip_ipaddr(addr, 192,168,254,1);
104 uip_setdraddr(addr);
105
106 uip_ipaddr(addr, 255,255,255,0);
107 uip_setnetmask(addr);
108
109 uip_ipaddr(addr, 195,54,122,204);
110 resolv_conf(addr);
111#endif
112
113 rrnet_drv_init();
114
115 program_handler_init();
116
117
118 /*program_handler_add(&directory_dsc, "Directory", 1);*/
119 program_handler_add(&netconf_dsc, "Network setup", 1);
120 /* program_handler_add(&processes_dsc, "Processes", 1);
121
122 program_handler_add(&memstat_dsc, "Memory stats", 1);*/
123 program_handler_add(&wget_dsc, "Web downloader", 1);
124 /* program_handler_add(&about_dsc, "About", 0);*/
125
126 /* program_handler_add(&vnc_dsc, "VNC viewer", 1);
127 program_handler_add(&www_dsc, "Web browser", 1);*/
128
129
130 /* webserver_init();*/
131 /* netconf_init();*/
132 wget_init();
133
134 /* processes_init();*/
135
136 dispatcher_run();
137
138 clrscr();
139
140 return 0;
141
142 argv = argv;
143 argc = argc;
144}
145/*-----------------------------------------------------------------------------------*/