Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 05 Jun 2007 09:59:52 +0300
From:      Artis Caune <Artis.Caune@latnet.lv>
To:        net@FreeBSD.org
Subject:   PFIL hooks
Message-ID:  <466509E8.4090707@latnet.lv>

next in thread | raw e-mail | index | archive | help
I want to monitor pf tagged mbufs, but (without kld hacks) I can see 
only IN or OUT direction, because PFIL insert hooks in reverse order.

Hack like this works, but is ugly:
# kldload mymodule
# mymodule -enable PFIL_OUT
# kldload pf
# pfctl -e
# mymodule -enable PFIL_IN


How about PFIL_HEAD, PFIL_TAIL flags for pfil_add_hook?



pfil_list_add()
...
if (flags & PFIL_IN) {
   if (flags & PFIL_TAIL)
     TAILQ_INSERT_TAIL(list, pfh1, pfil_link);
   else
     TAILQ_INSERT_HEAD(list, pfh1, pfil_link);
} else {
   if (flags & PFIL_HEAD)
     TAILQ_INSERT_HEAD(list, pfh1, pfil_link);
   else
     TAILQ_INSERT_TAIL(list, pfh1, pfil_link);
}



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