Commit Graph

3 Commits

Author SHA1 Message Date
Francois-Xavier Le Bail
85f876ba89 Fix some typos in comments
[skip ci]
2023-01-03 13:11:22 +01:00
Guy Harris
71da7b139e pflog: use nd_ipv4 and nd_ipv6 for addresses in the header.
We should be using nd_ types in structures that are overlaid on packets,
so that we control the field offsets (as independently of the compiler
as possible) and to make it more difficult to fetch data fromt he packet
without using packet data accessor routines (to force bounds checking
and conversion from the appropriate byte order to host byte order as
necessary).
2022-07-17 10:56:05 -07:00
Guy Harris
fe762c04a6 Handle DLT_PFLOG on all OSes.
Don't pad the pflog header with BPF_WORDALIGN(); round up to a multiple
of 4, instead, as that's what all but FreeBSD do, and FreeBSD used to do
that and should go back to doing so (kern/261566).

Don't rely on the OS's pflog include files to define direction types,
reason types, action types, or the layout of the header; instead, define
them ourselves in a header of our own, with #ifs to select the ones that
are only on some platforms.  That way, it'll handle some fields and
field values (the ones common to all OSes with pflog) on all OSes, even
ones without pflog.

That also expands the set of direction, reason, and action codes to what
various *BSDs and Darwin support.

Also, handle all the different AF_INET6 values in various *BSDs and
Darwin.
2022-01-29 22:30:33 -08:00