BPF Berkeley Packet Filter
Julian Elischer
julian at freebsd.org
Wed Dec 30 08:43:33 UTC 2015
On 30/12/2015 6:26 AM, Juan Herrera wrote:
> Hello,
>
> I have a question regarding Berkeley Packet filter, which is Can I read an
> incoming packet length with BPF, I am working on a project that requires to
> filter the receiving packets in the kernel before they get to userspace,
> but I need to be able to read the packet length when applying BPF because I
> (previously) encapsulated the packet with my own metadata before sending it
> to the machine with BPF so I want to read packet length to decapsulate as I
> know the value for the metadata at the end of the packet?
https://www.freebsd.org/cgi/man.cgi?bpf%284%29
should show you what you need.
there is a structure prepended to the packet that includes the
original length.
or do you want to know the length BEFORE reading it?
or do you want your filter to know the length?
what do you mean by "applying BPF"?
>
>
> Thank you in advance!
> _______________________________________________
> freebsd-net at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscribe at freebsd.org"
>
More information about the freebsd-net
mailing list