diff --git a/platform/win32/contiki-conf.h b/platform/win32/contiki-conf.h
index bc8909d87..681c39aa3 100644
--- a/platform/win32/contiki-conf.h
+++ b/platform/win32/contiki-conf.h
@@ -22,6 +22,7 @@
#define LOG_CONF_ENABLED 1
#include "sys/log.h"
CCIF void debug_printf(char *format, ...);
+CCIF void error_exit(char *message);
diff --git a/platform/win32/contiki-main.c b/platform/win32/contiki-main.c
index f46b0ad3f..d4c39652f 100644
--- a/platform/win32/contiki-main.c
+++ b/platform/win32/contiki-main.c
@@ -30,25 +30,35 @@
*
* Author: Oliver Schmidt
*
- * $Id: contiki-main.c,v 1.1 2006/08/14 23:53:55 oliverschmidt Exp $
+ * $Id: contiki-main.c,v 1.2 2006/10/03 11:27:51 oliverschmidt Exp $
*/
#define WIN32_LEAN_AND_MEAN
#include
#include
+#include
#include "contiki.h"
+#include "contiki-net.h"
#include "sys/clock.h"
#include "../../apps/directory/directory-dsc.h"
#include "../../apps/webbrowser/www-dsc.h"
-#include "ctk/ctk-conio-service.h"
+#include "sys/etimer.h"
#include "cfs/cfs-win32.h"
+#include "ctk/ctk-conio-service.h"
+#include "net/wpcap-service.h"
#include "program-handler.h"
-PROCINIT(&ctk_conio_service_process, &ctk_process, &cfs_win32_process, &program_handler_process);
+PROCINIT(&etimer_process,
+ &cfs_win32_process,
+ &ctk_conio_service_process,
+ &ctk_process,
+ &tcpip_process,
+ &resolv_process,
+ &program_handler_process);
/*-----------------------------------------------------------------------------------*/
void
@@ -76,6 +86,16 @@ log_message(const char *part1, const char *part2)
debug_printf("%s%s\n", part1, part2);
}
/*-----------------------------------------------------------------------------------*/
+void
+error_exit(char *message)
+{
+ debug_printf("Error Exit: %s", message);
+
+ console_exit();
+ console_cputs(message);
+ exit(EXIT_FAILURE);
+}
+/*-----------------------------------------------------------------------------------*/
clock_time_t
clock_time(void)
{
@@ -94,6 +114,23 @@ main(int argc)
program_handler_add(&directory_dsc, "Directory", 1);
program_handler_add(&www_dsc, "Web browser", 1);
+#if 1
+ {
+ uip_ipaddr_t addr;
+ uip_ipaddr(&addr, 192,168,0,222);
+ uip_sethostaddr(&addr);
+
+ uip_ipaddr(&addr, 255,255,255,0);
+ uip_setnetmask(&addr);
+
+ uip_ipaddr(&addr, 192,168,0,1);
+ uip_setdraddr(&addr);
+
+ uip_ipaddr(&addr, 192,168,0,1);
+ resolv_conf(&addr);
+ }
+#endif
+
while(1) {
if(process_run() < 2) {
@@ -104,6 +141,8 @@ main(int argc)
/* Allow user-mode APC to execute. */
SleepEx(10, TRUE);
+
+ etimer_request_poll();
}
}
}
diff --git a/platform/win32/ctk/ctk-console.c b/platform/win32/ctk/ctk-console.c
index f16fab263..e63a92471 100644
--- a/platform/win32/ctk/ctk-console.c
+++ b/platform/win32/ctk/ctk-console.c
@@ -30,7 +30,7 @@
*
* Author: Oliver Schmidt
*
- * $Id: ctk-console.c,v 1.4 2006/09/09 23:20:39 oliverschmidt Exp $
+ * $Id: ctk-console.c,v 1.5 2006/10/03 11:27:51 oliverschmidt Exp $
*/
#define WIN32_LEAN_AND_MEAN
@@ -102,6 +102,13 @@ console_init(void)
void
console_exit(void)
{
+ static unsigned char done;
+
+ if(done) {
+ return;
+ }
+ done = 1;
+
textcolor(saved_color);
revers(0);
clrscr();
diff --git a/platform/win32/ctk/ctk-console.h b/platform/win32/ctk/ctk-console.h
index 2de252388..15c9fcd64 100644
--- a/platform/win32/ctk/ctk-console.h
+++ b/platform/win32/ctk/ctk-console.h
@@ -30,7 +30,7 @@
*
* Author: Oliver Schmidt
*
- * $Id: ctk-console.h,v 1.3 2006/10/03 00:30:42 oliverschmidt Exp $
+ * $Id: ctk-console.h,v 1.4 2006/10/03 11:27:51 oliverschmidt Exp $
*/
#ifndef __CTK_CONSOLE_H__
#define __CTK_CONSOLE_H__
@@ -50,7 +50,7 @@ void bordercolor(unsigned char c);
void screensize(unsigned char *x, unsigned char *y);
void revers(unsigned char c);
void console_cputc(char c);
-CCIF void console_cputs(char *str);
+void console_cputs(char *str);
void cclear(unsigned char length);
void chline(unsigned char length);
void cvline(unsigned char length);
diff --git a/platform/win32/net/wpcap-service.c b/platform/win32/net/wpcap-service.c
index 75cd4ac84..6b7b6b614 100644
--- a/platform/win32/net/wpcap-service.c
+++ b/platform/win32/net/wpcap-service.c
@@ -30,14 +30,13 @@
*
* Author: Oliver Schmidt
*
- * $Id: wpcap-service.c,v 1.2 2006/10/03 00:28:36 oliverschmidt Exp $
+ * $Id: wpcap-service.c,v 1.3 2006/10/03 11:27:51 oliverschmidt Exp $
*/
#define WIN32_LEAN_AND_MEAN
#include
#include
#include
-#include
#pragma comment(lib, "wsock32")
@@ -82,15 +81,6 @@ static int (* pcap_sendpacket)(struct pcap *, unsigned char *, int);
#define BUF ((struct uip_eth_hdr *)&uip_buf[0])
-/*---------------------------------------------------------------------------*/
-static void
-error_exit(char *message)
-{
- debug_printf("Error Exit: %s", message);
- _cexit();
- console_cputs(message);
- ExitProcess(EXIT_FAILURE);
-}
/*---------------------------------------------------------------------------*/
static void
pollhandler(void)
@@ -114,6 +104,7 @@ pollhandler(void)
debug_printf("I");
uip_len -= sizeof(struct uip_eth_hdr);
tcpip_input();
+
} else if(BUF->type == HTONS(UIP_ETHTYPE_ARP)) {
debug_printf("A");
uip_arp_arpin();