I'm writing an application that injects packets using SharpPcap (http://sourceforge.net/projects/sharppcap/).
However, since I'm constructing the packets on my own and only know the destination's IP address, I have to determine the physical address of the next hop. I can always send a ping to the remote ip address, sniff it, and get the mac address from the sniffed packet. However, I was hoping there's a less convoluted way to do so in c#.
Obviously, getting the next hop's ip address will also be very helpful, as I can then use SendArp to determine it's mac address.
edit: Getting the routing table will do. How would I obtain that using code?
Thanks,
r