Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Apr 2007 10:11:23 +0300
From:      "Ivo Vachkov" <ivo.vachkov@gmail.com>
To:        "Alan Garfield" <alan@fromorbit.com>
Cc:        freebsd-net@freebsd.org
Subject:   Re: rtentry and rtrequest
Message-ID:  <f85d6aa70704180011x46052036h281c56850e01b944@mail.gmail.com>
In-Reply-To: <1176861009.4426.21.camel@hiro.auspc.com.au>
References:  <1176861009.4426.21.camel@hiro.auspc.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <alan@fromorbit.com> 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



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