Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Oct 2003 09:08:55 -0700
From:      Jerry Toung <jtoung@arc.nasa.gov>
To:        freebsd-hackers@freebsd.org
Subject:   pseudo-driver (*pr_input)
Message-ID:  <200310230908.55464.jtoung@arc.nasa.gov>

next in thread | raw e-mail | index | archive | help
Good morning hackers,
I am writing a pseudo driver for a routing protocol that insert its heade=
r=20
after the ip header. I call it TTT. On the output after ip_output, for=20
packets destined to a particular subnet I go through the ttt0 virtual=20
interface calling ttt_output.
In ttt_input all I have is a printf statement to make sure that it is bei=
ng=20
called. tcpdump on the physical interface shows those packets getting in =
as a=20
result of a ping from 243.10.1.1, but I don't see in the /var/log/message=
s=20
what should be printed by ttt_input. I use 2 machines connected back to b=
ack=20
with a crossover cable.

tcpdump: listening on fxp0
16:11:15.398205 243.10.1.1 > 243.10.1.2:  ip-proto-110 91
16:11:16.408227 243.10.1.1 > 243.10.1.2:  ip-proto-110 91
=2E........................................

in if_ttt.c I have this to support calls to ttt_input

extern  struct domain inetdomain;
static  const struct protosw in_ttt_protosw =3D
{ SOCK_RAW, &inetdomain, IPPROTO_TTT, PR_ATOMIC|PR_ADDR,=20
(pr_input_t*)ttt_input, (pr_output_t*)rip_output, rip_ctlinput,=20
rip_ctloutput, 0, 0, 0, 0, 0,
 &rip_usrreqs,
};


and in=20

static int ttt_clone_create(struct if_clone *ifc, int unit)=20
{
=2E...........
sc->encap_cookie =3D encap_attach_func(AF_INET, IPPROTO_TTT,
            ttt_encapcheck, &in_ttt_protosw, sc);

=2E...........
}


sorry for the long post, but if somebody can tell me what I am missing I'=
ll=20
appreciate.
thank you,
Jerry.




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