Subject: Re: Determining protocol type in an mbuf?
To: Gary Thorpe <gthorpe@myrealbox.com>
From: Giorgos Keramidas <keramida@ceid.upatras.gr>
List: netbsd-help
Date: 03/25/2003 05:35:45
On 2003-03-23 18:40, Gary Thorpe <gthorpe@myrealbox.com> wrote:
> Hi,
>
> Is it possible to determine the protocol of a packet stored in one or
> more mbuf?  I.e. for an mbuf passed to IF_ENQUEUE, is it possible to
> differentiate between IPv4, IPv6 and other protocols?

Look at the source of ether_output() for hints.  It does this already.

Not by peeking in the contents of the mbuf though, but using a
separate struct sockaddr argument.  Not sure if this is of any help...