Cleanup trailing spaces and convert tabs to spaces

This commit removes trailing spaces and converts
tabs to spaces in all files affected by fix-doxygen PR.
This commit is contained in:
Tommy Sparber 2015-10-30 21:41:59 +11:00
parent 9bb3a3a235
commit 938a425949
29 changed files with 1001 additions and 1033 deletions

View file

@ -161,7 +161,7 @@ char program_handler_screensaver[20];
/*-----------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------*/
void void
program_handler_add(struct dsc *dsc, char *menuname, program_handler_add(struct dsc *dsc, char *menuname,
unsigned char desktop) unsigned char desktop)
{ {
contikidsc[contikidsclast++] = dsc; contikidsc[contikidsclast++] = dsc;
ctk_menuitem_add(&contikimenu, menuname); ctk_menuitem_add(&contikimenu, menuname);
@ -325,106 +325,106 @@ PROCESS_THREAD(program_handler_process, ev, data)
if(ev == ctk_signal_button_activate) { if(ev == ctk_signal_button_activate) {
#ifdef WITH_LOADER_ARCH #ifdef WITH_LOADER_ARCH
if(data == (process_data_t)&loadbutton) { if(data == (process_data_t)&loadbutton) {
ctk_window_close(&runwindow); ctk_window_close(&runwindow);
program_handler_load(name, NULL); program_handler_load(name, NULL);
} else if(data == (process_data_t)&errorokbutton) { } else if(data == (process_data_t)&errorokbutton) {
ctk_dialog_close(); ctk_dialog_close();
} }
#endif /* WITH_LOADER_ARCH */ #endif /* WITH_LOADER_ARCH */
#if QUIT_MENU #if QUIT_MENU
if(data == (process_data_t)&quityesbutton) { if(data == (process_data_t)&quityesbutton) {
ctk_draw_init(); ctk_draw_init();
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);
} else if(data == (process_data_t)&quitnobutton) { } else if(data == (process_data_t)&quitnobutton) {
ctk_dialog_close(); ctk_dialog_close();
} }
#endif /* QUIT_MENU */ #endif /* QUIT_MENU */
dscp = &contikidsc[0]; dscp = &contikidsc[0];
for(i = 0; i < CTK_MAXMENUITEMS; ++i) { for(i = 0; i < CTK_MAXMENUITEMS; ++i) {
if(*dscp != NULL if(*dscp != NULL
#if CTK_CONF_ICONS #if CTK_CONF_ICONS
&& data == (process_data_t)(*dscp)->icon && data == (process_data_t)(*dscp)->icon
#endif /* CTK_CONF_ICONS */ #endif /* CTK_CONF_ICONS */
) { ) {
RUN((*dscp)->prgname, (*dscp)->process, NULL); RUN((*dscp)->prgname, (*dscp)->process, NULL);
break; break;
} }
++dscp; ++dscp;
} }
} else if(ev == ctk_signal_menu_activate) { } else if(ev == ctk_signal_menu_activate) {
if((struct ctk_menu *)data == &contikimenu) { if((struct ctk_menu *)data == &contikimenu) {
#if WITH_LOADER_ARCH #if WITH_LOADER_ARCH
dsc = contikidsc[contikimenu.active]; dsc = contikidsc[contikimenu.active];
if(dsc != NULL) { if(dsc != NULL) {
RUN(dsc->prgname, dsc->process, NULL); RUN(dsc->prgname, dsc->process, NULL);
} else if(contikimenu.active == runmenuitem) { } else if(contikimenu.active == runmenuitem) {
make_windows(); make_windows();
ctk_window_close(&runwindow); ctk_window_close(&runwindow);
ctk_window_open(&runwindow); ctk_window_open(&runwindow);
CTK_WIDGET_FOCUS(&runwindow, &nameentry); CTK_WIDGET_FOCUS(&runwindow, &nameentry);
} }
#else /* WITH_LOADER_ARCH */ #else /* WITH_LOADER_ARCH */
if(contikidsc[contikimenu.active] != NULL) { if(contikidsc[contikimenu.active] != NULL) {
RUN(contikidsc[contikimenu.active]->prgname, RUN(contikidsc[contikimenu.active]->prgname,
contikidsc[contikimenu.active]->process, contikidsc[contikimenu.active]->process,
NULL); NULL);
} }
#endif /* WITH_LOADER_ARCH */ #endif /* WITH_LOADER_ARCH */
#if QUIT_MENU #if QUIT_MENU
if(contikimenu.active == quitmenuitem) { if(contikimenu.active == quitmenuitem) {
ctk_dialog_new(&quitdialog, 24, 5); ctk_dialog_new(&quitdialog, 24, 5);
CTK_WIDGET_ADD(&quitdialog, &quitdialoglabel); CTK_WIDGET_ADD(&quitdialog, &quitdialoglabel);
CTK_WIDGET_ADD(&quitdialog, &quityesbutton); CTK_WIDGET_ADD(&quitdialog, &quityesbutton);
CTK_WIDGET_ADD(&quitdialog, &quitnobutton); CTK_WIDGET_ADD(&quitdialog, &quitnobutton);
CTK_WIDGET_FOCUS(&quitdialog, &quitnobutton); CTK_WIDGET_FOCUS(&quitdialog, &quitnobutton);
ctk_dialog_open(&quitdialog); ctk_dialog_open(&quitdialog);
} }
#endif /* QUIT_MENU */ #endif /* QUIT_MENU */
} }
#if CTK_CONF_SCREENSAVER #if CTK_CONF_SCREENSAVER
} else if(ev == ctk_signal_screensaver_start) { } else if(ev == ctk_signal_screensaver_start) {
#if WITH_LOADER_ARCH #if WITH_LOADER_ARCH
if(program_handler_screensaver[0] != 0) { if(program_handler_screensaver[0] != 0) {
program_handler_load(program_handler_screensaver, NULL); program_handler_load(program_handler_screensaver, NULL);
} }
#endif /* WITH_LOADER_ARCH */ #endif /* WITH_LOADER_ARCH */
#endif /* CTK_CONF_SCREENSAVER */ #endif /* CTK_CONF_SCREENSAVER */
} else if(ev == LOADER_EVENT_DISPLAY_NAME) { } else if(ev == LOADER_EVENT_DISPLAY_NAME) {
#if WITH_LOADER_ARCH #if WITH_LOADER_ARCH
if(displayname == NULL) { if(displayname == NULL) {
make_windows(); make_windows();
ctk_label_set_text(&loadingname, ((struct pnarg *)data)->name); ctk_label_set_text(&loadingname, ((struct pnarg *)data)->name);
ctk_dialog_open(&loadingdialog); ctk_dialog_open(&loadingdialog);
process_post(&program_handler_process, LOADER_EVENT_LOAD, data); process_post(&program_handler_process, LOADER_EVENT_LOAD, data);
displayname = data; displayname = data;
} else { } else {
/* Try again. */ /* Try again. */
process_post(&program_handler_process, LOADER_EVENT_DISPLAY_NAME, data); process_post(&program_handler_process, LOADER_EVENT_DISPLAY_NAME, data);
} }
#endif /* WITH_LOADER_ARCH */ #endif /* WITH_LOADER_ARCH */
} else if(ev == LOADER_EVENT_LOAD) { } else if(ev == LOADER_EVENT_LOAD) {
#if WITH_LOADER_ARCH #if WITH_LOADER_ARCH
if(displayname == data) { if(displayname == data) {
ctk_dialog_close(); ctk_dialog_close();
displayname = NULL; displayname = NULL;
log_message("Loading ", ((struct pnarg *)data)->name); log_message("Loading ", ((struct pnarg *)data)->name);
err = LOADER_LOAD(((struct pnarg *)data)->name, err = LOADER_LOAD(((struct pnarg *)data)->name,
((struct pnarg *)data)->arg); ((struct pnarg *)data)->arg);
if(err != LOADER_OK) { if(err != LOADER_OK) {
make_windows(); make_windows();
errorfilename[0] = '"'; errorfilename[0] = '"';
strncpy(errorfilename + 1, ((struct pnarg *)data)->name, strncpy(errorfilename + 1, ((struct pnarg *)data)->name,
sizeof(errorfilename) - 2); sizeof(errorfilename) - 2);
errorfilename[1 + strlen(((struct pnarg *)data)->name)] = '"'; errorfilename[1 + strlen(((struct pnarg *)data)->name)] = '"';
ctk_label_set_text(&errortype, (char *)errormsgs[err]); ctk_label_set_text(&errortype, (char *)errormsgs[err]);
ctk_dialog_open(&errordialog); ctk_dialog_open(&errordialog);
log_message((char *)errormsgs[err], errorfilename); log_message((char *)errormsgs[err], errorfilename);
} }
pnarg_free(data); pnarg_free(data);
} else { } else {
/* Try again. */ /* Try again. */
process_post(&program_handler_process, LOADER_EVENT_DISPLAY_NAME, data); process_post(&program_handler_process, LOADER_EVENT_DISPLAY_NAME, data);
} }
#endif /* WITH_LOADEER_ARCH */ #endif /* WITH_LOADEER_ARCH */
} }

View file

@ -64,17 +64,11 @@
#define UIP_TCPH_LEN 20 /* Size of TCP header */ #define UIP_TCPH_LEN 20 /* Size of TCP header */
#define UIP_ICMPH_LEN 4 /* Size of ICMP header */ #define UIP_ICMPH_LEN 4 /* Size of ICMP header */
#define UIP_IPUDPH_LEN (UIP_UDPH_LEN + UIP_IPH_LEN) /* Size of IP + #define UIP_IPUDPH_LEN (UIP_UDPH_LEN + UIP_IPH_LEN) /* Size of IP + UDP header */
* UDP #define UIP_IPTCPH_LEN (UIP_TCPH_LEN + UIP_IPH_LEN) /* Size of IP + TCP header */
* header */
#define UIP_IPTCPH_LEN (UIP_TCPH_LEN + UIP_IPH_LEN) /* Size of IP +
* TCP
* header */
#define UIP_TCPIP_HLEN UIP_IPTCPH_LEN #define UIP_TCPIP_HLEN UIP_IPTCPH_LEN
#define UIP_IPICMPH_LEN (UIP_IPH_LEN + UIP_ICMPH_LEN) /* size of ICMP #define UIP_IPICMPH_LEN (UIP_IPH_LEN + UIP_ICMPH_LEN) /* Size of ICMP + IP header */
+ IP header */ #define UIP_LLIPH_LEN (UIP_LLH_LEN + UIP_IPH_LEN) /* Size of L2 + IP header */
#define UIP_LLIPH_LEN (UIP_LLH_LEN + UIP_IPH_LEN) /* size of L2
+ IP header */
#if NETSTACK_CONF_WITH_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
@ -99,12 +93,12 @@
* *
*/ */
typedef union uip_ip4addr_t { typedef union uip_ip4addr_t {
uint8_t u8[4]; /* Initializer, must come first. */ uint8_t u8[4]; /* Initializer, must come first. */
uint16_t u16[2]; uint16_t u16[2];
} uip_ip4addr_t; } uip_ip4addr_t;
typedef union uip_ip6addr_t { typedef union uip_ip6addr_t {
uint8_t u8[16]; /* Initializer, must come first. */ uint8_t u8[16]; /* Initializer, must come first. */
uint16_t u16[8]; uint16_t u16[8];
} uip_ip6addr_t; } uip_ip6addr_t;
@ -1057,7 +1051,7 @@ struct uip_udp_conn *uip_udp_new(const uip_ipaddr_t *ripaddr, uint16_t rport);
* \hideinitializer * \hideinitializer
*/ */
#define uip_ip4addr_cmp(addr1, addr2) ((addr1)->u16[0] == (addr2)->u16[0] && \ #define uip_ip4addr_cmp(addr1, addr2) ((addr1)->u16[0] == (addr2)->u16[0] && \
(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 NETSTACK_CONF_WITH_IPV6 #if NETSTACK_CONF_WITH_IPV6
@ -1358,26 +1352,21 @@ struct uip_conn {
uint16_t lport; /**< The local TCP port, in network byte order. */ uint16_t lport; /**< The local TCP port, in network byte order. */
uint16_t rport; /**< The local remote TCP port, in network byte uint16_t rport; /**< The local remote TCP port, in network byte
order. */ order. */
uint8_t rcv_nxt[4]; /**< The sequence number that we expect to uint8_t rcv_nxt[4]; /**< The sequence number that we expect to
receive next. */ receive next. */
uint8_t snd_nxt[4]; /**< The sequence number that was last sent by uint8_t snd_nxt[4]; /**< The sequence number that was last sent by us. */
us. */
uint16_t len; /**< Length of the data that was previously sent. */ uint16_t len; /**< Length of the data that was previously sent. */
uint16_t mss; /**< Current maximum segment size for the uint16_t mss; /**< Current maximum segment size for the connection. */
connection. */ uint16_t initialmss; /**< Initial maximum segment size for the connection. */
uint16_t initialmss; /**< Initial maximum segment size for the uint8_t sa; /**< Retransmission time-out calculation state variable. */
connection. */ uint8_t sv; /**< Retransmission time-out calculation state variable. */
uint8_t sa; /**< Retransmission time-out calculation state
variable. */
uint8_t sv; /**< Retransmission time-out calculation state
variable. */
uint8_t rto; /**< Retransmission time-out. */ uint8_t rto; /**< Retransmission time-out. */
uint8_t tcpstateflags; /**< TCP state and flags. */ uint8_t tcpstateflags; /**< TCP state and flags. */
uint8_t timer; /**< The retransmission timer. */ uint8_t timer; /**< The retransmission timer. */
uint8_t nrtx; /**< The number of retransmissions for the last uint8_t nrtx; /**< The number of retransmissions for the last
segment sent. */ segment sent. */
/** The application state. */ /** The application state. */
uip_tcp_appstate_t appstate; uip_tcp_appstate_t appstate;
@ -1431,9 +1420,9 @@ struct uip_fallback_interface {
void (*init)(void); void (*init)(void);
/** /**
* \retval >=0 * \retval >=0
* in case of success * in case of success
* \retval <0 * \retval <0
* in case of failure * in case of failure
*/ */
int (*output)(void); int (*output)(void);
}; };
@ -1464,51 +1453,43 @@ extern struct uip_stats uip_stat;
*/ */
struct uip_stats { struct uip_stats {
struct { struct {
uip_stats_t recv; /**< Number of received packets at the IP uip_stats_t recv; /**< Number of received packets at the IP layer. */
layer. */ uip_stats_t sent; /**< Number of sent packets at the IP layer. */
uip_stats_t sent; /**< Number of sent packets at the IP uip_stats_t forwarded;/**< Number of forwarded packets at the IP layer. */
layer. */ uip_stats_t drop; /**< Number of dropped packets at the IP layer. */
uip_stats_t forwarded;/**< Number of forwarded packets at the IP
layer. */
uip_stats_t drop; /**< Number of dropped packets at the IP
layer. */
uip_stats_t vhlerr; /**< Number of packets dropped due to wrong uip_stats_t vhlerr; /**< Number of packets dropped due to wrong
IP version or header length. */ IP version or header length. */
uip_stats_t hblenerr; /**< Number of packets dropped due to wrong uip_stats_t hblenerr; /**< Number of packets dropped due to wrong
IP length, high byte. */ IP length, high byte. */
uip_stats_t lblenerr; /**< Number of packets dropped due to wrong uip_stats_t lblenerr; /**< Number of packets dropped due to wrong
IP length, low byte. */ IP length, low byte. */
uip_stats_t fragerr; /**< Number of packets dropped because they uip_stats_t fragerr; /**< Number of packets dropped because they
were IP fragments. */ were IP fragments. */
uip_stats_t chkerr; /**< Number of packets dropped due to IP uip_stats_t chkerr; /**< Number of packets dropped due to IP
checksum errors. */ checksum errors. */
uip_stats_t protoerr; /**< Number of packets dropped because they uip_stats_t protoerr; /**< Number of packets dropped because they
were neither ICMP, UDP nor TCP. */ were neither ICMP, UDP nor TCP. */
} ip; /**< IP statistics. */ } ip; /**< IP statistics. */
struct { struct {
uip_stats_t recv; /**< Number of received ICMP packets. */ uip_stats_t recv; /**< Number of received ICMP packets. */
uip_stats_t sent; /**< Number of sent ICMP packets. */ uip_stats_t sent; /**< Number of sent ICMP packets. */
uip_stats_t drop; /**< Number of dropped ICMP packets. */ uip_stats_t drop; /**< Number of dropped ICMP packets. */
uip_stats_t typeerr; /**< Number of ICMP packets with a wrong uip_stats_t typeerr; /**< Number of ICMP packets with a wrong type. */
type. */ uip_stats_t chkerr; /**< Number of ICMP packets with a bad checksum. */
uip_stats_t chkerr; /**< Number of ICMP packets with a bad
checksum. */
} icmp; /**< ICMP statistics. */ } icmp; /**< ICMP statistics. */
#if UIP_TCP #if UIP_TCP
struct { struct {
uip_stats_t recv; /**< Number of recived TCP segments. */ uip_stats_t recv; /**< Number of recived TCP segments. */
uip_stats_t sent; /**< Number of sent TCP segments. */ uip_stats_t sent; /**< Number of sent TCP segments. */
uip_stats_t drop; /**< Number of dropped TCP segments. */ uip_stats_t drop; /**< Number of dropped TCP segments. */
uip_stats_t chkerr; /**< Number of TCP segments with a bad uip_stats_t chkerr; /**< Number of TCP segments with a bad checksum. */
checksum. */ uip_stats_t ackerr; /**< Number of TCP segments with a bad ACK number. */
uip_stats_t ackerr; /**< Number of TCP segments with a bad ACK
number. */
uip_stats_t rst; /**< Number of received TCP RST (reset) segments. */ uip_stats_t rst; /**< Number of received TCP RST (reset) segments. */
uip_stats_t rexmit; /**< Number of retransmitted TCP segments. */ uip_stats_t rexmit; /**< Number of retransmitted TCP segments. */
uip_stats_t syndrop; /**< Number of dropped SYNs because too few uip_stats_t syndrop; /**< Number of dropped SYNs because too few
connections were available. */ connections were available. */
uip_stats_t synrst; /**< Number of SYNs for closed ports, uip_stats_t synrst; /**< Number of SYNs for closed ports,
triggering a RST. */ triggering a RST. */
} tcp; /**< TCP statistics. */ } tcp; /**< TCP statistics. */
#endif #endif
#if UIP_UDP #if UIP_UDP
@ -1517,7 +1498,7 @@ struct uip_stats {
uip_stats_t recv; /**< Number of recived UDP segments. */ uip_stats_t recv; /**< Number of recived UDP segments. */
uip_stats_t sent; /**< Number of sent UDP segments. */ uip_stats_t sent; /**< Number of sent UDP segments. */
uip_stats_t chkerr; /**< Number of UDP segments with a bad uip_stats_t chkerr; /**< Number of UDP segments with a bad
checksum. */ checksum. */
} udp; /**< UDP statistics. */ } udp; /**< UDP statistics. */
#endif /* UIP_UDP */ #endif /* UIP_UDP */
#if NETSTACK_CONF_WITH_IPV6 #if NETSTACK_CONF_WITH_IPV6
@ -1554,33 +1535,33 @@ CCIF extern uint8_t uip_flags;
functions/macros. */ functions/macros. */
#define UIP_ACKDATA 1 /* Signifies that the outstanding data was #define UIP_ACKDATA 1 /* Signifies that the outstanding data was
acked and the application should send acked and the application should send
out new data instead of retransmitting out new data instead of retransmitting
the last data. */ the last data. */
#define UIP_NEWDATA 2 /* Flags the fact that the peer has sent #define UIP_NEWDATA 2 /* Flags the fact that the peer has sent
us new data. */ us new data. */
#define UIP_REXMIT 4 /* Tells the application to retransmit the #define UIP_REXMIT 4 /* Tells the application to retransmit the
data that was last sent. */ data that was last sent. */
#define UIP_POLL 8 /* Used for polling the application, to #define UIP_POLL 8 /* Used for polling the application, to
check if the application has data that check if the application has data that
it wants to send. */ it wants to send. */
#define UIP_CLOSE 16 /* The remote host has closed the #define UIP_CLOSE 16 /* The remote host has closed the
connection, thus the connection has connection, thus the connection has
gone away. Or the application signals gone away. Or the application signals
that it wants to close the that it wants to close the
connection. */ connection. */
#define UIP_ABORT 32 /* The remote host has aborted the #define UIP_ABORT 32 /* The remote host has aborted the
connection, thus the connection has connection, thus the connection has
gone away. Or the application signals gone away. Or the application signals
that it wants to abort the that it wants to abort the
connection. */ connection. */
#define UIP_CONNECTED 64 /* We have got a connection from a remote #define UIP_CONNECTED 64 /* We have got a connection from a remote
host and have set up a new connection host and have set up a new connection
for it, or an active connection has for it, or an active connection has
been successfully established. */ been successfully established. */
#define UIP_TIMEDOUT 128 /* The connection has been aborted due to #define UIP_TIMEDOUT 128 /* The connection has been aborted due to
too many retransmissions. */ too many retransmissions. */
/** /**
@ -1606,16 +1587,16 @@ void uip_process(uint8_t flag);
the macros defined in this file. */ the macros defined in this file. */
#define UIP_DATA 1 /* Tells uIP that there is incoming #define UIP_DATA 1 /* Tells uIP that there is incoming
data in the uip_buf buffer. The data in the uip_buf buffer. The
length of the data is stored in the length of the data is stored in the
global variable uip_len. */ global variable uip_len. */
#define UIP_TIMER 2 /* Tells uIP that the periodic timer #define UIP_TIMER 2 /* Tells uIP that the periodic timer
has fired. */ has fired. */
#define UIP_POLL_REQUEST 3 /* Tells uIP that a connection should #define UIP_POLL_REQUEST 3 /* Tells uIP that a connection should
be polled. */ be polled. */
#define UIP_UDP_SEND_CONN 4 /* Tells uIP that a UDP datagram #define UIP_UDP_SEND_CONN 4 /* Tells uIP that a UDP datagram
should be constructed in the should be constructed in the
uip_buf buffer. */ uip_buf buffer. */
#if UIP_UDP #if UIP_UDP
#define UIP_UDP_TIMER 5 #define UIP_UDP_TIMER 5
#endif /* UIP_UDP */ #endif /* UIP_UDP */

View file

@ -627,7 +627,7 @@ compress_hdr_hc06(linkaddr_t *link_destaddr)
!= NULL) { != NULL) {
/* elide the prefix - indicate by CID and set context + SAC */ /* elide the prefix - indicate by CID and set context + SAC */
PRINTF("IPHC: compressing src with context - setting CID & SAC ctx: %d\n", PRINTF("IPHC: compressing src with context - setting CID & SAC ctx: %d\n",
context->number); context->number);
iphc1 |= SICSLOWPAN_IPHC_CID | SICSLOWPAN_IPHC_SAC; iphc1 |= SICSLOWPAN_IPHC_CID | SICSLOWPAN_IPHC_SAC;
PACKETBUF_IPHC_BUF[2] |= context->number << 4; PACKETBUF_IPHC_BUF[2] |= context->number << 4;
/* compession compare with this nodes address (source) */ /* compession compare with this nodes address (source) */
@ -636,9 +636,9 @@ compress_hdr_hc06(linkaddr_t *link_destaddr)
&UIP_IP_BUF->srcipaddr, &uip_lladdr); &UIP_IP_BUF->srcipaddr, &uip_lladdr);
/* No context found for this address */ /* No context found for this address */
} else if(uip_is_addr_linklocal(&UIP_IP_BUF->srcipaddr) && } else if(uip_is_addr_linklocal(&UIP_IP_BUF->srcipaddr) &&
UIP_IP_BUF->destipaddr.u16[1] == 0 && UIP_IP_BUF->destipaddr.u16[1] == 0 &&
UIP_IP_BUF->destipaddr.u16[2] == 0 && UIP_IP_BUF->destipaddr.u16[2] == 0 &&
UIP_IP_BUF->destipaddr.u16[3] == 0) { UIP_IP_BUF->destipaddr.u16[3] == 0) {
iphc1 |= compress_addr_64(SICSLOWPAN_IPHC_SAM_BIT, iphc1 |= compress_addr_64(SICSLOWPAN_IPHC_SAM_BIT,
&UIP_IP_BUF->srcipaddr, &uip_lladdr); &UIP_IP_BUF->srcipaddr, &uip_lladdr);
} else { } else {
@ -684,12 +684,13 @@ compress_hdr_hc06(linkaddr_t *link_destaddr)
/* compession compare with link adress (destination) */ /* compession compare with link adress (destination) */
iphc1 |= compress_addr_64(SICSLOWPAN_IPHC_DAM_BIT, iphc1 |= compress_addr_64(SICSLOWPAN_IPHC_DAM_BIT,
&UIP_IP_BUF->destipaddr, (uip_lladdr_t *)link_destaddr); &UIP_IP_BUF->destipaddr,
(uip_lladdr_t *)link_destaddr);
/* No context found for this address */ /* No context found for this address */
} else if(uip_is_addr_linklocal(&UIP_IP_BUF->destipaddr) && } else if(uip_is_addr_linklocal(&UIP_IP_BUF->destipaddr) &&
UIP_IP_BUF->destipaddr.u16[1] == 0 && UIP_IP_BUF->destipaddr.u16[1] == 0 &&
UIP_IP_BUF->destipaddr.u16[2] == 0 && UIP_IP_BUF->destipaddr.u16[2] == 0 &&
UIP_IP_BUF->destipaddr.u16[3] == 0) { UIP_IP_BUF->destipaddr.u16[3] == 0) {
iphc1 |= compress_addr_64(SICSLOWPAN_IPHC_DAM_BIT, iphc1 |= compress_addr_64(SICSLOWPAN_IPHC_DAM_BIT,
&UIP_IP_BUF->destipaddr, (uip_lladdr_t *)link_destaddr); &UIP_IP_BUF->destipaddr, (uip_lladdr_t *)link_destaddr);
} else { } else {
@ -706,7 +707,7 @@ compress_hdr_hc06(linkaddr_t *link_destaddr)
/* UDP header compression */ /* UDP header compression */
if(UIP_IP_BUF->proto == UIP_PROTO_UDP) { if(UIP_IP_BUF->proto == UIP_PROTO_UDP) {
PRINTF("IPHC: Uncompressed UDP ports on send side: %x, %x\n", PRINTF("IPHC: Uncompressed UDP ports on send side: %x, %x\n",
UIP_HTONS(UIP_UDP_BUF->srcport), UIP_HTONS(UIP_UDP_BUF->destport)); UIP_HTONS(UIP_UDP_BUF->srcport), UIP_HTONS(UIP_UDP_BUF->destport));
/* Mask out the last 4 bits can be used as a mask */ /* Mask out the last 4 bits can be used as a mask */
if(((UIP_HTONS(UIP_UDP_BUF->srcport) & 0xfff0) == SICSLOWPAN_UDP_4_BIT_PORT_MIN) && if(((UIP_HTONS(UIP_UDP_BUF->srcport) & 0xfff0) == SICSLOWPAN_UDP_4_BIT_PORT_MIN) &&
((UIP_HTONS(UIP_UDP_BUF->destport) & 0xfff0) == SICSLOWPAN_UDP_4_BIT_PORT_MIN)) { ((UIP_HTONS(UIP_UDP_BUF->destport) & 0xfff0) == SICSLOWPAN_UDP_4_BIT_PORT_MIN)) {
@ -714,10 +715,10 @@ compress_hdr_hc06(linkaddr_t *link_destaddr)
*hc06_ptr = SICSLOWPAN_NHC_UDP_CS_P_11; *hc06_ptr = SICSLOWPAN_NHC_UDP_CS_P_11;
PRINTF("IPHC: remove 12 b of both source & dest with prefix 0xFOB\n"); PRINTF("IPHC: remove 12 b of both source & dest with prefix 0xFOB\n");
*(hc06_ptr + 1) = *(hc06_ptr + 1) =
(uint8_t)((UIP_HTONS(UIP_UDP_BUF->srcport) - (uint8_t)((UIP_HTONS(UIP_UDP_BUF->srcport) -
SICSLOWPAN_UDP_4_BIT_PORT_MIN) << 4) + SICSLOWPAN_UDP_4_BIT_PORT_MIN) << 4) +
(uint8_t)((UIP_HTONS(UIP_UDP_BUF->destport) - (uint8_t)((UIP_HTONS(UIP_UDP_BUF->destport) -
SICSLOWPAN_UDP_4_BIT_PORT_MIN)); SICSLOWPAN_UDP_4_BIT_PORT_MIN));
hc06_ptr += 2; hc06_ptr += 2;
} else if((UIP_HTONS(UIP_UDP_BUF->destport) & 0xff00) == SICSLOWPAN_UDP_8_BIT_PORT_MIN) { } else if((UIP_HTONS(UIP_UDP_BUF->destport) & 0xff00) == SICSLOWPAN_UDP_8_BIT_PORT_MIN) {
/* we can compress 8 bits of dest, leave source. */ /* we can compress 8 bits of dest, leave source. */
@ -725,16 +726,16 @@ compress_hdr_hc06(linkaddr_t *link_destaddr)
PRINTF("IPHC: leave source, remove 8 bits of dest with prefix 0xF0\n"); PRINTF("IPHC: leave source, remove 8 bits of dest with prefix 0xF0\n");
memcpy(hc06_ptr + 1, &UIP_UDP_BUF->srcport, 2); memcpy(hc06_ptr + 1, &UIP_UDP_BUF->srcport, 2);
*(hc06_ptr + 3) = *(hc06_ptr + 3) =
(uint8_t)((UIP_HTONS(UIP_UDP_BUF->destport) - (uint8_t)((UIP_HTONS(UIP_UDP_BUF->destport) -
SICSLOWPAN_UDP_8_BIT_PORT_MIN)); SICSLOWPAN_UDP_8_BIT_PORT_MIN));
hc06_ptr += 4; hc06_ptr += 4;
} else if((UIP_HTONS(UIP_UDP_BUF->srcport) & 0xff00) == SICSLOWPAN_UDP_8_BIT_PORT_MIN) { } else if((UIP_HTONS(UIP_UDP_BUF->srcport) & 0xff00) == SICSLOWPAN_UDP_8_BIT_PORT_MIN) {
/* we can compress 8 bits of src, leave dest. Copy compressed port */ /* we can compress 8 bits of src, leave dest. Copy compressed port */
*hc06_ptr = SICSLOWPAN_NHC_UDP_CS_P_10; *hc06_ptr = SICSLOWPAN_NHC_UDP_CS_P_10;
PRINTF("IPHC: remove 8 bits of source with prefix 0xF0, leave dest. hch: %i\n", *hc06_ptr); PRINTF("IPHC: remove 8 bits of source with prefix 0xF0, leave dest. hch: %i\n", *hc06_ptr);
*(hc06_ptr + 1) = *(hc06_ptr + 1) =
(uint8_t)((UIP_HTONS(UIP_UDP_BUF->srcport) - (uint8_t)((UIP_HTONS(UIP_UDP_BUF->srcport) -
SICSLOWPAN_UDP_8_BIT_PORT_MIN)); SICSLOWPAN_UDP_8_BIT_PORT_MIN));
memcpy(hc06_ptr + 2, &UIP_UDP_BUF->destport, 2); memcpy(hc06_ptr + 2, &UIP_UDP_BUF->destport, 2);
hc06_ptr += 4; hc06_ptr += 4;
} else { } else {
@ -811,13 +812,13 @@ uncompress_hdr_hc06(uint16_t ip_len)
SICSLOWPAN_IP_BUF->vtc = 0x60 | ((tmp >> 2) & 0x0f); SICSLOWPAN_IP_BUF->vtc = 0x60 | ((tmp >> 2) & 0x0f);
/* ECN rolled down two steps + lowest DSCP bits at top two bits */ /* ECN rolled down two steps + lowest DSCP bits at top two bits */
SICSLOWPAN_IP_BUF->tcflow = ((tmp >> 2) & 0x30) | (tmp << 6) | SICSLOWPAN_IP_BUF->tcflow = ((tmp >> 2) & 0x30) | (tmp << 6) |
(SICSLOWPAN_IP_BUF->tcflow & 0x0f); (SICSLOWPAN_IP_BUF->tcflow & 0x0f);
} else { } else {
/* Traffic class is compressed (set version and no TC)*/ /* Traffic class is compressed (set version and no TC)*/
SICSLOWPAN_IP_BUF->vtc = 0x60; SICSLOWPAN_IP_BUF->vtc = 0x60;
/* highest flow label bits + ECN bits */ /* highest flow label bits + ECN bits */
SICSLOWPAN_IP_BUF->tcflow = (*hc06_ptr & 0x0F) | SICSLOWPAN_IP_BUF->tcflow = (*hc06_ptr & 0x0F) |
((*hc06_ptr >> 2) & 0x30); ((*hc06_ptr >> 2) & 0x30);
memcpy(&SICSLOWPAN_IP_BUF->flow, hc06_ptr + 1, 2); memcpy(&SICSLOWPAN_IP_BUF->flow, hc06_ptr + 1, 2);
hc06_ptr += 3; hc06_ptr += 3;
} }
@ -908,14 +909,13 @@ uncompress_hdr_hc06(uint16_t ip_len)
/* no multicast */ /* no multicast */
/* Context based */ /* Context based */
if(iphc1 & SICSLOWPAN_IPHC_DAC) { if(iphc1 & SICSLOWPAN_IPHC_DAC) {
uint8_t dci = (iphc1 & SICSLOWPAN_IPHC_CID) ? uint8_t dci = (iphc1 & SICSLOWPAN_IPHC_CID) ? PACKETBUF_IPHC_BUF[2] & 0x0f : 0;
PACKETBUF_IPHC_BUF[2] & 0x0f : 0;
context = addr_context_lookup_by_number(dci); context = addr_context_lookup_by_number(dci);
/* all valid cases below need the context! */ /* all valid cases below need the context! */
if(context == NULL) { if(context == NULL) {
PRINTF("sicslowpan uncompress_hdr: error context not found\n"); PRINTF("sicslowpan uncompress_hdr: error context not found\n");
return; return;
} }
uncompress_addr(&SICSLOWPAN_IP_BUF->destipaddr, context->prefix, uncompress_addr(&SICSLOWPAN_IP_BUF->destipaddr, context->prefix,
unc_ctxconf[tmp], unc_ctxconf[tmp],
@ -939,56 +939,56 @@ uncompress_hdr_hc06(uint16_t ip_len)
PRINTF("IPHC: Incoming header value: %i\n", *hc06_ptr); PRINTF("IPHC: Incoming header value: %i\n", *hc06_ptr);
switch(*hc06_ptr & SICSLOWPAN_NHC_UDP_CS_P_11) { switch(*hc06_ptr & SICSLOWPAN_NHC_UDP_CS_P_11) {
case SICSLOWPAN_NHC_UDP_CS_P_00: case SICSLOWPAN_NHC_UDP_CS_P_00:
/* 1 byte for NHC, 4 byte for ports, 2 bytes chksum */ /* 1 byte for NHC, 4 byte for ports, 2 bytes chksum */
memcpy(&SICSLOWPAN_UDP_BUF->srcport, hc06_ptr + 1, 2); memcpy(&SICSLOWPAN_UDP_BUF->srcport, hc06_ptr + 1, 2);
memcpy(&SICSLOWPAN_UDP_BUF->destport, hc06_ptr + 3, 2); memcpy(&SICSLOWPAN_UDP_BUF->destport, hc06_ptr + 3, 2);
PRINTF("IPHC: Uncompressed UDP ports (ptr+5): %x, %x\n", PRINTF("IPHC: Uncompressed UDP ports (ptr+5): %x, %x\n",
UIP_HTONS(SICSLOWPAN_UDP_BUF->srcport), UIP_HTONS(SICSLOWPAN_UDP_BUF->destport)); UIP_HTONS(SICSLOWPAN_UDP_BUF->srcport), UIP_HTONS(SICSLOWPAN_UDP_BUF->destport));
hc06_ptr += 5; hc06_ptr += 5;
break; break;
case SICSLOWPAN_NHC_UDP_CS_P_01: case SICSLOWPAN_NHC_UDP_CS_P_01:
/* 1 byte for NHC + source 16bit inline, dest = 0xF0 + 8 bit inline */ /* 1 byte for NHC + source 16bit inline, dest = 0xF0 + 8 bit inline */
PRINTF("IPHC: Decompressing destination\n"); PRINTF("IPHC: Decompressing destination\n");
memcpy(&SICSLOWPAN_UDP_BUF->srcport, hc06_ptr + 1, 2); memcpy(&SICSLOWPAN_UDP_BUF->srcport, hc06_ptr + 1, 2);
SICSLOWPAN_UDP_BUF->destport = UIP_HTONS(SICSLOWPAN_UDP_8_BIT_PORT_MIN + (*(hc06_ptr + 3))); SICSLOWPAN_UDP_BUF->destport = UIP_HTONS(SICSLOWPAN_UDP_8_BIT_PORT_MIN + (*(hc06_ptr + 3)));
PRINTF("IPHC: Uncompressed UDP ports (ptr+4): %x, %x\n", PRINTF("IPHC: Uncompressed UDP ports (ptr+4): %x, %x\n",
UIP_HTONS(SICSLOWPAN_UDP_BUF->srcport), UIP_HTONS(SICSLOWPAN_UDP_BUF->destport)); UIP_HTONS(SICSLOWPAN_UDP_BUF->srcport), UIP_HTONS(SICSLOWPAN_UDP_BUF->destport));
hc06_ptr += 4; hc06_ptr += 4;
break; break;
case SICSLOWPAN_NHC_UDP_CS_P_10: case SICSLOWPAN_NHC_UDP_CS_P_10:
/* 1 byte for NHC + source = 0xF0 + 8bit inline, dest = 16 bit inline*/ /* 1 byte for NHC + source = 0xF0 + 8bit inline, dest = 16 bit inline*/
PRINTF("IPHC: Decompressing source\n"); PRINTF("IPHC: Decompressing source\n");
SICSLOWPAN_UDP_BUF->srcport = UIP_HTONS(SICSLOWPAN_UDP_8_BIT_PORT_MIN + SICSLOWPAN_UDP_BUF->srcport = UIP_HTONS(SICSLOWPAN_UDP_8_BIT_PORT_MIN +
(*(hc06_ptr + 1))); (*(hc06_ptr + 1)));
memcpy(&SICSLOWPAN_UDP_BUF->destport, hc06_ptr + 2, 2); memcpy(&SICSLOWPAN_UDP_BUF->destport, hc06_ptr + 2, 2);
PRINTF("IPHC: Uncompressed UDP ports (ptr+4): %x, %x\n", PRINTF("IPHC: Uncompressed UDP ports (ptr+4): %x, %x\n",
UIP_HTONS(SICSLOWPAN_UDP_BUF->srcport), UIP_HTONS(SICSLOWPAN_UDP_BUF->destport)); UIP_HTONS(SICSLOWPAN_UDP_BUF->srcport), UIP_HTONS(SICSLOWPAN_UDP_BUF->destport));
hc06_ptr += 4; hc06_ptr += 4;
break; break;
case SICSLOWPAN_NHC_UDP_CS_P_11: case SICSLOWPAN_NHC_UDP_CS_P_11:
/* 1 byte for NHC, 1 byte for ports */ /* 1 byte for NHC, 1 byte for ports */
SICSLOWPAN_UDP_BUF->srcport = UIP_HTONS(SICSLOWPAN_UDP_4_BIT_PORT_MIN + SICSLOWPAN_UDP_BUF->srcport = UIP_HTONS(SICSLOWPAN_UDP_4_BIT_PORT_MIN +
(*(hc06_ptr + 1) >> 4)); (*(hc06_ptr + 1) >> 4));
SICSLOWPAN_UDP_BUF->destport = UIP_HTONS(SICSLOWPAN_UDP_4_BIT_PORT_MIN + SICSLOWPAN_UDP_BUF->destport = UIP_HTONS(SICSLOWPAN_UDP_4_BIT_PORT_MIN +
((*(hc06_ptr + 1)) & 0x0F)); ((*(hc06_ptr + 1)) & 0x0F));
PRINTF("IPHC: Uncompressed UDP ports (ptr+2): %x, %x\n", PRINTF("IPHC: Uncompressed UDP ports (ptr+2): %x, %x\n",
UIP_HTONS(SICSLOWPAN_UDP_BUF->srcport), UIP_HTONS(SICSLOWPAN_UDP_BUF->destport)); UIP_HTONS(SICSLOWPAN_UDP_BUF->srcport), UIP_HTONS(SICSLOWPAN_UDP_BUF->destport));
hc06_ptr += 2; hc06_ptr += 2;
break; break;
default: default:
PRINTF("sicslowpan uncompress_hdr: error unsupported UDP compression\n"); PRINTF("sicslowpan uncompress_hdr: error unsupported UDP compression\n");
return; return;
} }
if(!checksum_compressed) { /* has_checksum, default */ if(!checksum_compressed) { /* has_checksum, default */
memcpy(&SICSLOWPAN_UDP_BUF->udpchksum, hc06_ptr, 2); memcpy(&SICSLOWPAN_UDP_BUF->udpchksum, hc06_ptr, 2);
hc06_ptr += 2; hc06_ptr += 2;
PRINTF("IPHC: sicslowpan uncompress_hdr: checksum included\n"); PRINTF("IPHC: sicslowpan uncompress_hdr: checksum included\n");
} else { } else {
PRINTF("IPHC: sicslowpan uncompress_hdr: checksum *NOT* included\n"); PRINTF("IPHC: sicslowpan uncompress_hdr: checksum *NOT* included\n");
} }
uncomp_hdr_len += UIP_UDPH_LEN; uncomp_hdr_len += UIP_UDPH_LEN;
} }
@ -1196,10 +1196,10 @@ uncompress_hdr_hc1(uint16_t ip_len)
/* src and dest ip addresses */ /* src and dest ip addresses */
uip_ip6addr(&SICSLOWPAN_IP_BUF->srcipaddr, 0xfe80, 0, 0, 0, 0, 0, 0, 0); uip_ip6addr(&SICSLOWPAN_IP_BUF->srcipaddr, 0xfe80, 0, 0, 0, 0, 0, 0, 0);
uip_ds6_set_addr_iid(&SICSLOWPAN_IP_BUF->srcipaddr, uip_ds6_set_addr_iid(&SICSLOWPAN_IP_BUF->srcipaddr,
(uip_lladdr_t *)packetbuf_addr(PACKETBUF_ADDR_SENDER)); (uip_lladdr_t *)packetbuf_addr(PACKETBUF_ADDR_SENDER));
uip_ip6addr(&SICSLOWPAN_IP_BUF->destipaddr, 0xfe80, 0, 0, 0, 0, 0, 0, 0); uip_ip6addr(&SICSLOWPAN_IP_BUF->destipaddr, 0xfe80, 0, 0, 0, 0, 0, 0, 0);
uip_ds6_set_addr_iid(&SICSLOWPAN_IP_BUF->destipaddr, uip_ds6_set_addr_iid(&SICSLOWPAN_IP_BUF->destipaddr,
(uip_lladdr_t *)packetbuf_addr(PACKETBUF_ADDR_RECEIVER)); (uip_lladdr_t *)packetbuf_addr(PACKETBUF_ADDR_RECEIVER));
uncomp_hdr_len += UIP_IPH_LEN; uncomp_hdr_len += UIP_IPH_LEN;
@ -1877,7 +1877,7 @@ sicslowpan_init(void)
addr_contexts[0].used = 1; addr_contexts[0].used = 1;
addr_contexts[0].number = 0; addr_contexts[0].number = 0;
#ifdef SICSLOWPAN_CONF_ADDR_CONTEXT_0 #ifdef SICSLOWPAN_CONF_ADDR_CONTEXT_0
SICSLOWPAN_CONF_ADDR_CONTEXT_0; SICSLOWPAN_CONF_ADDR_CONTEXT_0;
#else #else
addr_contexts[0].prefix[0] = 0xaa; addr_contexts[0].prefix[0] = 0xaa;
addr_contexts[0].prefix[1] = 0xaa; addr_contexts[0].prefix[1] = 0xaa;
@ -1889,15 +1889,15 @@ sicslowpan_init(void)
int i; int i;
for(i = 1; i < SICSLOWPAN_CONF_MAX_ADDR_CONTEXTS; i++) { for(i = 1; i < SICSLOWPAN_CONF_MAX_ADDR_CONTEXTS; i++) {
#ifdef SICSLOWPAN_CONF_ADDR_CONTEXT_1 #ifdef SICSLOWPAN_CONF_ADDR_CONTEXT_1
if (i==1) { if (i==1) {
addr_contexts[1].used = 1; addr_contexts[1].used = 1;
addr_contexts[1].number = 1; addr_contexts[1].number = 1;
SICSLOWPAN_CONF_ADDR_CONTEXT_1; SICSLOWPAN_CONF_ADDR_CONTEXT_1;
#ifdef SICSLOWPAN_CONF_ADDR_CONTEXT_2 #ifdef SICSLOWPAN_CONF_ADDR_CONTEXT_2
} else if (i==2) { } else if (i==2) {
addr_contexts[2].used = 1; addr_contexts[2].used = 1;
addr_contexts[2].number = 2; addr_contexts[2].number = 2;
SICSLOWPAN_CONF_ADDR_CONTEXT_2; SICSLOWPAN_CONF_ADDR_CONTEXT_2;
#endif #endif
} else { } else {
addr_contexts[i].used = 0; addr_contexts[i].used = 0;
@ -1905,7 +1905,6 @@ sicslowpan_init(void)
#else #else
addr_contexts[i].used = 0; addr_contexts[i].used = 0;
#endif /* SICSLOWPAN_CONF_ADDR_CONTEXT_1 */ #endif /* SICSLOWPAN_CONF_ADDR_CONTEXT_1 */
} }
} }
#endif /* SICSLOWPAN_CONF_MAX_ADDR_CONTEXTS > 1 */ #endif /* SICSLOWPAN_CONF_MAX_ADDR_CONTEXTS > 1 */

View file

@ -203,13 +203,13 @@ uip_ds6_link_neighbor_callback(int status, int numtx)
#if UIP_DS6_LL_NUD #if UIP_DS6_LL_NUD
/* From RFC4861, page 72, last paragraph of section 7.3.3: /* From RFC4861, page 72, last paragraph of section 7.3.3:
* *
* "In some cases, link-specific information may indicate that a path to * "In some cases, link-specific information may indicate that a path to
* a neighbor has failed (e.g., the resetting of a virtual circuit). In * a neighbor has failed (e.g., the resetting of a virtual circuit). In
* such cases, link-specific information may be used to purge Neighbor * such cases, link-specific information may be used to purge Neighbor
* Cache entries before the Neighbor Unreachability Detection would do * Cache entries before the Neighbor Unreachability Detection would do
* so. However, link-specific information MUST NOT be used to confirm * so. However, link-specific information MUST NOT be used to confirm
* the reachability of a neighbor; such information does not provide * the reachability of a neighbor; such information does not provide
* end-to-end confirmation between neighboring IP layers." * end-to-end confirmation between neighboring IP layers."
* *
* However, we assume that receiving a link layer ack ensures the delivery * However, we assume that receiving a link layer ack ensures the delivery
* of the transmitted packed to the IP stack of the neighbour. This is a * of the transmitted packed to the IP stack of the neighbour. This is a

View file

@ -297,9 +297,9 @@ uip_ds6_prefix_t *
uip_ds6_prefix_lookup(uip_ipaddr_t *ipaddr, uint8_t ipaddrlen) uip_ds6_prefix_lookup(uip_ipaddr_t *ipaddr, uint8_t ipaddrlen)
{ {
if(uip_ds6_list_loop((uip_ds6_element_t *)uip_ds6_prefix_list, if(uip_ds6_list_loop((uip_ds6_element_t *)uip_ds6_prefix_list,
UIP_DS6_PREFIX_NB, sizeof(uip_ds6_prefix_t), UIP_DS6_PREFIX_NB, sizeof(uip_ds6_prefix_t),
ipaddr, ipaddrlen, ipaddr, ipaddrlen,
(uip_ds6_element_t **)&locprefix) == FOUND) { (uip_ds6_element_t **)&locprefix) == FOUND) {
return locprefix; return locprefix;
} }
return NULL; return NULL;
@ -489,8 +489,8 @@ uip_ds6_aaddr_lookup(uip_ipaddr_t *ipaddr)
{ {
#if UIP_DS6_AADDR_NB #if UIP_DS6_AADDR_NB
if(uip_ds6_list_loop((uip_ds6_element_t *)uip_ds6_if.aaddr_list, if(uip_ds6_list_loop((uip_ds6_element_t *)uip_ds6_if.aaddr_list,
UIP_DS6_AADDR_NB, sizeof(uip_ds6_aaddr_t), ipaddr, 128, UIP_DS6_AADDR_NB, sizeof(uip_ds6_aaddr_t), ipaddr, 128,
(uip_ds6_element_t **)&locaaddr) == FOUND) { (uip_ds6_element_t **)&locaaddr) == FOUND) {
return locaaddr; return locaaddr;
} }
#endif /* UIP_DS6_AADDR_NB */ #endif /* UIP_DS6_AADDR_NB */

View file

@ -378,7 +378,7 @@ uip_nd6_ns_output(uip_ipaddr_t * src, uip_ipaddr_t * dest, uip_ipaddr_t * tgt)
UIP_ICMPH_LEN + UIP_ND6_NS_LEN + UIP_ND6_OPT_LLAO_LEN; UIP_ICMPH_LEN + UIP_ND6_NS_LEN + UIP_ND6_OPT_LLAO_LEN;
create_llao(&uip_buf[uip_l2_l3_icmp_hdr_len + UIP_ND6_NS_LEN], create_llao(&uip_buf[uip_l2_l3_icmp_hdr_len + UIP_ND6_NS_LEN],
UIP_ND6_OPT_SLLAO); UIP_ND6_OPT_SLLAO);
uip_len = uip_len =
UIP_IPH_LEN + UIP_ICMPH_LEN + UIP_ND6_NS_LEN + UIP_ND6_OPT_LLAO_LEN; UIP_IPH_LEN + UIP_ICMPH_LEN + UIP_ND6_NS_LEN + UIP_ND6_OPT_LLAO_LEN;
@ -505,7 +505,7 @@ na_input(void)
goto discard; goto discard;
} }
memcpy(lladdr, &nd6_opt_llao[UIP_ND6_OPT_DATA_OFFSET], memcpy(lladdr, &nd6_opt_llao[UIP_ND6_OPT_DATA_OFFSET],
UIP_LLADDR_LEN); UIP_LLADDR_LEN);
if(is_solicited) { if(is_solicited) {
nbr->state = NBR_REACHABLE; nbr->state = NBR_REACHABLE;
nbr->nscount = 0; nbr->nscount = 0;
@ -528,7 +528,7 @@ na_input(void)
|| nd6_opt_llao == 0) { || nd6_opt_llao == 0) {
if(nd6_opt_llao != 0) { if(nd6_opt_llao != 0) {
memcpy(lladdr, &nd6_opt_llao[UIP_ND6_OPT_DATA_OFFSET], memcpy(lladdr, &nd6_opt_llao[UIP_ND6_OPT_DATA_OFFSET],
UIP_LLADDR_LEN); UIP_LLADDR_LEN);
} }
if(is_solicited) { if(is_solicited) {
nbr->state = NBR_REACHABLE; nbr->state = NBR_REACHABLE;
@ -796,7 +796,7 @@ uip_nd6_rs_output(void)
UIP_ICMPH_LEN + UIP_ND6_RS_LEN + UIP_ND6_OPT_LLAO_LEN; UIP_ICMPH_LEN + UIP_ND6_RS_LEN + UIP_ND6_OPT_LLAO_LEN;
create_llao(&uip_buf[uip_l2_l3_icmp_hdr_len + UIP_ND6_RS_LEN], create_llao(&uip_buf[uip_l2_l3_icmp_hdr_len + UIP_ND6_RS_LEN],
UIP_ND6_OPT_SLLAO); UIP_ND6_OPT_SLLAO);
} }
UIP_ICMP_BUF->icmpchksum = 0; UIP_ICMP_BUF->icmpchksum = 0;
@ -877,9 +877,9 @@ ra_input(void)
nbr->state = NBR_STALE; nbr->state = NBR_STALE;
} }
if(memcmp(&nd6_opt_llao[UIP_ND6_OPT_DATA_OFFSET], if(memcmp(&nd6_opt_llao[UIP_ND6_OPT_DATA_OFFSET],
lladdr, UIP_LLADDR_LEN) != 0) { lladdr, UIP_LLADDR_LEN) != 0) {
memcpy(lladdr, &nd6_opt_llao[UIP_ND6_OPT_DATA_OFFSET], memcpy(lladdr, &nd6_opt_llao[UIP_ND6_OPT_DATA_OFFSET],
UIP_LLADDR_LEN); UIP_LLADDR_LEN);
nbr->state = NBR_STALE; nbr->state = NBR_STALE;
} }
nbr->isrouter = 1; nbr->isrouter = 1;

View file

@ -128,9 +128,9 @@
#endif #endif
#ifdef UIP_CONF_ND6_RETRANS_TIMER #ifdef UIP_CONF_ND6_RETRANS_TIMER
#define UIP_ND6_RETRANS_TIMER UIP_CONF_ND6_RETRANS_TIMER #define UIP_ND6_RETRANS_TIMER UIP_CONF_ND6_RETRANS_TIMER
#else #else
#define UIP_ND6_RETRANS_TIMER 1000 #define UIP_ND6_RETRANS_TIMER 1000
#endif #endif
#define UIP_ND6_DELAY_FIRST_PROBE_TIME 5 #define UIP_ND6_DELAY_FIRST_PROBE_TIME 5

View file

@ -390,7 +390,7 @@ upper_layer_chksum(uint8_t proto)
upper_layer_len = (((uint16_t)(UIP_IP_BUF->len[0]) << 8) + UIP_IP_BUF->len[1] - uip_ext_len); upper_layer_len = (((uint16_t)(UIP_IP_BUF->len[0]) << 8) + UIP_IP_BUF->len[1] - uip_ext_len);
PRINTF("Upper layer checksum len: %d from: %d\n", upper_layer_len, PRINTF("Upper layer checksum len: %d from: %d\n", upper_layer_len,
UIP_IPH_LEN + UIP_LLH_LEN + uip_ext_len); UIP_IPH_LEN + UIP_LLH_LEN + uip_ext_len);
/* First sum pseudoheader. */ /* First sum pseudoheader. */
/* IP protocol and length fields. This addition cannot carry. */ /* IP protocol and length fields. This addition cannot carry. */
@ -538,14 +538,14 @@ remove_ext_hdr(void)
/* Remove ext header before TCP/UDP processing. */ /* Remove ext header before TCP/UDP processing. */
if(uip_ext_len > 0) { if(uip_ext_len > 0) {
PRINTF("Cutting ext-header before processing (extlen: %d, uiplen: %d)\n", PRINTF("Cutting ext-header before processing (extlen: %d, uiplen: %d)\n",
uip_ext_len, uip_len); uip_ext_len, uip_len);
if(uip_len < UIP_IPH_LEN + uip_ext_len) { if(uip_len < UIP_IPH_LEN + uip_ext_len) {
PRINTF("ERROR: uip_len too short compared to ext len\n"); PRINTF("ERROR: uip_len too short compared to ext len\n");
uip_clear_buf(); uip_clear_buf();
return; return;
} }
memmove(((uint8_t *)UIP_TCP_BUF), (uint8_t *)UIP_TCP_BUF + uip_ext_len, memmove(((uint8_t *)UIP_TCP_BUF), (uint8_t *)UIP_TCP_BUF + uip_ext_len,
uip_len - UIP_IPH_LEN - uip_ext_len); uip_len - UIP_IPH_LEN - uip_ext_len);
uip_len -= uip_ext_len; uip_len -= uip_ext_len;
@ -881,14 +881,14 @@ ext_hdr_options_process(void)
uip_ext_opt_offset += UIP_EXT_HDR_OPT_PADN_BUF->opt_len + 2; uip_ext_opt_offset += UIP_EXT_HDR_OPT_PADN_BUF->opt_len + 2;
break; break;
case UIP_EXT_HDR_OPT_RPL: case UIP_EXT_HDR_OPT_RPL:
/* Fixes situation when a node that is not using RPL /* Fixes situation when a node that is not using RPL
* joins a network which does. The received packages will include the * joins a network which does. The received packages will include the
* RPL header and processed by the "default" case of the switch * RPL header and processed by the "default" case of the switch
* (0x63 & 0xC0 = 0x40). Hence, the packet is discarded as the header * (0x63 & 0xC0 = 0x40). Hence, the packet is discarded as the header
* is considered invalid. * is considered invalid.
* Using this fix, the header is ignored, and the next header (if * Using this fix, the header is ignored, and the next header (if
* present) is processed. * present) is processed.
*/ */
#if UIP_CONF_IPV6_RPL #if UIP_CONF_IPV6_RPL
PRINTF("Processing RPL option\n"); PRINTF("Processing RPL option\n");
if(rpl_verify_header(uip_ext_opt_offset)) { if(rpl_verify_header(uip_ext_opt_offset)) {
@ -1168,11 +1168,11 @@ uip_process(uint8_t flag)
uip_ext_len += (UIP_EXT_BUF->len << 3) + 8; uip_ext_len += (UIP_EXT_BUF->len << 3) + 8;
break; break;
case 1: case 1:
PRINTF("Dropping packet after extension header processing\n"); PRINTF("Dropping packet after extension header processing\n");
/* silently discard */ /* silently discard */
goto drop; goto drop;
case 2: case 2:
PRINTF("Sending error message after extension header processing\n"); PRINTF("Sending error message after extension header processing\n");
/* send icmp error message (created in ext_hdr_options_process) /* send icmp error message (created in ext_hdr_options_process)
* and discard*/ * and discard*/
goto send; goto send;
@ -1839,9 +1839,9 @@ uip_process(uint8_t flag)
receive a SYN, in which case we should retransmit our SYNACK receive a SYN, in which case we should retransmit our SYNACK
(which is done futher down). */ (which is done futher down). */
if(!((((uip_connr->tcpstateflags & UIP_TS_MASK) == UIP_SYN_SENT) && if(!((((uip_connr->tcpstateflags & UIP_TS_MASK) == UIP_SYN_SENT) &&
((UIP_TCP_BUF->flags & TCP_CTL) == (TCP_SYN | TCP_ACK))) || ((UIP_TCP_BUF->flags & TCP_CTL) == (TCP_SYN | TCP_ACK))) ||
(((uip_connr->tcpstateflags & UIP_TS_MASK) == UIP_SYN_RCVD) && (((uip_connr->tcpstateflags & UIP_TS_MASK) == UIP_SYN_RCVD) &&
((UIP_TCP_BUF->flags & TCP_CTL) == TCP_SYN)))) { ((UIP_TCP_BUF->flags & TCP_CTL) == TCP_SYN)))) {
if((uip_len > 0 || ((UIP_TCP_BUF->flags & (TCP_SYN | TCP_FIN)) != 0)) && if((uip_len > 0 || ((UIP_TCP_BUF->flags & (TCP_SYN | TCP_FIN)) != 0)) &&
(UIP_TCP_BUF->seqno[0] != uip_connr->rcv_nxt[0] || (UIP_TCP_BUF->seqno[0] != uip_connr->rcv_nxt[0] ||
UIP_TCP_BUF->seqno[1] != uip_connr->rcv_nxt[1] || UIP_TCP_BUF->seqno[1] != uip_connr->rcv_nxt[1] ||
@ -1927,7 +1927,7 @@ uip_process(uint8_t flag)
} }
/* We need to retransmit the SYNACK */ /* We need to retransmit the SYNACK */
if((UIP_TCP_BUF->flags & TCP_CTL) == TCP_SYN) { if((UIP_TCP_BUF->flags & TCP_CTL) == TCP_SYN) {
goto tcp_send_synack; goto tcp_send_synack;
} }
goto drop; goto drop;
#if UIP_ACTIVE_OPEN #if UIP_ACTIVE_OPEN

View file

@ -9772,36 +9772,36 @@ typedef struct { /*!< pADI_WDT Structure
*********************************************/ *********************************************/
//iEiNr in EiCfg() //iEiNr in EiCfg()
#define EXTINT0 0x0 #define EXTINT0 0x0
#define EXTINT1 0x1 #define EXTINT1 0x1
#define EXTINT2 0x2 #define EXTINT2 0x2
#define EXTINT3 0x3 #define EXTINT3 0x3
#define EXTINT4 0x4 #define EXTINT4 0x4
#define EXTINT5 0x5 #define EXTINT5 0x5
#define EXTINT6 0x6 #define EXTINT6 0x6
#define EXTINT7 0x7 #define EXTINT7 0x7
#define EXTINT8 0x8 #define EXTINT8 0x8
//iEnable in EiCfg() //iEnable in EiCfg()
#define INT_DIS 0x0 #define INT_DIS 0x0
#define INT_EN 0x1 #define INT_EN 0x1
//iMode in EiCfg() //iMode in EiCfg()
#define INT_RISE 0x0 #define INT_RISE 0x0
#define INT_FALL 0x1 #define INT_FALL 0x1
#define INT_EDGES 0x2 #define INT_EDGES 0x2
#define INT_HIGH 0x3 #define INT_HIGH 0x3
#define INT_LOW 0x4 #define INT_LOW 0x4
//Bit values. //Bit values.
#define BIT0 1 #define BIT0 1
#define BIT1 2 #define BIT1 2
#define BIT2 4 #define BIT2 4
#define BIT3 8 #define BIT3 8
#define BIT4 0x10 #define BIT4 0x10
#define BIT5 0x20 #define BIT5 0x20
#define BIT6 0x40 #define BIT6 0x40
#define BIT7 0x80 #define BIT7 0x80
/* ================================================================================ */ /* ================================================================================ */

View file

@ -89,10 +89,10 @@
* processor. * processor.
*/ */
int elfloader_arch_relocate(int input_fd, int elfloader_arch_relocate(int input_fd,
struct elfloader_output *output, struct elfloader_output *output,
unsigned int sectionoffset, unsigned int sectionoffset,
char *sectionaddr, char *sectionaddr,
struct elf32_rela *rela, char *addr); struct elf32_rela *rela, char *addr);
#endif /* ELFLOADER_ARCH_H_ */ #endif /* ELFLOADER_ARCH_H_ */

View file

@ -37,7 +37,7 @@
* Header file for the Contiki ELF loader. * Header file for the Contiki ELF loader.
* \author * \author
* Adam Dunkels <adam@sics.se> * Adam Dunkels <adam@sics.se>
* Simon Berg <ksb@users.sourceforge.net> * Simon Berg <ksb@users.sourceforge.net>
* *
*/ */
@ -132,7 +132,7 @@
* Return value from elfloader_load() indicating that the offset for * Return value from elfloader_load() indicating that the offset for
* a relative addressing mode was too big. * a relative addressing mode was too big.
*/ */
#define ELFLOADER_OUTOF_RANGE 9 #define ELFLOADER_OUTOF_RANGE 9
/** /**
* Return value from elfloader_load() indicating that the relocations * Return value from elfloader_load() indicating that the relocations
@ -144,13 +144,13 @@
* Return value from elfloader_load() indicating that reading from the * Return value from elfloader_load() indicating that reading from the
* ELF file failed in some way. * ELF file failed in some way.
*/ */
#define ELFLOADER_INPUT_ERROR 11 #define ELFLOADER_INPUT_ERROR 11
/** /**
* Return value from elfloader_load() indicating that writing to a segment * Return value from elfloader_load() indicating that writing to a segment
* failed. * failed.
*/ */
#define ELFLOADER_OUTPUT_ERROR 12 #define ELFLOADER_OUTPUT_ERROR 12
#define ELFLOADER_SEG_TEXT 1 #define ELFLOADER_SEG_TEXT 1
@ -164,10 +164,10 @@
* This object defines methods (callbacks) for writing the segments to memory. * This object defines methods (callbacks) for writing the segments to memory.
* It can be extended by the user to include any necessary state. * It can be extended by the user to include any necessary state.
*/ */
struct elfloader_output { struct elfloader_output {
const struct elfloader_output_ops *ops; const struct elfloader_output_ops *ops;
}; };
/** /**
* \brief Allocate a new segment * \brief Allocate a new segment
* \param input The output object * \param input The output object
@ -178,9 +178,8 @@ struct elfloader_output {
* The returned address doesn't need to correspond to any real memory, * The returned address doesn't need to correspond to any real memory,
* since it's only used for calculating the relocations. * since it's only used for calculating the relocations.
*/ */
void *elfloader_allocate_segment(struct elfloader_output *output, void *elfloader_allocate_segment(struct elfloader_output *output,
unsigned int type, int size); unsigned int type, int size);
/** /**
* \brief Start writing to a new segment * \brief Start writing to a new segment
@ -191,15 +190,14 @@ void *elfloader_allocate_segment(struct elfloader_output *output,
* \return Returns ELFLOADER_OK if successful, otherwise an error code * \return Returns ELFLOADER_OK if successful, otherwise an error code
* *
*/ */
int elfloader_start_segment(struct elfloader_output *output, int elfloader_start_segment(struct elfloader_output *output,
unsigned int type, void *addr, int size); unsigned int type, void *addr, int size);
/** /**
* \brief Mark end of segment * \brief Mark end of segment
* \param input The output object * \param input The output object
* \return Zero if successful * \return Zero if successful
*/ */
int elfloader_end_segment(struct elfloader_output *output); int elfloader_end_segment(struct elfloader_output *output);
/** /**
@ -209,9 +207,8 @@ int elfloader_end_segment(struct elfloader_output *output);
* \param len Length of data * \param len Length of data
* \return The number of bytes actually written, or negative if failed. * \return The number of bytes actually written, or negative if failed.
*/ */
int elfloader_write_segment(struct elfloader_output *output, const char *buf, int elfloader_write_segment(struct elfloader_output *output, const char *buf,
unsigned int len); unsigned int len);
/** /**
* \brief Get the current offset in the file where the next data will * \brief Get the current offset in the file where the next data will
@ -219,7 +216,6 @@ int elfloader_write_segment(struct elfloader_output *output, const char *buf,
* \param input The output object * \param input The output object
* \return The current offset. * \return The current offset.
*/ */
unsigned int elfloader_segment_offset(struct elfloader_output *output); unsigned int elfloader_segment_offset(struct elfloader_output *output);
#define elfloader_output_alloc_segment(output, type, size) \ #define elfloader_output_alloc_segment(output, type, size) \
@ -240,12 +236,12 @@ unsigned int elfloader_segment_offset(struct elfloader_output *output);
struct elfloader_output_ops { struct elfloader_output_ops {
void * (*allocate_segment)(struct elfloader_output *output, void * (*allocate_segment)(struct elfloader_output *output,
unsigned int type, int size); unsigned int type, int size);
int (*start_segment)(struct elfloader_output *output, int (*start_segment)(struct elfloader_output *output,
unsigned int type, void *addr, int size); unsigned int type, void *addr, int size);
int (*end_segment)(struct elfloader_output *output); int (*end_segment)(struct elfloader_output *output);
int (*write_segment)(struct elfloader_output *output, const char *buf, int (*write_segment)(struct elfloader_output *output, const char *buf,
unsigned int len); unsigned int len);
unsigned int (*segment_offset)(struct elfloader_output *output); unsigned int (*segment_offset)(struct elfloader_output *output);
}; };
@ -269,8 +265,7 @@ void elfloader_init(void);
* elfloader_loaded_process variable. * elfloader_loaded_process variable.
* *
*/ */
int elfloader_load(int input_fd, int elfloader_load(int input_fd, struct elfloader_output *output);
struct elfloader_output *output);
/** /**
* A pointer to the processes loaded with elfloader_load(). * A pointer to the processes loaded with elfloader_load().

View file

@ -1001,11 +1001,11 @@ static NETBUF *NicGetPacket(void)
* Hack alert: Rev A chips never set the odd frame indicator. * Hack alert: Rev A chips never set the odd frame indicator.
*/ */
fbc -= 3; fbc -= 3;
/* nb = NutNetBufAlloc(0, NBAF_DATALINK, fbc);*/ /* nb = NutNetBufAlloc(0, NBAF_DATALINK, fbc);*/
/* Perform the read. */ /* Perform the read. */
/* if (nb) /* if (nb)
NicRead(nb->nb_dl.vp, fbc);*/ NicRead(nb->nb_dl.vp, fbc);*/
} }
/* Release the packet. */ /* Release the packet. */
@ -1191,12 +1191,12 @@ PROCESS_THREAD(lanc111_process, ev, data)
*/ */
imsk = nic_inlb(NIC_MSK); imsk = nic_inlb(NIC_MSK);
nic_outlb(NIC_MSK, 0); nic_outlb(NIC_MSK, 0);
/* while ((nb = NicGetPacket()) != 0) { /* while ((nb = NicGetPacket()) != 0) {
if (nb != (NETBUF *) 0xFFFF) { if (nb != (NETBUF *) 0xFFFF) {
ni->ni_rx_packets++; ni->ni_rx_packets++;
(*ifn->if_recv) (dev, nb); (*ifn->if_recv) (dev, nb);
} }
}*/ }*/
nic_outlb(NIC_MSK, imsk | INT_RCV | INT_ERCV); nic_outlb(NIC_MSK, imsk | INT_RCV | INT_ERCV);
} }
@ -1351,7 +1351,7 @@ lanc111_init(void)
/* Register interrupt handler and enable interrupts. */ /* Register interrupt handler and enable interrupts. */
/* if (NutRegisterIrqHandler(&LANC111_SIGNAL, NicInterrupt, dev)) /* if (NutRegisterIrqHandler(&LANC111_SIGNAL, NicInterrupt, dev))
return -1;*/ return -1;*/
/* /*
* Start the receiver thread. * Start the receiver thread.

View file

@ -26,7 +26,6 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
*
/** /**
* \file * \file
* Dummy implementation of minileds module * Dummy implementation of minileds module

View file

@ -80,15 +80,15 @@ ISR(TIMERA1, timera1)
++count; ++count;
/* Make sure the CLOCK_CONF_SECOND is a power of two, to ensure /* Make sure the CLOCK_CONF_SECOND is a power of two, to ensure
that the modulo operation below becomes a logical and and not that the modulo operation below becomes a logical and and not
an expensive divide. Algorithm from Wikipedia: an expensive divide. Algorithm from Wikipedia:
http://en.wikipedia.org/wiki/Power_of_two */ http://en.wikipedia.org/wiki/Power_of_two */
#if (CLOCK_CONF_SECOND & (CLOCK_CONF_SECOND - 1)) != 0 #if (CLOCK_CONF_SECOND & (CLOCK_CONF_SECOND - 1)) != 0
#error CLOCK_CONF_SECOND must be a power of two (i.e., 1, 2, 4, 8, 16, 32, 64, ...). #error CLOCK_CONF_SECOND must be a power of two (i.e., 1, 2, 4, 8, 16, 32, 64, ...).
#error Change CLOCK_CONF_SECOND in contiki-conf.h. #error Change CLOCK_CONF_SECOND in contiki-conf.h.
#endif #endif
if(count % CLOCK_CONF_SECOND == 0) { if(count % CLOCK_CONF_SECOND == 0) {
++seconds; ++seconds;
energest_flush(); energest_flush();
} }
last_tar = read_tar(); last_tar = read_tar();

View file

@ -52,5 +52,3 @@ enum {
/**@} // End of addtogroup /**@} // End of addtogroup
*/ */

View file

@ -149,4 +149,3 @@ StStatus halBootloaderStart(uint8_t mode, uint8_t channel, uint16_t panId);
/** @} END micro group */ /** @} END micro group */
/** @} */ /** @} */

View file

@ -272,15 +272,15 @@ our code. These numbers are obtained using 'avr-gcc 4.2.2 (WinAVR
\note The following compilation flags were used: \note The following compilation flags were used:
\code \code
UIP_CONF_IPV6 1 UIP_CONF_IPV6 1
UIP_CONF_IPV6_CHECKS 1 UIP_CONF_IPV6_CHECKS 1
UIP_CONF_IPV6_QUEUE_PKT 0 UIP_CONF_IPV6_QUEUE_PKT 0
UIP_CONF_IPV6_REASSEMBLY 0 UIP_CONF_IPV6_REASSEMBLY 0
UIP_NETIF_MAX_ADDRESSES 3 UIP_NETIF_MAX_ADDRESSES 3
UIP_ND6_MAX_PREFIXES 3 UIP_ND6_MAX_PREFIXES 3
UIP_ND6_MAX_NEIGHBORS 4 UIP_ND6_MAX_NEIGHBORS 4
UIP_ND6_MAX_DEFROUTER 2 UIP_ND6_MAX_DEFROUTER 2
\endcode \endcode
The total IPv6 code size is approximately 11.5Kbyte and the RAM usage around The total IPv6 code size is approximately 11.5Kbyte and the RAM usage around

View file

@ -103,7 +103,7 @@ void menu_process(char c);
extern char usb_busy; extern char usb_busy;
//! Counter for USB Serial port //! Counter for USB Serial port
extern U8 tx_counter; extern U8 tx_counter;
//! Timers for LEDs //! Timers for LEDs
uint8_t led3_timer; uint8_t led3_timer;

View file

@ -191,7 +191,7 @@ contiki_init(void)
/* Initialize communication stack */ /* Initialize communication stack */
netstack_init(); netstack_init();
printf("%s/%s/%s, channel check rate %lu Hz\n", printf("%s/%s/%s, channel check rate %lu Hz\n",
NETSTACK_NETWORK.name, NETSTACK_MAC.name, NETSTACK_RDC.name, NETSTACK_NETWORK.name, NETSTACK_MAC.name, NETSTACK_RDC.name,
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()));

View file

@ -241,7 +241,7 @@ contiki_init()
/* Initialize communication stack */ /* Initialize communication stack */
netstack_init(); netstack_init();
printf("%s/%s/%s, channel check rate %lu Hz\n", printf("%s/%s/%s, channel check rate %lu Hz\n",
NETSTACK_NETWORK.name, NETSTACK_MAC.name, NETSTACK_RDC.name, NETSTACK_NETWORK.name, NETSTACK_MAC.name, NETSTACK_RDC.name,
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()));
@ -294,11 +294,11 @@ contiki_init()
int i; int i;
lladdr = uip_ds6_get_link_local(-1); lladdr = uip_ds6_get_link_local(-1);
for(i = 0; i < 7; ++i) { for(i = 0; i < 7; ++i) {
printf("%02x%02x:", lladdr->ipaddr.u8[i * 2], printf("%02x%02x:", lladdr->ipaddr.u8[i * 2],
lladdr->ipaddr.u8[i * 2 + 1]); lladdr->ipaddr.u8[i * 2 + 1]);
} }
printf("%02x%02x\n", lladdr->ipaddr.u8[14], printf("%02x%02x\n", lladdr->ipaddr.u8[14],
lladdr->ipaddr.u8[15]); lladdr->ipaddr.u8[15]);
} }
if(1) { if(1) {
@ -417,10 +417,9 @@ JNIEXPORT void JNICALL
Java_org_contikios_cooja_corecomm_CLASSNAME_setMemory(JNIEnv *env, jobject obj, jint rel_addr, jint length, jbyteArray mem_arr) Java_org_contikios_cooja_corecomm_CLASSNAME_setMemory(JNIEnv *env, jobject obj, jint rel_addr, jint length, jbyteArray mem_arr)
{ {
jbyte *mem = (*env)->GetByteArrayElements(env, mem_arr, 0); jbyte *mem = (*env)->GetByteArrayElements(env, mem_arr, 0);
memcpy( memcpy((char*) (((long)rel_addr) + referenceVar),
(char*) (((long)rel_addr) + referenceVar), mem,
mem, length);
length);
(*env)->ReleaseByteArrayElements(env, mem_arr, mem, 0); (*env)->ReleaseByteArrayElements(env, mem_arr, mem, 0);
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
@ -453,7 +452,7 @@ Java_org_contikios_cooja_corecomm_CLASSNAME_tick(JNIEnv *env, jobject obj)
doActionsBeforeTick(); doActionsBeforeTick();
/* Poll etimer process */ /* Poll etimer process */
if (etimer_pending()) { if(etimer_pending()) {
etimer_request_poll(); etimer_request_poll();
} }
@ -481,9 +480,9 @@ Java_org_contikios_cooja_corecomm_CLASSNAME_tick(JNIEnv *env, jobject obj)
nextRtimer = rtimer_arch_next() - (rtimer_clock_t) simCurrentTime; nextRtimer = rtimer_arch_next() - (rtimer_clock_t) simCurrentTime;
if(etimer_pending() && rtimer_arch_pending()) { if(etimer_pending() && rtimer_arch_pending()) {
simNextExpirationTime = MIN(nextEtimer, nextRtimer); simNextExpirationTime = MIN(nextEtimer, nextRtimer);
} else if (etimer_pending()) { } else if(etimer_pending()) {
simNextExpirationTime = nextEtimer; simNextExpirationTime = nextEtimer;
} else if (rtimer_arch_pending()) { } else if(rtimer_arch_pending()) {
simNextExpirationTime = nextRtimer; simNextExpirationTime = nextRtimer;
} }
} }

View file

@ -122,5 +122,4 @@ status(int type)
} }
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
SENSORS_SENSOR(acc_sensor, ACC_SENSOR, SENSORS_SENSOR(acc_sensor, ACC_SENSOR, value, configure, status);
value, configure, status);

View file

@ -100,5 +100,4 @@ configure(int type, int c)
} }
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
SENSORS_SENSOR(ext_sensor, "Ext", SENSORS_SENSOR(ext_sensor, "Ext", value, configure, status);
value, configure, status);