From owner-freebsd-net@FreeBSD.ORG Wed Apr 18 01:50:10 2007 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A2D1916A482 for ; Wed, 18 Apr 2007 01:50:10 +0000 (UTC) (envelope-from alan@fromorbit.com) Received: from thing1.auspcmarket.com.au (mail.fromorbit.com [203.31.169.65]) by mx1.freebsd.org (Postfix) with ESMTP id 6411313C45E for ; Wed, 18 Apr 2007 01:50:10 +0000 (UTC) (envelope-from alan@fromorbit.com) Received: from [192.168.1.99] (unknown [192.168.1.99]) by thing1.auspcmarket.com.au (Postfix) with ESMTP id A6C655C64 for ; Wed, 18 Apr 2007 11:50:09 +1000 (EST) From: Alan Garfield To: freebsd-net@freebsd.org Content-Type: text/plain Date: Wed, 18 Apr 2007 11:50:09 +1000 Message-Id: <1176861009.4426.21.camel@hiro.auspc.com.au> Mime-Version: 1.0 X-Mailer: Evolution 2.8.3 (2.8.3-2.fc6) Content-Transfer-Encoding: 7bit Subject: rtentry and rtrequest X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Apr 2007 01:50:10 -0000 Hi all! One word.... HOW! :) I've no clue what this FreeBSD ARP stuff is all about, there is little or no documentation, there are 14 different sock_addr's which seem to have a bazillion different fields, and I cannot output a simple debug statement without getting 'error: dereferencing pointer to incomplete type' errors! Sorry for the rant, I'm just frustrated. :) I've been going great on this port, but now I've struck ARP and have been stuck for days and I cannot seem to get myself out no matter how much kernel code I grep it still all looks Greek to me. I understand what ARP is and how it does it's thing. I even understand how Linux does it, but I cannot get a handle on how/why FreeBSD does what it does. Can someone point me in the direction or give an example to output debug from an rtrequest method. Currently I've got :- ---- static void jnet_rtrequest(int cmd, struct rtentry *rt, struct rt_addrinfo *info) { struct ifnet *ifp = rt->rt_ifp; struct jnet_softc *sc = ifp->if_softc; RT_LOCK_ASSERT(rt); switch (cmd) { case RTM_ADD: device_printf(sc->dev, "RTM_ADD. \n"); if (SIN(rt_key(rt))->sin_family == AF_INET) { device_printf(sc->dev, "AF_INET \n"); } break; case RTM_RESOLVE: device_printf(sc->dev, "RTM_RESOLVE. \n"); break; case RTM_DELETE: device_printf(sc->dev, "RTM_DELETE. \n"); break; } rt->rt_rmx.rmx_mtu = rt->rt_ifp->if_mtu; } ---- I just want an idea of the structures involved, and what I need to implement to intercept and injecting a fake MAC so my buffer driver can communicate with the other side without ARP errors. Any help would be more than appreciated (eg. I'd I'll buy you a case of beer next time you're in Sydney Australia). Thanks, Alan.