From owner-freebsd-net@FreeBSD.ORG Wed Apr 18 07:36:37 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 A877016A402 for ; Wed, 18 Apr 2007 07:36:37 +0000 (UTC) (envelope-from ivo.vachkov@gmail.com) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.235]) by mx1.freebsd.org (Postfix) with ESMTP id 6AFFE13C46C for ; Wed, 18 Apr 2007 07:36:37 +0000 (UTC) (envelope-from ivo.vachkov@gmail.com) Received: by wx-out-0506.google.com with SMTP id s18so65605wxc for ; Wed, 18 Apr 2007 00:36:36 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=cCTbMK5TvKzKFFISIXjy6qm0PamX6TK8TkHMQKu5A8eco//xy4owndVICut42N7yJavAjbR/V09AztdidloRtuGPQz+D5jGNRNX1w4DUwpSDlfWQuSLuw1TDMU5tO9Ijg3lqOsOXe8xrx5oyFdBsuZobWeRUv4rNYS0eZCD4LKI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=aGegZJ18obSjDFfkt7S109lbUJSMLzF4OEhvYzB0NPM8RwL3OFoKpB8HJeKll5nvQGJ9I484MObjUiQKSf01sIh5NQUpkK0E92Ye331QSJVIQUI53pg445bZMJS7DiftV4nHZjEPh0ljSMaQDsGAX6t1QLEaYnR5hYaSyTeROpE= Received: by 10.90.115.9 with SMTP id n9mr48334agc.1176880283241; Wed, 18 Apr 2007 00:11:23 -0700 (PDT) Received: by 10.90.119.8 with HTTP; Wed, 18 Apr 2007 00:11:23 -0700 (PDT) Message-ID: Date: Wed, 18 Apr 2007 10:11:23 +0300 From: "Ivo Vachkov" To: "Alan Garfield" In-Reply-To: <1176861009.4426.21.camel@hiro.auspc.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <1176861009.4426.21.camel@hiro.auspc.com.au> Cc: freebsd-net@freebsd.org Subject: Re: 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 07:36:37 -0000 please, give us more info about the connection between ARP (address resolution protocol) and rtentry/rtrequest. about the debug information: man 9 printf man 9 log On 4/18/07, Alan Garfield wrote: > 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. > > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > -- "UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity." Dennis Ritchie