Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Jun 2001 17:22:22 -0500 (CDT)
From:      Jonathan Lemon <jlemon@flugsvamp.com>
To:        bright@rush.net, net@freebsd.org
Subject:   Re: finding ifp from inpcb
Message-ID:  <200106112222.f5BMMMB05570@prism.flugsvamp.com>
In-Reply-To: <local.mail.freebsd-net/20010611163307.O1832@superconductor.rush.net>

next in thread | previous in thread | raw e-mail | index | archive | help
In article <local.mail.freebsd-net/20010611163307.O1832@superconductor.rush.net> 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




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