mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-01-01 12:00:53 +00:00
Changed all references to old debug defines to the new ones (e.g. LWIP_DBG_TRACE)
This commit is contained in:
parent
7c4377af0e
commit
f1d95379bc
@ -103,7 +103,7 @@ autoip_init(void)
|
|||||||
{
|
{
|
||||||
/* TODO MAC_ADDRESS macaddr; */
|
/* 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);*/
|
/* TODO Get_Current_MAC_Address(&macaddr);*/
|
||||||
/*srand(
|
/*srand(
|
||||||
@ -128,17 +128,17 @@ autoip_handle_arp_conflict(struct netif *netif)
|
|||||||
/* retreat, there was a conflicting ARP in the last
|
/* retreat, there was a conflicting ARP in the last
|
||||||
* DEFEND_INTERVAL seconds
|
* 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 */
|
/* TODO: close all TCP sessions */
|
||||||
autoip_start(netif);
|
autoip_start(netif);
|
||||||
} else {
|
} 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);
|
autoip_arp_announce(netif);
|
||||||
netif->autoip->lastconflict = DEFEND_INTERVAL * AUTOIP_FINE_TIMER_TICK_PER_SECOND;
|
netif->autoip->lastconflict = DEFEND_INTERVAL * AUTOIP_FINE_TIMER_TICK_PER_SECOND;
|
||||||
}
|
}
|
||||||
} else {
|
} 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 */
|
/* TODO: close all TCP sessions */
|
||||||
autoip_start(netif);
|
autoip_start(netif);
|
||||||
}
|
}
|
||||||
@ -192,7 +192,7 @@ autoip_bind(struct netif *netif)
|
|||||||
{
|
{
|
||||||
struct autoip *autoip = netif->autoip;
|
struct autoip *autoip = netif->autoip;
|
||||||
struct ip_addr sn_mask, gw_addr;
|
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(&sn_mask, 255, 255, 0, 0);
|
||||||
IP4_ADDR(&gw_addr, 0, 0, 0, 0);
|
IP4_ADDR(&gw_addr, 0, 0, 0, 0);
|
||||||
@ -227,19 +227,19 @@ autoip_start(struct netif *netif)
|
|||||||
netif->netmask.addr = 0;
|
netif->netmask.addr = 0;
|
||||||
netif->gw.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) {
|
if(autoip == NULL) {
|
||||||
/* no AutoIP client attached yet? */
|
/* 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));
|
autoip = mem_malloc(sizeof(struct autoip));
|
||||||
if(autoip == NULL) {
|
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;
|
return ERR_MEM;
|
||||||
}
|
}
|
||||||
memset( autoip, 0, sizeof(struct autoip));
|
memset( autoip, 0, sizeof(struct autoip));
|
||||||
/* store this AutoIP client in the netif */
|
/* store this AutoIP client in the netif */
|
||||||
netif->autoip = autoip;
|
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 {
|
} else {
|
||||||
autoip->state = AUTOIP_STATE_OFF;
|
autoip->state = AUTOIP_STATE_OFF;
|
||||||
autoip->ttw = 0;
|
autoip->ttw = 0;
|
||||||
@ -298,7 +298,7 @@ autoip_fine_tmr()
|
|||||||
netif->autoip->lastconflict--;
|
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) {
|
switch(netif->autoip->state) {
|
||||||
case AUTOIP_STATE_PROBING:
|
case AUTOIP_STATE_PROBING:
|
||||||
@ -311,7 +311,7 @@ autoip_fine_tmr()
|
|||||||
netif->autoip->ttw = ANNOUNCE_WAIT * AUTOIP_FINE_TIMER_TICK_PER_SECOND;
|
netif->autoip->ttw = ANNOUNCE_WAIT * AUTOIP_FINE_TIMER_TICK_PER_SECOND;
|
||||||
} else {
|
} else {
|
||||||
etharp_request(netif, &(netif->autoip->llipaddr));
|
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++;
|
netif->autoip->sent_num++;
|
||||||
/* calculate time to wait to next probe */
|
/* 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;
|
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;
|
netif->autoip->ttw = 0;
|
||||||
} else {
|
} else {
|
||||||
autoip_arp_announce(netif);
|
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->sent_num++;
|
||||||
netif->autoip->ttw = ANNOUNCE_INTERVAL * AUTOIP_FINE_TIMER_TICK_PER_SECOND;
|
netif->autoip->ttw = ANNOUNCE_INTERVAL * AUTOIP_FINE_TIMER_TICK_PER_SECOND;
|
||||||
}
|
}
|
||||||
@ -355,7 +355,7 @@ autoip_fine_tmr()
|
|||||||
void
|
void
|
||||||
autoip_arp_reply(struct netif *netif, struct etharp_hdr *hdr)
|
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)) {
|
if ((netif->autoip != NULL) && (netif->autoip->state != AUTOIP_STATE_OFF)) {
|
||||||
/* when ip.src == llipaddr && hw.src != netif->hwaddr
|
/* 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
|
* 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))) {
|
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);
|
autoip_start(netif);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -394,7 +394,7 @@ autoip_arp_reply(struct netif *netif, struct etharp_hdr *hdr)
|
|||||||
* ip.src == llipaddr && hw.src != own hwaddr
|
* ip.src == llipaddr && hw.src != own hwaddr
|
||||||
*/
|
*/
|
||||||
if(ip_addr_cmp(&sipaddr, &netif->autoip->llipaddr) && !eth_addr_cmp(&netifaddr, &hdr->shwaddr)) {
|
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);
|
autoip_handle_arp_conflict(netif);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -938,7 +938,7 @@ etharp_request(struct netif *netif, struct ip_addr *ipaddr)
|
|||||||
eth_addr_zero.addr[k] = 0x00;
|
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,
|
return etharp_raw( netif,
|
||||||
(struct eth_addr *)netif->hwaddr,
|
(struct eth_addr *)netif->hwaddr,
|
||||||
ð_addr_bc,
|
ð_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? */
|
/* could allocate a pbuf for an ARP request? */
|
||||||
if(p != NULL) {
|
if(p != NULL) {
|
||||||
struct etharp_hdr *hdr = p->payload;
|
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);
|
hdr->opcode = htons(OpCode);
|
||||||
k = netif->hwaddr_len;
|
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 */
|
/* could not allocate pbuf for ARP request */
|
||||||
} else {
|
} else {
|
||||||
result = ERR_MEM;
|
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;
|
return result;
|
||||||
|
Loading…
Reference in New Issue
Block a user