From e754426f5281b07feeee17256b5caa4fe1b8ef09 Mon Sep 17 00:00:00 2001 From: kieranm Date: Tue, 10 Jun 2003 10:45:29 +0000 Subject: [PATCH] Changed DEBUGF to LWIP_DEBUGF --- ports/c16x/netif/cs8900if.c | 18 +++++++++--------- ports/coldfire/sys_arch.c | 8 ++++---- ports/ecos/ioeth.diff | 6 +++--- ports/msvc6/pktif.c | 8 ++++---- ports/rtxc/sys_arch.c | 8 ++++---- ports/unix/lwip_chksum.c | 2 +- ports/unix/netif/delif.c | 18 +++++++++--------- ports/unix/netif/fifo.c | 6 +++--- ports/unix/netif/sio.c | 38 ++++++++++++++++++------------------- ports/unix/netif/tapif.c | 10 +++++----- ports/unix/netif/tcpdump.c | 6 +++--- ports/unix/netif/tunif.c | 6 +++--- ports/unix/netif/unixif.c | 28 +++++++++++++-------------- ports/unix/sys_arch.c | 8 ++++---- 14 files changed, 85 insertions(+), 85 deletions(-) diff --git a/ports/c16x/netif/cs8900if.c b/ports/c16x/netif/cs8900if.c index c7bd0e9..8e46cd0 100644 --- a/ports/c16x/netif/cs8900if.c +++ b/ports/c16x/netif/cs8900if.c @@ -415,7 +415,7 @@ static struct pbuf *cs8900_input(struct netif *netif) event_type = 0; // read RxLength len = RXTXREG; - DEBUGF(NETIF_DEBUG, ("cs8900_input: packet len %u\n", len)); + LWIP_DEBUGF(NETIF_DEBUG, ("cs8900_input: packet len %u\n", len)); snmp_add_ifinoctets(len); // positive length? if (len > 0) @@ -425,9 +425,9 @@ static struct pbuf *cs8900_input(struct netif *netif) if (p != NULL) { for (q = p; q != 0; q = q->next) - { - DEBUGF(NETIF_DEBUG, ("cs8900_input: pbuf @%p tot_len %u len %u\n", q, q->tot_len, q->len)); - ptr = q->payload; + { + LWIP_DEBUGF(NETIF_DEBUG, ("cs8900_input: pbuf @%p tot_len %u len %u\n", q, q->tot_len, q->len)); + ptr = q->payload; // TODO: CHECK: what if q->len is odd? we don't use the last byte? for (i = 0; i < (q->len + 1) / 2; i++) { @@ -561,10 +561,10 @@ static void cs8900_service(struct netif *netif) #if (CS8900_STATS > 0) /* copy statistics counters into netif state fields */ ((struct cs8900if *)netif->state)->missed += miss_count; - if (miss_count > 0) DEBUGF(NETIF_DEBUG | 1, ("cs8900_input: %u missed packets due to rx buffer overrun\n", miss_count)); + if (miss_count > 0) LWIP_DEBUGF(NETIF_DEBUG | 1, ("cs8900_input: %u missed packets due to rx buffer overrun\n", miss_count)); ((struct cs8900if *)netif->state)->collisions += coll_count; - if (coll_count > 0) DEBUGF(NETIF_DEBUG | 1, ("cs8900_input: %u packet collisions\n", coll_count)); + if (coll_count > 0) LWIP_DEBUGF(NETIF_DEBUG | 1, ("cs8900_input: %u packet collisions\n", coll_count)); #endif } @@ -659,7 +659,7 @@ void cs8900if_input(struct netif *netif) q = etharp_ip_input(netif, p); /* skip Ethernet header */ pbuf_header(p, -14); - DEBUGF(NETIF_DEBUG, ("cs8900_input: passing packet up to IP\n")); + LWIP_DEBUGF(NETIF_DEBUG, ("cs8900_input: passing packet up to IP\n")); /* pass to network layer */ netif->input(p, netif); break; @@ -720,7 +720,7 @@ err_t cs8900if_init(struct netif *netif) cs8900if = mem_malloc(sizeof(struct cs8900if)); if (cs8900if == NULL) { - DEBUGF(NETIF_DEBUG, ("cs8900_input: out of memory for cs8900if\n")); + LWIP_DEBUGF(NETIF_DEBUG, ("cs8900_input: out of memory for cs8900if\n")); return ERR_MEM; } // initialize lwip network interface @@ -897,4 +897,4 @@ static u32_t cs8900_chksum(void *dataptr, int len) return acc; } -#endif \ No newline at end of file +#endif diff --git a/ports/coldfire/sys_arch.c b/ports/coldfire/sys_arch.c index ada7d34..c092d87 100644 --- a/ports/coldfire/sys_arch.c +++ b/ports/coldfire/sys_arch.c @@ -383,7 +383,7 @@ sys_mbox_post(sys_mbox_t mbox, void *msg) { UNSIGNED status; - DEBUGF(SYS_DEBUG, ("sys_mbox_post: mbox %p msg %p\n", mbox, msg)); + LWIP_DEBUGF(SYS_DEBUG, ("sys_mbox_post: mbox %p msg %p\n", mbox, msg)); status = NU_Send_To_Queue(mbox, &msg, 1, @@ -413,14 +413,14 @@ sys_arch_mbox_fetch(sys_mbox_t mbox, void **msg, u32_t timeout) { if (msg) *msg = ret_msg; - DEBUGF(SYS_DEBUG, ("sys_mbox_fetch: mbox %p msg %p\n", mbox, ret_msg)); + LWIP_DEBUGF(SYS_DEBUG, ("sys_mbox_fetch: mbox %p msg %p\n", mbox, ret_msg)); } else { if (msg) *msg = 0; if (status == NU_TIMEOUT) - DEBUGF(SYS_DEBUG, ("sys_mbox_fetch: timeout on mbox %p\n", mbox)); + LWIP_DEBUGF(SYS_DEBUG, ("sys_mbox_fetch: timeout on mbox %p\n", mbox)); else - DEBUGF(SYS_DEBUG, ("sys_mbox_fetch: Queue Error %i on mbox %p\n", status, mbox)); + LWIP_DEBUGF(SYS_DEBUG, ("sys_mbox_fetch: Queue Error %i on mbox %p\n", status, mbox)); } diff --git a/ports/ecos/ioeth.diff b/ports/ecos/ioeth.diff index d40c243..f6d5a4d 100644 --- a/ports/ecos/ioeth.diff +++ b/ports/ecos/ioeth.diff @@ -365,13 +365,13 @@ diff -u -r1.2 eth_drv.c + + switch (htons(ethhdr->type)) { + case ETHTYPE_IP: -+ DEBUGF(0, ("ecosif_input: IP packet\n")); ++ LWIP_DEBUGF(0, ("ecosif_input: IP packet\n")); + q = etharp_ip_input(netif, p); + pbuf_header(p, -14); + netif->input(p, netif); + break; + case ETHTYPE_ARP: -+ DEBUGF(0, ("ecosif_input: ARP packet\n")); ++ LWIP_DEBUGF(0, ("ecosif_input: ARP packet\n")); + q = etharp_arp_input(netif, (struct eth_addr *) &sc->sc_arpcom.esa, p); + break; + default: @@ -380,7 +380,7 @@ diff -u -r1.2 eth_drv.c + } + + if (q != NULL) { -+ DEBUGF(0, ("ecosif_input: Sending ARP reply\n")); ++ LWIP_DEBUGF(0, ("ecosif_input: Sending ARP reply\n")); + low_level_output(netif, q); + pbuf_free(q); + } diff --git a/ports/msvc6/pktif.c b/ports/msvc6/pktif.c index 3292441..0b5b3b6 100644 --- a/ports/msvc6/pktif.c +++ b/ports/msvc6/pktif.c @@ -245,7 +245,7 @@ low_level_init(struct netif *netif) open_adapter(ethernetif); #ifdef NETIF_DEBUG - DEBUGF(NETIF_DEBUG, ("pktif: eth_addr %02X%02X%02X%02X%02X%02X\n",ethernetif->ethaddr->addr[0],ethernetif->ethaddr->addr[1],ethernetif->ethaddr->addr[2],ethernetif->ethaddr->addr[3],ethernetif->ethaddr->addr[4],ethernetif->ethaddr->addr[5])); + LWIP_DEBUGF(NETIF_DEBUG, ("pktif: eth_addr %02X%02X%02X%02X%02X%02X\n",ethernetif->ethaddr->addr[0],ethernetif->ethaddr->addr[1],ethernetif->ethaddr->addr[2],ethernetif->ethaddr->addr[3],ethernetif->ethaddr->addr[4],ethernetif->ethaddr->addr[5])); #endif /* NETIF_DEBUG */ /* Do whatever else is needed to initialize interface. */ @@ -283,7 +283,7 @@ low_level_output(struct netif *ethernetif, struct pbuf *p) variable. */ /* send data from(q->payload, q->len); */ #ifdef NETIF_DEBUG - DEBUGF(NETIF_DEBUG, ("netif: send ptr %p q->payload %p q->len %i q->next %p\n", ptr, q->payload, (int)q->len, q->next)); + LWIP_DEBUGF(NETIF_DEBUG, ("netif: send ptr %p q->payload %p q->len %i q->next %p\n", ptr, q->payload, (int)q->len, q->next)); #endif memcpy(ptr,q->payload,q->len); ptr+=q->len; @@ -324,7 +324,7 @@ low_level_input(struct netif *ethernetif) /* We allocate a pbuf chain of pbufs from the pool. */ p = pbuf_alloc(PBUF_LINK, (u16_t)length, PBUF_POOL); #ifdef NETIF_DEBUG - DEBUGF(NETIF_DEBUG, ("netif: recv length %i p->tot_len %i\n", length, (int)p->tot_len)); + LWIP_DEBUGF(NETIF_DEBUG, ("netif: recv length %i p->tot_len %i\n", length, (int)p->tot_len)); #endif if (p != NULL) { @@ -337,7 +337,7 @@ low_level_input(struct netif *ethernetif) variable. */ /* read data into(q->payload, q->len); */ #ifdef NETIF_DEBUG - DEBUGF(NETIF_DEBUG, ("netif: recv start %i length %i q->payload %p q->len %i q->next %p\n", start, length, q->payload, (int)q->len, q->next)); + LWIP_DEBUGF(NETIF_DEBUG, ("netif: recv start %i length %i q->payload %p q->len %i q->next %p\n", start, length, q->payload, (int)q->len, q->next)); #endif memcpy(q->payload,&cur_packet[start],q->len); start+=q->len; diff --git a/ports/rtxc/sys_arch.c b/ports/rtxc/sys_arch.c index 6748dc6..535eec9 100644 --- a/ports/rtxc/sys_arch.c +++ b/ports/rtxc/sys_arch.c @@ -84,7 +84,7 @@ sys_arch_mbox_fetch(sys_mbox_t mbox, void **data, u16_t timeout) u16_t wtime = 1; if (timeout == 0) { - DEBUGF(SYS_DEBUG, ("PID: %d sys_mbox_fetch: without timeouts\n",KS_inqtask())); + LWIP_DEBUGF(SYS_DEBUG, ("PID: %d sys_mbox_fetch: without timeouts\n",KS_inqtask())); KS_dequeuew(mbox, data); } else { @@ -127,7 +127,7 @@ sys_arch_sem_wait(sys_sem_t sem, u16_t timeout) u16_t wtime = 1; if (timeout == 0) { - DEBUGF(SYS_DEBUG, ("PID: %d sys_mbox_fetch: without timeouts\n",KS_inqtask())); + LWIP_DEBUGF(SYS_DEBUG, ("PID: %d sys_mbox_fetch: without timeouts\n",KS_inqtask())); KS_wait(sem); } else { @@ -198,12 +198,12 @@ sys_arch_timeouts(void) TASK pid; struct timeoutlist *tl; - DEBUGF(SYS_DEBUG, ("PID: %d sys_mbox_fetch: timeoutlist not empty\n",KS_inqtask())); + LWIP_DEBUGF(SYS_DEBUG, ("PID: %d sys_mbox_fetch: timeoutlist not empty\n",KS_inqtask())); pid = KS_inqtask(); for(i = 0; i < nextthread; i++) { tl = &timeoutlist[i]; if (tl->pid == pid) { - DEBUGF(SYS_DEBUG, ("PID: %d sys_mbox_fetch: corresponding pid found!\n",KS_inqtask())); + LWIP_DEBUGF(SYS_DEBUG, ("PID: %d sys_mbox_fetch: corresponding pid found!\n",KS_inqtask())); return &(tl->timeouts); } } diff --git a/ports/unix/lwip_chksum.c b/ports/unix/lwip_chksum.c index 10b8376..5a9c9a6 100644 --- a/ports/unix/lwip_chksum.c +++ b/ports/unix/lwip_chksum.c @@ -59,7 +59,7 @@ lwip_chksum(void *dataptr, int len) /* add up any odd byte */ if (len == 1) { acc += htons((u16_t)((*(u8_t *)dataptr) & 0xff) << 8); - DEBUGF(INET_DEBUG, ("inet: chksum: odd byte %d\n", *(u8_t *)dataptr)); + LWIP_DEBUGF(INET_DEBUG, ("inet: chksum: odd byte %d\n", *(u8_t *)dataptr)); } acc = (acc >> 16) + (acc & 0xffffUL); diff --git a/ports/unix/netif/delif.c b/ports/unix/netif/delif.c index 6694628..e484546 100644 --- a/ports/unix/netif/delif.c +++ b/ports/unix/netif/delif.c @@ -96,7 +96,7 @@ delif_input_timeout(void *arg) } else { timeout = 0; } - DEBUGF(DELIF_DEBUG, ("delif_output_timeout: timeout %u.\n", timeout)); + LWIP_DEBUGF(DELIF_DEBUG, ("delif_output_timeout: timeout %u.\n", timeout)); } input_list = dp->next; @@ -128,7 +128,7 @@ delif_output_timeout(void *arg) while (dp != NULL) { now = sys_now(); if (dp->time <= now) { - DEBUGF(DELIF_DEBUG, ("delif_output_timeout: now %u dp->time %u\n", + LWIP_DEBUGF(DELIF_DEBUG, ("delif_output_timeout: now %u dp->time %u\n", now, dp->time)); delif->netif->output(delif->netif, dp->p, dp->ipaddr); if (dp->next != NULL) { @@ -137,7 +137,7 @@ delif_output_timeout(void *arg) } else { timeout = 0; } - DEBUGF(DELIF_DEBUG, ("delif_output_timeout: timeout %u.\n", timeout)); + LWIP_DEBUGF(DELIF_DEBUG, ("delif_output_timeout: timeout %u.\n", timeout)); } pbuf_free(dp->p); @@ -162,17 +162,17 @@ delif_output(struct netif *netif, struct pbuf *p, struct ip_addr *ipaddr) int i, j; char *data; - DEBUGF(DELIF_DEBUG, ("delif_output\n")); + LWIP_DEBUGF(DELIF_DEBUG, ("delif_output\n")); #ifdef DELIF_OUTPUT_DROPRATE if (((double)rand()/(double)RAND_MAX) < DELIF_OUTPUT_DROPRATE) { - DEBUGF(DELIF_DEBUG, ("delif_output: Packet dropped\n")); + LWIP_DEBUGF(DELIF_DEBUG, ("delif_output: Packet dropped\n")); return 0; } #endif /* DELIF_OUTPUT_DROPRATE */ - DEBUGF(DELIF_DEBUG, ("delif_output\n")); + LWIP_DEBUGF(DELIF_DEBUG, ("delif_output\n")); dp = malloc(sizeof(struct delif_pbuf)); @@ -212,10 +212,10 @@ delif_input(struct pbuf *p, struct netif *inp) { struct delif_pbuf *dp, *np; - DEBUGF(DELIF_DEBUG, ("delif_input\n")); + LWIP_DEBUGF(DELIF_DEBUG, ("delif_input\n")); #ifdef DELIF_INPUT_DROPRATE if (((double)rand()/(double)RAND_MAX) < DELIF_INPUT_DROPRATE) { - DEBUGF(DELIF_DEBUG, ("delif_input: Packet dropped\n")); + LWIP_DEBUGF(DELIF_DEBUG, ("delif_input: Packet dropped\n")); pbuf_free(p); return ERR_OK; } @@ -294,7 +294,7 @@ delif_init_thread(struct netif *netif) { struct delif *del; - DEBUGF(DELIF_DEBUG, ("delif_init_thread\n")); + LWIP_DEBUGF(DELIF_DEBUG, ("delif_init_thread\n")); del = malloc(sizeof(struct delif)); if (!del) diff --git a/ports/unix/netif/fifo.c b/ports/unix/netif/fifo.c index eff3af7..e15244d 100644 --- a/ports/unix/netif/fifo.c +++ b/ports/unix/netif/fifo.c @@ -77,7 +77,7 @@ void fifoPut(fifo_t * fifo, int fd) sys_sem_wait( fifo->sem ); /* enter critical */ - DEBUGF( SIO_FIFO_DEBUG,("fifoput: len%d dat%d empt%d --> ", fifo->len, fifo->dataslot, fifo->emptyslot ) ); + LWIP_DEBUGF( SIO_FIFO_DEBUG,("fifoput: len%d dat%d empt%d --> ", fifo->len, fifo->dataslot, fifo->emptyslot ) ); if ( fifo->emptyslot < fifo->dataslot ) { @@ -90,7 +90,7 @@ void fifoPut(fifo_t * fifo, int fd) fifo->emptyslot += cnt; fifo->len += cnt; - DEBUGF( SIO_FIFO_DEBUG,("len%d dat%d empt%d\n", fifo->len, fifo->dataslot, fifo->emptyslot ) ); + LWIP_DEBUGF( SIO_FIFO_DEBUG,("len%d dat%d empt%d\n", fifo->len, fifo->dataslot, fifo->emptyslot ) ); if ( fifo->len > FIFOSIZE ) { @@ -103,7 +103,7 @@ void fifoPut(fifo_t * fifo, int fd) if ( fifo->emptyslot == FIFOSIZE ) { fifo->emptyslot = 0; - DEBUGF( SIO_FIFO_DEBUG, ("(WRAP) ") ); + LWIP_DEBUGF( SIO_FIFO_DEBUG, ("(WRAP) ") ); sys_sem_signal( fifo->sem ); /* leave critical */ fifoPut( fifo, fd ); diff --git a/ports/unix/netif/sio.c b/ports/unix/netif/sio.c index ea52dc2..c04a6c8 100644 --- a/ports/unix/netif/sio.c +++ b/ports/unix/netif/sio.c @@ -60,7 +60,7 @@ static sio_status_t statusar[2]; */ static void signal_handler_IO_0( int status ) { - DEBUGF(SIO_DEBUG, ("SigHand: rxSignal chanel 0")); + LWIP_DEBUGF(SIO_DEBUG, ("SigHand: rxSignal chanel 0")); fifoPut( &statusar[0].myfifo, statusar[0].fd ); } @@ -70,7 +70,7 @@ static void signal_handler_IO_0( int status ) */ static void signal_handler_IO_1( int status ) { - DEBUGF(SIO_DEBUG, ("SigHand: rxSignal channel 1")); + LWIP_DEBUGF(SIO_DEBUG, ("SigHand: rxSignal channel 1")); fifoPut( &statusar[1].myfifo, statusar[1].fd ); } @@ -98,15 +98,15 @@ static int sio_init( char * device, int devnum, sio_status_t * siostat ) switch ( devnum ) { case 0: - DEBUGF( SIO_DEBUG, ("sioinit, signal_handler_IO_0\r\n") ); + LWIP_DEBUGF( SIO_DEBUG, ("sioinit, signal_handler_IO_0\r\n") ); saio.sa_handler = signal_handler_IO_0; break; case 1: - DEBUGF( SIO_DEBUG, ("sioinit, signal_handler_IO_1\r\n") ); + LWIP_DEBUGF( SIO_DEBUG, ("sioinit, signal_handler_IO_1\r\n") ); saio.sa_handler = signal_handler_IO_1; break; default: - DEBUGF( SIO_DEBUG,("sioinit, devnum not allowed\r\n") ); + LWIP_DEBUGF( SIO_DEBUG,("sioinit, devnum not allowed\r\n") ); break; } @@ -146,11 +146,11 @@ static void sio_speed( int fd, int speed ) struct termios oldtio,newtio; /* int fd; */ - DEBUGF( 1,("sio_speed: baudcode:%d enter\n",speed ) ); + LWIP_DEBUGF( 1,("sio_speed: baudcode:%d enter\n",speed ) ); if ( fd < 0 ) { - DEBUGF(SIO_DEBUG, ( "sio_speed: fd ERROR\n" )); + LWIP_DEBUGF(SIO_DEBUG, ( "sio_speed: fd ERROR\n" )); exit( -1 ); } @@ -168,7 +168,7 @@ static void sio_speed( int fd, int speed ) tcsetattr( fd,TCSANOW,&newtio ); tcflush( fd, TCIOFLUSH ); - DEBUGF( SIO_DEBUG ,("sio_speed: leave\n" )); + LWIP_DEBUGF( SIO_DEBUG ,("sio_speed: leave\n" )); } /* --public-functions----------------------------------------------------------------------------- */ @@ -178,7 +178,7 @@ void sio_send( u8_t c, sio_status_t * siostat ) if ( write( siostat->fd, &c, 1 ) <= 0 ) { - DEBUGF( SIO_DEBUG,("sio_send: write refused") ); + LWIP_DEBUGF( SIO_DEBUG,("sio_send: write refused") ); } } @@ -189,9 +189,9 @@ void sio_send_string( u8_t *str, sio_status_t * siostat ) if ( write( siostat->fd, str, len ) <= 0 ) { - DEBUGF( SIO_DEBUG,("sio_send_string: write refused") ); + LWIP_DEBUGF( SIO_DEBUG,("sio_send_string: write refused") ); } - DEBUGF( (PPP_DEBUG | SIO_DEBUG),("sent:%s",str ) ); + LWIP_DEBUGF( (PPP_DEBUG | SIO_DEBUG),("sent:%s",str ) ); } @@ -222,11 +222,11 @@ void sio_expect_string( u8_t *str, sio_status_t * siostat ) u8_t c; int finger=0; - DEBUGF( (PPP_DEBUG | SIO_DEBUG), ("expect:%s\n",str) ); + LWIP_DEBUGF( (PPP_DEBUG | SIO_DEBUG), ("expect:%s\n",str) ); while ( 1 ) { c=fifoGet( &(siostat->myfifo) ); - DEBUGF( (PPP_DEBUG | SIO_DEBUG), ("_%c",c) ); + LWIP_DEBUGF( (PPP_DEBUG | SIO_DEBUG), ("_%c",c) ); if ( c==str[finger] ) { finger++; @@ -241,7 +241,7 @@ void sio_expect_string( u8_t *str, sio_status_t * siostat ) if ( 0 == str[finger] ) break; /* done, we have a match */ } - DEBUGF( (PPP_DEBUG | SIO_DEBUG), ("[match]\n") ); + LWIP_DEBUGF( (PPP_DEBUG | SIO_DEBUG), ("[match]\n") ); } @@ -269,17 +269,17 @@ sio_status_t * sio_open( int devnum ) { if ( ( siostate->fd = sio_init( dev, devnum, siostate ) ) == 0 ) { - DEBUGF(SIO_DEBUG, ( "sio_open: ERROR opening serial device" )); + LWIP_DEBUGF(SIO_DEBUG, ( "sio_open: ERROR opening serial device" )); abort( ); return NULL; } } else { - DEBUGF(SIO_DEBUG, ( "sio_open: device %s (%d) is not supported", dev, devnum )); + LWIP_DEBUGF(SIO_DEBUG, ( "sio_open: device %s (%d) is not supported", dev, devnum )); return NULL; } - DEBUGF( 1,("sio_open: dev=%s open.\n", dev )); + LWIP_DEBUGF( 1,("sio_open: dev=%s open.\n", dev )); return siostate; } @@ -291,7 +291,7 @@ void sio_change_baud( sioBaudrates baud, sio_status_t * siostat ) { /* sio_status_t * siostat = ((siostruct_t*)netif->state)->sio;*/ - DEBUGF( 1,("sio_change_baud\n" )); + LWIP_DEBUGF( 1,("sio_change_baud\n" )); switch ( baud ) { @@ -312,7 +312,7 @@ void sio_change_baud( sioBaudrates baud, sio_status_t * siostat ) break; default: - DEBUGF( 1,("sio_change_baud: Unknown baudrate, code:%d", baud )); + LWIP_DEBUGF( 1,("sio_change_baud: Unknown baudrate, code:%d", baud )); break; } } diff --git a/ports/unix/netif/tapif.c b/ports/unix/netif/tapif.c index 6548c86..4be9f08 100644 --- a/ports/unix/netif/tapif.c +++ b/ports/unix/netif/tapif.c @@ -100,7 +100,7 @@ low_level_init(struct netif *netif) /* Do whatever else is needed to initialize interface. */ tapif->fd = open(DEVTAP, O_RDWR); - DEBUGF(TAPIF_DEBUG, ("tapif_init: fd %d\n", tapif->fd)); + LWIP_DEBUGF(TAPIF_DEBUG, ("tapif_init: fd %d\n", tapif->fd)); if(tapif->fd == -1) { #ifdef linux perror("tapif_init: try running \"modprobe tun\" or rebuilding your kernel with CONFIG_TUN; cannot open "DEVTAP); @@ -128,7 +128,7 @@ low_level_init(struct netif *netif) ip4_addr3(&(netif->gw)), ip4_addr4(&(netif->gw))); - DEBUGF(TAPIF_DEBUG, ("tapif_init: system(\"%s\");\n", buf)); + LWIP_DEBUGF(TAPIF_DEBUG, ("tapif_init: system(\"%s\");\n", buf)); system(buf); sys_thread_new(tapif_thread, netif, DEFAULT_THREAD_PRIO); @@ -299,7 +299,7 @@ tapif_input(struct netif *netif) p = low_level_input(tapif); if(p == NULL) { - DEBUGF(TAPIF_DEBUG, ("tapif_input: low_level_input returned NULL\n")); + LWIP_DEBUGF(TAPIF_DEBUG, ("tapif_input: low_level_input returned NULL\n")); return; } ethhdr = p->payload; @@ -307,13 +307,13 @@ tapif_input(struct netif *netif) q = NULL; switch(htons(ethhdr->type)) { case ETHTYPE_IP: - DEBUGF(TAPIF_DEBUG, ("tapif_input: IP packet\n")); + LWIP_DEBUGF(TAPIF_DEBUG, ("tapif_input: IP packet\n")); q = etharp_ip_input(netif, p); pbuf_header(p, -14); netif->input(p, netif); break; case ETHTYPE_ARP: - DEBUGF(TAPIF_DEBUG, ("tapif_input: ARP packet\n")); + LWIP_DEBUGF(TAPIF_DEBUG, ("tapif_input: ARP packet\n")); q = etharp_arp_input(netif, tapif->ethaddr, p); break; default: diff --git a/ports/unix/netif/tcpdump.c b/ports/unix/netif/tcpdump.c index 6dec727..3435a88 100644 --- a/ports/unix/netif/tcpdump.c +++ b/ports/unix/netif/tcpdump.c @@ -51,7 +51,7 @@ tcpdump_init(void) if (file == NULL) { perror("tcpdump_init: fopen"); } - DEBUGF(TCPDUMP_DEBUG, ("tcpdump: file %s\n", fname)); + LWIP_DEBUGF(TCPDUMP_DEBUG, ("tcpdump: file %s\n", fname)); } /*-----------------------------------------------------------------------------------*/ void @@ -78,7 +78,7 @@ tcpdump(struct pbuf *p) if (inet_chksum_pseudo(p, (struct ip_addr *)&(iphdr->src), (struct ip_addr *)&(iphdr->dest), IP_PROTO_TCP, p->tot_len) != 0) { - DEBUGF(TCPDUMP_DEBUG, ("tcpdump: IP checksum failed!\n")); + LWIP_DEBUGF(TCPDUMP_DEBUG, ("tcpdump: IP checksum failed!\n")); /* fprintf(file, "chksum 0x%lx ", tcphdr->chksum); tcphdr->chksum = 0; fprintf(file, "should be 0x%lx ", inet_chksum_pseudo(p, (struct ip_addr *)&(iphdr->src), @@ -147,7 +147,7 @@ tcpdump(struct pbuf *p) if (inet_chksum_pseudo(p, (struct ip_addr *)&(iphdr->src), (struct ip_addr *)&(iphdr->dest), IP_PROTO_UDP, p->tot_len) != 0) { - DEBUGF(TCPDUMP_DEBUG, ("tcpdump: IP checksum failed!\n")); + LWIP_DEBUGF(TCPDUMP_DEBUG, ("tcpdump: IP checksum failed!\n")); /* fprintf(file, "chksum 0x%lx ", tcphdr->chksum); tcphdr->chksum = 0; fprintf(file, "should be 0x%lx ", inet_chksum_pseudo(p, (struct ip_addr *)&(iphdr->src), diff --git a/ports/unix/netif/tunif.c b/ports/unix/netif/tunif.c index f2387ea..2e492e2 100644 --- a/ports/unix/netif/tunif.c +++ b/ports/unix/netif/tunif.c @@ -80,7 +80,7 @@ low_level_init(struct netif *netif) /* Do whatever else is needed to initialize interface. */ tunif->fd = open("/dev/tun0", O_RDWR); - DEBUGF(TUNIF_DEBUG, ("tunif_init: fd %d\n", tunif->fd)); + LWIP_DEBUGF(TUNIF_DEBUG, ("tunif_init: fd %d\n", tunif->fd)); if (tunif->fd == -1) { perror("tunif_init"); exit(1); @@ -95,7 +95,7 @@ low_level_init(struct netif *netif) ip4_addr3(&(netif->ip_addr)), ip4_addr4(&(netif->ip_addr))); - DEBUGF(TUNIF_DEBUG, ("tunif_init: system(\"%s\");\n", buf)); + LWIP_DEBUGF(TUNIF_DEBUG, ("tunif_init: system(\"%s\");\n", buf)); system(buf); sys_thread_new(tunif_thread, netif, DEFAULT_THREAD_PRIO); @@ -263,7 +263,7 @@ tunif_input(struct netif *netif) p = low_level_input(tunif); if (p == NULL) { - DEBUGF(TUNIF_DEBUG, ("tunif_input: low_level_input returned NULL\n")); + LWIP_DEBUGF(TUNIF_DEBUG, ("tunif_input: low_level_input returned NULL\n")); return; } diff --git a/ports/unix/netif/unixif.c b/ports/unix/netif/unixif.c index 2988ba0..c35d7f1 100644 --- a/ports/unix/netif/unixif.c +++ b/ports/unix/netif/unixif.c @@ -196,11 +196,11 @@ unixif_input_handler(void *data) abort(); } - DEBUGF(UNIXIF_DEBUG, ("unixif_irq_handler: len == %d plen == %d bytes\n", len, plen)); + LWIP_DEBUGF(UNIXIF_DEBUG, ("unixif_irq_handler: len == %d plen == %d bytes\n", len, plen)); if (len == sizeof(int)) { if (plen < 20 || plen > 1500) { - DEBUGF(UNIXIF_DEBUG, ("plen %d!\n", plen)); + LWIP_DEBUGF(UNIXIF_DEBUG, ("plen %d!\n", plen)); return; } @@ -209,7 +209,7 @@ unixif_input_handler(void *data) perror("unixif_irq_handler: read"); abort(); } - DEBUGF(UNIXIF_DEBUG, ("unixif_irq_handler: read %d bytes\n", len)); + LWIP_DEBUGF(UNIXIF_DEBUG, ("unixif_irq_handler: read %d bytes\n", len)); p = pbuf_alloc(PBUF_LINK, len, PBUF_POOL); if (p != NULL) { @@ -229,7 +229,7 @@ unixif_input_handler(void *data) tcpdump(p); netif->input(p, netif); } else { - DEBUGF(UNIXIF_DEBUG, ("unixif_irq_handler: could not allocate pbuf\n")); + LWIP_DEBUGF(UNIXIF_DEBUG, ("unixif_irq_handler: could not allocate pbuf\n")); } @@ -242,7 +242,7 @@ unixif_thread(void *arg) struct netif *netif; struct unixif *unixif; - DEBUGF(UNIXIF_DEBUG, ("unixif_thread: started.\n")); + LWIP_DEBUGF(UNIXIF_DEBUG, ("unixif_thread: started.\n")); netif = arg; unixif = netif->state; @@ -262,7 +262,7 @@ unixif_thread2(void *arg) struct unixif *unixif; fd_set fdset; - DEBUGF(UNIXIF_DEBUG, ("unixif_thread2: started.\n")); + LWIP_DEBUGF(UNIXIF_DEBUG, ("unixif_thread2: started.\n")); netif = arg; unixif = netif->state; @@ -298,7 +298,7 @@ unixif_output(struct netif *netif, struct pbuf *p, struct ip_addr *ipaddr) sys_timeout((double)p->tot_len * 8000.0 / UNIXIF_BPS, unixif_output_timeout, netif); - DEBUGF(UNIXIF_DEBUG, ("unixif_output: first on list\n")); + LWIP_DEBUGF(UNIXIF_DEBUG, ("unixif_output: first on list\n")); } else { pbuf_ref(p); @@ -314,7 +314,7 @@ unixif_output(struct netif *netif, struct pbuf *p, struct ip_addr *ipaddr) free(buf); pbuf_free(p); - DEBUGF(UNIXIF_DEBUG, ("unixif_output: drop\n")); + LWIP_DEBUGF(UNIXIF_DEBUG, ("unixif_output: drop\n")); #endif /* UNIXIF_DROP_FIRST */ #ifdef LINK_STATS @@ -322,7 +322,7 @@ unixif_output(struct netif *netif, struct pbuf *p, struct ip_addr *ipaddr) #endif /* LINK_STATS */ } else { - DEBUGF(UNIXIF_DEBUG, ("unixif_output: on list\n")); + LWIP_DEBUGF(UNIXIF_DEBUG, ("unixif_output: on list\n")); } } @@ -344,7 +344,7 @@ unixif_output_timeout(void *arg) netif = arg; unixif = netif->state; - DEBUGF(UNIXIF_DEBUG, ("unixif_output_timeout\n")); + LWIP_DEBUGF(UNIXIF_DEBUG, ("unixif_output_timeout\n")); /* buf = unixif->q[0]; unixif->q[0] = unixif->q[1]; @@ -364,7 +364,7 @@ unixif_output_timeout(void *arg) if (p->tot_len == 0) { - DEBUGF(UNIXIF_DEBUG, ("p->len!\n")); + LWIP_DEBUGF(UNIXIF_DEBUG, ("p->len!\n")); abort(); } data = malloc(p->tot_len); @@ -377,7 +377,7 @@ unixif_output_timeout(void *arg) } } - DEBUGF(UNIXIF_DEBUG, ("unixif_output: sending %d (%d) bytes\n", + LWIP_DEBUGF(UNIXIF_DEBUG, ("unixif_output: sending %d (%d) bytes\n", p->len, p->tot_len)); len = p->tot_len; @@ -428,7 +428,7 @@ unixif_init_server(struct netif *netif) perror("unixif_server"); abort(); } - DEBUGF(UNIXIF_DEBUG, ("unixif_server: fd %d\n", fd)); + LWIP_DEBUGF(UNIXIF_DEBUG, ("unixif_server: fd %d\n", fd)); unixif = malloc(sizeof(struct unixif)); if (!unixif) @@ -448,7 +448,7 @@ unixif_init_server(struct netif *netif) abort(); } - DEBUGF(UNIXIF_DEBUG, ("unixif_accept: %d\n", fd2)); + LWIP_DEBUGF(UNIXIF_DEBUG, ("unixif_accept: %d\n", fd2)); unixif->fd = fd2; unixif->sem = sys_sem_new(0); diff --git a/ports/unix/sys_arch.c b/ports/unix/sys_arch.c index 7a467b4..fa8c265 100644 --- a/ports/unix/sys_arch.c +++ b/ports/unix/sys_arch.c @@ -168,7 +168,7 @@ sys_thread_new(void (*function)(void *arg), void *arg, int prio) } if (NULL == st) { - DEBUGF(SYS_DEBUG, ("sys_thread_new: pthread_create %d, st = 0x%x", + LWIP_DEBUGF(SYS_DEBUG, ("sys_thread_new: pthread_create %d, st = 0x%x", code, (int)st)); abort(); } @@ -208,7 +208,7 @@ sys_mbox_free(struct sys_mbox *mbox) sys_sem_free_(mbox->mail); sys_sem_free_(mbox->mutex); mbox->mail = mbox->mutex = NULL; - /* DEBUGF("sys_mbox_free: mbox 0x%lx\n", mbox); */ + /* LWIP_DEBUGF("sys_mbox_free: mbox 0x%lx\n", mbox); */ free(mbox); } } @@ -221,7 +221,7 @@ sys_mbox_post(struct sys_mbox *mbox, void *msg) sys_sem_wait(mbox->mutex); - DEBUGF(SYS_DEBUG, ("sys_mbox_post: mbox %p msg %p\n", (void *)mbox, (void *)msg)); + LWIP_DEBUGF(SYS_DEBUG, ("sys_mbox_post: mbox %p msg %p\n", (void *)mbox, (void *)msg)); while ((mbox->last + 1) >= (mbox->first + SYS_MBOX_SIZE)) { mbox->wait_send++; @@ -275,7 +275,7 @@ sys_arch_mbox_fetch(struct sys_mbox *mbox, void **msg, u32_t timeout) sys_arch_sem_wait(mbox->mutex, 0); } - DEBUGF(SYS_DEBUG, ("sys_mbox_fetch: mbox %p msg %p\n", (void *)mbox, *msg)); + LWIP_DEBUGF(SYS_DEBUG, ("sys_mbox_fetch: mbox %p msg %p\n", (void *)mbox, *msg)); if (msg != NULL) { *msg = mbox->msgs[mbox->first % SYS_MBOX_SIZE];