Network layer configuration: replace UIP_CONF_* with NETSTACK_CONF_WITH_*
This commit is contained in:
parent
229c53a2e6
commit
a9cc909794
|
@ -68,13 +68,13 @@ MODULES += core/sys core/dev core/lib
|
||||||
HAS_STACK = 0
|
HAS_STACK = 0
|
||||||
ifeq ($(CONTIKI_WITH_IPV4),1)
|
ifeq ($(CONTIKI_WITH_IPV4),1)
|
||||||
HAS_STACK = 1
|
HAS_STACK = 1
|
||||||
CFLAGS += -DUIP_CONF_IPV4=1
|
CFLAGS += -DNETSTACK_CONF_WITH_IPV4=1
|
||||||
MODULES += core/net/ipv4 core/net/ip
|
MODULES += core/net/ipv4 core/net/ip
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CONTIKI_WITH_RIME),1)
|
ifeq ($(CONTIKI_WITH_RIME),1)
|
||||||
HAS_STACK = 1
|
HAS_STACK = 1
|
||||||
CFLAGS += -DUIP_CONF_RIME=1
|
CFLAGS += -DNETSTACK_CONF_WITH_RIME=1
|
||||||
MODULES += core/net/rime
|
MODULES += core/net/rime
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CONTIKI_WITH_IPV6),1)
|
ifeq ($(CONTIKI_WITH_IPV6),1)
|
||||||
CFLAGS += -DUIP_CONF_IPV6=1
|
CFLAGS += -DNETSTACK_CONF_WITH_IPV6=1
|
||||||
ifneq ($(CONTIKI_WITH_RPL),0)
|
ifneq ($(CONTIKI_WITH_RPL),0)
|
||||||
CFLAGS += -DUIP_CONF_IPV6_RPL=1
|
CFLAGS += -DUIP_CONF_IPV6_RPL=1
|
||||||
MODULES += core/net/rpl
|
MODULES += core/net/rpl
|
||||||
|
|
|
@ -67,7 +67,7 @@
|
||||||
|
|
||||||
/* direct access into the buffer */
|
/* direct access into the buffer */
|
||||||
#define UIP_IP_BUF ((struct uip_ip_hdr *)&uip_buf[UIP_LLH_LEN])
|
#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])
|
#define UIP_UDP_BUF ((struct uip_udp_hdr *)&uip_buf[uip_l2_l3_hdr_len])
|
||||||
#else
|
#else
|
||||||
#define UIP_UDP_BUF ((struct uip_udp_hdr *)&uip_buf[UIP_LLH_LEN + UIP_IPH_LEN])
|
#define UIP_UDP_BUF ((struct uip_udp_hdr *)&uip_buf[UIP_LLH_LEN + UIP_IPH_LEN])
|
||||||
|
|
|
@ -51,7 +51,7 @@ struct powertrace_sniff_stats {
|
||||||
uint32_t num_input, num_output;
|
uint32_t num_input, num_output;
|
||||||
uint32_t input_txtime, input_rxtime;
|
uint32_t input_txtime, input_rxtime;
|
||||||
uint32_t output_txtime, output_rxtime;
|
uint32_t output_txtime, output_rxtime;
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
uint16_t proto; /* includes proto + possibly flags */
|
uint16_t proto; /* includes proto + possibly flags */
|
||||||
#endif
|
#endif
|
||||||
uint16_t channel;
|
uint16_t channel;
|
||||||
|
@ -135,7 +135,7 @@ powertrace_print(char *str)
|
||||||
|
|
||||||
for(s = list_head(stats_list); s != NULL; s = list_item_next(s)) {
|
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",
|
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,
|
str, clock_time(), linkaddr_node_addr.u8[0], linkaddr_node_addr.u8[1], seqno,
|
||||||
s->channel,
|
s->channel,
|
||||||
|
@ -249,7 +249,7 @@ add_packet_stats(int input_or_output)
|
||||||
put it on the list. */
|
put it on the list. */
|
||||||
for(s = list_head(stats_list); s != NULL; s = list_item_next(s)) {
|
for(s = list_head(stats_list); s != NULL; s = list_item_next(s)) {
|
||||||
if(s->channel == packetbuf_attr(PACKETBUF_ATTR_CHANNEL)
|
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)
|
&& s->proto == packetbuf_attr(PACKETBUF_ATTR_NETWORK_ID)
|
||||||
#endif
|
#endif
|
||||||
) {
|
) {
|
||||||
|
@ -262,7 +262,7 @@ add_packet_stats(int input_or_output)
|
||||||
if(s != NULL) {
|
if(s != NULL) {
|
||||||
memset(s, 0, sizeof(struct powertrace_sniff_stats));
|
memset(s, 0, sizeof(struct powertrace_sniff_stats));
|
||||||
s->channel = packetbuf_attr(PACKETBUF_ATTR_CHANNEL);
|
s->channel = packetbuf_attr(PACKETBUF_ATTR_CHANNEL);
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
s->proto = packetbuf_attr(PACKETBUF_ATTR_NETWORK_ID);
|
s->proto = packetbuf_attr(PACKETBUF_ATTR_NETWORK_ID);
|
||||||
#endif
|
#endif
|
||||||
list_add(stats_list, s);
|
list_add(stats_list, s);
|
||||||
|
@ -283,7 +283,7 @@ output_sniffer(int mac_status)
|
||||||
add_packet_stats(OUTPUT);
|
add_packet_stats(OUTPUT);
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
#if ! UIP_CONF_IPV6
|
#if ! NETSTACK_CONF_WITH_IPV6
|
||||||
static void
|
static void
|
||||||
sniffprint(char *prefix, int seqno)
|
sniffprint(char *prefix, int seqno)
|
||||||
{
|
{
|
||||||
|
|
|
@ -62,7 +62,7 @@ static unsigned char running;
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
static void
|
static void
|
||||||
send_ping(uip_ipaddr_t *dest_addr)
|
send_ping(uip_ipaddr_t *dest_addr)
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
{
|
{
|
||||||
static uint16_t count;
|
static uint16_t count;
|
||||||
UIP_IP_BUF->vtc = 0x60;
|
UIP_IP_BUF->vtc = 0x60;
|
||||||
|
@ -92,7 +92,7 @@ send_ping(uip_ipaddr_t *dest_addr)
|
||||||
|
|
||||||
tcpip_ipv6_output();
|
tcpip_ipv6_output();
|
||||||
}
|
}
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
{
|
{
|
||||||
static uint16_t ipid = 0;
|
static uint16_t ipid = 0;
|
||||||
static uint16_t seqno = 0;
|
static uint16_t seqno = 0;
|
||||||
|
@ -128,7 +128,7 @@ send_ping(uip_ipaddr_t *dest_addr)
|
||||||
|
|
||||||
tcpip_output();
|
tcpip_output();
|
||||||
}
|
}
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
PROCESS_THREAD(shell_ping_process, ev, data)
|
PROCESS_THREAD(shell_ping_process, ev, data)
|
||||||
{
|
{
|
||||||
|
|
|
@ -64,7 +64,7 @@ webserver_log_file(uip_ipaddr_t *requester, char *file)
|
||||||
{
|
{
|
||||||
/* Print out IP address of requesting host. */
|
/* Print out IP address of requesting host. */
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
#if WEBSERVER_CONF_ADDRESSES
|
#if WEBSERVER_CONF_ADDRESSES
|
||||||
char buf[48];
|
char buf[48];
|
||||||
uint8_t j;
|
uint8_t j;
|
||||||
|
@ -78,7 +78,7 @@ webserver_log_file(uip_ipaddr_t *requester, char *file)
|
||||||
char buf[20];
|
char buf[20];
|
||||||
sprintf(buf, "%d.%d.%d.%d: ", requester->u8[0], requester->u8[1],
|
sprintf(buf, "%d.%d.%d.%d: ", requester->u8[0], requester->u8[1],
|
||||||
requester->u8[2], requester->u8[3]);
|
requester->u8[2], requester->u8[3]);
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
//log_message(buf, file);
|
//log_message(buf, file);
|
||||||
printf("%s%s\n", buf, file);
|
printf("%s%s\n", buf, file);
|
||||||
}
|
}
|
||||||
|
|
|
@ -157,7 +157,7 @@ make_tcp_stats(void *arg)
|
||||||
struct httpd_state *s = (struct httpd_state *)arg;
|
struct httpd_state *s = (struct httpd_state *)arg;
|
||||||
conn = &uip_conns[s->u.count];
|
conn = &uip_conns[s->u.count];
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
char buf[48];
|
char buf[48];
|
||||||
httpd_sprint_ip6(conn->ripaddr, buf);
|
httpd_sprint_ip6(conn->ripaddr, buf);
|
||||||
return snprintf((char *)uip_appdata, uip_mss(),
|
return snprintf((char *)uip_appdata, uip_mss(),
|
||||||
|
@ -184,7 +184,7 @@ make_tcp_stats(void *arg)
|
||||||
conn->timer,
|
conn->timer,
|
||||||
(uip_outstanding(conn))? '*':' ',
|
(uip_outstanding(conn))? '*':' ',
|
||||||
(uip_stopped(conn))? '!':' ');
|
(uip_stopped(conn))? '!':' ');
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
static
|
static
|
||||||
|
@ -226,7 +226,7 @@ PT_THREAD(processes(struct httpd_state *s, char *ptr))
|
||||||
}
|
}
|
||||||
PSOCK_END(&s->sout);
|
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.
|
/* 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
|
* 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
|
* 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 adrs_name[] HTTPD_STRING_ATTR = "addresses";
|
||||||
static const char nbrs_name[] HTTPD_STRING_ATTR = "neighbors";
|
static const char nbrs_name[] HTTPD_STRING_ATTR = "neighbors";
|
||||||
static const char rtes_name[] HTTPD_STRING_ATTR = "routes";
|
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(file, file_name, file_stats);
|
||||||
HTTPD_CGI_CALL(tcp, tcp_name, tcp_stats);
|
HTTPD_CGI_CALL(tcp, tcp_name, tcp_stats);
|
||||||
HTTPD_CGI_CALL(proc, proc_name, processes);
|
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(adrs, adrs_name, addresses);
|
||||||
HTTPD_CGI_CALL(nbrs, nbrs_name, neighbors);
|
HTTPD_CGI_CALL(nbrs, nbrs_name, neighbors);
|
||||||
HTTPD_CGI_CALL(rtes, rtes_name, routes);
|
HTTPD_CGI_CALL(rtes, rtes_name, routes);
|
||||||
|
@ -377,7 +377,7 @@ httpd_cgi_init(void)
|
||||||
httpd_cgi_add(&file);
|
httpd_cgi_add(&file);
|
||||||
httpd_cgi_add(&tcp);
|
httpd_cgi_add(&tcp);
|
||||||
httpd_cgi_add(&proc);
|
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(&adrs);
|
||||||
httpd_cgi_add(&nbrs);
|
httpd_cgi_add(&nbrs);
|
||||||
httpd_cgi_add(&rtes);
|
httpd_cgi_add(&rtes);
|
||||||
|
|
|
@ -342,7 +342,7 @@ httpd_init(void)
|
||||||
memb_init(&conns);
|
memb_init(&conns);
|
||||||
httpd_cgi_init();
|
httpd_cgi_init();
|
||||||
}
|
}
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
uint8_t
|
uint8_t
|
||||||
httpd_sprint_ip6(uip_ip6addr_t addr, char * result)
|
httpd_sprint_ip6(uip_ip6addr_t addr, char * result)
|
||||||
|
@ -374,5 +374,5 @@ httpd_sprint_ip6(uip_ip6addr_t addr, char * result)
|
||||||
*result=0;
|
*result=0;
|
||||||
return (result - starting);
|
return (result - starting);
|
||||||
}
|
}
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
|
@ -59,8 +59,8 @@ struct httpd_state {
|
||||||
void httpd_init(void);
|
void httpd_init(void);
|
||||||
void httpd_appcall(void *state);
|
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);
|
uint8_t httpd_sprint_ip6(uip_ip6addr_t addr, char * result);
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
#endif /* HTTPD_H_ */
|
#endif /* HTTPD_H_ */
|
||||||
|
|
|
@ -67,7 +67,7 @@ webserver_log_file(uip_ipaddr_t *requester, char *file)
|
||||||
#if LOG_CONF_ENABLED
|
#if LOG_CONF_ENABLED
|
||||||
/* Print out IP address of requesting host. */
|
/* Print out IP address of requesting host. */
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
char buf[48];
|
char buf[48];
|
||||||
uint8_t j;
|
uint8_t j;
|
||||||
j=httpd_sprint_ip6((uip_ip6addr_t)*requester, buf);
|
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];
|
char buf[20];
|
||||||
sprintf(buf, "%d.%d.%d.%d: ", requester->u8[0], requester->u8[1],
|
sprintf(buf, "%d.%d.%d.%d: ", requester->u8[0], requester->u8[1],
|
||||||
requester->u8[2], requester->u8[3]);
|
requester->u8[2], requester->u8[3]);
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
log_message(buf, file);
|
log_message(buf, file);
|
||||||
#endif /* LOG_CONF_ENABLED */
|
#endif /* LOG_CONF_ENABLED */
|
||||||
|
|
|
@ -123,11 +123,11 @@
|
||||||
* project-specific configuration to save memory.
|
* project-specific configuration to save memory.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* UIP_CONF_IPV6 specifies whether or not IPv6 should be used. If IPv6
|
/* NETSTACK_CONF_WITH_IPV6 specifies whether or not IPv6 should be used. If IPv6
|
||||||
is not used, IPv4 is used instead. */
|
is not used, IPv4 is used instead. */
|
||||||
#ifndef UIP_CONF_IPV6
|
#ifndef NETSTACK_CONF_WITH_IPV6
|
||||||
#define UIP_CONF_IPV6 0
|
#define NETSTACK_CONF_WITH_IPV6 0
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
/* UIP_CONF_BUFFER_SIZE specifies how much memory should be reserved
|
/* UIP_CONF_BUFFER_SIZE specifies how much memory should be reserved
|
||||||
for the uIP packet buffer. This sets an upper bound on the largest
|
for the uIP packet buffer. This sets an upper bound on the largest
|
||||||
|
|
|
@ -45,10 +45,10 @@
|
||||||
#include "net/ip/uip-udp-packet.h"
|
#include "net/ip/uip-udp-packet.h"
|
||||||
#include "net/ip/simple-udp.h"
|
#include "net/ip/simple-udp.h"
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
#include "net/ipv6/uip-icmp6.h"
|
#include "net/ipv6/uip-icmp6.h"
|
||||||
#include "net/ipv6/uip-ds6.h"
|
#include "net/ipv6/uip-ds6.h"
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
#include "net/ip/resolv.h"
|
#include "net/ip/resolv.h"
|
||||||
|
|
||||||
|
|
|
@ -262,7 +262,7 @@ PROCESS_THREAD(slip_process, ev, data)
|
||||||
/* Move packet from rxbuf to buffer provided by uIP. */
|
/* Move packet from rxbuf to buffer provided by uIP. */
|
||||||
uip_len = slip_poll_handler(&uip_buf[UIP_LLH_LEN],
|
uip_len = slip_poll_handler(&uip_buf[UIP_LLH_LEN],
|
||||||
UIP_BUFSIZE - UIP_LLH_LEN);
|
UIP_BUFSIZE - UIP_LLH_LEN);
|
||||||
#if !UIP_CONF_IPV6
|
#if !NETSTACK_CONF_WITH_IPV6
|
||||||
if(uip_len == 4 && strncmp((char*)&uip_buf[UIP_LLH_LEN], "?IPA", 4) == 0) {
|
if(uip_len == 4 && strncmp((char*)&uip_buf[UIP_LLH_LEN], "?IPA", 4) == 0) {
|
||||||
char buf[8];
|
char buf[8];
|
||||||
memcpy(&buf[0], "=IPA", 4);
|
memcpy(&buf[0], "=IPA", 4);
|
||||||
|
@ -296,7 +296,7 @@ PROCESS_THREAD(slip_process, ev, data)
|
||||||
uip_len = 0;
|
uip_len = 0;
|
||||||
SLIP_STATISTICS(slip_ip_drop++);
|
SLIP_STATISTICS(slip_ip_drop++);
|
||||||
}
|
}
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
if(uip_len > 0) {
|
if(uip_len > 0) {
|
||||||
if(input_callback) {
|
if(input_callback) {
|
||||||
input_callback();
|
input_callback();
|
||||||
|
@ -307,7 +307,7 @@ PROCESS_THREAD(slip_process, ev, data)
|
||||||
tcpip_input();
|
tcpip_input();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
}
|
}
|
||||||
|
|
||||||
PROCESS_END();
|
PROCESS_END();
|
||||||
|
|
|
@ -185,7 +185,7 @@ strcasecmp(const char *s1, const char *s2)
|
||||||
#define DNS_TYPE_ANY 255
|
#define DNS_TYPE_ANY 255
|
||||||
#define DNS_TYPE_NSEC 47
|
#define DNS_TYPE_NSEC 47
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
#define NATIVE_DNS_TYPE DNS_TYPE_AAAA /* IPv6 */
|
#define NATIVE_DNS_TYPE DNS_TYPE_AAAA /* IPv6 */
|
||||||
#else
|
#else
|
||||||
#define NATIVE_DNS_TYPE DNS_TYPE_A /* IPv4 */
|
#define NATIVE_DNS_TYPE DNS_TYPE_A /* IPv4 */
|
||||||
|
@ -234,12 +234,12 @@ struct dns_hdr {
|
||||||
* <https://developers.google.com/speed/public-dns/docs/using>
|
* <https://developers.google.com/speed/public-dns/docs/using>
|
||||||
*/
|
*/
|
||||||
static uip_ipaddr_t resolv_default_dns_server =
|
static uip_ipaddr_t resolv_default_dns_server =
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
{ { 0x20, 0x01, 0x48, 0x60, 0x48, 0x60, 0x00, 0x00,
|
{ { 0x20, 0x01, 0x48, 0x60, 0x48, 0x60, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x88 } };
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x88 } };
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
{ { 8, 8, 8, 8 } };
|
{ { 8, 8, 8, 8 } };
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
/** \internal The DNS answer message structure. */
|
/** \internal The DNS answer message structure. */
|
||||||
struct dns_answer {
|
struct dns_answer {
|
||||||
|
@ -249,7 +249,7 @@ struct dns_answer {
|
||||||
uint16_t class;
|
uint16_t class;
|
||||||
uint16_t ttl[2];
|
uint16_t ttl[2];
|
||||||
uint16_t len;
|
uint16_t len;
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
uint8_t ipaddr[16];
|
uint8_t ipaddr[16];
|
||||||
#else
|
#else
|
||||||
uint8_t ipaddr[4];
|
uint8_t ipaddr[4];
|
||||||
|
@ -315,13 +315,13 @@ enum {
|
||||||
static uint8_t mdns_state;
|
static uint8_t mdns_state;
|
||||||
|
|
||||||
static const uip_ipaddr_t resolv_mdns_addr =
|
static const uip_ipaddr_t resolv_mdns_addr =
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
{ { 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
{ { 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfb } };
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfb } };
|
||||||
#include "net/ipv6/uip-ds6.h"
|
#include "net/ipv6/uip-ds6.h"
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
{ { 224, 0, 0, 251 } };
|
{ { 224, 0, 0, 251 } };
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
static int mdns_needs_host_announce;
|
static int mdns_needs_host_announce;
|
||||||
|
|
||||||
PROCESS(mdns_probe_process, "mDNS probe");
|
PROCESS(mdns_probe_process, "mDNS probe");
|
||||||
|
@ -508,7 +508,7 @@ mdns_write_announce_records(unsigned char *queryptr, uint8_t *count)
|
||||||
{
|
{
|
||||||
struct dns_answer *ans;
|
struct dns_answer *ans;
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
uint8_t i;
|
uint8_t i;
|
||||||
|
|
||||||
for(i = 0; i < UIP_DS6_ADDR_NB; ++i) {
|
for(i = 0; i < UIP_DS6_ADDR_NB; ++i) {
|
||||||
|
@ -545,7 +545,7 @@ mdns_write_announce_records(unsigned char *queryptr, uint8_t *count)
|
||||||
++(*count);
|
++(*count);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
queryptr = encode_name(queryptr, resolv_hostname);
|
queryptr = encode_name(queryptr, resolv_hostname);
|
||||||
ans = (struct dns_answer *)queryptr;
|
ans = (struct dns_answer *)queryptr;
|
||||||
ans->type = UIP_HTONS(NATIVE_DNS_TYPE);
|
ans->type = UIP_HTONS(NATIVE_DNS_TYPE);
|
||||||
|
@ -556,7 +556,7 @@ mdns_write_announce_records(unsigned char *queryptr, uint8_t *count)
|
||||||
uip_gethostaddr((uip_ipaddr_t *) ans->ipaddr);
|
uip_gethostaddr((uip_ipaddr_t *) ans->ipaddr);
|
||||||
queryptr = (unsigned char *)ans + sizeof(*ans);
|
queryptr = (unsigned char *)ans + sizeof(*ans);
|
||||||
++(*count);
|
++(*count);
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
return queryptr;
|
return queryptr;
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
|
@ -585,17 +585,17 @@ mdns_prep_host_announce_packet(void)
|
||||||
0x00,
|
0x00,
|
||||||
0x04,
|
0x04,
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
0x00,
|
0x00,
|
||||||
0x00,
|
0x00,
|
||||||
0x00,
|
0x00,
|
||||||
0x08,
|
0x08,
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
0x40,
|
0x40,
|
||||||
0x00,
|
0x00,
|
||||||
0x00,
|
0x00,
|
||||||
0x00,
|
0x00,
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1141,7 +1141,7 @@ PROCESS_THREAD(resolv_process, ev, data)
|
||||||
PRINTF("resolver: Supports MDNS.\n");
|
PRINTF("resolver: Supports MDNS.\n");
|
||||||
uip_udp_bind(resolv_conn, UIP_HTONS(MDNS_PORT));
|
uip_udp_bind(resolv_conn, UIP_HTONS(MDNS_PORT));
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
uip_ds6_maddr_add(&resolv_mdns_addr);
|
uip_ds6_maddr_add(&resolv_mdns_addr);
|
||||||
#else
|
#else
|
||||||
/* TODO: Is there anything we need to do here for IPv4 multicast? */
|
/* TODO: Is there anything we need to do here for IPv4 multicast? */
|
||||||
|
@ -1316,12 +1316,12 @@ resolv_lookup(const char *name, uip_ipaddr_t ** ipaddr)
|
||||||
#if UIP_CONF_LOOPBACK_INTERFACE
|
#if UIP_CONF_LOOPBACK_INTERFACE
|
||||||
if(strcmp(name, "localhost")) {
|
if(strcmp(name, "localhost")) {
|
||||||
static uip_ipaddr_t loopback =
|
static uip_ipaddr_t loopback =
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
{ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
{ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 } };
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 } };
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
{ { 127, 0, 0, 1 } };
|
{ { 127, 0, 0, 1 } };
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
if(ipaddr) {
|
if(ipaddr) {
|
||||||
*ipaddr = &loopback;
|
*ipaddr = &loopback;
|
||||||
}
|
}
|
||||||
|
@ -1428,7 +1428,7 @@ resolv_found(char *name, uip_ipaddr_t * ipaddr)
|
||||||
#if RESOLV_CONF_SUPPORTS_MDNS
|
#if RESOLV_CONF_SUPPORTS_MDNS
|
||||||
if(strncasecmp(resolv_hostname, name, strlen(resolv_hostname)) == 0 &&
|
if(strncasecmp(resolv_hostname, name, strlen(resolv_hostname)) == 0 &&
|
||||||
ipaddr
|
ipaddr
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
&& !uip_ds6_is_my_addr(ipaddr)
|
&& !uip_ds6_is_my_addr(ipaddr)
|
||||||
#else
|
#else
|
||||||
&& uip_ipaddr_cmp(&uip_hostaddr, ipaddr) != 0
|
&& uip_ipaddr_cmp(&uip_hostaddr, ipaddr) != 0
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
#include "net/ip/uip-split.h"
|
#include "net/ip/uip-split.h"
|
||||||
#include "net/ip/uip-packetqueue.h"
|
#include "net/ip/uip-packetqueue.h"
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
#include "net/ipv6/uip-nd6.h"
|
#include "net/ipv6/uip-nd6.h"
|
||||||
#include "net/ipv6/uip-ds6.h"
|
#include "net/ipv6/uip-ds6.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -80,7 +80,7 @@ process_event_t tcpip_icmp6_event;
|
||||||
/* Periodic check of active connections. */
|
/* Periodic check of active connections. */
|
||||||
static struct etimer periodic;
|
static struct etimer periodic;
|
||||||
|
|
||||||
#if UIP_CONF_IPV6 && UIP_CONF_IPV6_REASSEMBLY
|
#if NETSTACK_CONF_WITH_IPV6 && UIP_CONF_IPV6_REASSEMBLY
|
||||||
/* Timer for reassembly. */
|
/* Timer for reassembly. */
|
||||||
extern struct etimer uip_reass_timer;
|
extern struct etimer uip_reass_timer;
|
||||||
#endif
|
#endif
|
||||||
|
@ -107,7 +107,7 @@ enum {
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Called on IP packet output. */
|
/* Called on IP packet output. */
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
|
|
||||||
static uint8_t (* outputfunc)(const uip_lladdr_t *a);
|
static uint8_t (* outputfunc)(const uip_lladdr_t *a);
|
||||||
|
|
||||||
|
@ -194,7 +194,7 @@ packet_input(void)
|
||||||
#if UIP_CONF_TCP_SPLIT
|
#if UIP_CONF_TCP_SPLIT
|
||||||
uip_split_output();
|
uip_split_output();
|
||||||
#else /* UIP_CONF_TCP_SPLIT */
|
#else /* UIP_CONF_TCP_SPLIT */
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
tcpip_ipv6_output();
|
tcpip_ipv6_output();
|
||||||
#else
|
#else
|
||||||
PRINTF("tcpip packet_input forward output len %d\n", uip_len);
|
PRINTF("tcpip packet_input forward output len %d\n", uip_len);
|
||||||
|
@ -213,7 +213,7 @@ packet_input(void)
|
||||||
#if UIP_CONF_TCP_SPLIT
|
#if UIP_CONF_TCP_SPLIT
|
||||||
uip_split_output();
|
uip_split_output();
|
||||||
#else /* UIP_CONF_TCP_SPLIT */
|
#else /* UIP_CONF_TCP_SPLIT */
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
tcpip_ipv6_output();
|
tcpip_ipv6_output();
|
||||||
#else
|
#else
|
||||||
PRINTF("tcpip packet_input output len %d\n", uip_len);
|
PRINTF("tcpip packet_input output len %d\n", uip_len);
|
||||||
|
@ -331,11 +331,11 @@ udp_broadcast_new(uint16_t port, void *appstate)
|
||||||
uip_ipaddr_t addr;
|
uip_ipaddr_t addr;
|
||||||
struct uip_udp_conn *conn;
|
struct uip_udp_conn *conn;
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
uip_create_linklocal_allnodes_mcast(&addr);
|
uip_create_linklocal_allnodes_mcast(&addr);
|
||||||
#else
|
#else
|
||||||
uip_ipaddr(&addr, 255,255,255,255);
|
uip_ipaddr(&addr, 255,255,255,255);
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
conn = udp_new(&addr, port, appstate);
|
conn = udp_new(&addr, port, appstate);
|
||||||
if(conn != NULL) {
|
if(conn != NULL) {
|
||||||
udp_bind(conn, port);
|
udp_bind(conn, port);
|
||||||
|
@ -434,7 +434,7 @@ eventhandler(process_event_t ev, process_data_t data)
|
||||||
connections. */
|
connections. */
|
||||||
etimer_restart(&periodic);
|
etimer_restart(&periodic);
|
||||||
uip_periodic(i);
|
uip_periodic(i);
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
tcpip_ipv6_output();
|
tcpip_ipv6_output();
|
||||||
#else
|
#else
|
||||||
if(uip_len > 0) {
|
if(uip_len > 0) {
|
||||||
|
@ -442,7 +442,7 @@ eventhandler(process_event_t ev, process_data_t data)
|
||||||
tcpip_output();
|
tcpip_output();
|
||||||
PRINTF("tcpip_output after periodic len %d\n", uip_len);
|
PRINTF("tcpip_output after periodic len %d\n", uip_len);
|
||||||
}
|
}
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* UIP_TCP */
|
#endif /* UIP_TCP */
|
||||||
|
@ -451,7 +451,7 @@ eventhandler(process_event_t ev, process_data_t data)
|
||||||
#endif /* UIP_CONF_IP_FORWARD */
|
#endif /* UIP_CONF_IP_FORWARD */
|
||||||
}
|
}
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
#if UIP_CONF_IPV6_REASSEMBLY
|
#if UIP_CONF_IPV6_REASSEMBLY
|
||||||
/*
|
/*
|
||||||
* check the timer for reassembly
|
* check the timer for reassembly
|
||||||
|
@ -483,7 +483,7 @@ eventhandler(process_event_t ev, process_data_t data)
|
||||||
uip_ds6_periodic();
|
uip_ds6_periodic();
|
||||||
tcpip_ipv6_output();
|
tcpip_ipv6_output();
|
||||||
}
|
}
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -491,14 +491,14 @@ eventhandler(process_event_t ev, process_data_t data)
|
||||||
case TCP_POLL:
|
case TCP_POLL:
|
||||||
if(data != NULL) {
|
if(data != NULL) {
|
||||||
uip_poll_conn(data);
|
uip_poll_conn(data);
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
tcpip_ipv6_output();
|
tcpip_ipv6_output();
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
if(uip_len > 0) {
|
if(uip_len > 0) {
|
||||||
PRINTF("tcpip_output from tcp poll len %d\n", uip_len);
|
PRINTF("tcpip_output from tcp poll len %d\n", uip_len);
|
||||||
tcpip_output();
|
tcpip_output();
|
||||||
}
|
}
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
/* Start the periodic polling, if it isn't already active. */
|
/* Start the periodic polling, if it isn't already active. */
|
||||||
start_periodic_tcp_timer();
|
start_periodic_tcp_timer();
|
||||||
}
|
}
|
||||||
|
@ -508,7 +508,7 @@ eventhandler(process_event_t ev, process_data_t data)
|
||||||
case UDP_POLL:
|
case UDP_POLL:
|
||||||
if(data != NULL) {
|
if(data != NULL) {
|
||||||
uip_udp_periodic_conn(data);
|
uip_udp_periodic_conn(data);
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
tcpip_ipv6_output();
|
tcpip_ipv6_output();
|
||||||
#else
|
#else
|
||||||
if(uip_len > 0) {
|
if(uip_len > 0) {
|
||||||
|
@ -530,12 +530,12 @@ tcpip_input(void)
|
||||||
{
|
{
|
||||||
process_post_synch(&tcpip_process, PACKET_INPUT, NULL);
|
process_post_synch(&tcpip_process, PACKET_INPUT, NULL);
|
||||||
uip_len = 0;
|
uip_len = 0;
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
uip_ext_len = 0;
|
uip_ext_len = 0;
|
||||||
#endif /*UIP_CONF_IPV6*/
|
#endif /*NETSTACK_CONF_WITH_IPV6*/
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
void
|
void
|
||||||
tcpip_ipv6_output(void)
|
tcpip_ipv6_output(void)
|
||||||
{
|
{
|
||||||
|
@ -729,7 +729,7 @@ tcpip_ipv6_output(void)
|
||||||
uip_len = 0;
|
uip_len = 0;
|
||||||
uip_ext_len = 0;
|
uip_ext_len = 0;
|
||||||
}
|
}
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
#if UIP_UDP
|
#if UIP_UDP
|
||||||
void
|
void
|
||||||
|
@ -818,7 +818,7 @@ PROCESS_THREAD(tcpip_process, ev, data)
|
||||||
UIP_FALLBACK_INTERFACE.init();
|
UIP_FALLBACK_INTERFACE.init();
|
||||||
#endif
|
#endif
|
||||||
/* initialize RPL if configured for using RPL */
|
/* initialize RPL if configured for using RPL */
|
||||||
#if UIP_CONF_IPV6 && UIP_CONF_IPV6_RPL
|
#if NETSTACK_CONF_WITH_IPV6 && UIP_CONF_IPV6_RPL
|
||||||
rpl_init();
|
rpl_init();
|
||||||
#endif /* UIP_CONF_IPV6_RPL */
|
#endif /* UIP_CONF_IPV6_RPL */
|
||||||
|
|
||||||
|
|
|
@ -340,7 +340,7 @@ CCIF void tcpip_input(void);
|
||||||
* \brief Output packet to layer 2
|
* \brief Output packet to layer 2
|
||||||
* The eventual parameter is the MAC address of the destination.
|
* The eventual parameter is the MAC address of the destination.
|
||||||
*/
|
*/
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
uint8_t tcpip_output(const uip_lladdr_t *);
|
uint8_t tcpip_output(const uip_lladdr_t *);
|
||||||
void tcpip_set_outputfunc(uint8_t (* f)(const uip_lladdr_t *));
|
void tcpip_set_outputfunc(uint8_t (* f)(const uip_lladdr_t *));
|
||||||
#else
|
#else
|
||||||
|
@ -351,7 +351,7 @@ void tcpip_set_outputfunc(uint8_t (* f)(void));
|
||||||
/**
|
/**
|
||||||
* \brief This function does address resolution and then calls tcpip_output
|
* \brief This function does address resolution and then calls tcpip_output
|
||||||
*/
|
*/
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
void tcpip_ipv6_output(void);
|
void tcpip_ipv6_output(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ uip_debug_ipaddr_print(const uip_ipaddr_t *addr)
|
||||||
printf("(NULL IP addr)");
|
printf("(NULL IP addr)");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
uint16_t a;
|
uint16_t a;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
int f;
|
int f;
|
||||||
|
@ -66,9 +66,9 @@ uip_debug_ipaddr_print(const uip_ipaddr_t *addr)
|
||||||
PRINTA("%x", a);
|
PRINTA("%x", a);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
PRINTA("%u.%u.%u.%u", addr->u8[0], addr->u8[1], addr->u8[2], addr->u8[3]);
|
PRINTA("%u.%u.%u.%u", addr->u8[0], addr->u8[1], addr->u8[2], addr->u8[3]);
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
void
|
void
|
||||||
|
|
|
@ -73,33 +73,33 @@ uip_split_output(void)
|
||||||
/* Create the first packet. This is done by altering the length
|
/* Create the first packet. This is done by altering the length
|
||||||
field of the IP header and updating the checksums. */
|
field of the IP header and updating the checksums. */
|
||||||
uip_len = len1 + UIP_TCPIP_HLEN;
|
uip_len = len1 + UIP_TCPIP_HLEN;
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
/* For IPv6, the IP length field does not include the IPv6 IP header
|
/* For IPv6, the IP length field does not include the IPv6 IP header
|
||||||
length. */
|
length. */
|
||||||
BUF->len[0] = ((uip_len - UIP_IPH_LEN) >> 8);
|
BUF->len[0] = ((uip_len - UIP_IPH_LEN) >> 8);
|
||||||
BUF->len[1] = ((uip_len - UIP_IPH_LEN) & 0xff);
|
BUF->len[1] = ((uip_len - UIP_IPH_LEN) & 0xff);
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
BUF->len[0] = uip_len >> 8;
|
BUF->len[0] = uip_len >> 8;
|
||||||
BUF->len[1] = uip_len & 0xff;
|
BUF->len[1] = uip_len & 0xff;
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
/* Recalculate the TCP checksum. */
|
/* Recalculate the TCP checksum. */
|
||||||
BUF->tcpchksum = 0;
|
BUF->tcpchksum = 0;
|
||||||
BUF->tcpchksum = ~(uip_tcpchksum());
|
BUF->tcpchksum = ~(uip_tcpchksum());
|
||||||
|
|
||||||
#if !UIP_CONF_IPV6
|
#if !NETSTACK_CONF_WITH_IPV6
|
||||||
/* Recalculate the IP checksum. */
|
/* Recalculate the IP checksum. */
|
||||||
BUF->ipchksum = 0;
|
BUF->ipchksum = 0;
|
||||||
BUF->ipchksum = ~(uip_ipchksum());
|
BUF->ipchksum = ~(uip_ipchksum());
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
/* Transmit the first packet. */
|
/* Transmit the first packet. */
|
||||||
/* uip_fw_output();*/
|
/* uip_fw_output();*/
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
tcpip_ipv6_output();
|
tcpip_ipv6_output();
|
||||||
#else
|
#else
|
||||||
tcpip_output();
|
tcpip_output();
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
/* Now, create the second packet. To do this, it is not enough to
|
/* Now, create the second packet. To do this, it is not enough to
|
||||||
just alter the length field, but we must also update the TCP
|
just alter the length field, but we must also update the TCP
|
||||||
|
@ -107,15 +107,15 @@ uip_split_output(void)
|
||||||
memory. This place is detemined by the length of the first
|
memory. This place is detemined by the length of the first
|
||||||
packet (len1). */
|
packet (len1). */
|
||||||
uip_len = len2 + UIP_TCPIP_HLEN;
|
uip_len = len2 + UIP_TCPIP_HLEN;
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
/* For IPv6, the IP length field does not include the IPv6 IP header
|
/* For IPv6, the IP length field does not include the IPv6 IP header
|
||||||
length. */
|
length. */
|
||||||
BUF->len[0] = ((uip_len - UIP_IPH_LEN) >> 8);
|
BUF->len[0] = ((uip_len - UIP_IPH_LEN) >> 8);
|
||||||
BUF->len[1] = ((uip_len - UIP_IPH_LEN) & 0xff);
|
BUF->len[1] = ((uip_len - UIP_IPH_LEN) & 0xff);
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
BUF->len[0] = uip_len >> 8;
|
BUF->len[0] = uip_len >> 8;
|
||||||
BUF->len[1] = uip_len & 0xff;
|
BUF->len[1] = uip_len & 0xff;
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
/* uip_appdata += len1;*/
|
/* uip_appdata += len1;*/
|
||||||
memcpy(uip_appdata, (uint8_t *)uip_appdata + len1, len2);
|
memcpy(uip_appdata, (uint8_t *)uip_appdata + len1, len2);
|
||||||
|
@ -130,29 +130,29 @@ uip_split_output(void)
|
||||||
BUF->tcpchksum = 0;
|
BUF->tcpchksum = 0;
|
||||||
BUF->tcpchksum = ~(uip_tcpchksum());
|
BUF->tcpchksum = ~(uip_tcpchksum());
|
||||||
|
|
||||||
#if !UIP_CONF_IPV6
|
#if !NETSTACK_CONF_WITH_IPV6
|
||||||
/* Recalculate the IP checksum. */
|
/* Recalculate the IP checksum. */
|
||||||
BUF->ipchksum = 0;
|
BUF->ipchksum = 0;
|
||||||
BUF->ipchksum = ~(uip_ipchksum());
|
BUF->ipchksum = ~(uip_ipchksum());
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
/* Transmit the second packet. */
|
/* Transmit the second packet. */
|
||||||
/* uip_fw_output();*/
|
/* uip_fw_output();*/
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
tcpip_ipv6_output();
|
tcpip_ipv6_output();
|
||||||
#else
|
#else
|
||||||
tcpip_output();
|
tcpip_output();
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif /* UIP_TCP */
|
#endif /* UIP_TCP */
|
||||||
|
|
||||||
/* uip_fw_output();*/
|
/* uip_fw_output();*/
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
tcpip_ipv6_output();
|
tcpip_ipv6_output();
|
||||||
#else
|
#else
|
||||||
tcpip_output();
|
tcpip_output();
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
}
|
}
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------*/
|
||||||
|
|
|
@ -66,7 +66,7 @@ uip_udp_packet_send(struct uip_udp_conn *c, const void *data, int len)
|
||||||
}
|
}
|
||||||
#endif /* UIP_IPV6_MULTICAST */
|
#endif /* UIP_IPV6_MULTICAST */
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
tcpip_ipv6_output();
|
tcpip_ipv6_output();
|
||||||
#else
|
#else
|
||||||
if(uip_len > 0) {
|
if(uip_len > 0) {
|
||||||
|
|
|
@ -53,12 +53,12 @@
|
||||||
#define UIP_H_
|
#define UIP_H_
|
||||||
|
|
||||||
/* Header sizes. */
|
/* Header sizes. */
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
#define UIP_IPH_LEN 40
|
#define UIP_IPH_LEN 40
|
||||||
#define UIP_FRAGH_LEN 8
|
#define UIP_FRAGH_LEN 8
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
#define UIP_IPH_LEN 20 /* Size of IP header */
|
#define UIP_IPH_LEN 20 /* Size of IP header */
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
#define UIP_UDPH_LEN 8 /* Size of UDP header */
|
#define UIP_UDPH_LEN 8 /* Size of UDP header */
|
||||||
#define UIP_TCPH_LEN 20 /* Size of TCP header */
|
#define UIP_TCPH_LEN 20 /* Size of TCP header */
|
||||||
|
@ -75,7 +75,7 @@
|
||||||
+ IP header */
|
+ IP header */
|
||||||
#define UIP_LLIPH_LEN (UIP_LLH_LEN + UIP_IPH_LEN) /* size of L2
|
#define UIP_LLIPH_LEN (UIP_LLH_LEN + UIP_IPH_LEN) /* size of L2
|
||||||
+ IP header */
|
+ IP header */
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
/**
|
/**
|
||||||
* The sums below are quite used in ND. When used for uip_buf, we
|
* The sums below are quite used in ND. When used for uip_buf, we
|
||||||
* include link layer length when used for uip_len, we do not, hence
|
* include link layer length when used for uip_len, we do not, hence
|
||||||
|
@ -86,7 +86,7 @@
|
||||||
#define uip_l2_l3_icmp_hdr_len (UIP_LLH_LEN + UIP_IPH_LEN + uip_ext_len + UIP_ICMPH_LEN)
|
#define uip_l2_l3_icmp_hdr_len (UIP_LLH_LEN + UIP_IPH_LEN + uip_ext_len + UIP_ICMPH_LEN)
|
||||||
#define uip_l3_hdr_len (UIP_IPH_LEN + uip_ext_len)
|
#define uip_l3_hdr_len (UIP_IPH_LEN + uip_ext_len)
|
||||||
#define uip_l3_icmp_hdr_len (UIP_IPH_LEN + uip_ext_len + UIP_ICMPH_LEN)
|
#define uip_l3_icmp_hdr_len (UIP_IPH_LEN + uip_ext_len + UIP_ICMPH_LEN)
|
||||||
#endif /*UIP_CONF_IPV6*/
|
#endif /*NETSTACK_CONF_WITH_IPV6*/
|
||||||
|
|
||||||
|
|
||||||
#include "net/ip/uipopt.h"
|
#include "net/ip/uipopt.h"
|
||||||
|
@ -108,11 +108,11 @@ typedef union uip_ip6addr_t {
|
||||||
uint16_t u16[8];
|
uint16_t u16[8];
|
||||||
} uip_ip6addr_t;
|
} uip_ip6addr_t;
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
typedef uip_ip6addr_t uip_ipaddr_t;
|
typedef uip_ip6addr_t uip_ipaddr_t;
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
typedef uip_ip4addr_t uip_ipaddr_t;
|
typedef uip_ip4addr_t uip_ipaddr_t;
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
|
@ -1056,11 +1056,11 @@ struct uip_udp_conn *uip_udp_new(const uip_ipaddr_t *ripaddr, uint16_t rport);
|
||||||
(addr1)->u16[1] == (addr2)->u16[1])
|
(addr1)->u16[1] == (addr2)->u16[1])
|
||||||
#define uip_ip6addr_cmp(addr1, addr2) (memcmp(addr1, addr2, sizeof(uip_ip6addr_t)) == 0)
|
#define uip_ip6addr_cmp(addr1, addr2) (memcmp(addr1, addr2, sizeof(uip_ip6addr_t)) == 0)
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
#define uip_ipaddr_cmp(addr1, addr2) uip_ip6addr_cmp(addr1, addr2)
|
#define uip_ipaddr_cmp(addr1, addr2) uip_ip6addr_cmp(addr1, addr2)
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
#define uip_ipaddr_cmp(addr1, addr2) uip_ip4addr_cmp(addr1, addr2)
|
#define uip_ipaddr_cmp(addr1, addr2) uip_ip4addr_cmp(addr1, addr2)
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compare two IP addresses with netmasks
|
* Compare two IP addresses with netmasks
|
||||||
|
@ -1494,13 +1494,13 @@ struct uip_stats {
|
||||||
checksum. */
|
checksum. */
|
||||||
} udp; /**< UDP statistics. */
|
} udp; /**< UDP statistics. */
|
||||||
#endif /* UIP_UDP */
|
#endif /* UIP_UDP */
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
struct {
|
struct {
|
||||||
uip_stats_t drop; /**< Number of dropped ND6 packets. */
|
uip_stats_t drop; /**< Number of dropped ND6 packets. */
|
||||||
uip_stats_t recv; /**< Number of recived ND6 packets */
|
uip_stats_t recv; /**< Number of recived ND6 packets */
|
||||||
uip_stats_t sent; /**< Number of sent ND6 packets */
|
uip_stats_t sent; /**< Number of sent ND6 packets */
|
||||||
} nd6;
|
} nd6;
|
||||||
#endif /*UIP_CONF_IPV6*/
|
#endif /*NETSTACK_CONF_WITH_IPV6*/
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -1610,7 +1610,7 @@ void uip_process(uint8_t flag);
|
||||||
|
|
||||||
/* The TCP and IP headers. */
|
/* The TCP and IP headers. */
|
||||||
struct uip_tcpip_hdr {
|
struct uip_tcpip_hdr {
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
/* IPv6 header. */
|
/* IPv6 header. */
|
||||||
uint8_t vtc,
|
uint8_t vtc,
|
||||||
tcflow;
|
tcflow;
|
||||||
|
@ -1618,7 +1618,7 @@ struct uip_tcpip_hdr {
|
||||||
uint8_t len[2];
|
uint8_t len[2];
|
||||||
uint8_t proto, ttl;
|
uint8_t proto, ttl;
|
||||||
uip_ip6addr_t srcipaddr, destipaddr;
|
uip_ip6addr_t srcipaddr, destipaddr;
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
/* IPv4 header. */
|
/* IPv4 header. */
|
||||||
uint8_t vhl,
|
uint8_t vhl,
|
||||||
tos,
|
tos,
|
||||||
|
@ -1629,7 +1629,7 @@ struct uip_tcpip_hdr {
|
||||||
proto;
|
proto;
|
||||||
uint16_t ipchksum;
|
uint16_t ipchksum;
|
||||||
uip_ipaddr_t srcipaddr, destipaddr;
|
uip_ipaddr_t srcipaddr, destipaddr;
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
/* TCP header. */
|
/* TCP header. */
|
||||||
uint16_t srcport,
|
uint16_t srcport,
|
||||||
|
@ -1646,7 +1646,7 @@ struct uip_tcpip_hdr {
|
||||||
|
|
||||||
/* The ICMP and IP headers. */
|
/* The ICMP and IP headers. */
|
||||||
struct uip_icmpip_hdr {
|
struct uip_icmpip_hdr {
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
/* IPv6 header. */
|
/* IPv6 header. */
|
||||||
uint8_t vtc,
|
uint8_t vtc,
|
||||||
tcf;
|
tcf;
|
||||||
|
@ -1654,7 +1654,7 @@ struct uip_icmpip_hdr {
|
||||||
uint8_t len[2];
|
uint8_t len[2];
|
||||||
uint8_t proto, ttl;
|
uint8_t proto, ttl;
|
||||||
uip_ip6addr_t srcipaddr, destipaddr;
|
uip_ip6addr_t srcipaddr, destipaddr;
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
/* IPv4 header. */
|
/* IPv4 header. */
|
||||||
uint8_t vhl,
|
uint8_t vhl,
|
||||||
tos,
|
tos,
|
||||||
|
@ -1665,21 +1665,21 @@ struct uip_icmpip_hdr {
|
||||||
proto;
|
proto;
|
||||||
uint16_t ipchksum;
|
uint16_t ipchksum;
|
||||||
uip_ipaddr_t srcipaddr, destipaddr;
|
uip_ipaddr_t srcipaddr, destipaddr;
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
/* ICMP header. */
|
/* ICMP header. */
|
||||||
uint8_t type, icode;
|
uint8_t type, icode;
|
||||||
uint16_t icmpchksum;
|
uint16_t icmpchksum;
|
||||||
#if !UIP_CONF_IPV6
|
#if !NETSTACK_CONF_WITH_IPV6
|
||||||
uint16_t id, seqno;
|
uint16_t id, seqno;
|
||||||
uint8_t payload[1];
|
uint8_t payload[1];
|
||||||
#endif /* !UIP_CONF_IPV6 */
|
#endif /* !NETSTACK_CONF_WITH_IPV6 */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/* The UDP and IP headers. */
|
/* The UDP and IP headers. */
|
||||||
struct uip_udpip_hdr {
|
struct uip_udpip_hdr {
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
/* IPv6 header. */
|
/* IPv6 header. */
|
||||||
uint8_t vtc,
|
uint8_t vtc,
|
||||||
tcf;
|
tcf;
|
||||||
|
@ -1687,7 +1687,7 @@ struct uip_udpip_hdr {
|
||||||
uint8_t len[2];
|
uint8_t len[2];
|
||||||
uint8_t proto, ttl;
|
uint8_t proto, ttl;
|
||||||
uip_ip6addr_t srcipaddr, destipaddr;
|
uip_ip6addr_t srcipaddr, destipaddr;
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
/* IP header. */
|
/* IP header. */
|
||||||
uint8_t vhl,
|
uint8_t vhl,
|
||||||
tos,
|
tos,
|
||||||
|
@ -1698,7 +1698,7 @@ struct uip_udpip_hdr {
|
||||||
proto;
|
proto;
|
||||||
uint16_t ipchksum;
|
uint16_t ipchksum;
|
||||||
uip_ipaddr_t srcipaddr, destipaddr;
|
uip_ipaddr_t srcipaddr, destipaddr;
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
/* UDP header. */
|
/* UDP header. */
|
||||||
uint16_t srcport,
|
uint16_t srcport,
|
||||||
|
@ -1714,7 +1714,7 @@ struct uip_udpip_hdr {
|
||||||
*/
|
*/
|
||||||
/* The IP header */
|
/* The IP header */
|
||||||
struct uip_ip_hdr {
|
struct uip_ip_hdr {
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
/* IPV6 header */
|
/* IPV6 header */
|
||||||
uint8_t vtc;
|
uint8_t vtc;
|
||||||
uint8_t tcflow;
|
uint8_t tcflow;
|
||||||
|
@ -1722,7 +1722,7 @@ struct uip_ip_hdr {
|
||||||
uint8_t len[2];
|
uint8_t len[2];
|
||||||
uint8_t proto, ttl;
|
uint8_t proto, ttl;
|
||||||
uip_ip6addr_t srcipaddr, destipaddr;
|
uip_ip6addr_t srcipaddr, destipaddr;
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
/* IPV4 header */
|
/* IPV4 header */
|
||||||
uint8_t vhl,
|
uint8_t vhl,
|
||||||
tos,
|
tos,
|
||||||
|
@ -1733,7 +1733,7 @@ struct uip_ip_hdr {
|
||||||
proto;
|
proto;
|
||||||
uint16_t ipchksum;
|
uint16_t ipchksum;
|
||||||
uip_ipaddr_t srcipaddr, destipaddr;
|
uip_ipaddr_t srcipaddr, destipaddr;
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -1842,9 +1842,9 @@ struct uip_tcp_hdr {
|
||||||
struct uip_icmp_hdr {
|
struct uip_icmp_hdr {
|
||||||
uint8_t type, icode;
|
uint8_t type, icode;
|
||||||
uint16_t icmpchksum;
|
uint16_t icmpchksum;
|
||||||
#if !UIP_CONF_IPV6
|
#if !NETSTACK_CONF_WITH_IPV6
|
||||||
uint16_t id, seqno;
|
uint16_t id, seqno;
|
||||||
#endif /* !UIP_CONF_IPV6 */
|
#endif /* !NETSTACK_CONF_WITH_IPV6 */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -1880,7 +1880,7 @@ struct uip_udp_hdr {
|
||||||
#define UIP_PROTO_ICMP6 58
|
#define UIP_PROTO_ICMP6 58
|
||||||
|
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
/** @{ */
|
/** @{ */
|
||||||
/** \brief extension headers types */
|
/** \brief extension headers types */
|
||||||
#define UIP_PROTO_HBHO 0
|
#define UIP_PROTO_HBHO 0
|
||||||
|
@ -1917,7 +1917,7 @@ struct uip_udp_hdr {
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
|
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
|
|
||||||
#if UIP_FIXEDADDR
|
#if UIP_FIXEDADDR
|
||||||
|
@ -1937,7 +1937,7 @@ CCIF extern uip_lladdr_t uip_lladdr;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
/** Length of the link local prefix */
|
/** Length of the link local prefix */
|
||||||
#define UIP_LLPREF_LEN 10
|
#define UIP_LLPREF_LEN 10
|
||||||
|
|
||||||
|
@ -2162,7 +2162,7 @@ CCIF extern uip_lladdr_t uip_lladdr;
|
||||||
(((a)->u8[14]) == ((b)->u8[14])) && \
|
(((a)->u8[14]) == ((b)->u8[14])) && \
|
||||||
(((a)->u8[15]) == ((b)->u8[15])))
|
(((a)->u8[15]) == ((b)->u8[15])))
|
||||||
|
|
||||||
#endif /*UIP_CONF_IPV6*/
|
#endif /*NETSTACK_CONF_WITH_IPV6*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculate the Internet checksum over a buffer.
|
* Calculate the Internet checksum over a buffer.
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
#include "net/ip/uip-debug.h"
|
#include "net/ip/uip-debug.h"
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
int
|
int
|
||||||
uiplib_ip6addrconv(const char *addrstr, uip_ip6addr_t *ipaddr)
|
uiplib_ip6addrconv(const char *addrstr, uip_ip6addr_t *ipaddr)
|
||||||
{
|
{
|
||||||
|
@ -103,7 +103,7 @@ uiplib_ip6addrconv(const char *addrstr, uip_ip6addr_t *ipaddr)
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
/* Parse a IPv4-address from a string. Returns the number of characters read
|
/* Parse a IPv4-address from a string. Returns the number of characters read
|
||||||
* for the address. */
|
* for the address. */
|
||||||
|
|
|
@ -67,11 +67,11 @@
|
||||||
* \retval 0 If the IP address could not be parsed.
|
* \retval 0 If the IP address could not be parsed.
|
||||||
* \retval Non-zero If the IP address was parsed.
|
* \retval Non-zero If the IP address was parsed.
|
||||||
*/
|
*/
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
#define uiplib_ipaddrconv uiplib_ip6addrconv
|
#define uiplib_ipaddrconv uiplib_ip6addrconv
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
#define uiplib_ipaddrconv uiplib_ip4addrconv
|
#define uiplib_ipaddrconv uiplib_ip4addrconv
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
CCIF int uiplib_ip4addrconv(const char *addrstr, uip_ip4addr_t *addr);
|
CCIF int uiplib_ip4addrconv(const char *addrstr, uip_ip4addr_t *addr);
|
||||||
CCIF int uiplib_ip6addrconv(const char *addrstr, uip_ip6addr_t *addr);
|
CCIF int uiplib_ip6addrconv(const char *addrstr, uip_ip6addr_t *addr);
|
||||||
|
|
|
@ -282,9 +282,9 @@ void uip_log(char *msg);
|
||||||
/** The maximum transmission unit at the IP Layer*/
|
/** The maximum transmission unit at the IP Layer*/
|
||||||
#define UIP_LINK_MTU 1280
|
#define UIP_LINK_MTU 1280
|
||||||
|
|
||||||
#ifndef UIP_CONF_IPV6
|
#ifndef NETSTACK_CONF_WITH_IPV6
|
||||||
/** Do we use IPv6 or not (default: no) */
|
/** Do we use IPv6 or not (default: no) */
|
||||||
#define UIP_CONF_IPV6 0
|
#define NETSTACK_CONF_WITH_IPV6 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef UIP_CONF_IPV6_QUEUE_PKT
|
#ifndef UIP_CONF_IPV6_QUEUE_PKT
|
||||||
|
@ -351,7 +351,7 @@ void uip_log(char *msg);
|
||||||
#ifdef UIP_CONF_UDP_CHECKSUMS
|
#ifdef UIP_CONF_UDP_CHECKSUMS
|
||||||
#define UIP_UDP_CHECKSUMS (UIP_CONF_UDP_CHECKSUMS)
|
#define UIP_UDP_CHECKSUMS (UIP_CONF_UDP_CHECKSUMS)
|
||||||
#else
|
#else
|
||||||
#define UIP_UDP_CHECKSUMS (UIP_CONF_IPV6)
|
#define UIP_UDP_CHECKSUMS (NETSTACK_CONF_WITH_IPV6)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
|
|
||||||
#include "net/ipv4/uip-fw.h"
|
#include "net/ipv4/uip-fw.h"
|
||||||
|
|
||||||
#if !UIP_CONF_IPV6
|
#if !NETSTACK_CONF_WITH_IPV6
|
||||||
|
|
||||||
PROCESS(uip_fw_process, "IP forwarding");
|
PROCESS(uip_fw_process, "IP forwarding");
|
||||||
|
|
||||||
|
@ -51,4 +51,4 @@ PROCESS_THREAD(uip_fw_process, ev, data)
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
|
@ -75,15 +75,15 @@
|
||||||
#include "net/ipv4/uip_arp.h"
|
#include "net/ipv4/uip_arp.h"
|
||||||
#include "net/ip/uip_arch.h"
|
#include "net/ip/uip_arch.h"
|
||||||
|
|
||||||
#if !UIP_CONF_IPV6 /* If UIP_CONF_IPV6 is defined, we compile the
|
#if !NETSTACK_CONF_WITH_IPV6 /* If NETSTACK_CONF_WITH_IPV6 is defined, we compile the
|
||||||
uip6.c file instead of this one. Therefore
|
uip6.c file instead of this one. Therefore
|
||||||
this #ifndef removes the entire compilation
|
this #ifndef removes the entire compilation
|
||||||
output of the uip.c file */
|
output of the uip.c file */
|
||||||
|
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
#include "net/ipv4/uip-neighbor.h"
|
#include "net/ipv4/uip-neighbor.h"
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
@ -106,12 +106,12 @@ uip_ipaddr_t uip_hostaddr, uip_draddr, uip_netmask;
|
||||||
#endif /* UIP_FIXEDADDR */
|
#endif /* UIP_FIXEDADDR */
|
||||||
|
|
||||||
const uip_ipaddr_t uip_broadcast_addr =
|
const uip_ipaddr_t uip_broadcast_addr =
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
{ { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
{ { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff } };
|
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff } };
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
{ { 0xff, 0xff, 0xff, 0xff } };
|
{ { 0xff, 0xff, 0xff, 0xff } };
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
const uip_ipaddr_t uip_all_zeroes_addr = { { 0x0, /* rest is 0 */ } };
|
const uip_ipaddr_t uip_all_zeroes_addr = { { 0x0, /* rest is 0 */ } };
|
||||||
|
|
||||||
#if UIP_FIXEDETHADDR
|
#if UIP_FIXEDETHADDR
|
||||||
|
@ -322,11 +322,11 @@ upper_layer_chksum(uint8_t proto)
|
||||||
uint16_t upper_layer_len;
|
uint16_t upper_layer_len;
|
||||||
uint16_t sum;
|
uint16_t sum;
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
upper_layer_len = (((uint16_t)(BUF->len[0]) << 8) + BUF->len[1]);
|
upper_layer_len = (((uint16_t)(BUF->len[0]) << 8) + BUF->len[1]);
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
upper_layer_len = (((uint16_t)(BUF->len[0]) << 8) + BUF->len[1]) - UIP_IPH_LEN;
|
upper_layer_len = (((uint16_t)(BUF->len[0]) << 8) + BUF->len[1]) - UIP_IPH_LEN;
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
/* First sum pseudoheader. */
|
/* First sum pseudoheader. */
|
||||||
|
|
||||||
|
@ -342,14 +342,14 @@ upper_layer_chksum(uint8_t proto)
|
||||||
return (sum == 0) ? 0xffff : uip_htons(sum);
|
return (sum == 0) ? 0xffff : uip_htons(sum);
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
uint16_t
|
uint16_t
|
||||||
uip_icmp6chksum(void)
|
uip_icmp6chksum(void)
|
||||||
{
|
{
|
||||||
return upper_layer_chksum(UIP_PROTO_ICMP6);
|
return upper_layer_chksum(UIP_PROTO_ICMP6);
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
uint16_t
|
uint16_t
|
||||||
uip_tcpchksum(void)
|
uip_tcpchksum(void)
|
||||||
|
@ -529,7 +529,7 @@ uip_listen(uint16_t port)
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
/* XXX: IP fragment reassembly: not well-tested. */
|
/* XXX: IP fragment reassembly: not well-tested. */
|
||||||
|
|
||||||
#if UIP_REASSEMBLY && !UIP_CONF_IPV6
|
#if UIP_REASSEMBLY && !NETSTACK_CONF_WITH_IPV6
|
||||||
#define UIP_REASS_BUFSIZE (UIP_BUFSIZE - UIP_LLH_LEN)
|
#define UIP_REASS_BUFSIZE (UIP_BUFSIZE - UIP_LLH_LEN)
|
||||||
static uint8_t uip_reassbuf[UIP_REASS_BUFSIZE];
|
static uint8_t uip_reassbuf[UIP_REASS_BUFSIZE];
|
||||||
static uint8_t uip_reassbitmap[UIP_REASS_BUFSIZE / (8 * 8)];
|
static uint8_t uip_reassbitmap[UIP_REASS_BUFSIZE / (8 * 8)];
|
||||||
|
@ -828,7 +828,7 @@ uip_process(uint8_t flag)
|
||||||
|
|
||||||
/* Start of IP input header processing code. */
|
/* Start of IP input header processing code. */
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
/* Check validity of the IP header. */
|
/* Check validity of the IP header. */
|
||||||
if((BUF->vtc & 0xf0) != 0x60) { /* IP version and header length. */
|
if((BUF->vtc & 0xf0) != 0x60) { /* IP version and header length. */
|
||||||
UIP_STAT(++uip_stat.ip.drop);
|
UIP_STAT(++uip_stat.ip.drop);
|
||||||
|
@ -836,7 +836,7 @@ uip_process(uint8_t flag)
|
||||||
UIP_LOG("ipv6: invalid version.");
|
UIP_LOG("ipv6: invalid version.");
|
||||||
goto drop;
|
goto drop;
|
||||||
}
|
}
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
/* Check validity of the IP header. */
|
/* Check validity of the IP header. */
|
||||||
if(BUF->vhl != 0x45) { /* IP version and header length. */
|
if(BUF->vhl != 0x45) { /* IP version and header length. */
|
||||||
UIP_STAT(++uip_stat.ip.drop);
|
UIP_STAT(++uip_stat.ip.drop);
|
||||||
|
@ -844,7 +844,7 @@ uip_process(uint8_t flag)
|
||||||
UIP_LOG("ip: invalid version or header length.");
|
UIP_LOG("ip: invalid version or header length.");
|
||||||
goto drop;
|
goto drop;
|
||||||
}
|
}
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
/* Check the size of the packet. If the size reported to us in
|
/* Check the size of the packet. If the size reported to us in
|
||||||
uip_len is smaller the size reported in the IP header, we assume
|
uip_len is smaller the size reported in the IP header, we assume
|
||||||
|
@ -855,7 +855,7 @@ uip_process(uint8_t flag)
|
||||||
|
|
||||||
if((BUF->len[0] << 8) + BUF->len[1] <= uip_len) {
|
if((BUF->len[0] << 8) + BUF->len[1] <= uip_len) {
|
||||||
uip_len = (BUF->len[0] << 8) + BUF->len[1];
|
uip_len = (BUF->len[0] << 8) + BUF->len[1];
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
uip_len += 40; /* The length reported in the IPv6 header is the
|
uip_len += 40; /* The length reported in the IPv6 header is the
|
||||||
length of the payload that follows the
|
length of the payload that follows the
|
||||||
header. However, uIP uses the uip_len variable
|
header. However, uIP uses the uip_len variable
|
||||||
|
@ -865,13 +865,13 @@ uip_process(uint8_t flag)
|
||||||
contains the length of the entire packet. But
|
contains the length of the entire packet. But
|
||||||
for IPv6 we need to add the size of the IPv6
|
for IPv6 we need to add the size of the IPv6
|
||||||
header (40 bytes). */
|
header (40 bytes). */
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
} else {
|
} else {
|
||||||
UIP_LOG("ip: packet shorter than reported in IP header.");
|
UIP_LOG("ip: packet shorter than reported in IP header.");
|
||||||
goto drop;
|
goto drop;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !UIP_CONF_IPV6
|
#if !NETSTACK_CONF_WITH_IPV6
|
||||||
/* Check the fragment flag. */
|
/* Check the fragment flag. */
|
||||||
if((BUF->ipoffset[0] & 0x3f) != 0 ||
|
if((BUF->ipoffset[0] & 0x3f) != 0 ||
|
||||||
BUF->ipoffset[1] != 0) {
|
BUF->ipoffset[1] != 0) {
|
||||||
|
@ -887,13 +887,13 @@ uip_process(uint8_t flag)
|
||||||
goto drop;
|
goto drop;
|
||||||
#endif /* UIP_REASSEMBLY */
|
#endif /* UIP_REASSEMBLY */
|
||||||
}
|
}
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
if(uip_ipaddr_cmp(&uip_hostaddr, &uip_all_zeroes_addr)) {
|
if(uip_ipaddr_cmp(&uip_hostaddr, &uip_all_zeroes_addr)) {
|
||||||
/* If we are configured to use ping IP address configuration and
|
/* If we are configured to use ping IP address configuration and
|
||||||
hasn't been assigned an IP address yet, we accept all ICMP
|
hasn't been assigned an IP address yet, we accept all ICMP
|
||||||
packets. */
|
packets. */
|
||||||
#if UIP_PINGADDRCONF && !UIP_CONF_IPV6
|
#if UIP_PINGADDRCONF && !NETSTACK_CONF_WITH_IPV6
|
||||||
if(BUF->proto == UIP_PROTO_ICMP) {
|
if(BUF->proto == UIP_PROTO_ICMP) {
|
||||||
UIP_LOG("ip: possible ping config packet received.");
|
UIP_LOG("ip: possible ping config packet received.");
|
||||||
goto icmp_input;
|
goto icmp_input;
|
||||||
|
@ -924,12 +924,12 @@ uip_process(uint8_t flag)
|
||||||
#endif /* UIP_BROADCAST */
|
#endif /* UIP_BROADCAST */
|
||||||
|
|
||||||
/* Check if the packet is destined for our IP address. */
|
/* Check if the packet is destined for our IP address. */
|
||||||
#if !UIP_CONF_IPV6
|
#if !NETSTACK_CONF_WITH_IPV6
|
||||||
if(!uip_ipaddr_cmp(&BUF->destipaddr, &uip_hostaddr)) {
|
if(!uip_ipaddr_cmp(&BUF->destipaddr, &uip_hostaddr)) {
|
||||||
UIP_STAT(++uip_stat.ip.drop);
|
UIP_STAT(++uip_stat.ip.drop);
|
||||||
goto drop;
|
goto drop;
|
||||||
}
|
}
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
/* For IPv6, packet reception is a little trickier as we need to
|
/* For IPv6, packet reception is a little trickier as we need to
|
||||||
make sure that we listen to certain multicast addresses (all
|
make sure that we listen to certain multicast addresses (all
|
||||||
hosts multicast address, and the solicited-node multicast
|
hosts multicast address, and the solicited-node multicast
|
||||||
|
@ -940,10 +940,10 @@ uip_process(uint8_t flag)
|
||||||
UIP_STAT(++uip_stat.ip.drop);
|
UIP_STAT(++uip_stat.ip.drop);
|
||||||
goto drop;
|
goto drop;
|
||||||
}
|
}
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !UIP_CONF_IPV6
|
#if !NETSTACK_CONF_WITH_IPV6
|
||||||
if(uip_ipchksum() != 0xffff) { /* Compute and check the IP header
|
if(uip_ipchksum() != 0xffff) { /* Compute and check the IP header
|
||||||
checksum. */
|
checksum. */
|
||||||
UIP_STAT(++uip_stat.ip.drop);
|
UIP_STAT(++uip_stat.ip.drop);
|
||||||
|
@ -951,7 +951,7 @@ uip_process(uint8_t flag)
|
||||||
UIP_LOG("ip: bad checksum.");
|
UIP_LOG("ip: bad checksum.");
|
||||||
goto drop;
|
goto drop;
|
||||||
}
|
}
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
#if UIP_TCP
|
#if UIP_TCP
|
||||||
if(BUF->proto == UIP_PROTO_TCP) { /* Check for TCP packet. If so,
|
if(BUF->proto == UIP_PROTO_TCP) { /* Check for TCP packet. If so,
|
||||||
|
@ -967,7 +967,7 @@ uip_process(uint8_t flag)
|
||||||
}
|
}
|
||||||
#endif /* UIP_UDP */
|
#endif /* UIP_UDP */
|
||||||
|
|
||||||
#if !UIP_CONF_IPV6
|
#if !NETSTACK_CONF_WITH_IPV6
|
||||||
/* ICMPv4 processing code follows. */
|
/* ICMPv4 processing code follows. */
|
||||||
if(BUF->proto != UIP_PROTO_ICMP) { /* We only allow ICMP packets from
|
if(BUF->proto != UIP_PROTO_ICMP) { /* We only allow ICMP packets from
|
||||||
here. */
|
here. */
|
||||||
|
@ -1018,7 +1018,7 @@ uip_process(uint8_t flag)
|
||||||
goto ip_send_nolen;
|
goto ip_send_nolen;
|
||||||
|
|
||||||
/* End of IPv4 input header processing code. */
|
/* End of IPv4 input header processing code. */
|
||||||
#else /* !UIP_CONF_IPV6 */
|
#else /* !NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
/* This is IPv6 ICMPv6 processing code. */
|
/* This is IPv6 ICMPv6 processing code. */
|
||||||
DEBUG_PRINTF("icmp6_input: length %d\n", uip_len);
|
DEBUG_PRINTF("icmp6_input: length %d\n", uip_len);
|
||||||
|
@ -1086,7 +1086,7 @@ uip_process(uint8_t flag)
|
||||||
|
|
||||||
/* End of IPv6 ICMP processing. */
|
/* End of IPv6 ICMP processing. */
|
||||||
|
|
||||||
#endif /* !UIP_CONF_IPV6 */
|
#endif /* !NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
#if UIP_UDP
|
#if UIP_UDP
|
||||||
/* UDP input processing. */
|
/* UDP input processing. */
|
||||||
|
@ -1137,7 +1137,7 @@ uip_process(uint8_t flag)
|
||||||
}
|
}
|
||||||
UIP_LOG("udp: no matching connection found");
|
UIP_LOG("udp: no matching connection found");
|
||||||
UIP_STAT(++uip_stat.udp.drop);
|
UIP_STAT(++uip_stat.udp.drop);
|
||||||
#if UIP_CONF_ICMP_DEST_UNREACH && !UIP_CONF_IPV6
|
#if UIP_CONF_ICMP_DEST_UNREACH && !NETSTACK_CONF_WITH_IPV6
|
||||||
/* Copy fields from packet header into payload of this ICMP packet. */
|
/* Copy fields from packet header into payload of this ICMP packet. */
|
||||||
memcpy(&(ICMPBUF->payload[0]), ICMPBUF, UIP_IPH_LEN + 8);
|
memcpy(&(ICMPBUF->payload[0]), ICMPBUF, UIP_IPH_LEN + 8);
|
||||||
|
|
||||||
|
@ -1183,15 +1183,15 @@ uip_process(uint8_t flag)
|
||||||
}
|
}
|
||||||
uip_len = uip_slen + UIP_IPUDPH_LEN;
|
uip_len = uip_slen + UIP_IPUDPH_LEN;
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
/* For IPv6, the IP length field does not include the IPv6 IP header
|
/* For IPv6, the IP length field does not include the IPv6 IP header
|
||||||
length. */
|
length. */
|
||||||
BUF->len[0] = ((uip_len - UIP_IPH_LEN) >> 8);
|
BUF->len[0] = ((uip_len - UIP_IPH_LEN) >> 8);
|
||||||
BUF->len[1] = ((uip_len - UIP_IPH_LEN) & 0xff);
|
BUF->len[1] = ((uip_len - UIP_IPH_LEN) & 0xff);
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
BUF->len[0] = (uip_len >> 8);
|
BUF->len[0] = (uip_len >> 8);
|
||||||
BUF->len[1] = (uip_len & 0xff);
|
BUF->len[1] = (uip_len & 0xff);
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
BUF->ttl = uip_udp_conn->ttl;
|
BUF->ttl = uip_udp_conn->ttl;
|
||||||
BUF->proto = UIP_PROTO_UDP;
|
BUF->proto = UIP_PROTO_UDP;
|
||||||
|
@ -1894,15 +1894,15 @@ uip_process(uint8_t flag)
|
||||||
|
|
||||||
tcp_send_noconn:
|
tcp_send_noconn:
|
||||||
BUF->ttl = UIP_TTL;
|
BUF->ttl = UIP_TTL;
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
/* For IPv6, the IP length field does not include the IPv6 IP header
|
/* For IPv6, the IP length field does not include the IPv6 IP header
|
||||||
length. */
|
length. */
|
||||||
BUF->len[0] = ((uip_len - UIP_IPH_LEN) >> 8);
|
BUF->len[0] = ((uip_len - UIP_IPH_LEN) >> 8);
|
||||||
BUF->len[1] = ((uip_len - UIP_IPH_LEN) & 0xff);
|
BUF->len[1] = ((uip_len - UIP_IPH_LEN) & 0xff);
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
BUF->len[0] = (uip_len >> 8);
|
BUF->len[0] = (uip_len >> 8);
|
||||||
BUF->len[1] = (uip_len & 0xff);
|
BUF->len[1] = (uip_len & 0xff);
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
BUF->urgp[0] = BUF->urgp[1] = 0;
|
BUF->urgp[0] = BUF->urgp[1] = 0;
|
||||||
|
|
||||||
|
@ -1912,11 +1912,11 @@ uip_process(uint8_t flag)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ip_send_nolen:
|
ip_send_nolen:
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
BUF->vtc = 0x60;
|
BUF->vtc = 0x60;
|
||||||
BUF->tcflow = 0x00;
|
BUF->tcflow = 0x00;
|
||||||
BUF->flow = 0x00;
|
BUF->flow = 0x00;
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
BUF->vhl = 0x45;
|
BUF->vhl = 0x45;
|
||||||
BUF->tos = 0;
|
BUF->tos = 0;
|
||||||
BUF->ipoffset[0] = BUF->ipoffset[1] = 0;
|
BUF->ipoffset[0] = BUF->ipoffset[1] = 0;
|
||||||
|
@ -1927,11 +1927,11 @@ uip_process(uint8_t flag)
|
||||||
BUF->ipchksum = 0;
|
BUF->ipchksum = 0;
|
||||||
BUF->ipchksum = ~(uip_ipchksum());
|
BUF->ipchksum = ~(uip_ipchksum());
|
||||||
DEBUG_PRINTF("uip ip_send_nolen: chkecum 0x%04x\n", uip_ipchksum());
|
DEBUG_PRINTF("uip ip_send_nolen: chkecum 0x%04x\n", uip_ipchksum());
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
UIP_STAT(++uip_stat.tcp.sent);
|
UIP_STAT(++uip_stat.tcp.sent);
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
send:
|
send:
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
DEBUG_PRINTF("Sending packet with length %d (%d)\n", uip_len,
|
DEBUG_PRINTF("Sending packet with length %d (%d)\n", uip_len,
|
||||||
(BUF->len[0] << 8) | BUF->len[1]);
|
(BUF->len[0] << 8) | BUF->len[1]);
|
||||||
|
|
||||||
|
@ -1973,6 +1973,6 @@ uip_send(const void *data, int len)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
/** @}*/
|
/** @}*/
|
||||||
|
|
|
@ -530,7 +530,7 @@ send_packet(mac_callback_t mac_callback, void *mac_callback_ptr,
|
||||||
return MAC_TX_COLLISION;
|
return MAC_TX_COLLISION;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
PRINTDEBUG("contikimac: send unicast to %02x%02x:%02x%02x:%02x%02x:%02x%02x\n",
|
PRINTDEBUG("contikimac: send unicast to %02x%02x:%02x%02x:%02x%02x:%02x%02x\n",
|
||||||
packetbuf_addr(PACKETBUF_ADDR_RECEIVER)->u8[0],
|
packetbuf_addr(PACKETBUF_ADDR_RECEIVER)->u8[0],
|
||||||
packetbuf_addr(PACKETBUF_ADDR_RECEIVER)->u8[1],
|
packetbuf_addr(PACKETBUF_ADDR_RECEIVER)->u8[1],
|
||||||
|
@ -540,11 +540,11 @@ send_packet(mac_callback_t mac_callback, void *mac_callback_ptr,
|
||||||
packetbuf_addr(PACKETBUF_ADDR_RECEIVER)->u8[5],
|
packetbuf_addr(PACKETBUF_ADDR_RECEIVER)->u8[5],
|
||||||
packetbuf_addr(PACKETBUF_ADDR_RECEIVER)->u8[6],
|
packetbuf_addr(PACKETBUF_ADDR_RECEIVER)->u8[6],
|
||||||
packetbuf_addr(PACKETBUF_ADDR_RECEIVER)->u8[7]);
|
packetbuf_addr(PACKETBUF_ADDR_RECEIVER)->u8[7]);
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
PRINTDEBUG("contikimac: send unicast to %u.%u\n",
|
PRINTDEBUG("contikimac: send unicast to %u.%u\n",
|
||||||
packetbuf_addr(PACKETBUF_ADDR_RECEIVER)->u8[0],
|
packetbuf_addr(PACKETBUF_ADDR_RECEIVER)->u8[0],
|
||||||
packetbuf_addr(PACKETBUF_ADDR_RECEIVER)->u8[1]);
|
packetbuf_addr(PACKETBUF_ADDR_RECEIVER)->u8[1]);
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
}
|
}
|
||||||
is_reliable = packetbuf_attr(PACKETBUF_ATTR_RELIABLE) ||
|
is_reliable = packetbuf_attr(PACKETBUF_ATTR_RELIABLE) ||
|
||||||
packetbuf_attr(PACKETBUF_ATTR_ERELIABLE);
|
packetbuf_attr(PACKETBUF_ATTR_ERELIABLE);
|
||||||
|
|
|
@ -437,7 +437,7 @@ send_packet(void)
|
||||||
is_broadcast = 1;
|
is_broadcast = 1;
|
||||||
PRINTDEBUG("cxmac: send broadcast\n");
|
PRINTDEBUG("cxmac: send broadcast\n");
|
||||||
} else {
|
} else {
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
PRINTDEBUG("cxmac: send unicast to %02x%02x:%02x%02x:%02x%02x:%02x%02x\n",
|
PRINTDEBUG("cxmac: send unicast to %02x%02x:%02x%02x:%02x%02x:%02x%02x\n",
|
||||||
packetbuf_addr(PACKETBUF_ADDR_RECEIVER)->u8[0],
|
packetbuf_addr(PACKETBUF_ADDR_RECEIVER)->u8[0],
|
||||||
packetbuf_addr(PACKETBUF_ADDR_RECEIVER)->u8[1],
|
packetbuf_addr(PACKETBUF_ADDR_RECEIVER)->u8[1],
|
||||||
|
@ -451,7 +451,7 @@ send_packet(void)
|
||||||
PRINTDEBUG("cxmac: send unicast to %u.%u\n",
|
PRINTDEBUG("cxmac: send unicast to %u.%u\n",
|
||||||
packetbuf_addr(PACKETBUF_ADDR_RECEIVER)->u8[0],
|
packetbuf_addr(PACKETBUF_ADDR_RECEIVER)->u8[0],
|
||||||
packetbuf_addr(PACKETBUF_ADDR_RECEIVER)->u8[1]);
|
packetbuf_addr(PACKETBUF_ADDR_RECEIVER)->u8[1]);
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
}
|
}
|
||||||
/* is_reliable = packetbuf_attr(PACKETBUF_ATTR_RELIABLE) ||
|
/* is_reliable = packetbuf_attr(PACKETBUF_ATTR_RELIABLE) ||
|
||||||
packetbuf_attr(PACKETBUF_ATTR_ERELIABLE);*/
|
packetbuf_attr(PACKETBUF_ATTR_ERELIABLE);*/
|
||||||
|
|
|
@ -59,12 +59,12 @@ pollhandler(void)
|
||||||
uip_len = ethernet_poll();
|
uip_len = ethernet_poll();
|
||||||
|
|
||||||
if(uip_len > 0) {
|
if(uip_len > 0) {
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
if(BUF->type == uip_htons(UIP_ETHTYPE_IPV6)) {
|
if(BUF->type == uip_htons(UIP_ETHTYPE_IPV6)) {
|
||||||
uip_neighbor_add(&IPBUF->srcipaddr, &BUF->src);
|
uip_neighbor_add(&IPBUF->srcipaddr, &BUF->src);
|
||||||
tcpip_input();
|
tcpip_input();
|
||||||
} else
|
} else
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
if(BUF->type == uip_htons(UIP_ETHTYPE_IP)) {
|
if(BUF->type == uip_htons(UIP_ETHTYPE_IP)) {
|
||||||
uip_len -= sizeof(struct uip_eth_hdr);
|
uip_len -= sizeof(struct uip_eth_hdr);
|
||||||
tcpip_input();
|
tcpip_input();
|
||||||
|
|
|
@ -117,12 +117,12 @@ PROCESS_THREAD(usb_eth_process, ev , data)
|
||||||
uip_len = sizeof(recv_data) - recv_buffer.left;
|
uip_len = sizeof(recv_data) - recv_buffer.left;
|
||||||
/* printf("Received: %d bytes\n", uip_len); */
|
/* printf("Received: %d bytes\n", uip_len); */
|
||||||
memcpy(uip_buf, recv_data, uip_len);
|
memcpy(uip_buf, recv_data, uip_len);
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
if(BUF->type == uip_htons(UIP_ETHTYPE_IPV6)) {
|
if(BUF->type == uip_htons(UIP_ETHTYPE_IPV6)) {
|
||||||
uip_neighbor_add(&IPBUF->srcipaddr, &BUF->src);
|
uip_neighbor_add(&IPBUF->srcipaddr, &BUF->src);
|
||||||
tcpip_input();
|
tcpip_input();
|
||||||
} else
|
} else
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
if(BUF->type == uip_htons(UIP_ETHTYPE_IP)) {
|
if(BUF->type == uip_htons(UIP_ETHTYPE_IP)) {
|
||||||
uip_len -= sizeof(struct uip_eth_hdr);
|
uip_len -= sizeof(struct uip_eth_hdr);
|
||||||
tcpip_input();
|
tcpip_input();
|
||||||
|
|
|
@ -57,7 +57,7 @@ slip_arch_writeb(unsigned char c)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
#if UIP_CONF_IPV4
|
#if NETSTACK_CONF_WITH_IPV4
|
||||||
int
|
int
|
||||||
putchar(int c)
|
putchar(int c)
|
||||||
{
|
{
|
||||||
|
@ -83,7 +83,7 @@ putchar(int c)
|
||||||
|
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
#endif /* UIP_CONF_IPV4 */
|
#endif /* NETSTACK_CONF_WITH_IPV4 */
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
/**
|
/**
|
||||||
* Initalize the RS232 port and the SLIP driver.
|
* Initalize the RS232 port and the SLIP driver.
|
||||||
|
|
|
@ -100,8 +100,8 @@ uart0_writeb(unsigned char c)
|
||||||
#endif /* TX_WITH_INTERRUPT */
|
#endif /* TX_WITH_INTERRUPT */
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
#if ! UIP_CONF_IPV4 /* If UIP_CONF_IPV4 is defined, putchar() is defined by the SLIP driver */
|
#if ! NETSTACK_CONF_WITH_IPV4 /* If NETSTACK_CONF_WITH_IPV4 is defined, putchar() is defined by the SLIP driver */
|
||||||
#endif /* ! UIP_CONF_IPV4 */
|
#endif /* ! NETSTACK_CONF_WITH_IPV4 */
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
/**
|
/**
|
||||||
* Initalize the RS232 port.
|
* Initalize the RS232 port.
|
||||||
|
|
|
@ -97,8 +97,8 @@ uart1_writeb(unsigned char c)
|
||||||
#endif /* TX_WITH_INTERRUPT */
|
#endif /* TX_WITH_INTERRUPT */
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
#if ! UIP_CONF_IPV4 /* If UIP_CONF_IPV4 is defined, putchar() is defined by the SLIP driver */
|
#if ! NETSTACK_CONF_WITH_IPV4 /* If NETSTACK_CONF_WITH_IPV4 is defined, putchar() is defined by the SLIP driver */
|
||||||
#endif /* ! UIP_CONF_IPV4 */
|
#endif /* ! NETSTACK_CONF_WITH_IPV4 */
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
/**
|
/**
|
||||||
* Initalize the RS232 port.
|
* Initalize the RS232 port.
|
||||||
|
|
|
@ -49,7 +49,7 @@ slip_arch_writeb(unsigned char c)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
#if UIP_CONF_IPV4
|
#if NETSTACK_CONF_WITH_IPV4
|
||||||
int
|
int
|
||||||
putchar(int c)
|
putchar(int c)
|
||||||
{
|
{
|
||||||
|
@ -75,7 +75,7 @@ putchar(int c)
|
||||||
|
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
#endif /* UIP_CONF_IPV4 */
|
#endif /* NETSTACK_CONF_WITH_IPV4 */
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
/**
|
/**
|
||||||
* Initalize the RS232 port and the SLIP driver.
|
* Initalize the RS232 port and the SLIP driver.
|
||||||
|
|
|
@ -49,7 +49,7 @@ slip_arch_writeb(unsigned char c)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
#if UIP_CONF_IPV4
|
#if NETSTACK_CONF_WITH_IPV4
|
||||||
int
|
int
|
||||||
putchar(int c)
|
putchar(int c)
|
||||||
{
|
{
|
||||||
|
@ -75,7 +75,7 @@ putchar(int c)
|
||||||
|
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
#endif /* UIP_CONF_IPV4 */
|
#endif /* NETSTACK_CONF_WITH_IPV4 */
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
/**
|
/**
|
||||||
* Initalize the RS232 port and the SLIP driver.
|
* Initalize the RS232 port and the SLIP driver.
|
||||||
|
|
|
@ -34,11 +34,11 @@
|
||||||
#include "net/ip/uip.h"
|
#include "net/ip/uip.h"
|
||||||
#include "net/ip/uipopt.h"
|
#include "net/ip/uipopt.h"
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
#include "tapdev6.h"
|
#include "tapdev6.h"
|
||||||
#else
|
#else
|
||||||
#include "tapdev.h"
|
#include "tapdev.h"
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
#include "tapdev-drv.h"
|
#include "tapdev-drv.h"
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@
|
||||||
PROCESS(tapdev_process, "TAP driver");
|
PROCESS(tapdev_process, "TAP driver");
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
#if !UIP_CONF_IPV6
|
#if !NETSTACK_CONF_WITH_IPV6
|
||||||
uint8_t
|
uint8_t
|
||||||
tapdev_output(void)
|
tapdev_output(void)
|
||||||
{
|
{
|
||||||
|
@ -64,16 +64,16 @@ pollhandler(void)
|
||||||
uip_len = tapdev_poll();
|
uip_len = tapdev_poll();
|
||||||
|
|
||||||
if(uip_len > 0) {
|
if(uip_len > 0) {
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
if(BUF->type == uip_htons(UIP_ETHTYPE_IPV6)) {
|
if(BUF->type == uip_htons(UIP_ETHTYPE_IPV6)) {
|
||||||
tcpip_input();
|
tcpip_input();
|
||||||
} else
|
} else
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
if(BUF->type == uip_htons(UIP_ETHTYPE_IP)) {
|
if(BUF->type == uip_htons(UIP_ETHTYPE_IP)) {
|
||||||
uip_len -= sizeof(struct uip_eth_hdr);
|
uip_len -= sizeof(struct uip_eth_hdr);
|
||||||
tcpip_input();
|
tcpip_input();
|
||||||
} else if(BUF->type == uip_htons(UIP_ETHTYPE_ARP)) {
|
} else if(BUF->type == uip_htons(UIP_ETHTYPE_ARP)) {
|
||||||
#if !UIP_CONF_IPV6 //math
|
#if !NETSTACK_CONF_WITH_IPV6 //math
|
||||||
uip_arp_arpin();
|
uip_arp_arpin();
|
||||||
/* If the above function invocation resulted in data that
|
/* If the above function invocation resulted in data that
|
||||||
should be sent out on the network, the global variable
|
should be sent out on the network, the global variable
|
||||||
|
@ -95,7 +95,7 @@ PROCESS_THREAD(tapdev_process, ev, data)
|
||||||
PROCESS_BEGIN();
|
PROCESS_BEGIN();
|
||||||
|
|
||||||
tapdev_init();
|
tapdev_init();
|
||||||
#if !UIP_CONF_IPV6
|
#if !NETSTACK_CONF_WITH_IPV6
|
||||||
tcpip_set_outputfunc(tapdev_output);
|
tcpip_set_outputfunc(tapdev_output);
|
||||||
#else
|
#else
|
||||||
tcpip_set_outputfunc(tapdev_send);
|
tcpip_set_outputfunc(tapdev_send);
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
#include "net/ip/uip.h"
|
#include "net/ip/uip.h"
|
||||||
#include "net/ip/uipopt.h"
|
#include "net/ip/uipopt.h"
|
||||||
|
|
||||||
#if !UIP_CONF_IPV6
|
#if !NETSTACK_CONF_WITH_IPV6
|
||||||
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -204,4 +204,4 @@ tapdev_exit(void)
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#endif /* !UIP_CONF_IPV6 */
|
#endif /* !NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
#include "net/ip/uip.h"
|
#include "net/ip/uip.h"
|
||||||
#include "net/ip/uipopt.h"
|
#include "net/ip/uipopt.h"
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -419,4 +419,4 @@ tapdev_exit(void)
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
|
@ -64,7 +64,7 @@
|
||||||
PROCESS(wpcap_process, "WinPcap driver");
|
PROCESS(wpcap_process, "WinPcap driver");
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
#if !UIP_CONF_IPV6
|
#if !NETSTACK_CONF_WITH_IPV6
|
||||||
uint8_t
|
uint8_t
|
||||||
wpcap_output(void)
|
wpcap_output(void)
|
||||||
{
|
{
|
||||||
|
@ -73,7 +73,7 @@ wpcap_output(void)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif /* !UIP_CONF_IPV6 */
|
#endif /* !NETSTACK_CONF_WITH_IPV6 */
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
static void
|
static void
|
||||||
pollhandler(void)
|
pollhandler(void)
|
||||||
|
@ -83,16 +83,16 @@ pollhandler(void)
|
||||||
uip_len = wpcap_poll();
|
uip_len = wpcap_poll();
|
||||||
|
|
||||||
if(uip_len > 0) {
|
if(uip_len > 0) {
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
if(BUF->type == uip_htons(UIP_ETHTYPE_IPV6)) {
|
if(BUF->type == uip_htons(UIP_ETHTYPE_IPV6)) {
|
||||||
// printf("wpcap poll calls tcpip");
|
// printf("wpcap poll calls tcpip");
|
||||||
tcpip_input();
|
tcpip_input();
|
||||||
} else
|
} else
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
if(BUF->type == uip_htons(UIP_ETHTYPE_IP)) {
|
if(BUF->type == uip_htons(UIP_ETHTYPE_IP)) {
|
||||||
uip_len -= sizeof(struct uip_eth_hdr);
|
uip_len -= sizeof(struct uip_eth_hdr);
|
||||||
tcpip_input();
|
tcpip_input();
|
||||||
#if !UIP_CONF_IPV6
|
#if !NETSTACK_CONF_WITH_IPV6
|
||||||
} else if(BUF->type == uip_htons(UIP_ETHTYPE_ARP)) {
|
} else if(BUF->type == uip_htons(UIP_ETHTYPE_ARP)) {
|
||||||
uip_arp_arpin(); //math
|
uip_arp_arpin(); //math
|
||||||
/* If the above function invocation resulted in data that
|
/* If the above function invocation resulted in data that
|
||||||
|
@ -101,7 +101,7 @@ pollhandler(void)
|
||||||
if(uip_len > 0) {
|
if(uip_len > 0) {
|
||||||
wpcap_send();
|
wpcap_send();
|
||||||
}
|
}
|
||||||
#endif /* !UIP_CONF_IPV6 */
|
#endif /* !NETSTACK_CONF_WITH_IPV6 */
|
||||||
} else {
|
} else {
|
||||||
uip_len = 0;
|
uip_len = 0;
|
||||||
}
|
}
|
||||||
|
@ -125,16 +125,16 @@ pollhandler(void)
|
||||||
tcpip_input();
|
tcpip_input();
|
||||||
} else
|
} else
|
||||||
goto bail;
|
goto bail;
|
||||||
#elif UIP_CONF_IPV6
|
#elif NETSTACK_CONF_WITH_IPV6
|
||||||
if(BUF->type == uip_htons(UIP_ETHTYPE_IPV6)) {
|
if(BUF->type == uip_htons(UIP_ETHTYPE_IPV6)) {
|
||||||
tcpip_input();
|
tcpip_input();
|
||||||
} else
|
} else
|
||||||
goto bail;
|
goto bail;
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
if(BUF->type == uip_htons(UIP_ETHTYPE_IP)) {
|
if(BUF->type == uip_htons(UIP_ETHTYPE_IP)) {
|
||||||
uip_len -= sizeof(struct uip_eth_hdr);
|
uip_len -= sizeof(struct uip_eth_hdr);
|
||||||
tcpip_input();
|
tcpip_input();
|
||||||
#if !UIP_CONF_IPV6
|
#if !NETSTACK_CONF_WITH_IPV6
|
||||||
} else if(BUF->type == uip_htons(UIP_ETHTYPE_ARP)) {
|
} else if(BUF->type == uip_htons(UIP_ETHTYPE_ARP)) {
|
||||||
uip_arp_arpin(); //math
|
uip_arp_arpin(); //math
|
||||||
/* If the above function invocation resulted in data that
|
/* If the above function invocation resulted in data that
|
||||||
|
@ -143,7 +143,7 @@ pollhandler(void)
|
||||||
if(uip_len > 0) {
|
if(uip_len > 0) {
|
||||||
wfall_send();
|
wfall_send();
|
||||||
}
|
}
|
||||||
#endif /* !UIP_CONF_IPV6 */
|
#endif /* !NETSTACK_CONF_WITH_IPV6 */
|
||||||
} else {
|
} else {
|
||||||
bail:
|
bail:
|
||||||
uip_len = 0;
|
uip_len = 0;
|
||||||
|
@ -161,13 +161,13 @@ PROCESS_THREAD(wpcap_process, ev, data)
|
||||||
|
|
||||||
wpcap_init();
|
wpcap_init();
|
||||||
|
|
||||||
#if !UIP_CONF_IPV6
|
#if !NETSTACK_CONF_WITH_IPV6
|
||||||
tcpip_set_outputfunc(wpcap_output);
|
tcpip_set_outputfunc(wpcap_output);
|
||||||
#else
|
#else
|
||||||
#if !FALLBACK_HAS_ETHERNET_HEADERS
|
#if !FALLBACK_HAS_ETHERNET_HEADERS
|
||||||
tcpip_set_outputfunc(wpcap_send);
|
tcpip_set_outputfunc(wpcap_send);
|
||||||
#endif
|
#endif
|
||||||
#endif /* !UIP_CONF_IPV6 */
|
#endif /* !NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
process_poll(&wpcap_process);
|
process_poll(&wpcap_process);
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,7 @@
|
||||||
#define FALLBACK_HAS_ETHERNET_HEADERS 1
|
#define FALLBACK_HAS_ETHERNET_HEADERS 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
#include <ws2tcpip.h>
|
#include <ws2tcpip.h>
|
||||||
struct in6_addr addr6;
|
struct in6_addr addr6;
|
||||||
char addr6str[64];
|
char addr6str[64];
|
||||||
|
@ -122,7 +122,7 @@ sprint_ip6addr(struct in6_addr addr, char * result)
|
||||||
return (result - starting);
|
return (result - starting);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
|
|
||||||
#ifdef __CYGWIN__
|
#ifdef __CYGWIN__
|
||||||
|
@ -158,7 +158,7 @@ static struct pcap *pcap;
|
||||||
/* uip_lladdr is defined in uip.c. It is not used in uip6.c.
|
/* uip_lladdr is defined in uip.c. It is not used in uip6.c.
|
||||||
* If needed for some purpose it can be defined here
|
* If needed for some purpose it can be defined here
|
||||||
*/
|
*/
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
//struct uip_eth_addr uip_lladdr;
|
//struct uip_eth_addr uip_lladdr;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -174,7 +174,7 @@ static int (* pcap_sendpacket)(struct pcap *, unsigned char *, int);
|
||||||
#ifdef UIP_FALLBACK_INTERFACE
|
#ifdef UIP_FALLBACK_INTERFACE
|
||||||
static struct pcap *pfall;
|
static struct pcap *pfall;
|
||||||
struct in_addr addrfall;
|
struct in_addr addrfall;
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
struct in_addr6 addrfall6;
|
struct in_addr6 addrfall6;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -265,7 +265,7 @@ set_ethaddr(struct in_addr addr)
|
||||||
adapters->PhysicalAddress[2], adapters->PhysicalAddress[3],
|
adapters->PhysicalAddress[2], adapters->PhysicalAddress[3],
|
||||||
adapters->PhysicalAddress[4], adapters->PhysicalAddress[5]);
|
adapters->PhysicalAddress[4], adapters->PhysicalAddress[5]);
|
||||||
log_message("set_ethaddr: ethernetaddr: ", buffer);
|
log_message("set_ethaddr: ethernetaddr: ", buffer);
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
// int i;for (i=0;i<6;i++) uip_lladdr.addr[i] = adapters->PhysicalAddress[i];
|
// int i;for (i=0;i<6;i++) uip_lladdr.addr[i] = adapters->PhysicalAddress[i];
|
||||||
#else
|
#else
|
||||||
uip_setethaddr((*(struct uip_eth_addr *)adapters->PhysicalAddress));
|
uip_setethaddr((*(struct uip_eth_addr *)adapters->PhysicalAddress));
|
||||||
|
@ -281,7 +281,7 @@ set_ethaddr(struct in_addr addr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
static void
|
static void
|
||||||
set_ethaddr6(struct in_addr6 addr)
|
set_ethaddr6(struct in_addr6 addr)
|
||||||
|
@ -327,7 +327,7 @@ set_ethaddr6(struct in_addr6 addr)
|
||||||
adapters->PhysicalAddress[2], adapters->PhysicalAddress[3],
|
adapters->PhysicalAddress[2], adapters->PhysicalAddress[3],
|
||||||
adapters->PhysicalAddress[4], adapters->PhysicalAddress[5]);
|
adapters->PhysicalAddress[4], adapters->PhysicalAddress[5]);
|
||||||
log_message("set_ethaddr: ethernetaddr: ", buffer);
|
log_message("set_ethaddr: ethernetaddr: ", buffer);
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
// int i;for (i=0;i<6;i++) uip_lladdr.addr[i] = adapters->PhysicalAddress[i]; //does this need doing?
|
// int i;for (i=0;i<6;i++) uip_lladdr.addr[i] = adapters->PhysicalAddress[i]; //does this need doing?
|
||||||
#else
|
#else
|
||||||
uip_setethaddr((*(struct uip_eth_addr *)adapters->PhysicalAddress));
|
uip_setethaddr((*(struct uip_eth_addr *)adapters->PhysicalAddress));
|
||||||
|
@ -396,7 +396,7 @@ init_pcap(struct in_addr addr)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
|
|
||||||
} else if(paddr->addr != NULL && paddr->addr->sa_family == AF_INET6) {
|
} else if(paddr->addr != NULL && paddr->addr->sa_family == AF_INET6) {
|
||||||
struct in6_addr interface_addr;
|
struct in6_addr interface_addr;
|
||||||
|
@ -431,7 +431,7 @@ init_pcap(struct in_addr addr)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -457,13 +457,13 @@ wpcap_init(void)
|
||||||
#ifdef __CYGWIN__
|
#ifdef __CYGWIN__
|
||||||
if ((*__argv)[1]) {
|
if ((*__argv)[1]) {
|
||||||
addr.s_addr = inet_addr((*__argv)[1]);
|
addr.s_addr = inet_addr((*__argv)[1]);
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
uiplib_ipaddrconv((*__argv)[1],(uip_ipaddr_t*) &addr6.s6_addr);
|
uiplib_ipaddrconv((*__argv)[1],(uip_ipaddr_t*) &addr6.s6_addr);
|
||||||
#endif
|
#endif
|
||||||
#ifdef UIP_FALLBACK_INTERFACE
|
#ifdef UIP_FALLBACK_INTERFACE
|
||||||
if ((*__argv)[2]) {
|
if ((*__argv)[2]) {
|
||||||
addrfall.s_addr = inet_addr((*__argv)[2]);
|
addrfall.s_addr = inet_addr((*__argv)[2]);
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
uiplib_ipaddrconv((*__argv)[2],(uip_ipaddr_t*) &addrfall6.s6_addr);
|
uiplib_ipaddrconv((*__argv)[2],(uip_ipaddr_t*) &addrfall6.s6_addr);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -473,13 +473,13 @@ wpcap_init(void)
|
||||||
#else /* __CYGWIN__ */
|
#else /* __CYGWIN__ */
|
||||||
/* VC++ build on win32 platform. Currently the platform has no ipv6 support */
|
/* VC++ build on win32 platform. Currently the platform has no ipv6 support */
|
||||||
addr.s_addr = inet_addr(__argv[1]);
|
addr.s_addr = inet_addr(__argv[1]);
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
if((__argv)[1])
|
if((__argv)[1])
|
||||||
uiplib_ipaddrconv((__argv)[1],(uip_ipaddr_t*) &addr6.s6_addr);
|
uiplib_ipaddrconv((__argv)[1],(uip_ipaddr_t*) &addr6.s6_addr);
|
||||||
#endif
|
#endif
|
||||||
#ifdef UIP_FALLBACK_INTERFACE
|
#ifdef UIP_FALLBACK_INTERFACE
|
||||||
addrfall.s_addr = inet_addr(__argv[2]);
|
addrfall.s_addr = inet_addr(__argv[2]);
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
if((__argv)[2])
|
if((__argv)[2])
|
||||||
uiplib_ipaddrconv((__argv)[2],(uip_ipaddr_t*) &addrfall6.s6_addr);
|
uiplib_ipaddrconv((__argv)[2],(uip_ipaddr_t*) &addrfall6.s6_addr);
|
||||||
#endif
|
#endif
|
||||||
|
@ -498,7 +498,7 @@ wpcap_init(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Use build defaults if not enough addresses passed */
|
/* Use build defaults if not enough addresses passed */
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
|
|
||||||
#ifdef UIP_FALLBACK_INTERFACE
|
#ifdef UIP_FALLBACK_INTERFACE
|
||||||
if(addrfall.s_addr == INADDR_NONE) {
|
if(addrfall.s_addr == INADDR_NONE) {
|
||||||
|
@ -561,7 +561,7 @@ wpcap_init(void)
|
||||||
#endif
|
#endif
|
||||||
log_message("usage: <program> <ip addr of ethernet card to share>\n-->I'll try guessing ", inet_ntoa(addr));
|
log_message("usage: <program> <ip addr of ethernet card to share>\n-->I'll try guessing ", inet_ntoa(addr));
|
||||||
}
|
}
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
log_message("wpcap_init:Using ipv4 ", inet_ntoa(addr));
|
log_message("wpcap_init:Using ipv4 ", inet_ntoa(addr));
|
||||||
|
@ -610,7 +610,7 @@ wpcap_poll(void)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
/* Since pcap_setdirection(PCAP_D_IN) is not implemented in winpcap all outgoing packets
|
/* Since pcap_setdirection(PCAP_D_IN) is not implemented in winpcap all outgoing packets
|
||||||
* will be echoed back. The stack will ignore any packets not addressed to it, but initial
|
* will be echoed back. The stack will ignore any packets not addressed to it, but initial
|
||||||
* ipv6 neighbor solicitations are addressed to everyone and the echoed NS sent on startup
|
* ipv6 neighbor solicitations are addressed to everyone and the echoed NS sent on startup
|
||||||
|
@ -649,7 +649,7 @@ wpcap_poll(void)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
if(packet_header->caplen > UIP_BUFSIZE) {
|
if(packet_header->caplen > UIP_BUFSIZE) {
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -673,7 +673,7 @@ wfall_poll(void)
|
||||||
case 0:
|
case 0:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
#if FALLBACK_HAS_ETHERNET_HEADERS
|
#if FALLBACK_HAS_ETHERNET_HEADERS
|
||||||
#define ETHERNET_LLADDR_LEN 6
|
#define ETHERNET_LLADDR_LEN 6
|
||||||
#else
|
#else
|
||||||
|
@ -692,7 +692,7 @@ wfall_poll(void)
|
||||||
PRINTF("Discarding echoed packet\n");
|
PRINTF("Discarding echoed packet\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
if(packet_header->caplen > UIP_BUFSIZE) {
|
if(packet_header->caplen > UIP_BUFSIZE) {
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -706,7 +706,7 @@ wfall_poll(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
uint8_t
|
uint8_t
|
||||||
wpcap_send(const uip_lladdr_t *lladdr)
|
wpcap_send(const uip_lladdr_t *lladdr)
|
||||||
{
|
{
|
||||||
|
@ -777,7 +777,7 @@ wfall_send(const uip_lladdr_t *lladdr)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
void
|
void
|
||||||
wpcap_send(void)
|
wpcap_send(void)
|
||||||
{
|
{
|
||||||
|
@ -792,7 +792,7 @@ wpcap_send(void)
|
||||||
error_exit("error on send\n");
|
error_exit("error on send\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
void
|
void
|
||||||
wpcap_exit(void)
|
wpcap_exit(void)
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
void wpcap_init(void);
|
void wpcap_init(void);
|
||||||
uint16_t wpcap_poll(void);
|
uint16_t wpcap_poll(void);
|
||||||
uint16_t wfall_poll(void);
|
uint16_t wfall_poll(void);
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
uint8_t wpcap_send(const uip_lladdr_t *lladdr);
|
uint8_t wpcap_send(const uip_lladdr_t *lladdr);
|
||||||
uint8_t wfall_send(const uip_lladdr_t *lladdr);
|
uint8_t wfall_send(const uip_lladdr_t *lladdr);
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -120,9 +120,9 @@ uart1_writeb(unsigned char c)
|
||||||
#endif /* TX_WITH_INTERRUPT */
|
#endif /* TX_WITH_INTERRUPT */
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
#if ! UIP_CONF_IPV4
|
#if ! NETSTACK_CONF_WITH_IPV4
|
||||||
/* If UIP_CONF_IPV4 is defined, putchar() is defined by the SLIP driver */
|
/* If NETSTACK_CONF_WITH_IPV4 is defined, putchar() is defined by the SLIP driver */
|
||||||
#endif /* ! UIP_CONF_IPV4 */
|
#endif /* ! NETSTACK_CONF_WITH_IPV4 */
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
/*
|
/*
|
||||||
* Initalize the RS232 port.
|
* Initalize the RS232 port.
|
||||||
|
|
|
@ -47,9 +47,9 @@
|
||||||
#include "contiki-net.h"
|
#include "contiki-net.h"
|
||||||
#include "net/ipv6/multicast/uip-mcast6.h"
|
#include "net/ipv6/multicast/uip-mcast6.h"
|
||||||
|
|
||||||
#if !UIP_CONF_IPV6 || !UIP_CONF_ROUTER || !UIP_CONF_IPV6_MULTICAST || !UIP_CONF_IPV6_RPL
|
#if !NETSTACK_CONF_WITH_IPV6 || !UIP_CONF_ROUTER || !UIP_CONF_IPV6_MULTICAST || !UIP_CONF_IPV6_RPL
|
||||||
#error "This example can not work with the current contiki configuration"
|
#error "This example can not work with the current contiki configuration"
|
||||||
#error "Check the values of: UIP_CONF_IPV6, UIP_CONF_ROUTER, UIP_CONF_IPV6_RPL"
|
#error "Check the values of: NETSTACK_CONF_WITH_IPV6, UIP_CONF_ROUTER, UIP_CONF_IPV6_RPL"
|
||||||
#endif
|
#endif
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
PROCESS(mcast_intermediate_process, "Intermediate Process");
|
PROCESS(mcast_intermediate_process, "Intermediate Process");
|
||||||
|
|
|
@ -63,9 +63,9 @@ static struct uip_udp_conn * mcast_conn;
|
||||||
static char buf[MAX_PAYLOAD_LEN];
|
static char buf[MAX_PAYLOAD_LEN];
|
||||||
static uint32_t seq_id;
|
static uint32_t seq_id;
|
||||||
|
|
||||||
#if !UIP_CONF_IPV6 || !UIP_CONF_ROUTER || !UIP_CONF_IPV6_MULTICAST || !UIP_CONF_IPV6_RPL
|
#if !NETSTACK_CONF_WITH_IPV6 || !UIP_CONF_ROUTER || !UIP_CONF_IPV6_MULTICAST || !UIP_CONF_IPV6_RPL
|
||||||
#error "This example can not work with the current contiki configuration"
|
#error "This example can not work with the current contiki configuration"
|
||||||
#error "Check the values of: UIP_CONF_IPV6, UIP_CONF_ROUTER, UIP_CONF_IPV6_RPL"
|
#error "Check the values of: NETSTACK_CONF_WITH_IPV6, UIP_CONF_ROUTER, UIP_CONF_IPV6_RPL"
|
||||||
#endif
|
#endif
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
PROCESS(rpl_root_process, "RPL ROOT, Multicast Sender");
|
PROCESS(rpl_root_process, "RPL ROOT, Multicast Sender");
|
||||||
|
|
|
@ -57,9 +57,9 @@ static uint16_t count;
|
||||||
|
|
||||||
#define UIP_IP_BUF ((struct uip_ip_hdr *)&uip_buf[UIP_LLH_LEN])
|
#define UIP_IP_BUF ((struct uip_ip_hdr *)&uip_buf[UIP_LLH_LEN])
|
||||||
|
|
||||||
#if !UIP_CONF_IPV6 || !UIP_CONF_ROUTER || !UIP_CONF_IPV6_MULTICAST || !UIP_CONF_IPV6_RPL
|
#if !NETSTACK_CONF_WITH_IPV6 || !UIP_CONF_ROUTER || !UIP_CONF_IPV6_MULTICAST || !UIP_CONF_IPV6_RPL
|
||||||
#error "This example can not work with the current contiki configuration"
|
#error "This example can not work with the current contiki configuration"
|
||||||
#error "Check the values of: UIP_CONF_IPV6, UIP_CONF_ROUTER, UIP_CONF_IPV6_RPL"
|
#error "Check the values of: NETSTACK_CONF_WITH_IPV6, UIP_CONF_ROUTER, UIP_CONF_IPV6_RPL"
|
||||||
#endif
|
#endif
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
PROCESS(mcast_sink_process, "Multicast Sink");
|
PROCESS(mcast_sink_process, "Multicast Sink");
|
||||||
|
|
|
@ -164,7 +164,7 @@ make_neighbor(void *arg)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !UIP_CONF_IPV6
|
#if !NETSTACK_CONF_WITH_IPV6
|
||||||
return snprintf((char *)uip_appdata, uip_mss(),
|
return snprintf((char *)uip_appdata, uip_mss(),
|
||||||
"<li><a href=\"http://172.16.%d.%d/\">%d.%d</a>\r\n",
|
"<li><a href=\"http://172.16.%d.%d/\">%d.%d</a>\r\n",
|
||||||
n->addr.u8[0], n->addr.u8[1],
|
n->addr.u8[0], n->addr.u8[1],
|
||||||
|
@ -212,7 +212,7 @@ make_neighbor(void *arg)
|
||||||
n->addr.u8[6],
|
n->addr.u8[6],
|
||||||
n->addr.u8[7]);
|
n->addr.u8[7]);
|
||||||
|
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
static
|
static
|
||||||
|
|
|
@ -51,7 +51,7 @@ PROCESS_THREAD(sky_shell_process, ev, data)
|
||||||
{
|
{
|
||||||
PROCESS_BEGIN();
|
PROCESS_BEGIN();
|
||||||
|
|
||||||
/* UIP_CONF_IPV4=1 assumes incoming SLIP serial data.
|
/* NETSTACK_CONF_WITH_IPV4=1 assumes incoming SLIP serial data.
|
||||||
* We override this assumption by restoring default serial input handler. */
|
* We override this assumption by restoring default serial input handler. */
|
||||||
uart1_set_input(serial_line_input_byte);
|
uart1_set_input(serial_line_input_byte);
|
||||||
serial_line_init();
|
serial_line_init();
|
||||||
|
|
|
@ -68,7 +68,7 @@ webserver_log_file(uip_ipaddr_t *requester, char *file)
|
||||||
{
|
{
|
||||||
/* Print out IP address of requesting host. */
|
/* Print out IP address of requesting host. */
|
||||||
#if LOG_CONF_ENABLED
|
#if LOG_CONF_ENABLED
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
char buf[48];
|
char buf[48];
|
||||||
uint8_t j;
|
uint8_t j;
|
||||||
j=httpd_cgi_sprint_ip6((uip_ip6addr_t)*requester, buf);
|
j=httpd_cgi_sprint_ip6((uip_ip6addr_t)*requester, buf);
|
||||||
|
@ -77,7 +77,7 @@ webserver_log_file(uip_ipaddr_t *requester, char *file)
|
||||||
char buf[20];
|
char buf[20];
|
||||||
sprintf(buf, "%d.%d.%d.%d: ", requester->u8[0], requester->u8[1],
|
sprintf(buf, "%d.%d.%d.%d: ", requester->u8[0], requester->u8[1],
|
||||||
requester->u8[2], requester->u8[3]);
|
requester->u8[2], requester->u8[3]);
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
log_message(buf, file);
|
log_message(buf, file);
|
||||||
#endif /* LOG_CONF_ENABLED */
|
#endif /* LOG_CONF_ENABLED */
|
||||||
|
|
|
@ -142,7 +142,7 @@ typedef unsigned short uip_stats_t;
|
||||||
/* Allow MCU sleeping between channel checks */
|
/* Allow MCU sleeping between channel checks */
|
||||||
#define RDC_CONF_MCU_SLEEP 1
|
#define RDC_CONF_MCU_SLEEP 1
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
#define LINKADDR_CONF_SIZE 8
|
#define LINKADDR_CONF_SIZE 8
|
||||||
#define UIP_CONF_ICMP6 1
|
#define UIP_CONF_ICMP6 1
|
||||||
#define UIP_CONF_UDP 1
|
#define UIP_CONF_UDP 1
|
||||||
|
@ -244,11 +244,11 @@ typedef unsigned short uip_stats_t;
|
||||||
#define CONTIKIMAC_CONF_COMPOWER 1
|
#define CONTIKIMAC_CONF_COMPOWER 1
|
||||||
#define RIMESTATS_CONF_ENABLED 1
|
#define RIMESTATS_CONF_ENABLED 1
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
#define NETSTACK_CONF_FRAMER framer802154
|
#define NETSTACK_CONF_FRAMER framer802154
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
#define NETSTACK_CONF_FRAMER contikimac_framer
|
#define NETSTACK_CONF_FRAMER contikimac_framer
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
#define NETSTACK_CONF_RADIO rf230_driver
|
#define NETSTACK_CONF_RADIO rf230_driver
|
||||||
#define CHANNEL_802_15_4 26
|
#define CHANNEL_802_15_4 26
|
||||||
|
|
|
@ -264,7 +264,7 @@ uint8_t i;
|
||||||
PRINTA("Random EUI64 address generated\n");
|
PRINTA("Random EUI64 address generated\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
memcpy(&uip_lladdr.addr, &addr.u8, sizeof(linkaddr_t));
|
memcpy(&uip_lladdr.addr, &addr.u8, sizeof(linkaddr_t));
|
||||||
#elif WITH_NODE_ID
|
#elif WITH_NODE_ID
|
||||||
node_id=get_panaddr_from_eeprom();
|
node_id=get_panaddr_from_eeprom();
|
||||||
|
@ -278,7 +278,7 @@ uint8_t i;
|
||||||
rf230_set_channel(params_get_channel());
|
rf230_set_channel(params_get_channel());
|
||||||
rf230_set_txpower(params_get_txpower());
|
rf230_set_txpower(params_get_txpower());
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
PRINTA("EUI-64 MAC: %x-%x-%x-%x-%x-%x-%x-%x\n",addr.u8[0],addr.u8[1],addr.u8[2],addr.u8[3],addr.u8[4],addr.u8[5],addr.u8[6],addr.u8[7]);
|
PRINTA("EUI-64 MAC: %x-%x-%x-%x-%x-%x-%x-%x\n",addr.u8[0],addr.u8[1],addr.u8[2],addr.u8[3],addr.u8[4],addr.u8[5],addr.u8[6],addr.u8[7]);
|
||||||
#else
|
#else
|
||||||
PRINTA("MAC address ");
|
PRINTA("MAC address ");
|
||||||
|
@ -308,7 +308,7 @@ uint8_t i;
|
||||||
|
|
||||||
#endif /* ANNOUNCE_BOOT */
|
#endif /* ANNOUNCE_BOOT */
|
||||||
|
|
||||||
#if UIP_CONF_IPV6 || UIP_CONF_IPV4
|
#if NETSTACK_CONF_WITH_IPV6 || NETSTACK_CONF_WITH_IPV4
|
||||||
process_start(&tcpip_process, NULL);
|
process_start(&tcpip_process, NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -393,7 +393,7 @@ uint8_t i;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ROUTES && UIP_CONF_IPV6
|
#if ROUTES && NETSTACK_CONF_WITH_IPV6
|
||||||
static void
|
static void
|
||||||
ipaddr_add(const uip_ipaddr_t *addr)
|
ipaddr_add(const uip_ipaddr_t *addr)
|
||||||
{
|
{
|
||||||
|
@ -421,9 +421,9 @@ ipaddr_add(const uip_ipaddr_t *addr)
|
||||||
int
|
int
|
||||||
main(void)
|
main(void)
|
||||||
{
|
{
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
uip_ds6_nbr_t *nbr;
|
uip_ds6_nbr_t *nbr;
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
initialize();
|
initialize();
|
||||||
|
|
||||||
while(1) {
|
while(1) {
|
||||||
|
@ -508,7 +508,7 @@ extern volatile unsigned long radioontime;
|
||||||
clocktime+=1;
|
clocktime+=1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if PINGS && UIP_CONF_IPV6
|
#if PINGS && NETSTACK_CONF_WITH_IPV6
|
||||||
extern void raven_ping6(void);
|
extern void raven_ping6(void);
|
||||||
if ((clocktime%PINGS)==1) {
|
if ((clocktime%PINGS)==1) {
|
||||||
PRINTF("**Ping\n");
|
PRINTF("**Ping\n");
|
||||||
|
@ -516,7 +516,7 @@ if ((clocktime%PINGS)==1) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ROUTES && UIP_CONF_IPV6
|
#if ROUTES && NETSTACK_CONF_WITH_IPV6
|
||||||
if ((clocktime%ROUTES)==2) {
|
if ((clocktime%ROUTES)==2) {
|
||||||
|
|
||||||
extern uip_ds6_netif_t uip_ds6_if;
|
extern uip_ds6_netif_t uip_ds6_if;
|
||||||
|
|
|
@ -68,7 +68,7 @@ webserver_log_file(uip_ipaddr_t *requester, char *file)
|
||||||
{
|
{
|
||||||
/* Print out IP address of requesting host. */
|
/* Print out IP address of requesting host. */
|
||||||
#if LOG_CONF_ENABLED
|
#if LOG_CONF_ENABLED
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
char buf[48];
|
char buf[48];
|
||||||
uint8_t j;
|
uint8_t j;
|
||||||
j=httpd_cgi_sprint_ip6((uip_ip6addr_t)*requester, buf);
|
j=httpd_cgi_sprint_ip6((uip_ip6addr_t)*requester, buf);
|
||||||
|
@ -77,7 +77,7 @@ webserver_log_file(uip_ipaddr_t *requester, char *file)
|
||||||
char buf[20];
|
char buf[20];
|
||||||
sprintf(buf, "%d.%d.%d.%d: ", requester->u8[0], requester->u8[1],
|
sprintf(buf, "%d.%d.%d.%d: ", requester->u8[0], requester->u8[1],
|
||||||
requester->u8[2], requester->u8[3]);
|
requester->u8[2], requester->u8[3]);
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
log_message(buf, file);
|
log_message(buf, file);
|
||||||
#endif /* LOG_CONF_ENABLED */
|
#endif /* LOG_CONF_ENABLED */
|
||||||
|
|
|
@ -157,7 +157,7 @@ typedef unsigned short uip_stats_t;
|
||||||
#define PACKETBUF_CONF_HDR_SIZE 0 //RF230 combined driver/mac handles headers internally
|
#define PACKETBUF_CONF_HDR_SIZE 0 //RF230 combined driver/mac handles headers internally
|
||||||
#endif /*RF230BB */
|
#endif /*RF230BB */
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
#define LINKADDR_CONF_SIZE 8
|
#define LINKADDR_CONF_SIZE 8
|
||||||
#define UIP_CONF_ICMP6 1
|
#define UIP_CONF_ICMP6 1
|
||||||
#define UIP_CONF_UDP 1
|
#define UIP_CONF_UDP 1
|
||||||
|
@ -169,7 +169,7 @@ typedef unsigned short uip_stats_t;
|
||||||
/* ip4 should build but is largely untested */
|
/* ip4 should build but is largely untested */
|
||||||
#define LINKADDR_CONF_SIZE 2
|
#define LINKADDR_CONF_SIZE 2
|
||||||
#define NETSTACK_CONF_NETWORK rime_driver
|
#define NETSTACK_CONF_NETWORK rime_driver
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
#define UIP_CONF_LL_802154 1
|
#define UIP_CONF_LL_802154 1
|
||||||
#define UIP_CONF_LLH_LEN 0
|
#define UIP_CONF_LLH_LEN 0
|
||||||
|
@ -260,11 +260,11 @@ typedef unsigned short uip_stats_t;
|
||||||
#define CONTIKIMAC_CONF_COMPOWER 1
|
#define CONTIKIMAC_CONF_COMPOWER 1
|
||||||
#define RIMESTATS_CONF_ENABLED 1
|
#define RIMESTATS_CONF_ENABLED 1
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
#define NETSTACK_CONF_FRAMER framer802154
|
#define NETSTACK_CONF_FRAMER framer802154
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
#define NETSTACK_CONF_FRAMER contikimac_framer
|
#define NETSTACK_CONF_FRAMER contikimac_framer
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
#define NETSTACK_CONF_RADIO rf230_driver
|
#define NETSTACK_CONF_RADIO rf230_driver
|
||||||
#define CHANNEL_802_15_4 26
|
#define CHANNEL_802_15_4 26
|
||||||
|
|
|
@ -265,7 +265,7 @@ uint8_t i;
|
||||||
PRINTA("Random EUI64 address generated\n");
|
PRINTA("Random EUI64 address generated\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
memcpy(&uip_lladdr.addr, &addr.u8, sizeof(linkaddr_t));
|
memcpy(&uip_lladdr.addr, &addr.u8, sizeof(linkaddr_t));
|
||||||
linkaddr_set_node_addr(&addr);
|
linkaddr_set_node_addr(&addr);
|
||||||
rf230_set_pan_addr(params_get_panid(),params_get_panaddr(),(uint8_t *)&addr.u8);
|
rf230_set_pan_addr(params_get_panid(),params_get_panaddr(),(uint8_t *)&addr.u8);
|
||||||
|
@ -284,7 +284,7 @@ uint8_t i;
|
||||||
rf230_set_channel(params_get_channel());
|
rf230_set_channel(params_get_channel());
|
||||||
rf230_set_txpower(params_get_txpower());
|
rf230_set_txpower(params_get_txpower());
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
PRINTA("EUI-64 MAC: %x-%x-%x-%x-%x-%x-%x-%x\n",addr.u8[0],addr.u8[1],addr.u8[2],addr.u8[3],addr.u8[4],addr.u8[5],addr.u8[6],addr.u8[7]);
|
PRINTA("EUI-64 MAC: %x-%x-%x-%x-%x-%x-%x-%x\n",addr.u8[0],addr.u8[1],addr.u8[2],addr.u8[3],addr.u8[4],addr.u8[5],addr.u8[6],addr.u8[7]);
|
||||||
#else
|
#else
|
||||||
PRINTA("MAC address ");
|
PRINTA("MAC address ");
|
||||||
|
@ -316,7 +316,7 @@ uint8_t i;
|
||||||
// rime_init(rime_udp_init(NULL));
|
// rime_init(rime_udp_init(NULL));
|
||||||
// uip_router_register(&rimeroute);
|
// uip_router_register(&rimeroute);
|
||||||
|
|
||||||
#if UIP_CONF_IPV6 || UIP_CONF_IPV4
|
#if NETSTACK_CONF_WITH_IPV6 || NETSTACK_CONF_WITH_IPV4
|
||||||
process_start(&tcpip_process, NULL);
|
process_start(&tcpip_process, NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -324,7 +324,7 @@ uint8_t i;
|
||||||
/* Original RF230 combined mac/radio driver */
|
/* Original RF230 combined mac/radio driver */
|
||||||
/* mac process must be started before tcpip process! */
|
/* mac process must be started before tcpip process! */
|
||||||
process_start(&mac_process, NULL);
|
process_start(&mac_process, NULL);
|
||||||
#if UIP_CONF_IPV6 || UIP_CONF_IPV4
|
#if NETSTACK_CONF_WITH_IPV6 || NETSTACK_CONF_WITH_IPV4
|
||||||
process_start(&tcpip_process, NULL);
|
process_start(&tcpip_process, NULL);
|
||||||
#endif
|
#endif
|
||||||
#endif /* RF230BB */
|
#endif /* RF230BB */
|
||||||
|
@ -405,7 +405,7 @@ uint8_t i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ROUTES && UIP_CONF_IPV6
|
#if ROUTES && NETSTACK_CONF_WITH_IPV6
|
||||||
static void
|
static void
|
||||||
ipaddr_add(const uip_ipaddr_t *addr)
|
ipaddr_add(const uip_ipaddr_t *addr)
|
||||||
{
|
{
|
||||||
|
@ -433,9 +433,9 @@ ipaddr_add(const uip_ipaddr_t *addr)
|
||||||
int
|
int
|
||||||
main(void)
|
main(void)
|
||||||
{
|
{
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
uip_ds6_nbr_t *nbr;
|
uip_ds6_nbr_t *nbr;
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
initialize();
|
initialize();
|
||||||
|
|
||||||
while(1) {
|
while(1) {
|
||||||
|
@ -506,7 +506,7 @@ extern volatile unsigned long radioontime;
|
||||||
clocktime+=1;
|
clocktime+=1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if PINGS && UIP_CONF_IPV6
|
#if PINGS && NETSTACK_CONF_WITH_IPV6
|
||||||
extern void raven_ping6(void);
|
extern void raven_ping6(void);
|
||||||
if ((clocktime%PINGS)==1) {
|
if ((clocktime%PINGS)==1) {
|
||||||
PRINTF("**Ping\n");
|
PRINTF("**Ping\n");
|
||||||
|
@ -514,7 +514,7 @@ if ((clocktime%PINGS)==1) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ROUTES && UIP_CONF_IPV6
|
#if ROUTES && NETSTACK_CONF_WITH_IPV6
|
||||||
if ((clocktime%ROUTES)==2) {
|
if ((clocktime%ROUTES)==2) {
|
||||||
|
|
||||||
extern uip_ds6_netif_t uip_ds6_if;
|
extern uip_ds6_netif_t uip_ds6_if;
|
||||||
|
|
|
@ -42,7 +42,7 @@ CONTIKI_PLAT_DEFS = -DF_CPU=8000000UL -DAVRGCC -DAUTO_CRC_PADDING=2 -DJACKDAW=1
|
||||||
#The no-net build using fakeuip.c is always ipv6
|
#The no-net build using fakeuip.c is always ipv6
|
||||||
CFLAGS += -I$(CONTIKI)/core/net/ipv6 -I$(CONTIKI)/core/net/ip -I$(CONTIKI)/core/net/ipv4
|
CFLAGS += -I$(CONTIKI)/core/net/ipv6 -I$(CONTIKI)/core/net/ip -I$(CONTIKI)/core/net/ipv4
|
||||||
ifdef CONTIKI_NO_NET
|
ifdef CONTIKI_NO_NET
|
||||||
CONTIKI_PLAT_DEFS+= -DUIP_CONF_IPV6=1
|
CONTIKI_PLAT_DEFS+= -DNETSTACK_CONF_WITH_IPV6=1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -217,7 +217,7 @@ extern void mac_log_802_15_4_rx(const uint8_t* buffer, size_t total_len);
|
||||||
#define PACKETBUF_CONF_HDR_SIZE 0 //RF230 combined driver/mac handles headers internally
|
#define PACKETBUF_CONF_HDR_SIZE 0 //RF230 combined driver/mac handles headers internally
|
||||||
#endif /*RF230BB */
|
#endif /*RF230BB */
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
#define LINKADDR_CONF_SIZE 8
|
#define LINKADDR_CONF_SIZE 8
|
||||||
#define UIP_CONF_ICMP6 1
|
#define UIP_CONF_ICMP6 1
|
||||||
#define UIP_CONF_UDP 1
|
#define UIP_CONF_UDP 1
|
||||||
|
@ -229,7 +229,7 @@ extern void mac_log_802_15_4_rx(const uint8_t* buffer, size_t total_len);
|
||||||
/* ip4 should build but is thoroughly untested */
|
/* ip4 should build but is thoroughly untested */
|
||||||
#define LINKADDR_CONF_SIZE 2
|
#define LINKADDR_CONF_SIZE 2
|
||||||
#define NETSTACK_CONF_NETWORK rime_driver
|
#define NETSTACK_CONF_NETWORK rime_driver
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
/* See uip-ds6.h */
|
/* See uip-ds6.h */
|
||||||
#define NBR_TABLE_CONF_MAX_NEIGHBORS 2
|
#define NBR_TABLE_CONF_MAX_NEIGHBORS 2
|
||||||
|
@ -313,11 +313,11 @@ typedef unsigned short uip_stats_t;
|
||||||
//#define NETSTACK_CONF_MAC csma_driver
|
//#define NETSTACK_CONF_MAC csma_driver
|
||||||
#define NETSTACK_CONF_RDC contikimac_driver
|
#define NETSTACK_CONF_RDC contikimac_driver
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
#define NETSTACK_CONF_FRAMER framer802154
|
#define NETSTACK_CONF_FRAMER framer802154
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
#define NETSTACK_CONF_FRAMER contikimac_framer
|
#define NETSTACK_CONF_FRAMER contikimac_framer
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
#define NETSTACK_CONF_RADIO rf230_driver
|
#define NETSTACK_CONF_RADIO rf230_driver
|
||||||
#define CHANNEL_802_15_4 26
|
#define CHANNEL_802_15_4 26
|
||||||
|
@ -386,7 +386,7 @@ typedef unsigned short uip_stats_t;
|
||||||
/* Not completely working yet. Works on Ubuntu after $ifconfig usb0 -arp to drop the neighbor solitications */
|
/* Not completely working yet. Works on Ubuntu after $ifconfig usb0 -arp to drop the neighbor solitications */
|
||||||
/* Dropping the NS on other OSs is more complicated, see http://www.sics.se/~adam/wiki/index.php/Jackdaw_RNDIS_RPL_border_router */
|
/* Dropping the NS on other OSs is more complicated, see http://www.sics.se/~adam/wiki/index.php/Jackdaw_RNDIS_RPL_border_router */
|
||||||
|
|
||||||
/* RPL requires the uip stack. Change #CONTIKI_NO_NET=1 to UIP_CONF_IPV6=1 in the examples makefile,
|
/* RPL requires the uip stack. Change #CONTIKI_NO_NET=1 to NETSTACK_CONF_WITH_IPV6=1 in the examples makefile,
|
||||||
or include the needed source files in /plaftorm/avr-ravenusb/Makefile.avr-ravenusb */
|
or include the needed source files in /plaftorm/avr-ravenusb/Makefile.avr-ravenusb */
|
||||||
/* For the present the buffer_length calcs in rpl-icmp6.c will need adjustment by the length difference
|
/* For the present the buffer_length calcs in rpl-icmp6.c will need adjustment by the length difference
|
||||||
between 6lowpan (0) and ethernet (14) link-layer headers:
|
between 6lowpan (0) and ethernet (14) link-layer headers:
|
||||||
|
|
|
@ -500,7 +500,7 @@ uint16_t p=(uint16_t)&__bss_end;
|
||||||
//Fix MAC address
|
//Fix MAC address
|
||||||
init_net();
|
init_net();
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
memcpy(&uip_lladdr.addr, &tmp_addr.u8, 8);
|
memcpy(&uip_lladdr.addr, &tmp_addr.u8, 8);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -552,7 +552,7 @@ uint16_t p=(uint16_t)&__bss_end;
|
||||||
#else /* RF230BB */
|
#else /* RF230BB */
|
||||||
/* The order of starting these is important! */
|
/* The order of starting these is important! */
|
||||||
process_start(&mac_process, NULL);
|
process_start(&mac_process, NULL);
|
||||||
#if UIP_CONF_IPV6 || UIP_CONF_IPV4
|
#if NETSTACK_CONF_WITH_IPV6 || NETSTACK_CONF_WITH_IPV4
|
||||||
process_start(&tcpip_process, NULL);
|
process_start(&tcpip_process, NULL);
|
||||||
#endif
|
#endif
|
||||||
#endif /* RF230BB */
|
#endif /* RF230BB */
|
||||||
|
|
|
@ -253,7 +253,7 @@ PT_THREAD(generate_routes(struct httpd_state *s))
|
||||||
PSOCK_GENERATOR_SEND(&s->sout, generate_string_P, (char *) TOP1);
|
PSOCK_GENERATOR_SEND(&s->sout, generate_string_P, (char *) TOP1);
|
||||||
PSOCK_GENERATOR_SEND(&s->sout, generate_string_P, (char *) TOP2);
|
PSOCK_GENERATOR_SEND(&s->sout, generate_string_P, (char *) TOP2);
|
||||||
|
|
||||||
#if UIP_CONF_IPV6 //allow ip4 builds
|
#if NETSTACK_CONF_WITH_IPV6 //allow ip4 builds
|
||||||
blen = 0;
|
blen = 0;
|
||||||
ADD("<h2>Neighbors [%u max]</h2>",NBR_TABLE_CONF_MAX_NEIGHBORS);
|
ADD("<h2>Neighbors [%u max]</h2>",NBR_TABLE_CONF_MAX_NEIGHBORS);
|
||||||
PSOCK_GENERATOR_SEND(&s->sout, generate_string, buf);
|
PSOCK_GENERATOR_SEND(&s->sout, generate_string, buf);
|
||||||
|
@ -296,11 +296,11 @@ PT_THREAD(generate_routes(struct httpd_state *s))
|
||||||
PSOCK_GENERATOR_SEND(&s->sout, generate_string, buf);
|
PSOCK_GENERATOR_SEND(&s->sout, generate_string, buf);
|
||||||
blen = 0;
|
blen = 0;
|
||||||
}
|
}
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
blen = 0;i++;
|
blen = 0;i++;
|
||||||
ADD("<h2>Hey, you got ip4 working!</h2>");
|
ADD("<h2>Hey, you got ip4 working!</h2>");
|
||||||
PSOCK_GENERATOR_SEND(&s->sout, generate_string, buf);
|
PSOCK_GENERATOR_SEND(&s->sout, generate_string, buf);
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
PSOCK_GENERATOR_SEND(&s->sout, generate_string_P, (char *) BOTTOM);
|
PSOCK_GENERATOR_SEND(&s->sout, generate_string_P, (char *) BOTTOM);
|
||||||
|
|
||||||
|
|
|
@ -381,7 +381,7 @@ void mac_ethernetToLowpan(uint8_t * ethHeader)
|
||||||
|
|
||||||
/* Simple Address Translation */
|
/* Simple Address Translation */
|
||||||
if(memcmp((uint8_t *)&simple_trans_ethernet_addr, &(((struct uip_eth_hdr *) ethHeader)->dest.addr[0]), 6) == 0) {
|
if(memcmp((uint8_t *)&simple_trans_ethernet_addr, &(((struct uip_eth_hdr *) ethHeader)->dest.addr[0]), 6) == 0) {
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
//Addressed to us: make 802.15.4 address from IPv6 Address
|
//Addressed to us: make 802.15.4 address from IPv6 Address
|
||||||
destAddr.addr[0] = UIP_IP_BUF->destipaddr.u8[8] ^ 0x02;
|
destAddr.addr[0] = UIP_IP_BUF->destipaddr.u8[8] ^ 0x02;
|
||||||
destAddr.addr[1] = UIP_IP_BUF->destipaddr.u8[9];
|
destAddr.addr[1] = UIP_IP_BUF->destipaddr.u8[9];
|
||||||
|
@ -445,7 +445,7 @@ void mac_ethernetToLowpan(uint8_t * ethHeader)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
/* Send the packet to the uip6 stack if it exists, else send to 6lowpan */
|
/* Send the packet to the uip6 stack if it exists, else send to 6lowpan */
|
||||||
#if UIP_CONF_IPV6_RPL
|
#if UIP_CONF_IPV6_RPL
|
||||||
/* Save the destination address, to trap ponging it back to the interface */
|
/* Save the destination address, to trap ponging it back to the interface */
|
||||||
|
@ -456,9 +456,9 @@ void mac_ethernetToLowpan(uint8_t * ethHeader)
|
||||||
// PRINTF("Output to %x %x %x %x %x %x %x %x\n",destAddr.addr[0],destAddr.addr[1],destAddr.addr[2],destAddr.addr[3],destAddr.addr[4],destAddr.addr[5],destAddr.addr[6],destAddr.addr[7]);
|
// PRINTF("Output to %x %x %x %x %x %x %x %x\n",destAddr.addr[0],destAddr.addr[1],destAddr.addr[2],destAddr.addr[3],destAddr.addr[4],destAddr.addr[5],destAddr.addr[6],destAddr.addr[7]);
|
||||||
tcpip_output(destAddrPtr);
|
tcpip_output(destAddrPtr);
|
||||||
#endif
|
#endif
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
tcpip_output(); //Allow non-ipv6 builds (Hello World)
|
tcpip_output(); //Allow non-ipv6 builds (Hello World)
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
#if !RF230BB
|
#if !RF230BB
|
||||||
usb_eth_stat.txok++;
|
usb_eth_stat.txok++;
|
||||||
|
@ -490,7 +490,7 @@ void mac_LowpanToEthernet(void)
|
||||||
ETHBUF(uip_buf)->dest.addr[0] = 0x33;
|
ETHBUF(uip_buf)->dest.addr[0] = 0x33;
|
||||||
ETHBUF(uip_buf)->dest.addr[1] = 0x33;
|
ETHBUF(uip_buf)->dest.addr[1] = 0x33;
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
ETHBUF(uip_buf)->dest.addr[2] = UIP_IP_BUF->destipaddr.u8[12];
|
ETHBUF(uip_buf)->dest.addr[2] = UIP_IP_BUF->destipaddr.u8[12];
|
||||||
ETHBUF(uip_buf)->dest.addr[3] = UIP_IP_BUF->destipaddr.u8[13];
|
ETHBUF(uip_buf)->dest.addr[3] = UIP_IP_BUF->destipaddr.u8[13];
|
||||||
ETHBUF(uip_buf)->dest.addr[4] = UIP_IP_BUF->destipaddr.u8[14];
|
ETHBUF(uip_buf)->dest.addr[4] = UIP_IP_BUF->destipaddr.u8[14];
|
||||||
|
@ -709,7 +709,7 @@ int8_t mac_translateIcmpLinkLayer(lltype_t target)
|
||||||
|
|
||||||
//We broke ICMP checksum, be sure to fix that
|
//We broke ICMP checksum, be sure to fix that
|
||||||
UIP_ICMP_BUF->icmpchksum = 0;
|
UIP_ICMP_BUF->icmpchksum = 0;
|
||||||
#if UIP_CONF_IPV6 //allow non ipv6 builds
|
#if NETSTACK_CONF_WITH_IPV6 //allow non ipv6 builds
|
||||||
UIP_ICMP_BUF->icmpchksum = ~uip_icmp6chksum();
|
UIP_ICMP_BUF->icmpchksum = ~uip_icmp6chksum();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -92,7 +92,7 @@ void clock_adjust_ticks(clock_time_t howmany);
|
||||||
#define CCIF
|
#define CCIF
|
||||||
#define CLIF
|
#define CLIF
|
||||||
|
|
||||||
//#define UIP_CONF_IPV6 1 //Let makefile determine this so ipv4 hello-world will compile
|
//#define NETSTACK_CONF_WITH_IPV6 1 //Let makefile determine this so ipv4 hello-world will compile
|
||||||
|
|
||||||
#define LINKADDR_CONF_SIZE 8
|
#define LINKADDR_CONF_SIZE 8
|
||||||
#define PACKETBUF_CONF_HDR_SIZE 0
|
#define PACKETBUF_CONF_HDR_SIZE 0
|
||||||
|
@ -124,7 +124,7 @@ void clock_adjust_ticks(clock_time_t howmany);
|
||||||
#define UIP_CONF_NETIF_MAX_ADDRESSES 3
|
#define UIP_CONF_NETIF_MAX_ADDRESSES 3
|
||||||
#define UIP_CONF_ND6_MAX_PREFIXES 3
|
#define UIP_CONF_ND6_MAX_PREFIXES 3
|
||||||
#define UIP_CONF_ND6_MAX_DEFROUTERS 2
|
#define UIP_CONF_ND6_MAX_DEFROUTERS 2
|
||||||
#if UIP_CONF_IPV6 //tcpip.c error on ipv4 build if UIP_CONF_ICMP6 defined
|
#if NETSTACK_CONF_WITH_IPV6 //tcpip.c error on ipv4 build if UIP_CONF_ICMP6 defined
|
||||||
#define UIP_CONF_ICMP6 1
|
#define UIP_CONF_ICMP6 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -74,13 +74,13 @@ FUSES =
|
||||||
PROCESS(rcb_leds, "RCB leds process");
|
PROCESS(rcb_leds, "RCB leds process");
|
||||||
|
|
||||||
#if RF230BB
|
#if RF230BB
|
||||||
#if UIP_CONF_IPV6 || UIP_CONF_IPV4
|
#if NETSTACK_CONF_WITH_IPV6 || NETSTACK_CONF_WITH_IPV4
|
||||||
PROCINIT(&etimer_process, &tcpip_process, &rcb_leds);
|
PROCINIT(&etimer_process, &tcpip_process, &rcb_leds);
|
||||||
#else
|
#else
|
||||||
PROCINIT(&etimer_process, &rcb_leds);
|
PROCINIT(&etimer_process, &rcb_leds);
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
#if UIP_CONF_IPV6 || UIP_CONF_IPV4
|
#if NETSTACK_CONF_WITH_IPV6 || NETSTACK_CONF_WITH_IPV4
|
||||||
PROCINIT(&etimer_process, &mac_process, &tcpip_process, &rcb_leds);
|
PROCINIT(&etimer_process, &mac_process, &tcpip_process, &rcb_leds);
|
||||||
#else
|
#else
|
||||||
PROCINIT(&etimer_process, &mac_process, &rcb_leds);
|
PROCINIT(&etimer_process, &mac_process, &rcb_leds);
|
||||||
|
@ -123,7 +123,7 @@ PROCESS_THREAD(rcb_leds, ev, data)
|
||||||
while(1) {
|
while(1) {
|
||||||
PROCESS_YIELD();
|
PROCESS_YIELD();
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
if (ev == ICMP6_ECHO_REQUEST) {
|
if (ev == ICMP6_ECHO_REQUEST) {
|
||||||
#else
|
#else
|
||||||
if (1) {
|
if (1) {
|
||||||
|
|
|
@ -82,13 +82,13 @@ FUSES =
|
||||||
};
|
};
|
||||||
|
|
||||||
#if RF230BB
|
#if RF230BB
|
||||||
#if UIP_CONF_IPV6 || UIP_CONF_IPV4
|
#if NETSTACK_CONF_WITH_IPV6 || NETSTACK_CONF_WITH_IPV4
|
||||||
//PROCINIT(&etimer_process, &tcpip_process );
|
//PROCINIT(&etimer_process, &tcpip_process );
|
||||||
#else
|
#else
|
||||||
//PROCINIT(&etimer_process );
|
//PROCINIT(&etimer_process );
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
#if UIP_CONF_IPV6 || UIP_CONF_IPV4
|
#if NETSTACK_CONF_WITH_IPV6 || NETSTACK_CONF_WITH_IPV4
|
||||||
PROCINIT(&etimer_process, &mac_process, &tcpip_process );
|
PROCINIT(&etimer_process, &mac_process, &tcpip_process );
|
||||||
#else
|
#else
|
||||||
PROCINIT(&etimer_process, &mac_process );
|
PROCINIT(&etimer_process, &mac_process );
|
||||||
|
@ -132,7 +132,7 @@ init_lowlevel(void)
|
||||||
memset(&addr, 0, sizeof(linkaddr_t));
|
memset(&addr, 0, sizeof(linkaddr_t));
|
||||||
eeprom_read_block ((void *)&addr.u8, &mac_address, 8);
|
eeprom_read_block ((void *)&addr.u8, &mac_address, 8);
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
memcpy(&uip_lladdr.addr, &addr.u8, 8);
|
memcpy(&uip_lladdr.addr, &addr.u8, 8);
|
||||||
#endif
|
#endif
|
||||||
rf230_set_pan_addr(IEEE802154_PANID, 0, (uint8_t *)&addr.u8);
|
rf230_set_pan_addr(IEEE802154_PANID, 0, (uint8_t *)&addr.u8);
|
||||||
|
@ -170,13 +170,13 @@ init_lowlevel(void)
|
||||||
rime_init(rime_udp_init(NULL));
|
rime_init(rime_udp_init(NULL));
|
||||||
uip_router_register(&rimeroute);
|
uip_router_register(&rimeroute);
|
||||||
#endif
|
#endif
|
||||||
#if UIP_CONF_IPV6 || UIP_CONF_IPV4
|
#if NETSTACK_CONF_WITH_IPV6 || NETSTACK_CONF_WITH_IPV4
|
||||||
process_start(&tcpip_process, NULL);
|
process_start(&tcpip_process, NULL);
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
/* mac process must be started before tcpip process! */
|
/* mac process must be started before tcpip process! */
|
||||||
process_start(&mac_process, NULL);
|
process_start(&mac_process, NULL);
|
||||||
#if UIP_CONF_IPV6 || UIP_CONF_IPV4
|
#if NETSTACK_CONF_WITH_IPV6 || NETSTACK_CONF_WITH_IPV4
|
||||||
process_start(&tcpip_process, NULL);
|
process_start(&tcpip_process, NULL);
|
||||||
#endif
|
#endif
|
||||||
#endif /*RF230BB*/
|
#endif /*RF230BB*/
|
||||||
|
|
|
@ -98,8 +98,8 @@ void clock_adjust_ticks(clock_time_t howmany);
|
||||||
#define LINKADDR_CONF_SIZE 8
|
#define LINKADDR_CONF_SIZE 8
|
||||||
#define PACKETBUF_CONF_HDR_SIZE 0
|
#define PACKETBUF_CONF_HDR_SIZE 0
|
||||||
|
|
||||||
//define UIP_CONF_IPV6 1 //Let the makefile do this, allows hello-world to compile
|
//define NETSTACK_CONF_WITH_IPV6 1 //Let the makefile do this, allows hello-world to compile
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
#define UIP_CONF_ICMP6 1
|
#define UIP_CONF_ICMP6 1
|
||||||
#define UIP_CONF_UDP 1
|
#define UIP_CONF_UDP 1
|
||||||
#define UIP_CONF_TCP 1
|
#define UIP_CONF_TCP 1
|
||||||
|
@ -113,7 +113,7 @@ void clock_adjust_ticks(clock_time_t howmany);
|
||||||
#define UIP_CONF_LLH_LEN 0
|
#define UIP_CONF_LLH_LEN 0
|
||||||
|
|
||||||
/* No radio cycling */
|
/* No radio cycling */
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
#define NETSTACK_CONF_NETWORK sicslowpan_driver
|
#define NETSTACK_CONF_NETWORK sicslowpan_driver
|
||||||
#else
|
#else
|
||||||
#define NETSTACK_CONF_NETWORK rime_driver
|
#define NETSTACK_CONF_NETWORK rime_driver
|
||||||
|
|
|
@ -157,19 +157,19 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Viztool on by default for IPv6 builds */
|
/* Viztool on by default for IPv6 builds */
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
#ifndef VIZTOOL_CONF_ON
|
#ifndef VIZTOOL_CONF_ON
|
||||||
#define VIZTOOL_CONF_ON 1
|
#define VIZTOOL_CONF_ON 1
|
||||||
#endif /* VIZTOOL_CONF_ON */
|
#endif /* VIZTOOL_CONF_ON */
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
/* Network Stack */
|
/* Network Stack */
|
||||||
#ifndef NETSTACK_CONF_NETWORK
|
#ifndef NETSTACK_CONF_NETWORK
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
#define NETSTACK_CONF_NETWORK sicslowpan_driver
|
#define NETSTACK_CONF_NETWORK sicslowpan_driver
|
||||||
#else
|
#else
|
||||||
#define NETSTACK_CONF_NETWORK rime_driver
|
#define NETSTACK_CONF_NETWORK rime_driver
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
#endif /* NETSTACK_CONF_NETWORK */
|
#endif /* NETSTACK_CONF_NETWORK */
|
||||||
|
|
||||||
#ifndef NETSTACK_CONF_MAC
|
#ifndef NETSTACK_CONF_MAC
|
||||||
|
@ -203,7 +203,7 @@
|
||||||
#define CC2530_RF_CONF_AUTOACK 1
|
#define CC2530_RF_CONF_AUTOACK 1
|
||||||
#endif /* CC2530_CONF_AUTOACK */
|
#endif /* CC2530_CONF_AUTOACK */
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
/* Addresses, Sizes and Interfaces */
|
/* Addresses, Sizes and Interfaces */
|
||||||
/* 8-byte addresses here, 2 otherwise */
|
/* 8-byte addresses here, 2 otherwise */
|
||||||
#define LINKADDR_CONF_SIZE 8
|
#define LINKADDR_CONF_SIZE 8
|
||||||
|
@ -267,13 +267,13 @@
|
||||||
#define QUEUEBUF_CONF_NUM 6
|
#define QUEUEBUF_CONF_NUM 6
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
/* Network setup for non-IPv6 (rime). */
|
/* Network setup for non-IPv6 (rime). */
|
||||||
#define UIP_CONF_IP_FORWARD 1
|
#define UIP_CONF_IP_FORWARD 1
|
||||||
#define UIP_CONF_BUFFER_SIZE 108
|
#define UIP_CONF_BUFFER_SIZE 108
|
||||||
#define RIME_CONF_NO_POLITE_ANNOUCEMENTS 0
|
#define RIME_CONF_NO_POLITE_ANNOUCEMENTS 0
|
||||||
#define QUEUEBUF_CONF_NUM 8
|
#define QUEUEBUF_CONF_NUM 8
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
/* Prevent SDCC compile error when UIP_CONF_ROUTER == 0 */
|
/* Prevent SDCC compile error when UIP_CONF_ROUTER == 0 */
|
||||||
#if !UIP_CONF_ROUTER
|
#if !UIP_CONF_ROUTER
|
||||||
|
|
|
@ -260,11 +260,11 @@ main(void) CC_NON_BANKED
|
||||||
ADC_SENSOR_ACTIVATE();
|
ADC_SENSOR_ACTIVATE();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
memcpy(&uip_lladdr.addr, &linkaddr_node_addr, sizeof(uip_lladdr.addr));
|
memcpy(&uip_lladdr.addr, &linkaddr_node_addr, sizeof(uip_lladdr.addr));
|
||||||
queuebuf_init();
|
queuebuf_init();
|
||||||
process_start(&tcpip_process, NULL);
|
process_start(&tcpip_process, NULL);
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
#if VIZTOOL_CONF_ON
|
#if VIZTOOL_CONF_ON
|
||||||
process_start(&viztool_process, NULL);
|
process_start(&viztool_process, NULL);
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
void
|
void
|
||||||
uip_debug_ipaddr_print(const uip_ipaddr_t *addr)
|
uip_debug_ipaddr_print(const uip_ipaddr_t *addr)
|
||||||
{
|
{
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
uint16_t a;
|
uint16_t a;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
int f;
|
int f;
|
||||||
|
@ -63,9 +63,9 @@ uip_debug_ipaddr_print(const uip_ipaddr_t *addr)
|
||||||
puthex(a & 0xFF);
|
puthex(a & 0xFF);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
PRINTA("%u.%u.%u.%u", addr->u8[0], addr->u8[1], addr->u8[2], addr->u8[3]);
|
PRINTA("%u.%u.%u.%u", addr->u8[0], addr->u8[1], addr->u8[2], addr->u8[3]);
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
void
|
void
|
||||||
|
|
|
@ -288,11 +288,11 @@ typedef uint32_t rtimer_clock_t;
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
#ifndef NETSTACK_CONF_NETWORK
|
#ifndef NETSTACK_CONF_NETWORK
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
#define NETSTACK_CONF_NETWORK sicslowpan_driver
|
#define NETSTACK_CONF_NETWORK sicslowpan_driver
|
||||||
#else
|
#else
|
||||||
#define NETSTACK_CONF_NETWORK rime_driver
|
#define NETSTACK_CONF_NETWORK rime_driver
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
#endif /* NETSTACK_CONF_NETWORK */
|
#endif /* NETSTACK_CONF_NETWORK */
|
||||||
|
|
||||||
#ifndef NETSTACK_CONF_MAC
|
#ifndef NETSTACK_CONF_MAC
|
||||||
|
@ -316,11 +316,11 @@ typedef uint32_t rtimer_clock_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef NETSTACK_CONF_FRAMER
|
#ifndef NETSTACK_CONF_FRAMER
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
#define NETSTACK_CONF_FRAMER framer_802154
|
#define NETSTACK_CONF_FRAMER framer_802154
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
#define NETSTACK_CONF_FRAMER contikimac_framer
|
#define NETSTACK_CONF_FRAMER contikimac_framer
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
#endif /* NETSTACK_CONF_FRAMER */
|
#endif /* NETSTACK_CONF_FRAMER */
|
||||||
|
|
||||||
#define NETSTACK_CONF_RADIO cc2538_rf_driver
|
#define NETSTACK_CONF_RADIO cc2538_rf_driver
|
||||||
|
@ -417,11 +417,11 @@ typedef uint32_t rtimer_clock_t;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Don't let contiki-default-conf.h decide if we are an IPv6 build */
|
/* Don't let contiki-default-conf.h decide if we are an IPv6 build */
|
||||||
#ifndef UIP_CONF_IPV6
|
#ifndef NETSTACK_CONF_WITH_IPV6
|
||||||
#define UIP_CONF_IPV6 0
|
#define NETSTACK_CONF_WITH_IPV6 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
/* Addresses, Sizes and Interfaces */
|
/* Addresses, Sizes and Interfaces */
|
||||||
/* 8-byte addresses here, 2 otherwise */
|
/* 8-byte addresses here, 2 otherwise */
|
||||||
#define LINKADDR_CONF_SIZE 8
|
#define LINKADDR_CONF_SIZE 8
|
||||||
|
@ -502,7 +502,7 @@ typedef uint32_t rtimer_clock_t;
|
||||||
#define QUEUEBUF_CONF_NUM 8
|
#define QUEUEBUF_CONF_NUM 8
|
||||||
#endif
|
#endif
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
/* Network setup for non-IPv6 (rime). */
|
/* Network setup for non-IPv6 (rime). */
|
||||||
#define UIP_CONF_IP_FORWARD 1
|
#define UIP_CONF_IP_FORWARD 1
|
||||||
|
|
||||||
|
@ -516,7 +516,7 @@ typedef uint32_t rtimer_clock_t;
|
||||||
#define QUEUEBUF_CONF_NUM 8
|
#define QUEUEBUF_CONF_NUM 8
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
/** @} */
|
/** @} */
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
|
@ -202,11 +202,11 @@ main(void)
|
||||||
set_rf_params();
|
set_rf_params();
|
||||||
netstack_init();
|
netstack_init();
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
memcpy(&uip_lladdr.addr, &linkaddr_node_addr, sizeof(uip_lladdr.addr));
|
memcpy(&uip_lladdr.addr, &linkaddr_node_addr, sizeof(uip_lladdr.addr));
|
||||||
queuebuf_init();
|
queuebuf_init();
|
||||||
process_start(&tcpip_process, NULL);
|
process_start(&tcpip_process, NULL);
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
process_start(&sensors_process, NULL);
|
process_start(&sensors_process, NULL);
|
||||||
|
|
||||||
|
|
|
@ -81,12 +81,12 @@ MODULES += core/net core/net/mac \
|
||||||
HAS_STACK = 0
|
HAS_STACK = 0
|
||||||
ifeq ($(CONTIKI_WITH_IPV4),1)
|
ifeq ($(CONTIKI_WITH_IPV4),1)
|
||||||
HAS_STACK = 1
|
HAS_STACK = 1
|
||||||
CFLAGS += -DUIP_CONF_IPV4=1
|
CFLAGS += -DNETSTACK_CONF_WITH_IPV4=1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CONTIKI_WITH_RIME),1)
|
ifeq ($(CONTIKI_WITH_RIME),1)
|
||||||
HAS_STACK = 1
|
HAS_STACK = 1
|
||||||
CFLAGS += -DUIP_CONF_RIME=1
|
CFLAGS += -DNETSTACK_CONF_WITH_RIME=1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Make IPv6 the default stack
|
# Make IPv6 the default stack
|
||||||
|
@ -95,7 +95,7 @@ CONTIKI_WITH_IPV6 = 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CONTIKI_WITH_IPV6),1)
|
ifeq ($(CONTIKI_WITH_IPV6),1)
|
||||||
CFLAGS += -DUIP_CONF_IPV6=1
|
CFLAGS += -DNETSTACK_CONF_WITH_IPV6=1
|
||||||
ifneq ($(CONTIKI_WITH_RPL),0)
|
ifneq ($(CONTIKI_WITH_RPL),0)
|
||||||
CFLAGS += -DUIP_CONF_IPV6_RPL=1
|
CFLAGS += -DUIP_CONF_IPV6_RPL=1
|
||||||
endif # UIP_CONF_RPL
|
endif # UIP_CONF_RPL
|
||||||
|
|
|
@ -47,11 +47,11 @@
|
||||||
|
|
||||||
#define w_memcpy memcpy
|
#define w_memcpy memcpy
|
||||||
|
|
||||||
#if UIP_CONF_IPV4
|
#if NETSTACK_CONF_WITH_IPV4
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
#error UIP_CONF_IPV4 && UIP_CONF_IPV6: Bad configuration
|
#error NETSTACK_CONF_WITH_IPV4 && NETSTACK_CONF_WITH_IPV6: Bad configuration
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
#endif /* UIP_CONF_IPV4 */
|
#endif /* NETSTACK_CONF_WITH_IPV4 */
|
||||||
|
|
||||||
#ifdef NETSTACK_CONF_H
|
#ifdef NETSTACK_CONF_H
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@
|
||||||
#else /* NETSTACK_CONF_H */
|
#else /* NETSTACK_CONF_H */
|
||||||
|
|
||||||
/* Default network config */
|
/* Default network config */
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
|
|
||||||
#define NULLRDC_CONF_802154_AUTOACK 1
|
#define NULLRDC_CONF_802154_AUTOACK 1
|
||||||
#define NULLRDC_CONF_SEND_802154_ACK 1
|
#define NULLRDC_CONF_SEND_802154_ACK 1
|
||||||
|
@ -78,9 +78,9 @@
|
||||||
#define NETSTACK_CONF_RADIO cooja_radio_driver
|
#define NETSTACK_CONF_RADIO cooja_radio_driver
|
||||||
#define NETSTACK_CONF_FRAMER framer_802154
|
#define NETSTACK_CONF_FRAMER framer_802154
|
||||||
|
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
#if UIP_CONF_IPV4
|
#if NETSTACK_CONF_WITH_IPV4
|
||||||
|
|
||||||
/* Network setup for IPv4 */
|
/* Network setup for IPv4 */
|
||||||
#define NETSTACK_CONF_NETWORK rime_driver /* NOTE: uip_over_mesh. else: uip_driver */
|
#define NETSTACK_CONF_NETWORK rime_driver /* NOTE: uip_over_mesh. else: uip_driver */
|
||||||
|
@ -89,7 +89,7 @@
|
||||||
#define NETSTACK_CONF_RADIO cooja_radio_driver
|
#define NETSTACK_CONF_RADIO cooja_radio_driver
|
||||||
#define UIP_CONF_IP_FORWARD 1
|
#define UIP_CONF_IP_FORWARD 1
|
||||||
|
|
||||||
#else /* UIP_CONF_IPV4 */
|
#else /* NETSTACK_CONF_WITH_IPV4 */
|
||||||
|
|
||||||
/* Network setup for Rime */
|
/* Network setup for Rime */
|
||||||
#define NETSTACK_CONF_NETWORK rime_driver
|
#define NETSTACK_CONF_NETWORK rime_driver
|
||||||
|
@ -98,15 +98,15 @@
|
||||||
#define NETSTACK_CONF_RADIO cooja_radio_driver
|
#define NETSTACK_CONF_RADIO cooja_radio_driver
|
||||||
/*#define NETSTACK_CONF_FRAMER framer_nullmac*/
|
/*#define NETSTACK_CONF_FRAMER framer_nullmac*/
|
||||||
|
|
||||||
#endif /* UIP_CONF_IPV4 */
|
#endif /* NETSTACK_CONF_WITH_IPV4 */
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
#endif /* NETSTACK_CONF_H */
|
#endif /* NETSTACK_CONF_H */
|
||||||
|
|
||||||
#define NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE 8
|
#define NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE 8
|
||||||
|
|
||||||
/* Default network config */
|
/* Default network config */
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@
|
||||||
#define NETSTACK_CONF_RDC nullrdc_driver
|
#define NETSTACK_CONF_RDC nullrdc_driver
|
||||||
#define NETSTACK_CONF_RADIO cooja_radio_driver
|
#define NETSTACK_CONF_RADIO cooja_radio_driver
|
||||||
#define NETSTACK_CONF_FRAMER framer_802154
|
#define NETSTACK_CONF_FRAMER framer_802154
|
||||||
#define UIP_CONF_IPV6 1
|
#define NETSTACK_CONF_WITH_IPV6 1
|
||||||
|
|
||||||
#define LINKADDR_CONF_SIZE 8
|
#define LINKADDR_CONF_SIZE 8
|
||||||
|
|
||||||
|
@ -174,7 +174,7 @@
|
||||||
#define SICSLOWPAN_CONF_MAX_MAC_TRANSMISSIONS 8
|
#define SICSLOWPAN_CONF_MAX_MAC_TRANSMISSIONS 8
|
||||||
#endif /* SICSLOWPAN_CONF_MAX_MAC_TRANSMISSIONS */
|
#endif /* SICSLOWPAN_CONF_MAX_MAC_TRANSMISSIONS */
|
||||||
|
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
|
|
||||||
#define PACKETBUF_CONF_ATTRS_INLINE 1
|
#define PACKETBUF_CONF_ATTRS_INLINE 1
|
||||||
|
@ -232,8 +232,8 @@ typedef unsigned long rtimer_clock_t;
|
||||||
|
|
||||||
#define UIP_CONF_TCP_SPLIT 0
|
#define UIP_CONF_TCP_SPLIT 0
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
/* Turn off example-provided putchars */
|
/* Turn off example-provided putchars */
|
||||||
#define SLIP_BRIDGE_CONF_NO_PUTCHAR 1
|
#define SLIP_BRIDGE_CONF_NO_PUTCHAR 1
|
||||||
|
|
|
@ -75,10 +75,10 @@
|
||||||
#define Java_org_contikios_cooja_corecomm_CLASSNAME_tick COOJA__QUOTEME(COOJA_JNI_PATH,CLASSNAME,_tick)
|
#define Java_org_contikios_cooja_corecomm_CLASSNAME_tick COOJA__QUOTEME(COOJA_JNI_PATH,CLASSNAME,_tick)
|
||||||
#define Java_org_contikios_cooja_corecomm_CLASSNAME_setReferenceAddress COOJA__QUOTEME(COOJA_JNI_PATH,CLASSNAME,_setReferenceAddress)
|
#define Java_org_contikios_cooja_corecomm_CLASSNAME_setReferenceAddress COOJA__QUOTEME(COOJA_JNI_PATH,CLASSNAME,_setReferenceAddress)
|
||||||
|
|
||||||
#ifndef UIP_CONF_IPV4
|
#ifndef NETSTACK_CONF_WITH_IPV4
|
||||||
#define UIP_CONF_IPV4 0
|
#define NETSTACK_CONF_WITH_IPV4 0
|
||||||
#endif
|
#endif
|
||||||
#if UIP_CONF_IPV4
|
#if NETSTACK_CONF_WITH_IPV4
|
||||||
#include "dev/rs232.h"
|
#include "dev/rs232.h"
|
||||||
#include "dev/slip.h"
|
#include "dev/slip.h"
|
||||||
#include "net/ip/uip.h"
|
#include "net/ip/uip.h"
|
||||||
|
@ -92,16 +92,16 @@ static struct uip_fw_netif meshif =
|
||||||
|
|
||||||
#define UIP_OVER_MESH_CHANNEL 8
|
#define UIP_OVER_MESH_CHANNEL 8
|
||||||
static uint8_t is_gateway;
|
static uint8_t is_gateway;
|
||||||
#endif /* UIP_CONF_IPV4 */
|
#endif /* NETSTACK_CONF_WITH_IPV4 */
|
||||||
|
|
||||||
#ifndef UIP_CONF_IPV6
|
#ifndef NETSTACK_CONF_WITH_IPV6
|
||||||
#define UIP_CONF_IPV6 0
|
#define NETSTACK_CONF_WITH_IPV6 0
|
||||||
#endif
|
#endif
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
#include "net/ip/uip.h"
|
#include "net/ip/uip.h"
|
||||||
#include "net/ipv6/uip-ds6.h"
|
#include "net/ipv6/uip-ds6.h"
|
||||||
#define PRINT6ADDR(addr) printf("%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x", ((uint8_t *)addr)[0], ((uint8_t *)addr)[1], ((uint8_t *)addr)[2], ((uint8_t *)addr)[3], ((uint8_t *)addr)[4], ((uint8_t *)addr)[5], ((uint8_t *)addr)[6], ((uint8_t *)addr)[7], ((uint8_t *)addr)[8], ((uint8_t *)addr)[9], ((uint8_t *)addr)[10], ((uint8_t *)addr)[11], ((uint8_t *)addr)[12], ((uint8_t *)addr)[13], ((uint8_t *)addr)[14], ((uint8_t *)addr)[15])
|
#define PRINT6ADDR(addr) printf("%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x", ((uint8_t *)addr)[0], ((uint8_t *)addr)[1], ((uint8_t *)addr)[2], ((uint8_t *)addr)[3], ((uint8_t *)addr)[4], ((uint8_t *)addr)[5], ((uint8_t *)addr)[6], ((uint8_t *)addr)[7], ((uint8_t *)addr)[8], ((uint8_t *)addr)[9], ((uint8_t *)addr)[10], ((uint8_t *)addr)[11], ((uint8_t *)addr)[12], ((uint8_t *)addr)[13], ((uint8_t *)addr)[14], ((uint8_t *)addr)[15])
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
/* Simulation mote interfaces */
|
/* Simulation mote interfaces */
|
||||||
SIM_INTERFACE_NAME(moteid_interface);
|
SIM_INTERFACE_NAME(moteid_interface);
|
||||||
|
@ -139,7 +139,7 @@ static struct cooja_mt_thread process_run_thread;
|
||||||
#define MIN(a, b) ( (a)<(b) ? (a) : (b) )
|
#define MIN(a, b) ( (a)<(b) ? (a) : (b) )
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
#if UIP_CONF_IPV4
|
#if NETSTACK_CONF_WITH_IPV4
|
||||||
static void
|
static void
|
||||||
set_gateway(void)
|
set_gateway(void)
|
||||||
{
|
{
|
||||||
|
@ -153,7 +153,7 @@ set_gateway(void)
|
||||||
is_gateway = 1;
|
is_gateway = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* UIP_CONF_IPV4 */
|
#endif /* NETSTACK_CONF_WITH_IPV4 */
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
static void
|
static void
|
||||||
print_processes(struct process * const processes[])
|
print_processes(struct process * const processes[])
|
||||||
|
@ -186,15 +186,15 @@ set_rime_addr(void)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
memset(&addr, 0, sizeof(linkaddr_t));
|
memset(&addr, 0, sizeof(linkaddr_t));
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
for(i = 0; i < sizeof(uip_lladdr.addr); i += 2) {
|
for(i = 0; i < sizeof(uip_lladdr.addr); i += 2) {
|
||||||
addr.u8[i + 1] = node_id & 0xff;
|
addr.u8[i + 1] = node_id & 0xff;
|
||||||
addr.u8[i + 0] = node_id >> 8;
|
addr.u8[i + 0] = node_id >> 8;
|
||||||
}
|
}
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
addr.u8[0] = node_id & 0xff;
|
addr.u8[0] = node_id & 0xff;
|
||||||
addr.u8[1] = node_id >> 8;
|
addr.u8[1] = node_id >> 8;
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
linkaddr_set_node_addr(&addr);
|
linkaddr_set_node_addr(&addr);
|
||||||
printf("Rime started with address ");
|
printf("Rime started with address ");
|
||||||
for(i = 0; i < sizeof(addr.u8) - 1; i++) {
|
for(i = 0; i < sizeof(addr.u8) - 1; i++) {
|
||||||
|
@ -246,7 +246,7 @@ contiki_init()
|
||||||
CLOCK_SECOND / (NETSTACK_RDC.channel_check_interval() == 0 ? 1:
|
CLOCK_SECOND / (NETSTACK_RDC.channel_check_interval() == 0 ? 1:
|
||||||
NETSTACK_RDC.channel_check_interval()));
|
NETSTACK_RDC.channel_check_interval()));
|
||||||
|
|
||||||
#if UIP_CONF_IPV4
|
#if NETSTACK_CONF_WITH_IPV4
|
||||||
/* IPv4 CONFIGURATION */
|
/* IPv4 CONFIGURATION */
|
||||||
{
|
{
|
||||||
uip_ipaddr_t hostaddr, netmask;
|
uip_ipaddr_t hostaddr, netmask;
|
||||||
|
@ -273,9 +273,9 @@ contiki_init()
|
||||||
rs232_set_input(slip_input_byte);
|
rs232_set_input(slip_input_byte);
|
||||||
printf("IPv4 address: %d.%d.%d.%d\n", uip_ipaddr_to_quad(&hostaddr));
|
printf("IPv4 address: %d.%d.%d.%d\n", uip_ipaddr_to_quad(&hostaddr));
|
||||||
}
|
}
|
||||||
#endif /* UIP_CONF_IPV4 */
|
#endif /* NETSTACK_CONF_WITH_IPV4 */
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
/* IPv6 CONFIGURATION */
|
/* IPv6 CONFIGURATION */
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
@ -317,7 +317,7 @@ contiki_init()
|
||||||
ipaddr.u8[7 * 2], ipaddr.u8[7 * 2 + 1]);
|
ipaddr.u8[7 * 2], ipaddr.u8[7 * 2 + 1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
/* Initialize eeprom */
|
/* Initialize eeprom */
|
||||||
eeprom_init();
|
eeprom_init();
|
||||||
|
|
|
@ -37,31 +37,31 @@ const struct simInterface ip_interface;
|
||||||
|
|
||||||
// COOJA variables
|
// COOJA variables
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
|
|
||||||
char simIPChanged;
|
char simIPChanged;
|
||||||
char simIP[16];
|
char simIP[16];
|
||||||
|
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
#if UIP_CONF_IPV4
|
#if NETSTACK_CONF_WITH_IPV4
|
||||||
|
|
||||||
char simIPChanged;
|
char simIPChanged;
|
||||||
char simIP[4];
|
char simIP[4];
|
||||||
|
|
||||||
#endif /* UIP_CONF_IPV4 */
|
#endif /* NETSTACK_CONF_WITH_IPV4 */
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
static void
|
static void
|
||||||
doInterfaceActionsBeforeTick(void)
|
doInterfaceActionsBeforeTick(void)
|
||||||
{
|
{
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
|
|
||||||
/* check if IPv6 address should change */
|
/* check if IPv6 address should change */
|
||||||
|
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
#if UIP_CONF_IPV4
|
#if NETSTACK_CONF_WITH_IPV4
|
||||||
|
|
||||||
/* check if IPv4 address should change */
|
/* check if IPv4 address should change */
|
||||||
/*
|
/*
|
||||||
|
@ -73,7 +73,7 @@ doInterfaceActionsBeforeTick(void)
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#endif /* UIP_CONF_IPV4 */
|
#endif /* NETSTACK_CONF_WITH_IPV4 */
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -36,13 +36,13 @@
|
||||||
|
|
||||||
#define IMPLEMENT_PRINTF 1
|
#define IMPLEMENT_PRINTF 1
|
||||||
|
|
||||||
#if UIP_CONF_IPV4
|
#if NETSTACK_CONF_WITH_IPV4
|
||||||
/* uIP packets via SLIP */
|
/* uIP packets via SLIP */
|
||||||
#include "uip.h"
|
#include "uip.h"
|
||||||
#define MAX_LOG_LENGTH (2*UIP_BUFSIZE)
|
#define MAX_LOG_LENGTH (2*UIP_BUFSIZE)
|
||||||
#else /* UIP_CONF_IPV4 */
|
#else /* NETSTACK_CONF_WITH_IPV4 */
|
||||||
#define MAX_LOG_LENGTH 1024
|
#define MAX_LOG_LENGTH 1024
|
||||||
#endif /* UIP_CONF_IPV4 */
|
#endif /* NETSTACK_CONF_WITH_IPV4 */
|
||||||
|
|
||||||
#if MAX_LOG_LENGTH < 1024
|
#if MAX_LOG_LENGTH < 1024
|
||||||
#undef MAX_LOG_LENGTH
|
#undef MAX_LOG_LENGTH
|
||||||
|
|
|
@ -108,7 +108,7 @@
|
||||||
|
|
||||||
#define LINKADDR_CONF_SIZE 8
|
#define LINKADDR_CONF_SIZE 8
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
/* Network setup for IPv6 */
|
/* Network setup for IPv6 */
|
||||||
#define NETSTACK_CONF_NETWORK sicslowpan_driver
|
#define NETSTACK_CONF_NETWORK sicslowpan_driver
|
||||||
#define NETSTACK_CONF_MAC nullmac_driver
|
#define NETSTACK_CONF_MAC nullmac_driver
|
||||||
|
@ -121,7 +121,7 @@
|
||||||
#define CXMAC_CONF_ANNOUNCEMENTS 0
|
#define CXMAC_CONF_ANNOUNCEMENTS 0
|
||||||
#define XMAC_CONF_ANNOUNCEMENTS 0
|
#define XMAC_CONF_ANNOUNCEMENTS 0
|
||||||
|
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
/* Network setup for non-IPv6 (rime). */
|
/* Network setup for non-IPv6 (rime). */
|
||||||
|
|
||||||
#define NETSTACK_CONF_NETWORK rime_driver
|
#define NETSTACK_CONF_NETWORK rime_driver
|
||||||
|
@ -144,7 +144,7 @@
|
||||||
|
|
||||||
#define COLLECT_NBR_TABLE_CONF_MAX_NEIGHBORS 32
|
#define COLLECT_NBR_TABLE_CONF_MAX_NEIGHBORS 32
|
||||||
|
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
#define QUEUEBUF_CONF_NUM 16
|
#define QUEUEBUF_CONF_NUM 16
|
||||||
|
|
||||||
|
@ -169,7 +169,7 @@
|
||||||
#define PROCESS_CONF_NUMEVENTS 8
|
#define PROCESS_CONF_NUMEVENTS 8
|
||||||
#define PROCESS_CONF_STATS 1
|
#define PROCESS_CONF_STATS 1
|
||||||
|
|
||||||
#ifdef UIP_CONF_IPV6
|
#ifdef NETSTACK_CONF_WITH_IPV6
|
||||||
|
|
||||||
#define LINKADDR_CONF_SIZE 8
|
#define LINKADDR_CONF_SIZE 8
|
||||||
|
|
||||||
|
@ -191,7 +191,7 @@
|
||||||
#define UIP_CONF_ND6_REACHABLE_TIME 600000
|
#define UIP_CONF_ND6_REACHABLE_TIME 600000
|
||||||
#define UIP_CONF_ND6_RETRANS_TIMER 10000
|
#define UIP_CONF_ND6_RETRANS_TIMER 10000
|
||||||
|
|
||||||
#define UIP_CONF_IPV6 1
|
#define NETSTACK_CONF_WITH_IPV6 1
|
||||||
#define UIP_CONF_IPV6_QUEUE_PKT 0
|
#define UIP_CONF_IPV6_QUEUE_PKT 0
|
||||||
#define UIP_CONF_IPV6_CHECKS 1
|
#define UIP_CONF_IPV6_CHECKS 1
|
||||||
#define UIP_CONF_IPV6_REASSEMBLY 0
|
#define UIP_CONF_IPV6_REASSEMBLY 0
|
||||||
|
@ -213,10 +213,10 @@
|
||||||
#endif /* SICSLOWPAN_CONF_FRAG */
|
#endif /* SICSLOWPAN_CONF_FRAG */
|
||||||
#define SICSLOWPAN_CONF_CONVENTIONAL_MAC 1
|
#define SICSLOWPAN_CONF_CONVENTIONAL_MAC 1
|
||||||
#define SICSLOWPAN_CONF_MAX_ADDR_CONTEXTS 2
|
#define SICSLOWPAN_CONF_MAX_ADDR_CONTEXTS 2
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
#define UIP_CONF_IP_FORWARD 1
|
#define UIP_CONF_IP_FORWARD 1
|
||||||
#define UIP_CONF_BUFFER_SIZE 1300
|
#define UIP_CONF_BUFFER_SIZE 1300
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
#define UIP_CONF_ICMP_DEST_UNREACH 1
|
#define UIP_CONF_ICMP_DEST_UNREACH 1
|
||||||
|
|
||||||
|
|
|
@ -124,7 +124,7 @@ int main(void) {
|
||||||
/* configure address on maca hardware and RIME */
|
/* configure address on maca hardware and RIME */
|
||||||
contiki_maca_set_mac_address(mc1322x_config.eui);
|
contiki_maca_set_mac_address(mc1322x_config.eui);
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
memcpy(&uip_lladdr.addr, &linkaddr_node_addr.u8, sizeof(uip_lladdr.addr));
|
memcpy(&uip_lladdr.addr, &linkaddr_node_addr.u8, sizeof(uip_lladdr.addr));
|
||||||
queuebuf_init();
|
queuebuf_init();
|
||||||
NETSTACK_RDC.init();
|
NETSTACK_RDC.init();
|
||||||
|
@ -137,7 +137,7 @@ int main(void) {
|
||||||
#if DEBUG_ANNOTATE
|
#if DEBUG_ANNOTATE
|
||||||
print_lladdrs();
|
print_lladdrs();
|
||||||
#endif
|
#endif
|
||||||
#endif /* endif UIP_CONF_IPV6 */
|
#endif /* endif NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
process_start(&sensors_process, NULL);
|
process_start(&sensors_process, NULL);
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@
|
||||||
|
|
||||||
#define LINKADDR_CONF_SIZE 8
|
#define LINKADDR_CONF_SIZE 8
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
/* Network setup for IPv6 */
|
/* Network setup for IPv6 */
|
||||||
#define NETSTACK_CONF_NETWORK sicslowpan_driver
|
#define NETSTACK_CONF_NETWORK sicslowpan_driver
|
||||||
#define NETSTACK_CONF_MAC nullmac_driver
|
#define NETSTACK_CONF_MAC nullmac_driver
|
||||||
|
@ -68,7 +68,7 @@
|
||||||
#define CXMAC_CONF_ANNOUNCEMENTS 0
|
#define CXMAC_CONF_ANNOUNCEMENTS 0
|
||||||
#define XMAC_CONF_ANNOUNCEMENTS 0
|
#define XMAC_CONF_ANNOUNCEMENTS 0
|
||||||
|
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
/* Network setup for non-IPv6 (rime). */
|
/* Network setup for non-IPv6 (rime). */
|
||||||
#define NETSTACK_CONF_NETWORK rime_driver
|
#define NETSTACK_CONF_NETWORK rime_driver
|
||||||
|
@ -91,7 +91,7 @@
|
||||||
|
|
||||||
#define COLLECT_NBR_TABLE_CONF_MAX_NEIGHBORS 16
|
#define COLLECT_NBR_TABLE_CONF_MAX_NEIGHBORS 16
|
||||||
|
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
#define QUEUEBUF_CONF_NUM 4
|
#define QUEUEBUF_CONF_NUM 4
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@
|
||||||
#define PROCESS_CONF_NUMEVENTS 8
|
#define PROCESS_CONF_NUMEVENTS 8
|
||||||
#define PROCESS_CONF_STATS 1
|
#define PROCESS_CONF_STATS 1
|
||||||
|
|
||||||
#ifdef UIP_CONF_IPV6
|
#ifdef NETSTACK_CONF_WITH_IPV6
|
||||||
|
|
||||||
#define LINKADDR_CONF_SIZE 8
|
#define LINKADDR_CONF_SIZE 8
|
||||||
|
|
||||||
|
@ -138,7 +138,7 @@
|
||||||
#define UIP_CONF_ND6_REACHABLE_TIME 600000
|
#define UIP_CONF_ND6_REACHABLE_TIME 600000
|
||||||
#define UIP_CONF_ND6_RETRANS_TIMER 10000
|
#define UIP_CONF_ND6_RETRANS_TIMER 10000
|
||||||
|
|
||||||
#define UIP_CONF_IPV6 1
|
#define NETSTACK_CONF_WITH_IPV6 1
|
||||||
#define UIP_CONF_IPV6_QUEUE_PKT 0
|
#define UIP_CONF_IPV6_QUEUE_PKT 0
|
||||||
#define UIP_CONF_IPV6_CHECKS 1
|
#define UIP_CONF_IPV6_CHECKS 1
|
||||||
#define UIP_CONF_IPV6_REASSEMBLY 0
|
#define UIP_CONF_IPV6_REASSEMBLY 0
|
||||||
|
@ -160,10 +160,10 @@
|
||||||
#endif /* SICSLOWPAN_CONF_FRAG */
|
#endif /* SICSLOWPAN_CONF_FRAG */
|
||||||
#define SICSLOWPAN_CONF_CONVENTIONAL_MAC 1
|
#define SICSLOWPAN_CONF_CONVENTIONAL_MAC 1
|
||||||
#define SICSLOWPAN_CONF_MAX_ADDR_CONTEXTS 2
|
#define SICSLOWPAN_CONF_MAX_ADDR_CONTEXTS 2
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
#define UIP_CONF_IP_FORWARD 1
|
#define UIP_CONF_IP_FORWARD 1
|
||||||
#define UIP_CONF_BUFFER_SIZE 140
|
#define UIP_CONF_BUFFER_SIZE 140
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
#define UIP_CONF_ICMP_DEST_UNREACH 1
|
#define UIP_CONF_ICMP_DEST_UNREACH 1
|
||||||
|
|
||||||
|
|
|
@ -49,9 +49,9 @@
|
||||||
#include "dev/button-sensor.h"
|
#include "dev/button-sensor.h"
|
||||||
#include "dev/leds.h"
|
#include "dev/leds.h"
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
#include "net/ipv6/uip-ds6.h"
|
#include "net/ipv6/uip-ds6.h"
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
#include "net/rime/rime.h"
|
#include "net/rime/rime.h"
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ set_rime_addr(void)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
memset(&addr, 0, sizeof(linkaddr_t));
|
memset(&addr, 0, sizeof(linkaddr_t));
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
memcpy(addr.u8, serial_id, sizeof(addr.u8));
|
memcpy(addr.u8, serial_id, sizeof(addr.u8));
|
||||||
#else
|
#else
|
||||||
if(node_id == 0) {
|
if(node_id == 0) {
|
||||||
|
@ -115,7 +115,7 @@ main(int argc, char **argv)
|
||||||
uart_init(115200);
|
uart_init(115200);
|
||||||
clock_init();
|
clock_init();
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
#if UIP_CONF_IPV6_RPL
|
#if UIP_CONF_IPV6_RPL
|
||||||
printf(CONTIKI_VERSION_STRING " started with IPV6, RPL\n");
|
printf(CONTIKI_VERSION_STRING " started with IPV6, RPL\n");
|
||||||
#else
|
#else
|
||||||
|
@ -142,7 +142,7 @@ main(int argc, char **argv)
|
||||||
printf("MAC %s RDC %s NETWORK %s\n",
|
printf("MAC %s RDC %s NETWORK %s\n",
|
||||||
NETSTACK_MAC.name, NETSTACK_RDC.name, NETSTACK_NETWORK.name);
|
NETSTACK_MAC.name, NETSTACK_RDC.name, NETSTACK_NETWORK.name);
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
memcpy(&uip_lladdr.addr, serial_id, sizeof(uip_lladdr.addr));
|
memcpy(&uip_lladdr.addr, serial_id, sizeof(uip_lladdr.addr));
|
||||||
|
|
||||||
process_start(&tcpip_process, NULL);
|
process_start(&tcpip_process, NULL);
|
||||||
|
@ -159,7 +159,7 @@ main(int argc, char **argv)
|
||||||
/* make it hardcoded... */
|
/* make it hardcoded... */
|
||||||
lladdr->state = ADDR_AUTOCONF;
|
lladdr->state = ADDR_AUTOCONF;
|
||||||
}
|
}
|
||||||
#elif UIP_CONF_IPV4
|
#elif NETSTACK_CONF_WITH_IPV4
|
||||||
process_start(&tcpip_process, NULL);
|
process_start(&tcpip_process, NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@
|
||||||
|
|
||||||
#define LINKADDR_CONF_SIZE 8
|
#define LINKADDR_CONF_SIZE 8
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
/* Network setup for IPv6 */
|
/* Network setup for IPv6 */
|
||||||
#define NETSTACK_CONF_NETWORK sicslowpan_driver
|
#define NETSTACK_CONF_NETWORK sicslowpan_driver
|
||||||
#define NETSTACK_CONF_MAC nullmac_driver
|
#define NETSTACK_CONF_MAC nullmac_driver
|
||||||
|
@ -71,7 +71,7 @@
|
||||||
#define CXMAC_CONF_ANNOUNCEMENTS 0
|
#define CXMAC_CONF_ANNOUNCEMENTS 0
|
||||||
#define XMAC_CONF_ANNOUNCEMENTS 0
|
#define XMAC_CONF_ANNOUNCEMENTS 0
|
||||||
|
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
/* Network setup for non-IPv6 (rime). */
|
/* Network setup for non-IPv6 (rime). */
|
||||||
|
|
||||||
#define NETSTACK_CONF_NETWORK rime_driver
|
#define NETSTACK_CONF_NETWORK rime_driver
|
||||||
|
@ -94,7 +94,7 @@
|
||||||
|
|
||||||
#define COLLECT_NBR_TABLE_CONF_MAX_NEIGHBORS 32
|
#define COLLECT_NBR_TABLE_CONF_MAX_NEIGHBORS 32
|
||||||
|
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
#define QUEUEBUF_CONF_NUM 16
|
#define QUEUEBUF_CONF_NUM 16
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@
|
||||||
#define PROCESS_CONF_NUMEVENTS 8
|
#define PROCESS_CONF_NUMEVENTS 8
|
||||||
#define PROCESS_CONF_STATS 1
|
#define PROCESS_CONF_STATS 1
|
||||||
|
|
||||||
#ifdef UIP_CONF_IPV6
|
#ifdef NETSTACK_CONF_WITH_IPV6
|
||||||
|
|
||||||
#define LINKADDR_CONF_SIZE 8
|
#define LINKADDR_CONF_SIZE 8
|
||||||
|
|
||||||
|
@ -141,7 +141,7 @@
|
||||||
#define UIP_CONF_ND6_REACHABLE_TIME 600000
|
#define UIP_CONF_ND6_REACHABLE_TIME 600000
|
||||||
#define UIP_CONF_ND6_RETRANS_TIMER 10000
|
#define UIP_CONF_ND6_RETRANS_TIMER 10000
|
||||||
|
|
||||||
#define UIP_CONF_IPV6 1
|
#define NETSTACK_CONF_WITH_IPV6 1
|
||||||
#define UIP_CONF_IPV6_QUEUE_PKT 0
|
#define UIP_CONF_IPV6_QUEUE_PKT 0
|
||||||
#define UIP_CONF_IPV6_CHECKS 1
|
#define UIP_CONF_IPV6_CHECKS 1
|
||||||
#define UIP_CONF_IPV6_REASSEMBLY 0
|
#define UIP_CONF_IPV6_REASSEMBLY 0
|
||||||
|
@ -163,10 +163,10 @@
|
||||||
#endif /* SICSLOWPAN_CONF_FRAG */
|
#endif /* SICSLOWPAN_CONF_FRAG */
|
||||||
#define SICSLOWPAN_CONF_CONVENTIONAL_MAC 1
|
#define SICSLOWPAN_CONF_CONVENTIONAL_MAC 1
|
||||||
#define SICSLOWPAN_CONF_MAX_ADDR_CONTEXTS 2
|
#define SICSLOWPAN_CONF_MAX_ADDR_CONTEXTS 2
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
#define UIP_CONF_IP_FORWARD 1
|
#define UIP_CONF_IP_FORWARD 1
|
||||||
#define UIP_CONF_BUFFER_SIZE 1300
|
#define UIP_CONF_BUFFER_SIZE 1300
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
#define UIP_CONF_ICMP_DEST_UNREACH 1
|
#define UIP_CONF_ICMP_DEST_UNREACH 1
|
||||||
|
|
||||||
|
|
|
@ -45,9 +45,9 @@
|
||||||
|
|
||||||
#include "dev/button-sensor.h"
|
#include "dev/button-sensor.h"
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
#include "net/ipv6/uip-ds6.h"
|
#include "net/ipv6/uip-ds6.h"
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
#include "net/rime/rime.h"
|
#include "net/rime/rime.h"
|
||||||
#include "uart0.h"
|
#include "uart0.h"
|
||||||
|
@ -76,7 +76,7 @@ set_rime_addr(void)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
memset(&addr, 0, sizeof(linkaddr_t));
|
memset(&addr, 0, sizeof(linkaddr_t));
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
memcpy(addr.u8, serial_id, sizeof(addr.u8));
|
memcpy(addr.u8, serial_id, sizeof(addr.u8));
|
||||||
#else
|
#else
|
||||||
if(node_id == 0) {
|
if(node_id == 0) {
|
||||||
|
@ -158,7 +158,7 @@ main(int argc, char **argv)
|
||||||
PM3 &= ~BIT(0); /* LED7 */
|
PM3 &= ~BIT(0); /* LED7 */
|
||||||
PM5 &= ~BIT(0); /* LED8 */
|
PM5 &= ~BIT(0); /* LED8 */
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
#if UIP_CONF_IPV6_RPL
|
#if UIP_CONF_IPV6_RPL
|
||||||
printf(CONTIKI_VERSION_STRING " started with IPV6, RPL" NEWLINE);
|
printf(CONTIKI_VERSION_STRING " started with IPV6, RPL" NEWLINE);
|
||||||
#else
|
#else
|
||||||
|
@ -183,7 +183,7 @@ main(int argc, char **argv)
|
||||||
netstack_init();
|
netstack_init();
|
||||||
printf("MAC %s RDC %s NETWORK %s" NEWLINE, NETSTACK_MAC.name, NETSTACK_RDC.name, NETSTACK_NETWORK.name);
|
printf("MAC %s RDC %s NETWORK %s" NEWLINE, NETSTACK_MAC.name, NETSTACK_RDC.name, NETSTACK_NETWORK.name);
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
memcpy(&uip_lladdr.addr, serial_id, sizeof(uip_lladdr.addr));
|
memcpy(&uip_lladdr.addr, serial_id, sizeof(uip_lladdr.addr));
|
||||||
|
|
||||||
process_start(&tcpip_process, NULL);
|
process_start(&tcpip_process, NULL);
|
||||||
|
@ -201,7 +201,7 @@ main(int argc, char **argv)
|
||||||
|
|
||||||
printf("%02x%02x" NEWLINE, lladdr->ipaddr.u8[14], lladdr->ipaddr.u8[15]);
|
printf("%02x%02x" NEWLINE, lladdr->ipaddr.u8[14], lladdr->ipaddr.u8[15]);
|
||||||
}
|
}
|
||||||
#elif UIP_CONF_IPV4
|
#elif NETSTACK_CONF_WITH_IPV4
|
||||||
process_start(&tcpip_process, NULL);
|
process_start(&tcpip_process, NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
|
|
||||||
#define NULLRDC_CONF_802154_AUTOACK 1
|
#define NULLRDC_CONF_802154_AUTOACK 1
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
/* Network setup for IPv6 */
|
/* Network setup for IPv6 */
|
||||||
#define NETSTACK_CONF_NETWORK sicslowpan_driver
|
#define NETSTACK_CONF_NETWORK sicslowpan_driver
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@
|
||||||
#define QUEUEBUF_CONF_NUM 8
|
#define QUEUEBUF_CONF_NUM 8
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
/* Network setup for non-IPv6 (rime). */
|
/* Network setup for non-IPv6 (rime). */
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@
|
||||||
#define CC2420_CONF_SFD_TIMESTAMPS 1
|
#define CC2420_CONF_SFD_TIMESTAMPS 1
|
||||||
#endif /* TIMESYNCH_CONF_ENABLED */
|
#endif /* TIMESYNCH_CONF_ENABLED */
|
||||||
|
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
#define PACKETBUF_CONF_ATTRS_INLINE 1
|
#define PACKETBUF_CONF_ATTRS_INLINE 1
|
||||||
|
|
||||||
|
@ -135,7 +135,7 @@
|
||||||
#define PROCESS_CONF_STATS 1
|
#define PROCESS_CONF_STATS 1
|
||||||
/*#define PROCESS_CONF_FASTPOLL 4*/
|
/*#define PROCESS_CONF_FASTPOLL 4*/
|
||||||
|
|
||||||
#ifdef UIP_CONF_IPV6
|
#ifdef NETSTACK_CONF_WITH_IPV6
|
||||||
|
|
||||||
#define LINKADDR_CONF_SIZE 8
|
#define LINKADDR_CONF_SIZE 8
|
||||||
|
|
||||||
|
@ -159,7 +159,7 @@
|
||||||
#define UIP_CONF_ND6_REACHABLE_TIME 600000
|
#define UIP_CONF_ND6_REACHABLE_TIME 600000
|
||||||
#define UIP_CONF_ND6_RETRANS_TIMER 10000
|
#define UIP_CONF_ND6_RETRANS_TIMER 10000
|
||||||
|
|
||||||
#define UIP_CONF_IPV6 1
|
#define NETSTACK_CONF_WITH_IPV6 1
|
||||||
#ifndef UIP_CONF_IPV6_QUEUE_PKT
|
#ifndef UIP_CONF_IPV6_QUEUE_PKT
|
||||||
#define UIP_CONF_IPV6_QUEUE_PKT 0
|
#define UIP_CONF_IPV6_QUEUE_PKT 0
|
||||||
#endif /* UIP_CONF_IPV6_QUEUE_PKT */
|
#endif /* UIP_CONF_IPV6_QUEUE_PKT */
|
||||||
|
@ -186,10 +186,10 @@
|
||||||
#ifndef SICSLOWPAN_CONF_MAX_MAC_TRANSMISSIONS
|
#ifndef SICSLOWPAN_CONF_MAX_MAC_TRANSMISSIONS
|
||||||
#define SICSLOWPAN_CONF_MAX_MAC_TRANSMISSIONS 5
|
#define SICSLOWPAN_CONF_MAX_MAC_TRANSMISSIONS 5
|
||||||
#endif /* SICSLOWPAN_CONF_MAX_MAC_TRANSMISSIONS */
|
#endif /* SICSLOWPAN_CONF_MAX_MAC_TRANSMISSIONS */
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
#define UIP_CONF_IP_FORWARD 1
|
#define UIP_CONF_IP_FORWARD 1
|
||||||
#define UIP_CONF_BUFFER_SIZE 108
|
#define UIP_CONF_BUFFER_SIZE 108
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
#define UIP_CONF_ICMP_DEST_UNREACH 1
|
#define UIP_CONF_ICMP_DEST_UNREACH 1
|
||||||
|
|
||||||
|
|
|
@ -53,9 +53,9 @@
|
||||||
#include "lcd.h"
|
#include "lcd.h"
|
||||||
#include "duty-cycle-scroller.h"
|
#include "duty-cycle-scroller.h"
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
#include "net/ipv6/uip-ds6.h"
|
#include "net/ipv6/uip-ds6.h"
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
|
|
||||||
#define DEBUG 1
|
#define DEBUG 1
|
||||||
|
@ -77,7 +77,7 @@ set_rime_addr(void)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
memset(&addr, 0, sizeof(linkaddr_t));
|
memset(&addr, 0, sizeof(linkaddr_t));
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
memcpy(addr.u8, node_mac, sizeof(addr.u8));
|
memcpy(addr.u8, node_mac, sizeof(addr.u8));
|
||||||
#else
|
#else
|
||||||
if(node_id == 0) {
|
if(node_id == 0) {
|
||||||
|
@ -122,9 +122,9 @@ main(int argc, char **argv)
|
||||||
leds_on(LEDS_RED);
|
leds_on(LEDS_RED);
|
||||||
|
|
||||||
uart1_init(BAUD2UBR(115200)); /* Must come before first printf */
|
uart1_init(BAUD2UBR(115200)); /* Must come before first printf */
|
||||||
#if UIP_CONF_IPV4
|
#if NETSTACK_CONF_WITH_IPV4
|
||||||
slip_arch_init(BAUD2UBR(115200));
|
slip_arch_init(BAUD2UBR(115200));
|
||||||
#endif /* UIP_CONF_IPV4 */
|
#endif /* NETSTACK_CONF_WITH_IPV4 */
|
||||||
|
|
||||||
leds_on(LEDS_GREEN);
|
leds_on(LEDS_GREEN);
|
||||||
/* xmem_init(); */
|
/* xmem_init(); */
|
||||||
|
@ -203,7 +203,7 @@ main(int argc, char **argv)
|
||||||
PRINTF("Node id not set.\n");
|
PRINTF("Node id not set.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
memcpy(&uip_lladdr.addr, node_mac, sizeof(uip_lladdr.addr));
|
memcpy(&uip_lladdr.addr, node_mac, sizeof(uip_lladdr.addr));
|
||||||
/* Setup nullmac-like MAC for 802.15.4 */
|
/* Setup nullmac-like MAC for 802.15.4 */
|
||||||
|
|
||||||
|
@ -248,7 +248,7 @@ main(int argc, char **argv)
|
||||||
ipaddr.u8[7 * 2], ipaddr.u8[7 * 2 + 1]);
|
ipaddr.u8[7 * 2], ipaddr.u8[7 * 2 + 1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
NETSTACK_RDC.init();
|
NETSTACK_RDC.init();
|
||||||
NETSTACK_MAC.init();
|
NETSTACK_MAC.init();
|
||||||
|
@ -259,9 +259,9 @@ main(int argc, char **argv)
|
||||||
CLOCK_SECOND / (NETSTACK_RDC.channel_check_interval() == 0? 1:
|
CLOCK_SECOND / (NETSTACK_RDC.channel_check_interval() == 0? 1:
|
||||||
NETSTACK_RDC.channel_check_interval()),
|
NETSTACK_RDC.channel_check_interval()),
|
||||||
CC2420_CONF_CHANNEL);
|
CC2420_CONF_CHANNEL);
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
#if !UIP_CONF_IPV6
|
#if !NETSTACK_CONF_WITH_IPV6
|
||||||
uart1_set_input(serial_line_input_byte);
|
uart1_set_input(serial_line_input_byte);
|
||||||
serial_line_init();
|
serial_line_init();
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -72,8 +72,8 @@ uart1_writeb(unsigned char c)
|
||||||
UCA1TXBUF = c;
|
UCA1TXBUF = c;
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
#if ! UIP_CONF_IPV4 /* If UIP_CONF_IPV4 is defined, putchar() is defined by the SLIP driver */
|
#if ! NETSTACK_CONF_WITH_IPV4 /* If NETSTACK_CONF_WITH_IPV4 is defined, putchar() is defined by the SLIP driver */
|
||||||
#endif /* ! UIP_CONF_IPV4 */
|
#endif /* ! NETSTACK_CONF_WITH_IPV4 */
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
/**
|
/**
|
||||||
* Initalize the RS232 port.
|
* Initalize the RS232 port.
|
||||||
|
|
|
@ -115,7 +115,7 @@
|
||||||
#define RPL_CONF_MAX_DAG_PER_INSTANCE 1
|
#define RPL_CONF_MAX_DAG_PER_INSTANCE 1
|
||||||
#define PROCESS_CONF_NUMEVENTS 16
|
#define PROCESS_CONF_NUMEVENTS 16
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
|
|
||||||
/* Network setup for IPv6 */
|
/* Network setup for IPv6 */
|
||||||
#define NETSTACK_CONF_NETWORK sicslowpan_driver
|
#define NETSTACK_CONF_NETWORK sicslowpan_driver
|
||||||
|
@ -138,7 +138,7 @@
|
||||||
#define UIP_CONF_IPV6_RPL 1
|
#define UIP_CONF_IPV6_RPL 1
|
||||||
#define UIP_CONF_ND6_SEND_RA 0
|
#define UIP_CONF_ND6_SEND_RA 0
|
||||||
|
|
||||||
#define UIP_CONF_IPV6 1
|
#define NETSTACK_CONF_WITH_IPV6 1
|
||||||
#define UIP_CONF_IPV6_QUEUE_PKT 0
|
#define UIP_CONF_IPV6_QUEUE_PKT 0
|
||||||
#define UIP_CONF_IPV6_CHECKS 1
|
#define UIP_CONF_IPV6_CHECKS 1
|
||||||
#define UIP_CONF_IPV6_REASSEMBLY 0
|
#define UIP_CONF_IPV6_REASSEMBLY 0
|
||||||
|
@ -161,12 +161,12 @@
|
||||||
#define SICSLOWPAN_CONF_MAXAGE 2
|
#define SICSLOWPAN_CONF_MAXAGE 2
|
||||||
#endif /* SICSLOWPAN_CONF_MAXAGE */
|
#endif /* SICSLOWPAN_CONF_MAXAGE */
|
||||||
|
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
/* Network setup for non-IPv6 (rime). */
|
/* Network setup for non-IPv6 (rime). */
|
||||||
#define NETSTACK_CONF_NETWORK rime_driver
|
#define NETSTACK_CONF_NETWORK rime_driver
|
||||||
|
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
#ifdef PROJECT_CONF_H
|
#ifdef PROJECT_CONF_H
|
||||||
#include PROJECT_CONF_H
|
#include PROJECT_CONF_H
|
||||||
|
|
|
@ -46,7 +46,7 @@
|
||||||
|
|
||||||
#include "contiki-net.h"
|
#include "contiki-net.h"
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
|
|
||||||
#define DEBUG 1
|
#define DEBUG 1
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
|
@ -136,5 +136,5 @@ void set_net_address(void)
|
||||||
#endif /* FIXED_GLOBAL_ADDRESS */
|
#endif /* FIXED_GLOBAL_ADDRESS */
|
||||||
|
|
||||||
|
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
|
@ -72,9 +72,9 @@
|
||||||
#include "net/rime/rime.h"
|
#include "net/rime/rime.h"
|
||||||
#include "net/ip/uip.h"
|
#include "net/ip/uip.h"
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
#include "net/ipv6/uip-ds6.h"
|
#include "net/ipv6/uip-ds6.h"
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
#define DEBUG 1
|
#define DEBUG 1
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
|
@ -89,7 +89,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
PROCINIT(&tcpip_process, &sensors_process);
|
PROCINIT(&tcpip_process, &sensors_process);
|
||||||
#else
|
#else
|
||||||
PROCINIT(&sensors_process);
|
PROCINIT(&sensors_process);
|
||||||
|
@ -121,11 +121,11 @@ set_rime_addr(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
memcpy(&uip_lladdr.addr, &eui64, sizeof(uip_lladdr.addr));
|
memcpy(&uip_lladdr.addr, &eui64, sizeof(uip_lladdr.addr));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
linkaddr_set_node_addr((linkaddr_t *)&eui64);
|
linkaddr_set_node_addr((linkaddr_t *)&eui64);
|
||||||
#else
|
#else
|
||||||
linkaddr_set_node_addr((linkaddr_t *)&eui64.u8[8 - LINKADDR_SIZE]);
|
linkaddr_set_node_addr((linkaddr_t *)&eui64.u8[8 - LINKADDR_SIZE]);
|
||||||
|
@ -207,7 +207,7 @@ main(void)
|
||||||
ST_RadioSetEdCcaThreshold(DEFAULT_RADIO_CCA_THRESHOLD);
|
ST_RadioSetEdCcaThreshold(DEFAULT_RADIO_CCA_THRESHOLD);
|
||||||
|
|
||||||
autostart_start(autostart_processes);
|
autostart_start(autostart_processes);
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
printf("Tentative link-local IPv6 address ");
|
printf("Tentative link-local IPv6 address ");
|
||||||
{
|
{
|
||||||
uip_ds6_addr_t *lladdr;
|
uip_ds6_addr_t *lladdr;
|
||||||
|
@ -235,7 +235,7 @@ main(void)
|
||||||
printf("%02x%02x\n",
|
printf("%02x%02x\n",
|
||||||
ipaddr.u8[7 * 2], ipaddr.u8[7 * 2 + 1]);
|
ipaddr.u8[7 * 2], ipaddr.u8[7 * 2 + 1]);
|
||||||
}
|
}
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
watchdog_start();
|
watchdog_start();
|
||||||
|
|
||||||
|
|
|
@ -48,10 +48,10 @@
|
||||||
#include "platform-conf.h"
|
#include "platform-conf.h"
|
||||||
|
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
#define UIP_CONF_IPV6 1
|
#define NETSTACK_CONF_WITH_IPV6 1
|
||||||
#endif
|
#endif
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
/* Network setup for IPv6 */
|
/* Network setup for IPv6 */
|
||||||
#define NETSTACK_CONF_NETWORK sicslowpan_driver
|
#define NETSTACK_CONF_NETWORK sicslowpan_driver
|
||||||
//#define NETSTACK_CONF_MAC csma_driver
|
//#define NETSTACK_CONF_MAC csma_driver
|
||||||
|
@ -65,7 +65,7 @@
|
||||||
#define RIME_CONF_NO_POLITE_ANNOUCEMENTS 0
|
#define RIME_CONF_NO_POLITE_ANNOUCEMENTS 0
|
||||||
#define CXMAC_CONF_ANNOUNCEMENTS 0
|
#define CXMAC_CONF_ANNOUNCEMENTS 0
|
||||||
|
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
/* Network setup for non-IPv6 (rime). */
|
/* Network setup for non-IPv6 (rime). */
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@
|
||||||
|
|
||||||
#define COLLECT_NBR_TABLE_CONF_MAX_NEIGHBORS 32
|
#define COLLECT_NBR_TABLE_CONF_MAX_NEIGHBORS 32
|
||||||
|
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
#define PACKETBUF_CONF_ATTRS_INLINE 1
|
#define PACKETBUF_CONF_ATTRS_INLINE 1
|
||||||
|
|
||||||
|
@ -115,7 +115,7 @@
|
||||||
#define PROCESS_CONF_NUMEVENTS 8
|
#define PROCESS_CONF_NUMEVENTS 8
|
||||||
#define PROCESS_CONF_STATS 1
|
#define PROCESS_CONF_STATS 1
|
||||||
|
|
||||||
#ifdef UIP_CONF_IPV6
|
#ifdef NETSTACK_CONF_WITH_IPV6
|
||||||
|
|
||||||
#define LINKADDR_CONF_SIZE 8
|
#define LINKADDR_CONF_SIZE 8
|
||||||
|
|
||||||
|
@ -135,7 +135,7 @@
|
||||||
#define UIP_CONF_ND6_REACHABLE_TIME 600000
|
#define UIP_CONF_ND6_REACHABLE_TIME 600000
|
||||||
#define UIP_CONF_ND6_RETRANS_TIMER 10000
|
#define UIP_CONF_ND6_RETRANS_TIMER 10000
|
||||||
|
|
||||||
#define UIP_CONF_IPV6 1
|
#define NETSTACK_CONF_WITH_IPV6 1
|
||||||
#define UIP_CONF_IPV6_QUEUE_PKT 0
|
#define UIP_CONF_IPV6_QUEUE_PKT 0
|
||||||
#define UIP_CONF_IPV6_CHECKS 1
|
#define UIP_CONF_IPV6_CHECKS 1
|
||||||
#define UIP_CONF_IPV6_REASSEMBLY 0
|
#define UIP_CONF_IPV6_REASSEMBLY 0
|
||||||
|
@ -155,14 +155,14 @@
|
||||||
#endif /* SICSLOWPAN_CONF_FRAG */
|
#endif /* SICSLOWPAN_CONF_FRAG */
|
||||||
#define SICSLOWPAN_CONF_CONVENTIONAL_MAC 1
|
#define SICSLOWPAN_CONF_CONVENTIONAL_MAC 1
|
||||||
#define SICSLOWPAN_CONF_MAX_ADDR_CONTEXTS 2
|
#define SICSLOWPAN_CONF_MAX_ADDR_CONTEXTS 2
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
#define UIP_CONF_IP_FORWARD 1
|
#define UIP_CONF_IP_FORWARD 1
|
||||||
#define UIP_CONF_BUFFER_SIZE 128
|
#define UIP_CONF_BUFFER_SIZE 128
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
#define UIP_CONF_ICMP_DEST_UNREACH 1
|
#define UIP_CONF_ICMP_DEST_UNREACH 1
|
||||||
|
|
||||||
#if !UIP_CONF_IPV4 && !UIP_CONF_IPV6
|
#if !NETSTACK_CONF_WITH_IPV4 && !NETSTACK_CONF_WITH_IPV6
|
||||||
#define QUEUEBUF_CONF_NUM 8
|
#define QUEUEBUF_CONF_NUM 8
|
||||||
#else
|
#else
|
||||||
#define QUEUEBUF_CONF_NUM 2
|
#define QUEUEBUF_CONF_NUM 2
|
||||||
|
|
|
@ -63,12 +63,12 @@ init_usart(void)
|
||||||
rs232_init(RS232_PORT_0, USART_BAUD_115200,
|
rs232_init(RS232_PORT_0, USART_BAUD_115200,
|
||||||
USART_PARITY_NONE | USART_STOP_BITS_1 | USART_DATA_BITS_8);
|
USART_PARITY_NONE | USART_STOP_BITS_1 | USART_DATA_BITS_8);
|
||||||
|
|
||||||
#if UIP_CONF_IPV4 || UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV4 || NETSTACK_CONF_WITH_IPV6
|
||||||
// slip_arch_init(USART_BAUD_115200);
|
// slip_arch_init(USART_BAUD_115200);
|
||||||
rs232_redirect_stdout(RS232_PORT_0);
|
rs232_redirect_stdout(RS232_PORT_0);
|
||||||
#else
|
#else
|
||||||
rs232_redirect_stdout(RS232_PORT_0);
|
rs232_redirect_stdout(RS232_PORT_0);
|
||||||
#endif /* UIP_CONF_IPV4 || UIP_CONF_IPV6*/
|
#endif /* NETSTACK_CONF_WITH_IPV4 || NETSTACK_CONF_WITH_IPV6*/
|
||||||
|
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
|
@ -54,11 +54,11 @@
|
||||||
#include "dev/ds2401.h"
|
#include "dev/ds2401.h"
|
||||||
#include "sys/node-id.h"
|
#include "sys/node-id.h"
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
#include "net/ipv6/uip-ds6.h"
|
#include "net/ipv6/uip-ds6.h"
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
#if UIP_CONF_IPV4
|
#if NETSTACK_CONF_WITH_IPV4
|
||||||
#include "net/ip/uip.h"
|
#include "net/ip/uip.h"
|
||||||
#include "net/ipv4/uip-fw.h"
|
#include "net/ipv4/uip-fw.h"
|
||||||
#include "net/uip-fw-drv.h"
|
#include "net/uip-fw-drv.h"
|
||||||
|
@ -70,7 +70,7 @@ static struct uip_fw_netif meshif =
|
||||||
|
|
||||||
static uint8_t is_gateway;
|
static uint8_t is_gateway;
|
||||||
|
|
||||||
#endif /* UIP_CONF_IPV4 */
|
#endif /* NETSTACK_CONF_WITH_IPV4 */
|
||||||
|
|
||||||
#define UIP_OVER_MESH_CHANNEL 8
|
#define UIP_OVER_MESH_CHANNEL 8
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ set_rime_addr(void)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
memset(&addr, 0, sizeof(linkaddr_t));
|
memset(&addr, 0, sizeof(linkaddr_t));
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
memcpy(addr.u8, ds2401_id, sizeof(addr.u8));
|
memcpy(addr.u8, ds2401_id, sizeof(addr.u8));
|
||||||
#else
|
#else
|
||||||
if(node_id == 0) {
|
if(node_id == 0) {
|
||||||
|
@ -103,7 +103,7 @@ set_rime_addr(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
#if UIP_CONF_IPV4
|
#if NETSTACK_CONF_WITH_IPV4
|
||||||
static void
|
static void
|
||||||
set_gateway(void)
|
set_gateway(void)
|
||||||
{
|
{
|
||||||
|
@ -118,7 +118,7 @@ set_gateway(void)
|
||||||
is_gateway = 1;
|
is_gateway = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* UIP_CONF_IPV4 */
|
#endif /* NETSTACK_CONF_WITH_IPV4 */
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
void
|
void
|
||||||
init_net(void)
|
init_net(void)
|
||||||
|
@ -141,7 +141,7 @@ init_net(void)
|
||||||
cc2420_set_pan_addr(IEEE802154_PANID, shortaddr, longaddr);
|
cc2420_set_pan_addr(IEEE802154_PANID, shortaddr, longaddr);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
memcpy(&uip_lladdr.addr, ds2401_id, sizeof(uip_lladdr.addr));
|
memcpy(&uip_lladdr.addr, ds2401_id, sizeof(uip_lladdr.addr));
|
||||||
/* Setup nullmac-like MAC for 802.15.4 */
|
/* Setup nullmac-like MAC for 802.15.4 */
|
||||||
/* sicslowpan_init(sicslowmac_init(&cc2420_driver)); */
|
/* sicslowpan_init(sicslowmac_init(&cc2420_driver)); */
|
||||||
|
@ -188,7 +188,7 @@ init_net(void)
|
||||||
ipaddr.u8[7 * 2], ipaddr.u8[7 * 2 + 1]);
|
ipaddr.u8[7 * 2], ipaddr.u8[7 * 2 + 1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
NETSTACK_RDC.init();
|
NETSTACK_RDC.init();
|
||||||
NETSTACK_MAC.init();
|
NETSTACK_MAC.init();
|
||||||
|
@ -199,10 +199,10 @@ init_net(void)
|
||||||
CLOCK_SECOND / (NETSTACK_RDC.channel_check_interval() == 0? 1:
|
CLOCK_SECOND / (NETSTACK_RDC.channel_check_interval() == 0? 1:
|
||||||
NETSTACK_RDC.channel_check_interval()),
|
NETSTACK_RDC.channel_check_interval()),
|
||||||
CC2420_CONF_CHANNEL);
|
CC2420_CONF_CHANNEL);
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
|
|
||||||
#if UIP_CONF_IPV4
|
#if NETSTACK_CONF_WITH_IPV4
|
||||||
uip_ipaddr_t hostaddr, netmask;
|
uip_ipaddr_t hostaddr, netmask;
|
||||||
|
|
||||||
uip_init();
|
uip_init();
|
||||||
|
@ -236,7 +236,7 @@ init_net(void)
|
||||||
uip_over_mesh_init(UIP_OVER_MESH_CHANNEL);
|
uip_over_mesh_init(UIP_OVER_MESH_CHANNEL);
|
||||||
printf_P(PSTR("uIP started with IP address %d.%d.%d.%d\n"),
|
printf_P(PSTR("uIP started with IP address %d.%d.%d.%d\n"),
|
||||||
uip_ipaddr_to_quad(&hostaddr));
|
uip_ipaddr_to_quad(&hostaddr));
|
||||||
#endif /* UIP_CONF_IPV4 */
|
#endif /* NETSTACK_CONF_WITH_IPV4 */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ typedef int32_t s32_t;
|
||||||
typedef unsigned short uip_stats_t;
|
typedef unsigned short uip_stats_t;
|
||||||
|
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
/* The Windows build uses wpcap to connect to a host interface. It finds the interface by scanning for
|
/* The Windows build uses wpcap to connect to a host interface. It finds the interface by scanning for
|
||||||
* an address, which can be specified here and overridden with the command line.
|
* an address, which can be specified here and overridden with the command line.
|
||||||
* An ip4 or ip6 address can be used; this allows turning off the ip4 protocol on the interface.
|
* An ip4 or ip6 address can be used; this allows turning off the ip4 protocol on the interface.
|
||||||
|
@ -155,7 +155,7 @@ typedef unsigned short uip_stats_t;
|
||||||
#define UIP_CONF_UDP 1
|
#define UIP_CONF_UDP 1
|
||||||
#define UIP_CONF_TCP 1
|
#define UIP_CONF_TCP 1
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
#define UIP_CONF_IPV6_QUEUE_PKT 1
|
#define UIP_CONF_IPV6_QUEUE_PKT 1
|
||||||
#define UIP_CONF_IPV6_CHECKS 1
|
#define UIP_CONF_IPV6_CHECKS 1
|
||||||
#define UIP_CONF_IPV6_REASSEMBLY 1
|
#define UIP_CONF_IPV6_REASSEMBLY 1
|
||||||
|
@ -169,7 +169,7 @@ typedef unsigned short uip_stats_t;
|
||||||
#define UIP_CONF_DS6_ADDR_NBU 10
|
#define UIP_CONF_DS6_ADDR_NBU 10
|
||||||
#define UIP_CONF_DS6_MADDR_NBU 0
|
#define UIP_CONF_DS6_MADDR_NBU 0
|
||||||
#define UIP_CONF_DS6_AADDR_NBU 0
|
#define UIP_CONF_DS6_AADDR_NBU 0
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
typedef unsigned long clock_time_t;
|
typedef unsigned long clock_time_t;
|
||||||
#define CLOCK_CONF_SECOND 1000
|
#define CLOCK_CONF_SECOND 1000
|
||||||
|
|
|
@ -54,13 +54,13 @@
|
||||||
#endif /* __CYGWIN__ */
|
#endif /* __CYGWIN__ */
|
||||||
|
|
||||||
#ifdef __CYGWIN__
|
#ifdef __CYGWIN__
|
||||||
#if UIP_CONF_IPV6 || UIP_CONF_IPV4
|
#if NETSTACK_CONF_WITH_IPV6 || NETSTACK_CONF_WITH_IPV4
|
||||||
PROCINIT(&etimer_process, &tcpip_process, &wpcap_process, &serial_line_process);
|
PROCINIT(&etimer_process, &tcpip_process, &wpcap_process, &serial_line_process);
|
||||||
#else
|
#else
|
||||||
PROCINIT(&etimer_process, &wpcap_process, &serial_line_process);
|
PROCINIT(&etimer_process, &wpcap_process, &serial_line_process);
|
||||||
#endif
|
#endif
|
||||||
#else /* __CYGWIN__ */
|
#else /* __CYGWIN__ */
|
||||||
#if UIP_CONF_IPV6 || UIP_CONF_IPV4
|
#if NETSTACK_CONF_WITH_IPV6 || NETSTACK_CONF_WITH_IPV4
|
||||||
PROCINIT(&etimer_process, &tapdev_process, &tcpip_process, &serial_line_process);
|
PROCINIT(&etimer_process, &tapdev_process, &tcpip_process, &serial_line_process);
|
||||||
#else
|
#else
|
||||||
PROCINIT(&etimer_process, &tapdev_process, &serial_line_process);
|
PROCINIT(&etimer_process, &tapdev_process, &serial_line_process);
|
||||||
|
@ -143,7 +143,7 @@ PROCESS_THREAD(border_router_process, ev, data)
|
||||||
}
|
}
|
||||||
#endif /* RPL_BORDER_ROUTER */
|
#endif /* RPL_BORDER_ROUTER */
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
static void
|
static void
|
||||||
sprint_ip6(uip_ip6addr_t addr)
|
sprint_ip6(uip_ip6addr_t addr)
|
||||||
|
@ -182,7 +182,7 @@ sprint_ip6(uip_ip6addr_t addr)
|
||||||
*result=0;
|
*result=0;
|
||||||
printf("%s", thestring);
|
printf("%s", thestring);
|
||||||
}
|
}
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
int contiki_argc = 0;
|
int contiki_argc = 0;
|
||||||
char **contiki_argv;
|
char **contiki_argv;
|
||||||
|
@ -206,7 +206,7 @@ main(int argc, char **argv)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
clock_init();
|
clock_init();
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
/* A hard coded address overrides the stack default MAC address to
|
/* A hard coded address overrides the stack default MAC address to
|
||||||
allow multiple instances. uip6.c defines it as
|
allow multiple instances. uip6.c defines it as
|
||||||
{0x00,0x06,0x98,0x00,0x02,0x32} giving an ipv6 address of
|
{0x00,0x06,0x98,0x00,0x02,0x32} giving an ipv6 address of
|
||||||
|
@ -237,7 +237,7 @@ main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* HARD_CODED_ADDRESS */
|
#endif /* HARD_CODED_ADDRESS */
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
process_init();
|
process_init();
|
||||||
/* procinit_init initializes RPL which sets a ctimer for the first DIS */
|
/* procinit_init initializes RPL which sets a ctimer for the first DIS */
|
||||||
|
@ -256,7 +256,7 @@ main(int argc, char **argv)
|
||||||
autostart_start(autostart_processes);
|
autostart_start(autostart_processes);
|
||||||
|
|
||||||
/* Set default IP addresses if not specified */
|
/* Set default IP addresses if not specified */
|
||||||
#if !UIP_CONF_IPV6
|
#if !NETSTACK_CONF_WITH_IPV6
|
||||||
{
|
{
|
||||||
uip_ipaddr_t addr;
|
uip_ipaddr_t addr;
|
||||||
|
|
||||||
|
@ -281,7 +281,7 @@ main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
printf("Def. Router: %d.%d.%d.%d\n", uip_ipaddr_to_quad(&addr));
|
printf("Def. Router: %d.%d.%d.%d\n", uip_ipaddr_to_quad(&addr));
|
||||||
}
|
}
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
#if !UIP_CONF_IPV6_RPL
|
#if !UIP_CONF_IPV6_RPL
|
||||||
{
|
{
|
||||||
|
@ -313,7 +313,7 @@ main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
#endif /* !UIP_CONF_IPV6_RPL */
|
#endif /* !UIP_CONF_IPV6_RPL */
|
||||||
|
|
||||||
#endif /* !UIP_CONF_IPV6 */
|
#endif /* !NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
// procinit_init();
|
// procinit_init();
|
||||||
// autostart_start(autostart_processes);
|
// autostart_start(autostart_processes);
|
||||||
|
@ -323,7 +323,7 @@ main(int argc, char **argv)
|
||||||
|
|
||||||
printf("\n*******%s online*******\n",CONTIKI_VERSION_STRING);
|
printf("\n*******%s online*******\n",CONTIKI_VERSION_STRING);
|
||||||
|
|
||||||
#if UIP_CONF_IPV6 && !RPL_BORDER_ROUTER /* Border router process prints addresses later */
|
#if NETSTACK_CONF_WITH_IPV6 && !RPL_BORDER_ROUTER /* Border router process prints addresses later */
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
int interface_count = 0;
|
int interface_count = 0;
|
||||||
|
|
|
@ -79,7 +79,7 @@ typedef unsigned short uip_stats_t;
|
||||||
#define NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE 8
|
#define NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE 8
|
||||||
#endif /* NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE */
|
#endif /* NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE */
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
|
|
||||||
#define LINKADDR_CONF_SIZE 8
|
#define LINKADDR_CONF_SIZE 8
|
||||||
|
|
||||||
|
@ -165,7 +165,7 @@ typedef unsigned short uip_stats_t;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#define ctk_arch_isprint isprint
|
#define ctk_arch_isprint isprint
|
||||||
|
|
|
@ -66,9 +66,9 @@
|
||||||
#include "dev/pir-sensor.h"
|
#include "dev/pir-sensor.h"
|
||||||
#include "dev/vib-sensor.h"
|
#include "dev/vib-sensor.h"
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
#include "net/ipv6/uip-ds6.h"
|
#include "net/ipv6/uip-ds6.h"
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
#include "net/rime/rime.h"
|
#include "net/rime/rime.h"
|
||||||
|
|
||||||
|
@ -145,7 +145,7 @@ set_rime_addr(void)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
memset(&addr, 0, sizeof(linkaddr_t));
|
memset(&addr, 0, sizeof(linkaddr_t));
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
memcpy(addr.u8, serial_id, sizeof(addr.u8));
|
memcpy(addr.u8, serial_id, sizeof(addr.u8));
|
||||||
#else
|
#else
|
||||||
if(node_id == 0) {
|
if(node_id == 0) {
|
||||||
|
@ -173,7 +173,7 @@ char **contiki_argv;
|
||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
#if UIP_CONF_IPV6_RPL
|
#if UIP_CONF_IPV6_RPL
|
||||||
printf(CONTIKI_VERSION_STRING " started with IPV6, RPL\n");
|
printf(CONTIKI_VERSION_STRING " started with IPV6, RPL\n");
|
||||||
#else
|
#else
|
||||||
|
@ -213,7 +213,7 @@ main(int argc, char **argv)
|
||||||
netstack_init();
|
netstack_init();
|
||||||
printf("MAC %s RDC %s NETWORK %s\n", NETSTACK_MAC.name, NETSTACK_RDC.name, NETSTACK_NETWORK.name);
|
printf("MAC %s RDC %s NETWORK %s\n", NETSTACK_MAC.name, NETSTACK_RDC.name, NETSTACK_NETWORK.name);
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
queuebuf_init();
|
queuebuf_init();
|
||||||
|
|
||||||
memcpy(&uip_lladdr.addr, serial_id, sizeof(uip_lladdr.addr));
|
memcpy(&uip_lladdr.addr, serial_id, sizeof(uip_lladdr.addr));
|
||||||
|
@ -236,7 +236,7 @@ main(int argc, char **argv)
|
||||||
|
|
||||||
printf("%02x%02x\n", lladdr->ipaddr.u8[14], lladdr->ipaddr.u8[15]);
|
printf("%02x%02x\n", lladdr->ipaddr.u8[14], lladdr->ipaddr.u8[15]);
|
||||||
}
|
}
|
||||||
#elif UIP_CONF_IPV4
|
#elif NETSTACK_CONF_WITH_IPV4
|
||||||
process_start(&tcpip_process, NULL);
|
process_start(&tcpip_process, NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@ typedef uint32_t rtimer_clock_t;
|
||||||
#define ENERGEST_CONF_ON 1
|
#define ENERGEST_CONF_ON 1
|
||||||
#endif /* ENERGEST_CONF_ON */
|
#endif /* ENERGEST_CONF_ON */
|
||||||
|
|
||||||
#ifdef UIP_CONF_IPV6
|
#ifdef NETSTACK_CONF_WITH_IPV6
|
||||||
#define NETSTACK_CONF_NETWORK sicslowpan_driver
|
#define NETSTACK_CONF_NETWORK sicslowpan_driver
|
||||||
#define NETSTACK_CONF_FRAMER framer_802154
|
#define NETSTACK_CONF_FRAMER framer_802154
|
||||||
#define NETSTACK_CONF_MAC nullmac_driver
|
#define NETSTACK_CONF_MAC nullmac_driver
|
||||||
|
@ -87,14 +87,14 @@ typedef uint32_t rtimer_clock_t;
|
||||||
|
|
||||||
#define RDC_CONF_HARDWARE_CSMA 1
|
#define RDC_CONF_HARDWARE_CSMA 1
|
||||||
|
|
||||||
#ifdef UIP_CONF_IPV6
|
#ifdef NETSTACK_CONF_WITH_IPV6
|
||||||
#define UIP_CONF_ROUTER 1
|
#define UIP_CONF_ROUTER 1
|
||||||
#ifndef UIP_CONF_IPV6_RPL
|
#ifndef UIP_CONF_IPV6_RPL
|
||||||
#define UIP_CONF_IPV6_RPL 1
|
#define UIP_CONF_IPV6_RPL 1
|
||||||
#endif /* UIP_CONF_IPV6_RPL */
|
#endif /* UIP_CONF_IPV6_RPL */
|
||||||
|
|
||||||
/* IPv6 configuration options */
|
/* IPv6 configuration options */
|
||||||
#define UIP_CONF_IPV6 1
|
#define NETSTACK_CONF_WITH_IPV6 1
|
||||||
#define NBR_TABLE_CONF_MAX_NEIGHBORS 20 /* number of neighbors */
|
#define NBR_TABLE_CONF_MAX_NEIGHBORS 20 /* number of neighbors */
|
||||||
#define UIP_CONF_DS6_ROUTE_NBU 20 /* number of routes */
|
#define UIP_CONF_DS6_ROUTE_NBU 20 /* number of routes */
|
||||||
#define UIP_CONF_ND6_SEND_RA 0
|
#define UIP_CONF_ND6_SEND_RA 0
|
||||||
|
|
|
@ -73,7 +73,7 @@ init_net(uint8_t node_id)
|
||||||
uint16_t shortaddr;
|
uint16_t shortaddr;
|
||||||
uint64_t longaddr;
|
uint64_t longaddr;
|
||||||
linkaddr_t addr;
|
linkaddr_t addr;
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
uip_ds6_addr_t *lladdr;
|
uip_ds6_addr_t *lladdr;
|
||||||
uip_ipaddr_t ipaddr;
|
uip_ipaddr_t ipaddr;
|
||||||
#endif
|
#endif
|
||||||
|
@ -135,7 +135,7 @@ init_net(uint8_t node_id)
|
||||||
CLOCK_SECOND / (NETSTACK_RDC.channel_check_interval() == 0 ? 1 :
|
CLOCK_SECOND / (NETSTACK_RDC.channel_check_interval() == 0 ? 1 :
|
||||||
NETSTACK_RDC.channel_check_interval()), RF_CHANNEL);
|
NETSTACK_RDC.channel_check_interval()), RF_CHANNEL);
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
|
|
||||||
#if LINKADDR_CONF_SIZE == 2
|
#if LINKADDR_CONF_SIZE == 2
|
||||||
memset(&uip_lladdr.addr, 0, sizeof(uip_lladdr.addr));
|
memset(&uip_lladdr.addr, 0, sizeof(uip_lladdr.addr));
|
||||||
|
@ -146,7 +146,7 @@ init_net(uint8_t node_id)
|
||||||
memcpy(&uip_lladdr.addr, &longaddr, sizeof(uip_lladdr.addr));
|
memcpy(&uip_lladdr.addr, &longaddr, sizeof(uip_lladdr.addr));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if UIP_CONF_IPV6 || UIP_CONF_IPV4
|
#if NETSTACK_CONF_WITH_IPV6 || NETSTACK_CONF_WITH_IPV4
|
||||||
process_start(&tcpip_process, NULL);
|
process_start(&tcpip_process, NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -146,11 +146,11 @@
|
||||||
|
|
||||||
/* Sensinode-Specific Tools and APPs */
|
/* Sensinode-Specific Tools and APPs */
|
||||||
/* Viztool on by default for IPv6 builds */
|
/* Viztool on by default for IPv6 builds */
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
#ifndef VIZTOOL_CONF_ON
|
#ifndef VIZTOOL_CONF_ON
|
||||||
#define VIZTOOL_CONF_ON 1
|
#define VIZTOOL_CONF_ON 1
|
||||||
#endif /* VIZTOOL_CONF_ON */
|
#endif /* VIZTOOL_CONF_ON */
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
/* BatMon off by default unless we build with APPS += batmon */
|
/* BatMon off by default unless we build with APPS += batmon */
|
||||||
#ifndef BATMON_CONF_ON
|
#ifndef BATMON_CONF_ON
|
||||||
|
@ -159,11 +159,11 @@
|
||||||
|
|
||||||
/* Network Stack */
|
/* Network Stack */
|
||||||
#ifndef NETSTACK_CONF_NETWORK
|
#ifndef NETSTACK_CONF_NETWORK
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
#define NETSTACK_CONF_NETWORK sicslowpan_driver
|
#define NETSTACK_CONF_NETWORK sicslowpan_driver
|
||||||
#else
|
#else
|
||||||
#define NETSTACK_CONF_NETWORK rime_driver
|
#define NETSTACK_CONF_NETWORK rime_driver
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
#endif /* NETSTACK_CONF_NETWORK */
|
#endif /* NETSTACK_CONF_NETWORK */
|
||||||
|
|
||||||
#ifndef NETSTACK_CONF_MAC
|
#ifndef NETSTACK_CONF_MAC
|
||||||
|
@ -201,7 +201,7 @@
|
||||||
#define CC2430_RF_CONF_AUTOACK 1
|
#define CC2430_RF_CONF_AUTOACK 1
|
||||||
#endif /* CC2430_CONF_AUTOACK */
|
#endif /* CC2430_CONF_AUTOACK */
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
/* Addresses, Sizes and Interfaces */
|
/* Addresses, Sizes and Interfaces */
|
||||||
/* 8-byte addresses here, 2 otherwise */
|
/* 8-byte addresses here, 2 otherwise */
|
||||||
#define LINKADDR_CONF_SIZE 8
|
#define LINKADDR_CONF_SIZE 8
|
||||||
|
@ -270,13 +270,13 @@
|
||||||
#define QUEUEBUF_CONF_NUM 6
|
#define QUEUEBUF_CONF_NUM 6
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
/* Network setup for non-IPv6 (rime). */
|
/* Network setup for non-IPv6 (rime). */
|
||||||
#define UIP_CONF_IP_FORWARD 1
|
#define UIP_CONF_IP_FORWARD 1
|
||||||
#define UIP_CONF_BUFFER_SIZE 108
|
#define UIP_CONF_BUFFER_SIZE 108
|
||||||
#define RIME_CONF_NO_POLITE_ANNOUCEMENTS 0
|
#define RIME_CONF_NO_POLITE_ANNOUCEMENTS 0
|
||||||
#define QUEUEBUF_CONF_NUM 8
|
#define QUEUEBUF_CONF_NUM 8
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
/* Prevent SDCC compile error when UIP_CONF_ROUTER == 0 */
|
/* Prevent SDCC compile error when UIP_CONF_ROUTER == 0 */
|
||||||
#if !UIP_CONF_ROUTER
|
#if !UIP_CONF_ROUTER
|
||||||
|
|
|
@ -245,7 +245,7 @@ main(void)
|
||||||
sensinode_sensors_activate();
|
sensinode_sensors_activate();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
memcpy(&uip_lladdr.addr, &linkaddr_node_addr, sizeof(uip_lladdr.addr));
|
memcpy(&uip_lladdr.addr, &linkaddr_node_addr, sizeof(uip_lladdr.addr));
|
||||||
queuebuf_init();
|
queuebuf_init();
|
||||||
process_start(&tcpip_process, NULL);
|
process_start(&tcpip_process, NULL);
|
||||||
|
@ -267,7 +267,7 @@ main(void)
|
||||||
uip_ds6_addr_add(&ipaddr, 0, ADDR_TENTATIVE);
|
uip_ds6_addr_add(&ipaddr, 0, ADDR_TENTATIVE);
|
||||||
}
|
}
|
||||||
#endif /* UIP_CONF_IPV6_RPL */
|
#endif /* UIP_CONF_IPV6_RPL */
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Acknowledge the UART1 RX interrupt
|
* Acknowledge the UART1 RX interrupt
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
void
|
void
|
||||||
uip_debug_ipaddr_print(const uip_ipaddr_t *addr)
|
uip_debug_ipaddr_print(const uip_ipaddr_t *addr)
|
||||||
{
|
{
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
uint16_t a;
|
uint16_t a;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
int f;
|
int f;
|
||||||
|
@ -63,9 +63,9 @@ uip_debug_ipaddr_print(const uip_ipaddr_t *addr)
|
||||||
puthex(a & 0xFF);
|
puthex(a & 0xFF);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
PRINTA("%u.%u.%u.%u", addr->u8[0], addr->u8[1], addr->u8[2], addr->u8[3]);
|
PRINTA("%u.%u.%u.%u", addr->u8[0], addr->u8[1], addr->u8[2], addr->u8[3]);
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
void
|
void
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
#define XMAC_CONF_COMPOWER 1
|
#define XMAC_CONF_COMPOWER 1
|
||||||
#define CXMAC_CONF_COMPOWER 1
|
#define CXMAC_CONF_COMPOWER 1
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
/* Network setup for IPv6 */
|
/* Network setup for IPv6 */
|
||||||
#define NETSTACK_CONF_NETWORK sicslowpan_driver
|
#define NETSTACK_CONF_NETWORK sicslowpan_driver
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@
|
||||||
#define QUEUEBUF_CONF_NUM 8
|
#define QUEUEBUF_CONF_NUM 8
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
/* Network setup for non-IPv6 (rime). */
|
/* Network setup for non-IPv6 (rime). */
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@
|
||||||
#define CC2420_CONF_SFD_TIMESTAMPS 1
|
#define CC2420_CONF_SFD_TIMESTAMPS 1
|
||||||
#endif /* TIMESYNCH_CONF_ENABLED */
|
#endif /* TIMESYNCH_CONF_ENABLED */
|
||||||
|
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
#define PACKETBUF_CONF_ATTRS_INLINE 1
|
#define PACKETBUF_CONF_ATTRS_INLINE 1
|
||||||
|
|
||||||
|
@ -135,7 +135,7 @@
|
||||||
#define PROCESS_CONF_STATS 1
|
#define PROCESS_CONF_STATS 1
|
||||||
/*#define PROCESS_CONF_FASTPOLL 4*/
|
/*#define PROCESS_CONF_FASTPOLL 4*/
|
||||||
|
|
||||||
#ifdef UIP_CONF_IPV6
|
#ifdef NETSTACK_CONF_WITH_IPV6
|
||||||
|
|
||||||
#define LINKADDR_CONF_SIZE 8
|
#define LINKADDR_CONF_SIZE 8
|
||||||
|
|
||||||
|
@ -160,7 +160,7 @@
|
||||||
#define UIP_CONF_ND6_REACHABLE_TIME 600000
|
#define UIP_CONF_ND6_REACHABLE_TIME 600000
|
||||||
#define UIP_CONF_ND6_RETRANS_TIMER 10000
|
#define UIP_CONF_ND6_RETRANS_TIMER 10000
|
||||||
|
|
||||||
#define UIP_CONF_IPV6 1
|
#define NETSTACK_CONF_WITH_IPV6 1
|
||||||
#ifndef UIP_CONF_IPV6_QUEUE_PKT
|
#ifndef UIP_CONF_IPV6_QUEUE_PKT
|
||||||
#define UIP_CONF_IPV6_QUEUE_PKT 0
|
#define UIP_CONF_IPV6_QUEUE_PKT 0
|
||||||
#endif /* UIP_CONF_IPV6_QUEUE_PKT */
|
#endif /* UIP_CONF_IPV6_QUEUE_PKT */
|
||||||
|
@ -187,10 +187,10 @@
|
||||||
#ifndef SICSLOWPAN_CONF_MAX_MAC_TRANSMISSIONS
|
#ifndef SICSLOWPAN_CONF_MAX_MAC_TRANSMISSIONS
|
||||||
#define SICSLOWPAN_CONF_MAX_MAC_TRANSMISSIONS 5
|
#define SICSLOWPAN_CONF_MAX_MAC_TRANSMISSIONS 5
|
||||||
#endif /* SICSLOWPAN_CONF_MAX_MAC_TRANSMISSIONS */
|
#endif /* SICSLOWPAN_CONF_MAX_MAC_TRANSMISSIONS */
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
#define UIP_CONF_IP_FORWARD 1
|
#define UIP_CONF_IP_FORWARD 1
|
||||||
#define UIP_CONF_BUFFER_SIZE 108
|
#define UIP_CONF_BUFFER_SIZE 108
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
#define UIP_CONF_ICMP_DEST_UNREACH 1
|
#define UIP_CONF_ICMP_DEST_UNREACH 1
|
||||||
|
|
||||||
|
|
|
@ -43,9 +43,9 @@
|
||||||
#include "net/netstack.h"
|
#include "net/netstack.h"
|
||||||
#include "net/mac/frame802154.h"
|
#include "net/mac/frame802154.h"
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
#include "net/ipv6/uip-ds6.h"
|
#include "net/ipv6/uip-ds6.h"
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
#include "net/rime/rime.h"
|
#include "net/rime/rime.h"
|
||||||
|
|
||||||
|
@ -72,11 +72,11 @@ static struct timer mgt_timer;
|
||||||
#endif
|
#endif
|
||||||
extern int msp430_dco_required;
|
extern int msp430_dco_required;
|
||||||
|
|
||||||
#ifndef UIP_CONF_IPV4
|
#ifndef NETSTACK_CONF_WITH_IPV4
|
||||||
#define UIP_CONF_IPV4 0
|
#define NETSTACK_CONF_WITH_IPV4 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if UIP_CONF_IPV4
|
#if NETSTACK_CONF_WITH_IPV4
|
||||||
#include "net/ip/uip.h"
|
#include "net/ip/uip.h"
|
||||||
#include "net/ipv4/uip-fw.h"
|
#include "net/ipv4/uip-fw.h"
|
||||||
#include "net/ipv4/uip-fw-drv.h"
|
#include "net/ipv4/uip-fw-drv.h"
|
||||||
|
@ -86,12 +86,12 @@ static struct uip_fw_netif slipif =
|
||||||
static struct uip_fw_netif meshif =
|
static struct uip_fw_netif meshif =
|
||||||
{UIP_FW_NETIF(172,16,0,0, 255,255,0,0, uip_over_mesh_send)};
|
{UIP_FW_NETIF(172,16,0,0, 255,255,0,0, uip_over_mesh_send)};
|
||||||
|
|
||||||
#endif /* UIP_CONF_IPV4 */
|
#endif /* NETSTACK_CONF_WITH_IPV4 */
|
||||||
|
|
||||||
#define UIP_OVER_MESH_CHANNEL 8
|
#define UIP_OVER_MESH_CHANNEL 8
|
||||||
#if UIP_CONF_IPV4
|
#if NETSTACK_CONF_WITH_IPV4
|
||||||
static uint8_t is_gateway;
|
static uint8_t is_gateway;
|
||||||
#endif /* UIP_CONF_IPV4 */
|
#endif /* NETSTACK_CONF_WITH_IPV4 */
|
||||||
|
|
||||||
#ifdef EXPERIMENT_SETUP
|
#ifdef EXPERIMENT_SETUP
|
||||||
#include "experiment-setup.h"
|
#include "experiment-setup.h"
|
||||||
|
@ -138,7 +138,7 @@ set_rime_addr(void)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
memset(&addr, 0, sizeof(linkaddr_t));
|
memset(&addr, 0, sizeof(linkaddr_t));
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
memcpy(addr.u8, ds2411_id, sizeof(addr.u8));
|
memcpy(addr.u8, ds2411_id, sizeof(addr.u8));
|
||||||
#else
|
#else
|
||||||
if(node_id == 0) {
|
if(node_id == 0) {
|
||||||
|
@ -172,7 +172,7 @@ print_processes(struct process * const processes[])
|
||||||
}
|
}
|
||||||
#endif /* !PROCESS_CONF_NO_PROCESS_NAMES */
|
#endif /* !PROCESS_CONF_NO_PROCESS_NAMES */
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
#if UIP_CONF_IPV4
|
#if NETSTACK_CONF_WITH_IPV4
|
||||||
static void
|
static void
|
||||||
set_gateway(void)
|
set_gateway(void)
|
||||||
{
|
{
|
||||||
|
@ -187,7 +187,7 @@ set_gateway(void)
|
||||||
is_gateway = 1;
|
is_gateway = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* UIP_CONF_IPV4 */
|
#endif /* NETSTACK_CONF_WITH_IPV4 */
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
static void
|
static void
|
||||||
start_autostart_processes()
|
start_autostart_processes()
|
||||||
|
@ -198,7 +198,7 @@ start_autostart_processes()
|
||||||
autostart_start(autostart_processes);
|
autostart_start(autostart_processes);
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
static void
|
static void
|
||||||
start_uip6()
|
start_uip6()
|
||||||
{
|
{
|
||||||
|
@ -235,16 +235,16 @@ start_uip6()
|
||||||
ipaddr.u8[7 * 2], ipaddr.u8[7 * 2 + 1]);
|
ipaddr.u8[7 * 2], ipaddr.u8[7 * 2 + 1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
static void
|
static void
|
||||||
start_network_layer()
|
start_network_layer()
|
||||||
{
|
{
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
start_uip6();
|
start_uip6();
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
start_autostart_processes();
|
start_autostart_processes();
|
||||||
/* To support link layer security in combination with UIP_CONF_IPV4 and
|
/* To support link layer security in combination with NETSTACK_CONF_WITH_IPV4 and
|
||||||
* TIMESYNCH_CONF_ENABLED further things may need to be moved here */
|
* TIMESYNCH_CONF_ENABLED further things may need to be moved here */
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
|
@ -315,9 +315,9 @@ main(int argc, char **argv)
|
||||||
|
|
||||||
ctimer_init();
|
ctimer_init();
|
||||||
|
|
||||||
#if UIP_CONF_IPV4
|
#if NETSTACK_CONF_WITH_IPV4
|
||||||
slip_arch_init(BAUD2UBR(115200));
|
slip_arch_init(BAUD2UBR(115200));
|
||||||
#endif /* UIP_CONF_IPV4 */
|
#endif /* NETSTACK_CONF_WITH_IPV4 */
|
||||||
|
|
||||||
init_platform();
|
init_platform();
|
||||||
|
|
||||||
|
@ -350,7 +350,7 @@ main(int argc, char **argv)
|
||||||
ds2411_id[0], ds2411_id[1], ds2411_id[2], ds2411_id[3],
|
ds2411_id[0], ds2411_id[1], ds2411_id[2], ds2411_id[3],
|
||||||
ds2411_id[4], ds2411_id[5], ds2411_id[6], ds2411_id[7]);*/
|
ds2411_id[4], ds2411_id[5], ds2411_id[6], ds2411_id[7]);*/
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
memcpy(&uip_lladdr.addr, ds2411_id, sizeof(uip_lladdr.addr));
|
memcpy(&uip_lladdr.addr, ds2411_id, sizeof(uip_lladdr.addr));
|
||||||
/* Setup nullmac-like MAC for 802.15.4 */
|
/* Setup nullmac-like MAC for 802.15.4 */
|
||||||
/* sicslowpan_init(sicslowmac_init(&cc2420_driver)); */
|
/* sicslowpan_init(sicslowmac_init(&cc2420_driver)); */
|
||||||
|
@ -368,7 +368,7 @@ main(int argc, char **argv)
|
||||||
CC2420_CONF_CHANNEL,
|
CC2420_CONF_CHANNEL,
|
||||||
CC2420_CONF_CCA_THRESH);
|
CC2420_CONF_CCA_THRESH);
|
||||||
|
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
NETSTACK_RDC.init();
|
NETSTACK_RDC.init();
|
||||||
NETSTACK_MAC.init();
|
NETSTACK_MAC.init();
|
||||||
|
@ -379,9 +379,9 @@ main(int argc, char **argv)
|
||||||
CLOCK_SECOND / (NETSTACK_RDC.channel_check_interval() == 0? 1:
|
CLOCK_SECOND / (NETSTACK_RDC.channel_check_interval() == 0? 1:
|
||||||
NETSTACK_RDC.channel_check_interval()),
|
NETSTACK_RDC.channel_check_interval()),
|
||||||
CC2420_CONF_CHANNEL);
|
CC2420_CONF_CHANNEL);
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
#if !UIP_CONF_IPV4 && !UIP_CONF_IPV6
|
#if !NETSTACK_CONF_WITH_IPV4 && !NETSTACK_CONF_WITH_IPV6
|
||||||
uart1_set_input(serial_line_input_byte);
|
uart1_set_input(serial_line_input_byte);
|
||||||
serial_line_init();
|
serial_line_init();
|
||||||
#endif
|
#endif
|
||||||
|
@ -393,7 +393,7 @@ main(int argc, char **argv)
|
||||||
timesynch_set_authority_level((linkaddr_node_addr.u8[0] << 4) + 16);
|
timesynch_set_authority_level((linkaddr_node_addr.u8[0] << 4) + 16);
|
||||||
#endif /* TIMESYNCH_CONF_ENABLED */
|
#endif /* TIMESYNCH_CONF_ENABLED */
|
||||||
|
|
||||||
#if UIP_CONF_IPV4
|
#if NETSTACK_CONF_WITH_IPV4
|
||||||
process_start(&tcpip_process, NULL);
|
process_start(&tcpip_process, NULL);
|
||||||
process_start(&uip_fw_process, NULL); /* Start IP output */
|
process_start(&uip_fw_process, NULL); /* Start IP output */
|
||||||
process_start(&slip_process, NULL);
|
process_start(&slip_process, NULL);
|
||||||
|
@ -420,7 +420,7 @@ main(int argc, char **argv)
|
||||||
PRINTF("uIP started with IP address %d.%d.%d.%d\n",
|
PRINTF("uIP started with IP address %d.%d.%d.%d\n",
|
||||||
uip_ipaddr_to_quad(&hostaddr));
|
uip_ipaddr_to_quad(&hostaddr));
|
||||||
}
|
}
|
||||||
#endif /* UIP_CONF_IPV4 */
|
#endif /* NETSTACK_CONF_WITH_IPV4 */
|
||||||
|
|
||||||
watchdog_start();
|
watchdog_start();
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
#define CCIF
|
#define CCIF
|
||||||
#define CLIF
|
#define CLIF
|
||||||
|
|
||||||
#define UIP_CONF_IPV4 1
|
#define NETSTACK_CONF_WITH_IPV4 1
|
||||||
#define WITH_ASCII 1
|
#define WITH_ASCII 1
|
||||||
|
|
||||||
#define CLOCK_CONF_SECOND 100
|
#define CLOCK_CONF_SECOND 100
|
||||||
|
|
|
@ -64,7 +64,7 @@ typedef unsigned short uip_stats_t;
|
||||||
#define UIP_CONF_TCP_SPLIT 1
|
#define UIP_CONF_TCP_SPLIT 1
|
||||||
#define UIP_CONF_LOGGING 1
|
#define UIP_CONF_LOGGING 1
|
||||||
#define UIP_CONF_UDP_CHECKSUMS 1
|
#define UIP_CONF_UDP_CHECKSUMS 1
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
#define UIP_CONF_IP_FORWARD 0
|
#define UIP_CONF_IP_FORWARD 0
|
||||||
#define NBR_TABLE_CONF_MAX_NEIGHBORS 100
|
#define NBR_TABLE_CONF_MAX_NEIGHBORS 100
|
||||||
#define UIP_CONF_DS6_DEFRT_NBU 2
|
#define UIP_CONF_DS6_DEFRT_NBU 2
|
||||||
|
|
|
@ -124,7 +124,7 @@ main(int argc, char **argv)
|
||||||
|
|
||||||
autostart_start(autostart_processes);
|
autostart_start(autostart_processes);
|
||||||
|
|
||||||
#if !UIP_CONF_IPV6
|
#if !NETSTACK_CONF_WITH_IPV6
|
||||||
{
|
{
|
||||||
uip_ipaddr_t addr;
|
uip_ipaddr_t addr;
|
||||||
uip_ipaddr(&addr, 192,168,0,111);
|
uip_ipaddr(&addr, 192,168,0,111);
|
||||||
|
@ -144,7 +144,7 @@ main(int argc, char **argv)
|
||||||
log_message("DNS Server: ", inet_ntoa(*(struct in_addr*)&addr));
|
log_message("DNS Server: ", inet_ntoa(*(struct in_addr*)&addr));
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
#if !UIP_CONF_IPV6_RPL
|
#if !UIP_CONF_IPV6_RPL
|
||||||
#ifdef HARD_CODED_ADDRESS
|
#ifdef HARD_CODED_ADDRESS
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
|
|
||||||
#define NULLRDC_CONF_802154_AUTOACK 1
|
#define NULLRDC_CONF_802154_AUTOACK 1
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
/* Network setup for IPv6 */
|
/* Network setup for IPv6 */
|
||||||
#define NETSTACK_CONF_NETWORK sicslowpan_driver
|
#define NETSTACK_CONF_NETWORK sicslowpan_driver
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@
|
||||||
#define QUEUEBUF_CONF_NUM 8
|
#define QUEUEBUF_CONF_NUM 8
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
/* Network setup for non-IPv6 (rime). */
|
/* Network setup for non-IPv6 (rime). */
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@
|
||||||
#define CC2520_CONF_SFD_TIMESTAMPS 1
|
#define CC2520_CONF_SFD_TIMESTAMPS 1
|
||||||
#endif /* TIMESYNCH_CONF_ENABLED */
|
#endif /* TIMESYNCH_CONF_ENABLED */
|
||||||
|
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
#define PACKETBUF_CONF_ATTRS_INLINE 1
|
#define PACKETBUF_CONF_ATTRS_INLINE 1
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@
|
||||||
#define PROCESS_CONF_STATS 1
|
#define PROCESS_CONF_STATS 1
|
||||||
/*#define PROCESS_CONF_FASTPOLL 4*/
|
/*#define PROCESS_CONF_FASTPOLL 4*/
|
||||||
|
|
||||||
#ifdef UIP_CONF_IPV6
|
#ifdef NETSTACK_CONF_WITH_IPV6
|
||||||
|
|
||||||
#define LINKADDR_CONF_SIZE 8
|
#define LINKADDR_CONF_SIZE 8
|
||||||
|
|
||||||
|
@ -143,7 +143,7 @@
|
||||||
#define UIP_CONF_ND6_REACHABLE_TIME 600000
|
#define UIP_CONF_ND6_REACHABLE_TIME 600000
|
||||||
#define UIP_CONF_ND6_RETRANS_TIMER 10000
|
#define UIP_CONF_ND6_RETRANS_TIMER 10000
|
||||||
|
|
||||||
#define UIP_CONF_IPV6 1
|
#define NETSTACK_CONF_WITH_IPV6 1
|
||||||
#ifndef UIP_CONF_IPV6_QUEUE_PKT
|
#ifndef UIP_CONF_IPV6_QUEUE_PKT
|
||||||
#define UIP_CONF_IPV6_QUEUE_PKT 0
|
#define UIP_CONF_IPV6_QUEUE_PKT 0
|
||||||
#endif /* UIP_CONF_IPV6_QUEUE_PKT */
|
#endif /* UIP_CONF_IPV6_QUEUE_PKT */
|
||||||
|
@ -170,10 +170,10 @@
|
||||||
#ifndef SICSLOWPAN_CONF_MAX_MAC_TRANSMISSIONS
|
#ifndef SICSLOWPAN_CONF_MAX_MAC_TRANSMISSIONS
|
||||||
#define SICSLOWPAN_CONF_MAX_MAC_TRANSMISSIONS 5
|
#define SICSLOWPAN_CONF_MAX_MAC_TRANSMISSIONS 5
|
||||||
#endif /* SICSLOWPAN_CONF_MAX_MAC_TRANSMISSIONS */
|
#endif /* SICSLOWPAN_CONF_MAX_MAC_TRANSMISSIONS */
|
||||||
#else /* UIP_CONF_IPV6 */
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
#define UIP_CONF_IP_FORWARD 1
|
#define UIP_CONF_IP_FORWARD 1
|
||||||
#define UIP_CONF_BUFFER_SIZE 108
|
#define UIP_CONF_BUFFER_SIZE 108
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
|
|
||||||
#define UIP_CONF_ICMP_DEST_UNREACH 1
|
#define UIP_CONF_ICMP_DEST_UNREACH 1
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue