diff --git a/src/core/ipv4/autoip.c b/src/core/ipv4/autoip.c index 49f0ecd7..201da3e4 100644 --- a/src/core/ipv4/autoip.c +++ b/src/core/ipv4/autoip.c @@ -103,7 +103,7 @@ autoip_init(void) { /* TODO MAC_ADDRESS macaddr; */ - LWIP_DEBUGF(AUTOIP_DEBUG | DBG_TRACE | 3, ("autoip_init()\n")); + LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE | 3, ("autoip_init()\n")); /* TODO Get_Current_MAC_Address(&macaddr);*/ /*srand( @@ -128,17 +128,17 @@ autoip_handle_arp_conflict(struct netif *netif) /* retreat, there was a conflicting ARP in the last * DEFEND_INTERVAL seconds */ - LWIP_DEBUGF(AUTOIP_DEBUG | DBG_TRACE | DBG_STATE | 1, ("autoip_handle_arp_conflict(): we are defending, but in DEFEND_INTERVAL, retreating\n")); + LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE | 1, ("autoip_handle_arp_conflict(): we are defending, but in DEFEND_INTERVAL, retreating\n")); /* TODO: close all TCP sessions */ autoip_start(netif); } else { - LWIP_DEBUGF(AUTOIP_DEBUG | DBG_TRACE | DBG_STATE | 1, ("autoip_handle_arp_conflict(): we are defend, send ARP Announce\n")); + LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE | 1, ("autoip_handle_arp_conflict(): we are defend, send ARP Announce\n")); autoip_arp_announce(netif); netif->autoip->lastconflict = DEFEND_INTERVAL * AUTOIP_FINE_TIMER_TICK_PER_SECOND; } } else { - LWIP_DEBUGF(AUTOIP_DEBUG | DBG_TRACE | DBG_STATE | 1, ("autoip_handle_arp_conflict(): we do not defend, retreating\n")); + LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE | 1, ("autoip_handle_arp_conflict(): we do not defend, retreating\n")); /* TODO: close all TCP sessions */ autoip_start(netif); } @@ -192,7 +192,7 @@ autoip_bind(struct netif *netif) { struct autoip *autoip = netif->autoip; struct ip_addr sn_mask, gw_addr; - LWIP_DEBUGF(AUTOIP_DEBUG | DBG_TRACE | 3, ("autoip_bind(netif=%p) %c%c%"U16_F"\n", (void*)netif, netif->name[0], netif->name[1], (u16_t)netif->num)); + LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE | 3, ("autoip_bind(netif=%p) %c%c%"U16_F"\n", (void*)netif, netif->name[0], netif->name[1], (u16_t)netif->num)); IP4_ADDR(&sn_mask, 255, 255, 0, 0); IP4_ADDR(&gw_addr, 0, 0, 0, 0); @@ -227,19 +227,19 @@ autoip_start(struct netif *netif) netif->netmask.addr = 0; netif->gw.addr = 0; - LWIP_DEBUGF(AUTOIP_DEBUG | DBG_TRACE | DBG_STATE, ("autoip_start(netif=%p) %c%c%"U16_F"\n", (void*)netif, netif->name[0], netif->name[1], (u16_t)netif->num)); + LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("autoip_start(netif=%p) %c%c%"U16_F"\n", (void*)netif, netif->name[0], netif->name[1], (u16_t)netif->num)); if(autoip == NULL) { /* no AutoIP client attached yet? */ - LWIP_DEBUGF(AUTOIP_DEBUG | DBG_TRACE, ("autoip_start(): starting new AUTOIP client\n")); + LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE, ("autoip_start(): starting new AUTOIP client\n")); autoip = mem_malloc(sizeof(struct autoip)); if(autoip == NULL) { - LWIP_DEBUGF(AUTOIP_DEBUG | DBG_TRACE, ("autoip_start(): could not allocate autoip\n")); + LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE, ("autoip_start(): could not allocate autoip\n")); return ERR_MEM; } memset( autoip, 0, sizeof(struct autoip)); /* store this AutoIP client in the netif */ netif->autoip = autoip; - LWIP_DEBUGF(AUTOIP_DEBUG | DBG_TRACE, ("autoip_start(): allocated autoip")); + LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE, ("autoip_start(): allocated autoip")); } else { autoip->state = AUTOIP_STATE_OFF; autoip->ttw = 0; @@ -298,7 +298,7 @@ autoip_fine_tmr() netif->autoip->lastconflict--; } - LWIP_DEBUGF(AUTOIP_DEBUG | DBG_TRACE | 3, ("autoip_fine_tmr()AutoIP-Sate: %d\n", netif->autoip->state)); + LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE | 3, ("autoip_fine_tmr()AutoIP-Sate: %d\n", netif->autoip->state)); switch(netif->autoip->state) { case AUTOIP_STATE_PROBING: @@ -311,7 +311,7 @@ autoip_fine_tmr() netif->autoip->ttw = ANNOUNCE_WAIT * AUTOIP_FINE_TIMER_TICK_PER_SECOND; } else { etharp_request(netif, &(netif->autoip->llipaddr)); - LWIP_DEBUGF(AUTOIP_DEBUG | DBG_TRACE | 3, ("autoip_fine_tmr() PROBING Sent Probe\n")); + LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE | 3, ("autoip_fine_tmr() PROBING Sent Probe\n")); netif->autoip->sent_num++; /* calculate time to wait to next probe */ netif->autoip->ttw = (rand() % ((PROBE_MAX - PROBE_MIN) * AUTOIP_FINE_TIMER_TICK_PER_SECOND) ) + PROBE_MIN * AUTOIP_FINE_TIMER_TICK_PER_SECOND; @@ -336,7 +336,7 @@ autoip_fine_tmr() netif->autoip->ttw = 0; } else { autoip_arp_announce(netif); - LWIP_DEBUGF(AUTOIP_DEBUG | DBG_TRACE | 3, ("autoip_fine_tmr() ANNOUNCING Sent Announce\n")); + LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE | 3, ("autoip_fine_tmr() ANNOUNCING Sent Announce\n")); netif->autoip->sent_num++; netif->autoip->ttw = ANNOUNCE_INTERVAL * AUTOIP_FINE_TIMER_TICK_PER_SECOND; } @@ -355,7 +355,7 @@ autoip_fine_tmr() void autoip_arp_reply(struct netif *netif, struct etharp_hdr *hdr) { - LWIP_DEBUGF(AUTOIP_DEBUG | DBG_TRACE | 3, ("autoip_arp_reply()\n")); + LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE | 3, ("autoip_arp_reply()\n")); if ((netif->autoip != NULL) && (netif->autoip->state != AUTOIP_STATE_OFF)) { /* when ip.src == llipaddr && hw.src != netif->hwaddr * @@ -385,7 +385,7 @@ autoip_arp_reply(struct netif *netif, struct etharp_hdr *hdr) * ip.dst == llipaddr && hw.src != own hwaddr */ if((ip_addr_cmp(&sipaddr, &netif->autoip->llipaddr)) || (ip_addr_cmp(&dipaddr, &netif->autoip->llipaddr) && !eth_addr_cmp(&netifaddr, &hdr->shwaddr))) { - LWIP_DEBUGF(AUTOIP_DEBUG | DBG_TRACE | DBG_STATE | 1, ("autoip_arp_reply(): Probe Conflict detected\n")); + LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE | 1, ("autoip_arp_reply(): Probe Conflict detected\n")); autoip_start(netif); } } else { @@ -394,7 +394,7 @@ autoip_arp_reply(struct netif *netif, struct etharp_hdr *hdr) * ip.src == llipaddr && hw.src != own hwaddr */ if(ip_addr_cmp(&sipaddr, &netif->autoip->llipaddr) && !eth_addr_cmp(&netifaddr, &hdr->shwaddr)) { - LWIP_DEBUGF(AUTOIP_DEBUG | DBG_TRACE | DBG_STATE | 1, ("autoip_arp_reply(): Conflicting ARP-Packet detected\n")); + LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE | 1, ("autoip_arp_reply(): Conflicting ARP-Packet detected\n")); autoip_handle_arp_conflict(netif); } } diff --git a/src/netif/etharp.c b/src/netif/etharp.c index a9bc02a8..a0dfae41 100644 --- a/src/netif/etharp.c +++ b/src/netif/etharp.c @@ -938,7 +938,7 @@ etharp_request(struct netif *netif, struct ip_addr *ipaddr) eth_addr_zero.addr[k] = 0x00; } - LWIP_DEBUGF(ETHARP_DEBUG | DBG_TRACE, ("etharp_request: sending ARP request.\n")); + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_request: sending ARP request.\n")); return etharp_raw( netif, (struct eth_addr *)netif->hwaddr, ð_addr_bc, @@ -962,7 +962,7 @@ etharp_raw(struct netif *netif, struct eth_addr *ethsrc_addr, struct eth_addr *e /* could allocate a pbuf for an ARP request? */ if(p != NULL) { struct etharp_hdr *hdr = p->payload; - LWIP_DEBUGF(ETHARP_DEBUG | DBG_TRACE, ("etharp_raw: sending raw ARP packet.\n")); + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_raw: sending raw ARP packet.\n")); hdr->opcode = htons(OpCode); k = netif->hwaddr_len; @@ -998,7 +998,7 @@ etharp_raw(struct netif *netif, struct eth_addr *ethsrc_addr, struct eth_addr *e /* could not allocate pbuf for ARP request */ } else { result = ERR_MEM; - LWIP_DEBUGF(ETHARP_DEBUG | DBG_TRACE | 2, ("etharp_raw: could not allocate pbuf for ARP request.\n")); + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE | 2, ("etharp_raw: could not allocate pbuf for ARP request.\n")); } return result;