Re: Resolving MAC address

2005-03-24 Thread Peter Heerboth
One thing you can try if you want to avoid needing super user privileges is to send a small UDP packet to the given IP, which will force the kernel to ARP for the address if it is not already present. Then you can check the routing table through sysctl() by passing in {CTL_NET, PF_ROUTE, 0, AF

Re: Resolving MAC address

2005-03-24 Thread c0ldbyte
On Wed, 23 Mar 2005, Charlie Schluting wrote: Olivier Nicole wrote: ? (10.0.0.1) at 00:e0:29:ad:5a:aa on em0 [ethernet] will do the trick, but it is a bit too heavy for the purpose, I'd prefer a solution that only send an ARP request. If you just want to avoid the DNS lookup, you can use arp -an. I

Re: Resolving MAC address

2005-03-23 Thread Bruce M Simpson
On Thu, Mar 24, 2005 at 10:58:37AM +0700, Olivier Nicole wrote: > But what i really want to avoid is sending any IP/ICMP packet when the > ARP resolution is all I need. (And some people even filter out the > ICMP echo request packets (Windows XP firewall), so I have to wait for > the time out). po

Re: Resolving MAC address

2005-03-23 Thread Olivier Nicole
> > ? (10.0.0.1) at 00:e0:29:ad:5a:aa on em0 [ethernet] > > > > will do the trick, but it is a bit too heavy for the purpose, I'd > > prefer a solution that only send an ARP request. > > > > If you just want to avoid the DNS lookup, you can use arp -an. > Its much faster :) Thanks. Off course I

Re: Resolving MAC address

2005-03-23 Thread Charlie Schluting
Olivier Nicole wrote: ? (10.0.0.1) at 00:e0:29:ad:5a:aa on em0 [ethernet] will do the trick, but it is a bit too heavy for the purpose, I'd prefer a solution that only send an ARP request. If you just want to avoid the DNS lookup, you can use arp -an. Its much faster :) -Charlie ___

Resolving MAC address

2005-03-23 Thread Olivier Nicole
Hi, Is there a command, or a short C code that I could use to resolve the MAC address for a given IP address? # ping -c 1 10.0.0.1 PING 10.0.0.1 (10.0.0.1): 56 data bytes 64 bytes from 10.0.0.1: icmp_seq=0 ttl=64 time=0.974 ms --- 10.0.0.1 ping statistics --- 1 packets transmitted, 1 packets re