From owner-freebsd-questions@FreeBSD.ORG Thu Jan 22 02:59:23 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0310E16A4CE for ; Thu, 22 Jan 2004 02:59:23 -0800 (PST) Received: from ei.bzerk.org (ei.xs4all.nl [213.84.67.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6BBFD43D2D for ; Thu, 22 Jan 2004 02:59:21 -0800 (PST) (envelope-from mail25@bzerk.org) Received: from ei.bzerk.org (BOFH@localhost [127.0.0.1]) by ei.bzerk.org (8.12.10/8.12.10) with ESMTP id i0MB1NCG020443; Thu, 22 Jan 2004 12:01:23 +0100 (CET) (envelope-from mail25@bzerk.org) Received: (from bulk@localhost) by ei.bzerk.org (8.12.10/8.12.10/Submit) id i0MB1NrP020442; Thu, 22 Jan 2004 12:01:23 +0100 (CET) (envelope-from mail25@bzerk.org) X-Authentication-Warning: ei.bzerk.org: bulk set sender to mail25@bzerk.org using -f Date: Thu, 22 Jan 2004 12:01:23 +0100 From: Ruben de Groot To: "Laslett, Greg" Message-ID: <20040122110123.GB19971@ei.bzerk.org> Mail-Followup-To: Ruben de Groot , "Laslett, Greg" , freebsd-questions@freebsd.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i cc: freebsd-questions@freebsd.org Subject: Re: Looking for C example of ARP lookup on FreeBSD X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2004 10:59:23 -0000 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" >