From owner-freebsd-net@FreeBSD.ORG Fri Aug 29 09:17:23 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 244AB16A4C0 for ; Fri, 29 Aug 2003 09:17:23 -0700 (PDT) Received: from handler3.mail.rice.edu (handler3.mail.rice.edu [128.42.58.203]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4BFD343FE1 for ; Fri, 29 Aug 2003 09:17:22 -0700 (PDT) (envelope-from takhoa@rice.edu) Received: from localhost (localhost [127.0.0.1]) by handler3.mail.rice.edu (Postfix) with ESMTP id A5E051DBF4 for ; Fri, 29 Aug 2003 11:17:21 -0500 (CDT) Received: from handler3.mail.rice.edu ([127.0.0.1]) by localhost (handler3.mail.rice.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 26381-05 for ; Fri, 29 Aug 2003 11:17:20 -0500 (CDT) Received: from PILLOW (dhcp-68-239.ece.rice.edu [128.42.68.239]) by handler3.mail.rice.edu (Postfix) with SMTP id 40C4B1DB59 for ; Fri, 29 Aug 2003 11:17:20 -0500 (CDT) From: "Khoa A. To" To: "FreeBSD_Net" Date: Fri, 29 Aug 2003 11:17:16 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2727.1300 In-reply-to: <20030829154401.GA417@newluxor.skynet.org> X-Virus-Scanned: by amavis-20030314-p2 at mail.rice.edu Subject: Reversed MAC lookup inside FreeBSD kernel? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Aug 2003 16:17:23 -0000 Hi, I'm new to kernel code, and don't understand the structure of ARP table very well. Could someone please point me to the right direction for the following problem I have: I need to get a translation of MAC addresses to IP addresses in the kernel. I saw some postings about how to translate MAC to IP in the user level, but they seem to require the host to send a packet to that MAC address and some other ways that also require the host to actually send some request packets out. All my MAC-IP addresses are already set statically using "arp -s" in the ARP table. When I'm in the kernel, how do I get a hold of the ARP table and do some kind of reversed search to get the IP address out? Thank you very much, Khoa.