pseudo-driver (*pr_input)

Jerry Toung jtoung at
Thu Oct 23 09:09:05 PDT 2003

Good morning hackers,
I am writing a pseudo driver for a routing protocol that insert its header 
after the ip header. I call it TTT. On the output after ip_output, for 
packets destined to a particular subnet I go through the ttt0 virtual 
interface calling ttt_output.
In ttt_input all I have is a printf statement to make sure that it is being 
called. tcpdump on the physical interface shows those packets getting in as a 
result of a ping from, but I don't see in the /var/log/messages 
what should be printed by ttt_input. I use 2 machines connected back to back 
with a crossover cable.

tcpdump: listening on fxp0
16:11:15.398205 >  ip-proto-110 91
16:11:16.408227 >  ip-proto-110 91

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

extern  struct domain inetdomain;
static  const struct protosw in_ttt_protosw =
(pr_input_t*)ttt_input, (pr_output_t*)rip_output, rip_ctlinput, 
rip_ctloutput, 0, 0, 0, 0, 0,

and in 

static int ttt_clone_create(struct if_clone *ifc, int unit) 
sc->encap_cookie = encap_attach_func(AF_INET, IPPROTO_TTT,
            ttt_encapcheck, &in_ttt_protosw, sc);


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

More information about the freebsd-hackers mailing list