lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] etharp.c update suggestions


From: Robert
Subject: [lwip-users] etharp.c update suggestions
Date: Wed, 4 Jun 2003 07:49:15 -0400 (EDT)

On Wed, 4 Jun 2003 address@hidden wrote:
> (Could not find NULL returns in etharp_query() though)

in etharp.c:  lines 687 & 699


------------------------------------------------
Is there any interest in adding the following function? It is callable
from whatever shell is with the OS and displays the arp table.  Some folks
might have to adjust the "printf" statement to their environment.  Or
perhaps it should be coded with LWIP_PLATFORM_DIAG, or a similar macro
like "LWIP_PLATFORM_PRINTF". I have found the routine to be quite handy
when debugging.

void etharp_dspl(void) {
  u8_t i;
  /* display ARP entries */
  printf("IP Address \t MAC Address \t\t ctime\n");
  for(i = 0; i < ARP_TABLE_SIZE; ++i) {
    if( arp_table[i].state == ETHARP_STATE_STABLE ) 
      printf("%d.%d.%d.%d \t %02X:%02X:%02X:%02X:%02X:%02X \t %d\n", 
        *(0 + (unsigned char*) &arp_table[i].ipaddr.addr), 
        *(1 + (unsigned char*) &arp_table[i].ipaddr.addr), 
        *(2 + (unsigned char*) &arp_table[i].ipaddr.addr), 
        *(3 + (unsigned char*) &arp_table[i].ipaddr.addr),
        arp_table[i].ethaddr.addr[0], 
        arp_table[i].ethaddr.addr[1], 
        arp_table[i].ethaddr.addr[2],
        arp_table[i].ethaddr.addr[3], 
        arp_table[i].ethaddr.addr[4], 
        arp_table[i].ethaddr.addr[5],
        arp_table[i].ctime);
  }
}


BTW, I have never seen any value in the "ctime" column other than "0".  
This is probably because nothing seems to be calling etharp_tmr().  When 
using the "raw" interface method, am I responsible for calling this 
routine?  If so, we need to update the docs to reflect this.  I have a few 
other updates I would like to see in rawapi.txt, if there is interest, I 
will try my hand at adding a bit of text to it.

-- 
Best Regards,
Robert 






reply via email to

[Prev in Thread] Current Thread [Next in Thread]