lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Using ARP to get MAC address


From: Tomas Daujotas
Subject: [lwip-users] Using ARP to get MAC address
Date: Fri, 17 Feb 2012 10:04:33 +0200

Hello,
I am trying to get destination MAC address, when I know destination IP address for my packet offload mechanism. The stack is only used for some minor services: ping/arp/etc and the whole stream is generated in other hardware.
The problem is that either I don't know which function I need to use or I am not getting correct results. I am trying to find the MAC address using etharp_find_addr(), which sends the gratuitous arp request and the other end doesn't give a reply, so I get returned -1 as a result. If I use etharp_query(), then the request is sent and a reply is received, however this time, I don't know how to get the destination MAC address. It should probably be placed in ARP table?
 
I've formed a request like this:

arp_pair_index = etharp_find_addr(&alteraTseNetif, &lwipStaticGw, &returned_eth_addr, &returned_ip_addr);

I am not as good in C as in VHDL, so I may do some mistakes - sorry if those are dumb ones.

So the question: how to get MAC address when I know the IP address using LwIP? Is my idea correct?

LwIP 1.4.0, Nios II/f softcpu, no RTOS.

Thank You for Your time.


reply via email to

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