Merge branch 'contiki' into osd

This commit is contained in:
Harald Pichler 2014-12-07 15:24:00 +01:00
commit a02be51f08
274 changed files with 1159 additions and 1285 deletions

View file

@ -67,7 +67,7 @@
/* direct access into the buffer */
#define UIP_IP_BUF ((struct uip_ip_hdr *)&uip_buf[UIP_LLH_LEN])
#if UIP_CONF_IPV6
#if NETSTACK_CONF_WITH_IPV6
#define UIP_UDP_BUF ((struct uip_udp_hdr *)&uip_buf[uip_l2_l3_hdr_len])
#else
#define UIP_UDP_BUF ((struct uip_udp_hdr *)&uip_buf[UIP_LLH_LEN + UIP_IPH_LEN])

View file

@ -51,7 +51,7 @@ struct powertrace_sniff_stats {
uint32_t num_input, num_output;
uint32_t input_txtime, input_rxtime;
uint32_t output_txtime, output_rxtime;
#if UIP_CONF_IPV6
#if NETSTACK_CONF_WITH_IPV6
uint16_t proto; /* includes proto + possibly flags */
#endif
uint16_t channel;
@ -135,7 +135,7 @@ powertrace_print(char *str)
for(s = list_head(stats_list); s != NULL; s = list_item_next(s)) {
#if ! UIP_CONF_IPV6
#if ! NETSTACK_CONF_WITH_IPV6
printf("%s %lu SP %d.%d %lu %u %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu (channel %d radio %d.%02d%% / %d.%02d%%)\n",
str, clock_time(), linkaddr_node_addr.u8[0], linkaddr_node_addr.u8[1], seqno,
s->channel,
@ -249,7 +249,7 @@ add_packet_stats(int input_or_output)
put it on the list. */
for(s = list_head(stats_list); s != NULL; s = list_item_next(s)) {
if(s->channel == packetbuf_attr(PACKETBUF_ATTR_CHANNEL)
#if UIP_CONF_IPV6
#if NETSTACK_CONF_WITH_IPV6
&& s->proto == packetbuf_attr(PACKETBUF_ATTR_NETWORK_ID)
#endif
) {
@ -262,7 +262,7 @@ add_packet_stats(int input_or_output)
if(s != NULL) {
memset(s, 0, sizeof(struct powertrace_sniff_stats));
s->channel = packetbuf_attr(PACKETBUF_ATTR_CHANNEL);
#if UIP_CONF_IPV6
#if NETSTACK_CONF_WITH_IPV6
s->proto = packetbuf_attr(PACKETBUF_ATTR_NETWORK_ID);
#endif
list_add(stats_list, s);
@ -283,7 +283,7 @@ output_sniffer(int mac_status)
add_packet_stats(OUTPUT);
}
/*---------------------------------------------------------------------------*/
#if ! UIP_CONF_IPV6
#if ! NETSTACK_CONF_WITH_IPV6
static void
sniffprint(char *prefix, int seqno)
{

View file

@ -379,3 +379,5 @@ PROCESS_THREAD(servreg_hack_process, ev, data)
PROCESS_END();
}
/*---------------------------------------------------------------------------*/
/** @} */

View file

@ -1,19 +1,35 @@
shell_src = shell.c shell-reboot.c \
shell-vars.c shell-ps.c shell-rime.c shell-sendtest.c \
shell_src = shell.c shell-reboot.c shell-vars.c shell-ps.c \
shell-blink.c shell-text.c shell-time.c \
shell-file.c shell-netfile.c shell-run.c \
shell-rime-ping.c shell-rime-sniff.c shell-rime-netcmd.c \
shell-rime-debug.c shell-rime-debug-runicast.c shell-coffee.c \
shell-wget.c shell-httpd.c shell-irc.c \
shell-file.c shell-run.c \
shell-coffee.c \
shell-power.c \
shell-tcpsend.c shell-udpsend.c shell-ping.c shell-netstat.c \
shell-rime-sendcmd.c shell-download.c shell-rime-neighbors.c \
shell-rime-unicast.c \
shell-base64.c \
shell-netperf.c shell-memdebug.c \
shell-powertrace.c shell-collect-view.c shell-crc.c
shell-memdebug.c \
shell-powertrace.c shell-crc.c
shell_dsc = shell-dsc.c
ifeq ($(CONTIKI_WITH_RIME),1)
shell_src += shell-rime.c shell-sendtest.c shell-netfile.c \
shell-rime-ping.c shell-rime-sniff.c shell-rime-netcmd.c \
shell-rime-debug.c shell-rime-debug-runicast.c \
shell-rime-sendcmd.c shell-download.c shell-rime-neighbors.c \
shell-rime-unicast.c shell-netperf.c \
shell-collect-view.c
APPS += collect-view
include $(CONTIKI)/apps/collect-view/Makefile.collect-view
endif
ifeq ($(CONTIKI_WITH_IPV4),1)
SHELL_WITH_IP = 1
endif
ifeq ($(CONTIKI_WITH_IPV6),1)
SHELL_WITH_IP = 1
endif
ifeq ($(SHELL_WITH_IP),1)
shell_src += shell-wget.c shell-httpd.c shell-irc.c \
shell-tcpsend.c shell-udpsend.c shell-ping.c shell-netstat.c
APPS += webserver
include $(CONTIKI)/apps/webserver/Makefile.webserver
ifndef PLATFORM_BUILD
@ -38,13 +54,11 @@ ifndef PLATFORM_BUILD
override telnet_src = telnet.c
endif
endif
APPS += powertrace
include $(CONTIKI)/apps/powertrace/Makefile.powertrace
APPS += collect-view
include $(CONTIKI)/apps/collect-view/Makefile.collect-view
ifeq ($(TARGET),sky)
shell_src += shell-sky.c shell-exec.c
endif

View file

@ -62,7 +62,7 @@ static unsigned char running;
/*---------------------------------------------------------------------------*/
static void
send_ping(uip_ipaddr_t *dest_addr)
#if UIP_CONF_IPV6
#if NETSTACK_CONF_WITH_IPV6
{
static uint16_t count;
UIP_IP_BUF->vtc = 0x60;
@ -92,7 +92,7 @@ send_ping(uip_ipaddr_t *dest_addr)
tcpip_ipv6_output();
}
#else /* UIP_CONF_IPV6 */
#else /* NETSTACK_CONF_WITH_IPV6 */
{
static uint16_t ipid = 0;
static uint16_t seqno = 0;
@ -128,7 +128,7 @@ send_ping(uip_ipaddr_t *dest_addr)
tcpip_output();
}
#endif /* UIP_CONF_IPV6 */
#endif /* NETSTACK_CONF_WITH_IPV6 */
/*---------------------------------------------------------------------------*/
PROCESS_THREAD(shell_ping_process, ev, data)
{

View file

@ -64,7 +64,7 @@ webserver_log_file(uip_ipaddr_t *requester, char *file)
{
/* Print out IP address of requesting host. */
#if UIP_CONF_IPV6
#if NETSTACK_CONF_WITH_IPV6
#if WEBSERVER_CONF_ADDRESSES
char buf[48];
uint8_t j;
@ -78,7 +78,7 @@ webserver_log_file(uip_ipaddr_t *requester, char *file)
char buf[20];
sprintf(buf, "%d.%d.%d.%d: ", requester->u8[0], requester->u8[1],
requester->u8[2], requester->u8[3]);
#endif /* UIP_CONF_IPV6 */
#endif /* NETSTACK_CONF_WITH_IPV6 */
//log_message(buf, file);
printf("%s%s\n", buf, file);
}

View file

@ -157,7 +157,7 @@ make_tcp_stats(void *arg)
struct httpd_state *s = (struct httpd_state *)arg;
conn = &uip_conns[s->u.count];
#if UIP_CONF_IPV6
#if NETSTACK_CONF_WITH_IPV6
char buf[48];
httpd_sprint_ip6(conn->ripaddr, buf);
return snprintf((char *)uip_appdata, uip_mss(),
@ -184,7 +184,7 @@ make_tcp_stats(void *arg)
conn->timer,
(uip_outstanding(conn))? '*':' ',
(uip_stopped(conn))? '!':' ');
#endif /* UIP_CONF_IPV6 */
#endif /* NETSTACK_CONF_WITH_IPV6 */
}
/*---------------------------------------------------------------------------*/
static
@ -226,7 +226,7 @@ PT_THREAD(processes(struct httpd_state *s, char *ptr))
}
PSOCK_END(&s->sout);
}
#if WEBSERVER_CONF_STATUSPAGE && UIP_CONF_IPV6
#if WEBSERVER_CONF_STATUSPAGE && NETSTACK_CONF_WITH_IPV6
/* These cgi's are invoked by the status.shtml page in /apps/webserver/httpd-fs.
* To keep the webserver build small that 160 byte page is not present in the
* default httpd-fsdata.c file. Run the PERL script /../../tools/makefsdata from the
@ -357,7 +357,7 @@ httpd_cgi_add(struct httpd_cgi_call *c)
}
}
/*---------------------------------------------------------------------------*/
#if WEBSERVER_CONF_STATUSPAGE && UIP_CONF_IPV6
#if WEBSERVER_CONF_STATUSPAGE && NETSTACK_CONF_WITH_IPV6
static const char adrs_name[] HTTPD_STRING_ATTR = "addresses";
static const char nbrs_name[] HTTPD_STRING_ATTR = "neighbors";
static const char rtes_name[] HTTPD_STRING_ATTR = "routes";
@ -365,7 +365,7 @@ static const char rtes_name[] HTTPD_STRING_ATTR = "routes";
HTTPD_CGI_CALL(file, file_name, file_stats);
HTTPD_CGI_CALL(tcp, tcp_name, tcp_stats);
HTTPD_CGI_CALL(proc, proc_name, processes);
#if WEBSERVER_CONF_STATUSPAGE && UIP_CONF_IPV6
#if WEBSERVER_CONF_STATUSPAGE && NETSTACK_CONF_WITH_IPV6
HTTPD_CGI_CALL(adrs, adrs_name, addresses);
HTTPD_CGI_CALL(nbrs, nbrs_name, neighbors);
HTTPD_CGI_CALL(rtes, rtes_name, routes);
@ -377,7 +377,7 @@ httpd_cgi_init(void)
httpd_cgi_add(&file);
httpd_cgi_add(&tcp);
httpd_cgi_add(&proc);
#if WEBSERVER_CONF_STATUSPAGE && UIP_CONF_IPV6
#if WEBSERVER_CONF_STATUSPAGE && NETSTACK_CONF_WITH_IPV6
httpd_cgi_add(&adrs);
httpd_cgi_add(&nbrs);
httpd_cgi_add(&rtes);

View file

@ -342,7 +342,7 @@ httpd_init(void)
memb_init(&conns);
httpd_cgi_init();
}
#if UIP_CONF_IPV6
#if NETSTACK_CONF_WITH_IPV6
/*---------------------------------------------------------------------------*/
uint8_t
httpd_sprint_ip6(uip_ip6addr_t addr, char * result)
@ -374,5 +374,5 @@ httpd_sprint_ip6(uip_ip6addr_t addr, char * result)
*result=0;
return (result - starting);
}
#endif /* UIP_CONF_IPV6 */
#endif /* NETSTACK_CONF_WITH_IPV6 */
/*---------------------------------------------------------------------------*/

View file

@ -59,8 +59,8 @@ struct httpd_state {
void httpd_init(void);
void httpd_appcall(void *state);
#if UIP_CONF_IPV6
#if NETSTACK_CONF_WITH_IPV6
uint8_t httpd_sprint_ip6(uip_ip6addr_t addr, char * result);
#endif /* UIP_CONF_IPV6 */
#endif /* NETSTACK_CONF_WITH_IPV6 */
#endif /* HTTPD_H_ */

View file

@ -67,7 +67,7 @@ webserver_log_file(uip_ipaddr_t *requester, char *file)
#if LOG_CONF_ENABLED
/* Print out IP address of requesting host. */
#if UIP_CONF_IPV6
#if NETSTACK_CONF_WITH_IPV6
char buf[48];
uint8_t j;
j=httpd_sprint_ip6((uip_ip6addr_t)*requester, buf);
@ -76,7 +76,7 @@ webserver_log_file(uip_ipaddr_t *requester, char *file)
char buf[20];
sprintf(buf, "%d.%d.%d.%d: ", requester->u8[0], requester->u8[1],
requester->u8[2], requester->u8[3]);
#endif /* UIP_CONF_IPV6 */
#endif /* NETSTACK_CONF_WITH_IPV6 */
log_message(buf, file);
#endif /* LOG_CONF_ENABLED */