network programming - Is there a way to get destination mac addres in ANSI C -


The destination IP is known using ANSI C, so is there a way to get the destination MAC address? I would like to prefer it with a system call so that the kernel can handle it with everyone and I will be able to take advantage of ARP cache. I know that I can create and send my own ARP request, but by then I should not get caching functionality etc, unless I do not apply myself, it seems like this is the way to settle the kernel To do.

is not the right answer because it is not ANSI C, but you / proc / net / Arp (in Linux, that is). This is where arp looks for any other OS, the easiest way is equivalent to strace or equivalent arp-cache-display utility.


Comments