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