Page 1 of 1

Print ARP table in ESP-IDF 5.1.1 version

Posted: Wed Feb 28, 2024 9:59 am
by endi83
How can I print the ARP table of my ESP32C6 device? I have been doing some research and I have seen that with the function "etharp_for_each_entry" it is possible to get the ARP table but for ESP-IDF 5.1.1 version this function is not available.

Thank you!

Re: Print ARP table in ESP-IDF 5.1.1 version

Posted: Wed Aug 14, 2024 5:31 pm
by MikeMyhre
You can use the etharp_get_entry() function. Something like this:

Code: Select all

struct eth_addr *ethaddr;
struct netif *netif;
struct eth_addr *ea;
for( int i=0;i<ARP_TABLE_SIZE;i++ ) {
  int ret = etharp_get_entry(i,&ipaddr,&netif,&ea);
  if( ret ) {
     // print contents of IP (ipaddress->addr), interface (netif->num), mac (6 bytes)
  }
}