Network layer configuration: replace UIP_CONF_* with NETSTACK_CONF_WITH_*
This commit is contained in:
parent
229c53a2e6
commit
a9cc909794
107 changed files with 617 additions and 617 deletions
|
@ -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])
|
||||
|
|
|
@ -51,7 +51,7 @@ struct powertrace_sniff_stats {
|
|||
uint32_t num_input, num_output;
|
||||
uint32_t input_txtime, input_rxtime;
|
||||
uint32_t output_txtime, output_rxtime;
|
||||
#if UIP_CONF_IPV6
|
||||
#if NETSTACK_CONF_WITH_IPV6
|
||||
uint16_t proto; /* includes proto + possibly flags */
|
||||
#endif
|
||||
uint16_t channel;
|
||||
|
@ -135,7 +135,7 @@ powertrace_print(char *str)
|
|||
|
||||
for(s = list_head(stats_list); s != NULL; s = list_item_next(s)) {
|
||||
|
||||
#if ! UIP_CONF_IPV6
|
||||
#if ! NETSTACK_CONF_WITH_IPV6
|
||||
printf("%s %lu SP %d.%d %lu %u %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu (channel %d radio %d.%02d%% / %d.%02d%%)\n",
|
||||
str, clock_time(), linkaddr_node_addr.u8[0], linkaddr_node_addr.u8[1], seqno,
|
||||
s->channel,
|
||||
|
@ -249,7 +249,7 @@ add_packet_stats(int input_or_output)
|
|||
put it on the list. */
|
||||
for(s = list_head(stats_list); s != NULL; s = list_item_next(s)) {
|
||||
if(s->channel == packetbuf_attr(PACKETBUF_ATTR_CHANNEL)
|
||||
#if UIP_CONF_IPV6
|
||||
#if NETSTACK_CONF_WITH_IPV6
|
||||
&& s->proto == packetbuf_attr(PACKETBUF_ATTR_NETWORK_ID)
|
||||
#endif
|
||||
) {
|
||||
|
@ -262,7 +262,7 @@ add_packet_stats(int input_or_output)
|
|||
if(s != NULL) {
|
||||
memset(s, 0, sizeof(struct powertrace_sniff_stats));
|
||||
s->channel = packetbuf_attr(PACKETBUF_ATTR_CHANNEL);
|
||||
#if UIP_CONF_IPV6
|
||||
#if NETSTACK_CONF_WITH_IPV6
|
||||
s->proto = packetbuf_attr(PACKETBUF_ATTR_NETWORK_ID);
|
||||
#endif
|
||||
list_add(stats_list, s);
|
||||
|
@ -283,7 +283,7 @@ output_sniffer(int mac_status)
|
|||
add_packet_stats(OUTPUT);
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#if ! UIP_CONF_IPV6
|
||||
#if ! NETSTACK_CONF_WITH_IPV6
|
||||
static void
|
||||
sniffprint(char *prefix, int seqno)
|
||||
{
|
||||
|
|
|
@ -62,7 +62,7 @@ static unsigned char running;
|
|||
/*---------------------------------------------------------------------------*/
|
||||
static void
|
||||
send_ping(uip_ipaddr_t *dest_addr)
|
||||
#if UIP_CONF_IPV6
|
||||
#if NETSTACK_CONF_WITH_IPV6
|
||||
{
|
||||
static uint16_t count;
|
||||
UIP_IP_BUF->vtc = 0x60;
|
||||
|
@ -92,7 +92,7 @@ send_ping(uip_ipaddr_t *dest_addr)
|
|||
|
||||
tcpip_ipv6_output();
|
||||
}
|
||||
#else /* UIP_CONF_IPV6 */
|
||||
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||
{
|
||||
static uint16_t ipid = 0;
|
||||
static uint16_t seqno = 0;
|
||||
|
@ -128,7 +128,7 @@ send_ping(uip_ipaddr_t *dest_addr)
|
|||
|
||||
tcpip_output();
|
||||
}
|
||||
#endif /* UIP_CONF_IPV6 */
|
||||
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
PROCESS_THREAD(shell_ping_process, ev, data)
|
||||
{
|
||||
|
|
|
@ -64,7 +64,7 @@ webserver_log_file(uip_ipaddr_t *requester, char *file)
|
|||
{
|
||||
/* Print out IP address of requesting host. */
|
||||
|
||||
#if UIP_CONF_IPV6
|
||||
#if NETSTACK_CONF_WITH_IPV6
|
||||
#if WEBSERVER_CONF_ADDRESSES
|
||||
char buf[48];
|
||||
uint8_t j;
|
||||
|
@ -78,7 +78,7 @@ webserver_log_file(uip_ipaddr_t *requester, char *file)
|
|||
char buf[20];
|
||||
sprintf(buf, "%d.%d.%d.%d: ", requester->u8[0], requester->u8[1],
|
||||
requester->u8[2], requester->u8[3]);
|
||||
#endif /* UIP_CONF_IPV6 */
|
||||
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||
//log_message(buf, file);
|
||||
printf("%s%s\n", buf, file);
|
||||
}
|
||||
|
|
|
@ -157,7 +157,7 @@ make_tcp_stats(void *arg)
|
|||
struct httpd_state *s = (struct httpd_state *)arg;
|
||||
conn = &uip_conns[s->u.count];
|
||||
|
||||
#if UIP_CONF_IPV6
|
||||
#if NETSTACK_CONF_WITH_IPV6
|
||||
char buf[48];
|
||||
httpd_sprint_ip6(conn->ripaddr, buf);
|
||||
return snprintf((char *)uip_appdata, uip_mss(),
|
||||
|
@ -184,7 +184,7 @@ make_tcp_stats(void *arg)
|
|||
conn->timer,
|
||||
(uip_outstanding(conn))? '*':' ',
|
||||
(uip_stopped(conn))? '!':' ');
|
||||
#endif /* UIP_CONF_IPV6 */
|
||||
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static
|
||||
|
@ -226,7 +226,7 @@ PT_THREAD(processes(struct httpd_state *s, char *ptr))
|
|||
}
|
||||
PSOCK_END(&s->sout);
|
||||
}
|
||||
#if WEBSERVER_CONF_STATUSPAGE && UIP_CONF_IPV6
|
||||
#if WEBSERVER_CONF_STATUSPAGE && NETSTACK_CONF_WITH_IPV6
|
||||
/* These cgi's are invoked by the status.shtml page in /apps/webserver/httpd-fs.
|
||||
* To keep the webserver build small that 160 byte page is not present in the
|
||||
* default httpd-fsdata.c file. Run the PERL script /../../tools/makefsdata from the
|
||||
|
@ -357,7 +357,7 @@ httpd_cgi_add(struct httpd_cgi_call *c)
|
|||
}
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#if WEBSERVER_CONF_STATUSPAGE && UIP_CONF_IPV6
|
||||
#if WEBSERVER_CONF_STATUSPAGE && NETSTACK_CONF_WITH_IPV6
|
||||
static const char adrs_name[] HTTPD_STRING_ATTR = "addresses";
|
||||
static const char nbrs_name[] HTTPD_STRING_ATTR = "neighbors";
|
||||
static const char rtes_name[] HTTPD_STRING_ATTR = "routes";
|
||||
|
@ -365,7 +365,7 @@ static const char rtes_name[] HTTPD_STRING_ATTR = "routes";
|
|||
HTTPD_CGI_CALL(file, file_name, file_stats);
|
||||
HTTPD_CGI_CALL(tcp, tcp_name, tcp_stats);
|
||||
HTTPD_CGI_CALL(proc, proc_name, processes);
|
||||
#if WEBSERVER_CONF_STATUSPAGE && UIP_CONF_IPV6
|
||||
#if WEBSERVER_CONF_STATUSPAGE && NETSTACK_CONF_WITH_IPV6
|
||||
HTTPD_CGI_CALL(adrs, adrs_name, addresses);
|
||||
HTTPD_CGI_CALL(nbrs, nbrs_name, neighbors);
|
||||
HTTPD_CGI_CALL(rtes, rtes_name, routes);
|
||||
|
@ -377,7 +377,7 @@ httpd_cgi_init(void)
|
|||
httpd_cgi_add(&file);
|
||||
httpd_cgi_add(&tcp);
|
||||
httpd_cgi_add(&proc);
|
||||
#if WEBSERVER_CONF_STATUSPAGE && UIP_CONF_IPV6
|
||||
#if WEBSERVER_CONF_STATUSPAGE && NETSTACK_CONF_WITH_IPV6
|
||||
httpd_cgi_add(&adrs);
|
||||
httpd_cgi_add(&nbrs);
|
||||
httpd_cgi_add(&rtes);
|
||||
|
|
|
@ -342,7 +342,7 @@ httpd_init(void)
|
|||
memb_init(&conns);
|
||||
httpd_cgi_init();
|
||||
}
|
||||
#if UIP_CONF_IPV6
|
||||
#if NETSTACK_CONF_WITH_IPV6
|
||||
/*---------------------------------------------------------------------------*/
|
||||
uint8_t
|
||||
httpd_sprint_ip6(uip_ip6addr_t addr, char * result)
|
||||
|
@ -374,5 +374,5 @@ httpd_sprint_ip6(uip_ip6addr_t addr, char * result)
|
|||
*result=0;
|
||||
return (result - starting);
|
||||
}
|
||||
#endif /* UIP_CONF_IPV6 */
|
||||
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
|
|
@ -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_ */
|
||||
|
|
|
@ -67,7 +67,7 @@ webserver_log_file(uip_ipaddr_t *requester, char *file)
|
|||
#if LOG_CONF_ENABLED
|
||||
/* Print out IP address of requesting host. */
|
||||
|
||||
#if UIP_CONF_IPV6
|
||||
#if NETSTACK_CONF_WITH_IPV6
|
||||
char buf[48];
|
||||
uint8_t j;
|
||||
j=httpd_sprint_ip6((uip_ip6addr_t)*requester, buf);
|
||||
|
@ -76,7 +76,7 @@ webserver_log_file(uip_ipaddr_t *requester, char *file)
|
|||
char buf[20];
|
||||
sprintf(buf, "%d.%d.%d.%d: ", requester->u8[0], requester->u8[1],
|
||||
requester->u8[2], requester->u8[3]);
|
||||
#endif /* UIP_CONF_IPV6 */
|
||||
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||
|
||||
log_message(buf, file);
|
||||
#endif /* LOG_CONF_ENABLED */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue