Forum Topic - ARP API for getting MAC address of an IP address: (5 Items)
   
ARP API for getting MAC address of an IP address  
Is there any API for getting the MAC address for a specified IP address? It looks like there is a SIOCGARP ioctl command
 but it does not work. 
Re: ARP API for getting MAC address of an IP address  
See SIOCGDRVCOM
Re: ARP API for getting MAC address of an IP address  
IP addresses don't have mac addresses.  Interfaces may or may not
have both.  Look at getifaddrs() / freeifaddrs().

-seanb

On Mon, Jan 20, 2014 at 12:22:51AM -0500, Muralidhar Duvvuri wrote:
> Is there any API for getting the MAC address for a specified IP address? It looks like there is a SIOCGARP ioctl 
command but it does not work. 
> 
> 
> 
> _______________________________________________
> 
> Networking Drivers
> http://community.qnx.com/sf/go/post108021
> To cancel your subscription to this discussion, please e-mail drivers-networking-unsubscribe@community.qnx.com
Re: ARP API for getting MAC address of an IP address  
Thanks. The getifaddrs looks to populate the IP and MAC addresses of only the interfaces on the current system on which 
the code runs. If I want to retrieve the MAC address of a remote machine using its IP address typically ARP is used. 
However, it looks like QNX does not expose any API for retrieving this information. So, is there any way for me to get 
the MAC address of a remote node, given its IP address?
Re: ARP API for getting MAC address of an IP address  
Check out the NetBSD 4 arp utility.  Same applies to QNX:

# arp -an

http://cvsweb.netbsd.org/bsdweb.cgi/src/usr.sbin/arp/?only_with_tag=netbsd-4-0-RELEASE

On Tue, Jan 21, 2014 at 12:30:53AM -0500, Muralidhar Duvvuri wrote:
> Thanks. The getifaddrs looks to populate the IP and MAC addresses of only the interfaces on the current system on 
which the code runs. If I want to retrieve the MAC address of a remote machine using its IP address typically ARP is 
used. However, it looks like QNX does not expose any API for retrieving this information. So, is there any way for me to
 get the MAC address of a remote node, given its IP address?
> 
> 
> 
> _______________________________________________
> 
> Networking Drivers
> http://community.qnx.com/sf/go/post108047
> To cancel your subscription to this discussion, please e-mail drivers-networking-unsubscribe@community.qnx.com