blob: 0d3d44d15f18a529c4ff927d8d0b573d7650e840 [file] [log] [blame]
adamdunkelsa4ed8472003-04-10 07:25:26 +00001/*
oliverschmidt9e652ff2004-07-11 12:24:52 +00002 * Copyright (c) 2004, Adam Dunkels.
adamdunkelsa4ed8472003-04-10 07:25:26 +00003 * 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 *
oliverschmidt9e652ff2004-07-11 12:24:52 +000035 * $Id: main.c,v 1.3 2004/07/11 12:24:52 oliverschmidt Exp $
adamdunkelsa4ed8472003-04-10 07:25:26 +000036 *
37 */
38
39#include "ctk.h"
40#include "ctk-draw.h"
oliverschmidt9e652ff2004-07-11 12:24:52 +000041#include "ek.h"
adamdunkelsa4ed8472003-04-10 07:25:26 +000042
adamdunkelsa4ed8472003-04-10 07:25:26 +000043#include "program-handler.h"
44
oliverschmidt9e652ff2004-07-11 12:24:52 +000045#include "uip-event.h"
oliverschmidt3cf3d302004-06-08 20:28:33 +000046#include "uip.h"
47#include "uip_arp.h"
48
49#include "resolv.h"
50
oliverschmidt19032c62004-06-14 22:30:32 +000051#include "config.h"
52
53#include "config-dsc.h"
oliverschmidt3cf3d302004-06-08 20:28:33 +000054#include "www-dsc.h"
55#include "telnet-dsc.h"
56#include "processes-dsc.h"
57#include "about-dsc.h"
58
oliverschmidt9e652ff2004-07-11 12:24:52 +000059#include "clock.h"
60
adamdunkelsa4ed8472003-04-10 07:25:26 +000061/*-----------------------------------------------------------------------------------*/
oliverschmidt9e652ff2004-07-11 12:24:52 +000062unsigned char
63uip_fw_forward(void)
adamdunkelsa4ed8472003-04-10 07:25:26 +000064{
oliverschmidt9e652ff2004-07-11 12:24:52 +000065 return 0;
66}
67/*-----------------------------------------------------------------------------------*/
68void
69uip_fw_periodic(void)
70{
71 return;
72}
73/*-----------------------------------------------------------------------------------*/
74clock_time_t
75clock_time(void)
76{
77 static clock_time_t counter;
78
79 return ++counter;
oliverschmidt3cf3d302004-06-08 20:28:33 +000080}
81/*-----------------------------------------------------------------------------------*/
82void
83main(void)
84{
oliverschmidt9e652ff2004-07-11 12:24:52 +000085 ek_init();
86 tcpip_init(NULL);
oliverschmidt3cf3d302004-06-08 20:28:33 +000087
adamdunkelsa4ed8472003-04-10 07:25:26 +000088 ctk_init();
oliverschmidt3cf3d302004-06-08 20:28:33 +000089
90 resolv_init(NULL);
91
oliverschmidt9e652ff2004-07-11 12:24:52 +000092 uip_event_init();
adamdunkelsa4ed8472003-04-10 07:25:26 +000093
94 program_handler_init();
adamdunkelsa4ed8472003-04-10 07:25:26 +000095
oliverschmidt19032c62004-06-14 22:30:32 +000096 program_handler_add(&config_dsc, "Configuration", 1);
oliverschmidt3cf3d302004-06-08 20:28:33 +000097 program_handler_add(&www_dsc, "Web browser", 1);
98 program_handler_add(&telnet_dsc, "Telnet", 1);
99 program_handler_add(&processes_dsc, "Processes", 1);
100 program_handler_add(&about_dsc, "About Contiki", 0);
adamdunkelsa4ed8472003-04-10 07:25:26 +0000101
oliverschmidt19032c62004-06-14 22:30:32 +0000102 config_apply();
103
oliverschmidt9e652ff2004-07-11 12:24:52 +0000104 while(1) {
105 ek_run();
106 }
adamdunkelsa4ed8472003-04-10 07:25:26 +0000107}
108/*-----------------------------------------------------------------------------------*/