From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 23 09:09:05 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2344716A4B3 for ; Thu, 23 Oct 2003 09:09:05 -0700 (PDT) Received: from pony1pub.arc.nasa.gov (pony1pub.arc.nasa.gov [128.102.31.41]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7BB4343F93 for ; Thu, 23 Oct 2003 09:09:04 -0700 (PDT) (envelope-from jtoung@arc.nasa.gov) Received: from nren-194.arc.nasa.gov ([128.102.196.194] verified) by pony1pub.arc.nasa.gov (CommuniGate Pro SMTP 4.1.3) with ESMTP id 4384139 for freebsd-hackers@freebsd.org; Thu, 23 Oct 2003 09:09:00 -0700 Content-Type: text/plain; charset="us-ascii" From: Jerry Toung To: freebsd-hackers@freebsd.org Date: Thu, 23 Oct 2003 09:08:55 -0700 User-Agent: KMail/1.4.3 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200310230908.55464.jtoung@arc.nasa.gov> Subject: pseudo-driver (*pr_input) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: jtoung@arc.nasa.gov List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Oct 2003 16:09:05 -0000 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.