Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Jan 2004 17:24:31 +0800
From:      "Laslett, Greg" <greglas@calm.wa.gov.au>
To:        <freebsd-questions@FreeBSD.ORG>
Subject:   Looking for C example of ARP lookup on FreeBSD
Message-ID:  <D6F4DCD16A2E944BBF6B357BD622CB2F01F4387A@calm-kens-10.calm.wa.gov.au>

next in thread | raw e-mail | index | archive | help

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 =3D 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.

Thanks,
Greg.



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