From owner-freebsd-net Mon Jun 11 15:23:47 2001 Delivered-To: freebsd-net@freebsd.org Received: from prism.flugsvamp.com (cb58709-a.mdsn1.wi.home.com [24.17.241.9]) by hub.freebsd.org (Postfix) with ESMTP id 49BEC37B427 for ; Mon, 11 Jun 2001 15:23:31 -0700 (PDT) (envelope-from jlemon@flugsvamp.com) Received: (from jlemon@localhost) by prism.flugsvamp.com (8.11.0/8.11.0) id f5BMMMB05570; Mon, 11 Jun 2001 17:22:22 -0500 (CDT) (envelope-from jlemon) Date: Mon, 11 Jun 2001 17:22:22 -0500 (CDT) From: Jonathan Lemon Message-Id: <200106112222.f5BMMMB05570@prism.flugsvamp.com> To: bright@rush.net, net@freebsd.org Subject: Re: finding ifp from inpcb X-Newsgroups: local.mail.freebsd-net In-Reply-To: Organization: Cc: Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org In article you write: >If I have an inpcb and an packet what's the best way to send >out the packet via the inpcb's interface? I think I want to >call ether_output_frame, but I can't figure out how to get >the ifp from the inpcb. PCB's don't have interfaces, but (depending on the protocol), they may have routes. For TCP, for example, you may be able to use the cached route in the PCB (if it exists) in order to send the packet: struct tcpcb *tp; struct route *ro; ro = &tp->t_inpcb->inp_route; ip_output(m, NULL, ro, ipflags, NULL); -- Jonathan To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message