Retrieving Mac Address for the given IP-Address
Is there any way to retrieve the mac-address for the given ip-address from the ARP table without providing the Interface name ??
开发者_JS百科I do know the procedure of retrieving the mac address using ioctl call but in that case I should provide the interface name .. :(
One Crude Solution: Read /proc/net/arp file ... :( .. other than that .. any system call or anything else where i can retrieve the mac-address without the need of interface name ??
NOTE: Simple C based solution not interested in scripting libraries.
NOTE: I am expecting a *NUX based solution rather than WINDOWS based one.
I do know the procedure of retrieving the mac address using ioctl call but in that case I should provide the interface name
So all you need is a way to find the interface name associated with a given IP. The ioctl SIOCGIFCONF will give you that.
精彩评论