开发者

Retrieving Mac Address for the given IP-Address

开发者 https://www.devze.com 2023-01-04 02:50 出处:网络
Is there any way to retrieve the mac-address for the given ip-address from the ARP table without providing the Interface name ??

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号