Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Jan 2004 12:01:23 +0100
From:      Ruben de Groot <mail25@bzerk.org>
To:        "Laslett, Greg" <greglas@calm.wa.gov.au>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Looking for C example of ARP lookup on FreeBSD
Message-ID:  <20040122110123.GB19971@ei.bzerk.org>
In-Reply-To: <D6F4DCD16A2E944BBF6B357BD622CB2F01F4387A@calm-kens-10.calm.wa.gov.au>
References:  <D6F4DCD16A2E944BBF6B357BD622CB2F01F4387A@calm-kens-10.calm.wa.gov.au>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Jan 22, 2004 at 05:24:31PM +0800, Laslett, Greg typed:
> 
> Hi,
> 
> The code that is being ported uses the 'ioctl' method to request a MAC address.
> eg:
>     struct arpreq            ReqARP;
>     struct sockaddr_in  *pAddr_in;
>     SOCKET                 s;
>     .
>     .
>     s = socket(AF_INET, SOCK_DGRAM, 0);
>     ioctl(s, SIOCGARP, &ReqARP);
>     .
>     .
> 
> This does not appear to be supported under FreeBSD.  Presumably a sysctl or other mechanism exists.
> 
> Can anyone provide a code fragment showing IP4 to MAC address translation.
 
Maybe a look at /usr/src/usr.sbin/arp/arp.c will help you.

Ruben

> Thanks,
> Greg.
> 
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"
> 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040122110123.GB19971>