39 #include "contiki-net.h"
42 #include "lib/error.h"
43 #include "net/ethernet-drv.h"
53 for(i = 0; i < 4; ++i) {
55 utoa(ipaddr->u8[i], ++ptr, 10);
64 config_read(
char *filename)
71 struct ethernet_config ethernetcfg;
77 log_message(filename,
": File not found");
81 if(cfs_read(file, &config,
sizeof(config)) <
sizeof(config)
82 -
sizeof(config.ethernetcfg.name)) {
83 log_message(filename,
": No config file");
89 log_message(
"IP Address: ", ipaddrtoa(&config.hostaddr, uip_buf));
90 log_message(
"Subnet Mask: ", ipaddrtoa(&config.netmask, uip_buf));
91 log_message(
"Def. Router: ", ipaddrtoa(&config.draddr, uip_buf));
92 log_message(
"DNS Server: ", ipaddrtoa(&config.resolvaddr, uip_buf));
95 log_message(
"Eth. Driver: ", config.ethernetcfg.name);
97 #define _stringize(arg) #arg
98 #define stringize(arg) _stringize(arg)
99 log_message(
"Eth. Driver: ", stringize(ETHERNET));
103 log_message(
"Driver Port: $", utoa(config.ethernetcfg.addr, uip_buf, 16));
112 return &config.ethernetcfg;