Skip to content

Commit

Permalink
Network layer configuration: replace UIP_CONF_* with NETSTACK_CONF_WI…
Browse files Browse the repository at this point in the history
…TH_*
  • Loading branch information
simonduq committed Dec 1, 2014
1 parent 229c53a commit a9cc909
Show file tree
Hide file tree
Showing 107 changed files with 617 additions and 617 deletions.
6 changes: 3 additions & 3 deletions Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ MODULES += core/sys core/dev core/lib
HAS_STACK = 0
ifeq ($(CONTIKI_WITH_IPV4),1)
HAS_STACK = 1
CFLAGS += -DUIP_CONF_IPV4=1
CFLAGS += -DNETSTACK_CONF_WITH_IPV4=1
MODULES += core/net/ipv4 core/net/ip
endif

ifeq ($(CONTIKI_WITH_RIME),1)
HAS_STACK = 1
CFLAGS += -DUIP_CONF_RIME=1
CFLAGS += -DNETSTACK_CONF_WITH_RIME=1
MODULES += core/net/rime
endif

Expand All @@ -86,7 +86,7 @@ endif
endif

ifeq ($(CONTIKI_WITH_IPV6),1)
CFLAGS += -DUIP_CONF_IPV6=1
CFLAGS += -DNETSTACK_CONF_WITH_IPV6=1
ifneq ($(CONTIKI_WITH_RPL),0)
CFLAGS += -DUIP_CONF_IPV6_RPL=1
MODULES += core/net/rpl
Expand Down
2 changes: 1 addition & 1 deletion apps/er-coap/er-coap.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@

/* direct access into the buffer */
#define UIP_IP_BUF ((struct uip_ip_hdr *)&uip_buf[UIP_LLH_LEN])
#if UIP_CONF_IPV6
#if NETSTACK_CONF_WITH_IPV6
#define UIP_UDP_BUF ((struct uip_udp_hdr *)&uip_buf[uip_l2_l3_hdr_len])
#else
#define UIP_UDP_BUF ((struct uip_udp_hdr *)&uip_buf[UIP_LLH_LEN + UIP_IPH_LEN])
Expand Down
10 changes: 5 additions & 5 deletions apps/powertrace/powertrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ struct powertrace_sniff_stats {
uint32_t num_input, num_output;
uint32_t input_txtime, input_rxtime;
uint32_t output_txtime, output_rxtime;
#if UIP_CONF_IPV6
#if NETSTACK_CONF_WITH_IPV6
uint16_t proto; /* includes proto + possibly flags */
#endif
uint16_t channel;
Expand Down Expand Up @@ -135,7 +135,7 @@ powertrace_print(char *str)

for(s = list_head(stats_list); s != NULL; s = list_item_next(s)) {

#if ! UIP_CONF_IPV6
#if ! NETSTACK_CONF_WITH_IPV6
printf("%s %lu SP %d.%d %lu %u %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu (channel %d radio %d.%02d%% / %d.%02d%%)\n",
str, clock_time(), linkaddr_node_addr.u8[0], linkaddr_node_addr.u8[1], seqno,
s->channel,
Expand Down Expand Up @@ -249,7 +249,7 @@ add_packet_stats(int input_or_output)
put it on the list. */
for(s = list_head(stats_list); s != NULL; s = list_item_next(s)) {
if(s->channel == packetbuf_attr(PACKETBUF_ATTR_CHANNEL)
#if UIP_CONF_IPV6
#if NETSTACK_CONF_WITH_IPV6
&& s->proto == packetbuf_attr(PACKETBUF_ATTR_NETWORK_ID)
#endif
) {
Expand All @@ -262,7 +262,7 @@ add_packet_stats(int input_or_output)
if(s != NULL) {
memset(s, 0, sizeof(struct powertrace_sniff_stats));
s->channel = packetbuf_attr(PACKETBUF_ATTR_CHANNEL);
#if UIP_CONF_IPV6
#if NETSTACK_CONF_WITH_IPV6
s->proto = packetbuf_attr(PACKETBUF_ATTR_NETWORK_ID);
#endif
list_add(stats_list, s);
Expand All @@ -283,7 +283,7 @@ output_sniffer(int mac_status)
add_packet_stats(OUTPUT);
}
/*---------------------------------------------------------------------------*/
#if ! UIP_CONF_IPV6
#if ! NETSTACK_CONF_WITH_IPV6
static void
sniffprint(char *prefix, int seqno)
{
Expand Down
6 changes: 3 additions & 3 deletions apps/shell/shell-ping.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ static unsigned char running;
/*---------------------------------------------------------------------------*/
static void
send_ping(uip_ipaddr_t *dest_addr)
#if UIP_CONF_IPV6
#if NETSTACK_CONF_WITH_IPV6
{
static uint16_t count;
UIP_IP_BUF->vtc = 0x60;
Expand Down Expand Up @@ -92,7 +92,7 @@ send_ping(uip_ipaddr_t *dest_addr)

tcpip_ipv6_output();
}
#else /* UIP_CONF_IPV6 */
#else /* NETSTACK_CONF_WITH_IPV6 */
{
static uint16_t ipid = 0;
static uint16_t seqno = 0;
Expand Down Expand Up @@ -128,7 +128,7 @@ send_ping(uip_ipaddr_t *dest_addr)

tcpip_output();
}
#endif /* UIP_CONF_IPV6 */
#endif /* NETSTACK_CONF_WITH_IPV6 */
/*---------------------------------------------------------------------------*/
PROCESS_THREAD(shell_ping_process, ev, data)
{
Expand Down
4 changes: 2 additions & 2 deletions apps/webserver-nano/webserver-nogui.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ webserver_log_file(uip_ipaddr_t *requester, char *file)
{
/* Print out IP address of requesting host. */

#if UIP_CONF_IPV6
#if NETSTACK_CONF_WITH_IPV6
#if WEBSERVER_CONF_ADDRESSES
char buf[48];
uint8_t j;
Expand All @@ -78,7 +78,7 @@ webserver_log_file(uip_ipaddr_t *requester, char *file)
char buf[20];
sprintf(buf, "%d.%d.%d.%d: ", requester->u8[0], requester->u8[1],
requester->u8[2], requester->u8[3]);
#endif /* UIP_CONF_IPV6 */
#endif /* NETSTACK_CONF_WITH_IPV6 */
//log_message(buf, file);
printf("%s%s\n", buf, file);
}
Expand Down
12 changes: 6 additions & 6 deletions apps/webserver/httpd-cgi.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ make_tcp_stats(void *arg)
struct httpd_state *s = (struct httpd_state *)arg;
conn = &uip_conns[s->u.count];

#if UIP_CONF_IPV6
#if NETSTACK_CONF_WITH_IPV6
char buf[48];
httpd_sprint_ip6(conn->ripaddr, buf);
return snprintf((char *)uip_appdata, uip_mss(),
Expand All @@ -184,7 +184,7 @@ make_tcp_stats(void *arg)
conn->timer,
(uip_outstanding(conn))? '*':' ',
(uip_stopped(conn))? '!':' ');
#endif /* UIP_CONF_IPV6 */
#endif /* NETSTACK_CONF_WITH_IPV6 */
}
/*---------------------------------------------------------------------------*/
static
Expand Down Expand Up @@ -226,7 +226,7 @@ PT_THREAD(processes(struct httpd_state *s, char *ptr))
}
PSOCK_END(&s->sout);
}
#if WEBSERVER_CONF_STATUSPAGE && UIP_CONF_IPV6
#if WEBSERVER_CONF_STATUSPAGE && NETSTACK_CONF_WITH_IPV6
/* These cgi's are invoked by the status.shtml page in /apps/webserver/httpd-fs.
* To keep the webserver build small that 160 byte page is not present in the
* default httpd-fsdata.c file. Run the PERL script /../../tools/makefsdata from the
Expand Down Expand Up @@ -357,15 +357,15 @@ httpd_cgi_add(struct httpd_cgi_call *c)
}
}
/*---------------------------------------------------------------------------*/
#if WEBSERVER_CONF_STATUSPAGE && UIP_CONF_IPV6
#if WEBSERVER_CONF_STATUSPAGE && NETSTACK_CONF_WITH_IPV6
static const char adrs_name[] HTTPD_STRING_ATTR = "addresses";
static const char nbrs_name[] HTTPD_STRING_ATTR = "neighbors";
static const char rtes_name[] HTTPD_STRING_ATTR = "routes";
#endif
HTTPD_CGI_CALL(file, file_name, file_stats);
HTTPD_CGI_CALL(tcp, tcp_name, tcp_stats);
HTTPD_CGI_CALL(proc, proc_name, processes);
#if WEBSERVER_CONF_STATUSPAGE && UIP_CONF_IPV6
#if WEBSERVER_CONF_STATUSPAGE && NETSTACK_CONF_WITH_IPV6
HTTPD_CGI_CALL(adrs, adrs_name, addresses);
HTTPD_CGI_CALL(nbrs, nbrs_name, neighbors);
HTTPD_CGI_CALL(rtes, rtes_name, routes);
Expand All @@ -377,7 +377,7 @@ httpd_cgi_init(void)
httpd_cgi_add(&file);
httpd_cgi_add(&tcp);
httpd_cgi_add(&proc);
#if WEBSERVER_CONF_STATUSPAGE && UIP_CONF_IPV6
#if WEBSERVER_CONF_STATUSPAGE && NETSTACK_CONF_WITH_IPV6
httpd_cgi_add(&adrs);
httpd_cgi_add(&nbrs);
httpd_cgi_add(&rtes);
Expand Down
4 changes: 2 additions & 2 deletions apps/webserver/httpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ httpd_init(void)
memb_init(&conns);
httpd_cgi_init();
}
#if UIP_CONF_IPV6
#if NETSTACK_CONF_WITH_IPV6
/*---------------------------------------------------------------------------*/
uint8_t
httpd_sprint_ip6(uip_ip6addr_t addr, char * result)
Expand Down Expand Up @@ -374,5 +374,5 @@ httpd_sprint_ip6(uip_ip6addr_t addr, char * result)
*result=0;
return (result - starting);
}
#endif /* UIP_CONF_IPV6 */
#endif /* NETSTACK_CONF_WITH_IPV6 */
/*---------------------------------------------------------------------------*/
4 changes: 2 additions & 2 deletions apps/webserver/httpd.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ struct httpd_state {
void httpd_init(void);
void httpd_appcall(void *state);

#if UIP_CONF_IPV6
#if NETSTACK_CONF_WITH_IPV6
uint8_t httpd_sprint_ip6(uip_ip6addr_t addr, char * result);
#endif /* UIP_CONF_IPV6 */
#endif /* NETSTACK_CONF_WITH_IPV6 */

#endif /* HTTPD_H_ */
4 changes: 2 additions & 2 deletions apps/webserver/webserver-nogui.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ webserver_log_file(uip_ipaddr_t *requester, char *file)
#if LOG_CONF_ENABLED
/* Print out IP address of requesting host. */

#if UIP_CONF_IPV6
#if NETSTACK_CONF_WITH_IPV6
char buf[48];
uint8_t j;
j=httpd_sprint_ip6((uip_ip6addr_t)*requester, buf);
Expand All @@ -76,7 +76,7 @@ webserver_log_file(uip_ipaddr_t *requester, char *file)
char buf[20];
sprintf(buf, "%d.%d.%d.%d: ", requester->u8[0], requester->u8[1],
requester->u8[2], requester->u8[3]);
#endif /* UIP_CONF_IPV6 */
#endif /* NETSTACK_CONF_WITH_IPV6 */

log_message(buf, file);
#endif /* LOG_CONF_ENABLED */
Expand Down
8 changes: 4 additions & 4 deletions core/contiki-default-conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,11 @@
* 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. */
#ifndef UIP_CONF_IPV6
#define UIP_CONF_IPV6 0
#endif /* UIP_CONF_IPV6 */
#ifndef NETSTACK_CONF_WITH_IPV6
#define NETSTACK_CONF_WITH_IPV6 0
#endif /* NETSTACK_CONF_WITH_IPV6 */

/* UIP_CONF_BUFFER_SIZE specifies how much memory should be reserved
for the uIP packet buffer. This sets an upper bound on the largest
Expand Down
4 changes: 2 additions & 2 deletions core/contiki-net.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@
#include "net/ip/uip-udp-packet.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-ds6.h"
#endif /* UIP_CONF_IPV6 */
#endif /* NETSTACK_CONF_WITH_IPV6 */

#include "net/ip/resolv.h"

Expand Down
6 changes: 3 additions & 3 deletions core/dev/slip.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ PROCESS_THREAD(slip_process, ev, data)
/* Move packet from rxbuf to buffer provided by uIP. */
uip_len = slip_poll_handler(&uip_buf[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) {
char buf[8];
memcpy(&buf[0], "=IPA", 4);
Expand Down Expand Up @@ -296,7 +296,7 @@ PROCESS_THREAD(slip_process, ev, data)
uip_len = 0;
SLIP_STATISTICS(slip_ip_drop++);
}
#else /* UIP_CONF_IPV6 */
#else /* NETSTACK_CONF_WITH_IPV6 */
if(uip_len > 0) {
if(input_callback) {
input_callback();
Expand All @@ -307,7 +307,7 @@ PROCESS_THREAD(slip_process, ev, data)
tcpip_input();
#endif
}
#endif /* UIP_CONF_IPV6 */
#endif /* NETSTACK_CONF_WITH_IPV6 */
}

PROCESS_END();
Expand Down
Loading

0 comments on commit a9cc909

Please sign in to comment.