Subject: Re: thoughts on a dohooks(9) API?
To: None <tech-kern@netbsd.org>
From: Pavel Cahyna <pcah8322@artax.karlin.mff.cuni.cz>
List: tech-kern
Date: 01/05/2006 09:47:35
On Wed, Jan 04, 2006 at 11:28:13AM -0800, Jeff Rizzo wrote:
> Pavel Cahyna wrote:
> > On Wed, Jan 04, 2006 at 08:26:20AM -0800, Jeff Rizzo wrote:
> >   
> >> I'm helping someone to port carp(4) from OpenBSD
> >> (comments/flames/whatever on the desirability of THAT in another thread,
> >> please :), and we've come across some instances where we need to add
> >> hooks to certain events (interface up, address change, etc).  OpenBSD
> >> has a dohooks(9) API that is used to implement various hook-needing
> >> functions (their doshutdownhooks() is implemented on top of it, for
> >>     
> >
> > This has been discussed, see
> > http://mail-index.netbsd.org/tech-net/2004/09/19/0012.html and the whole
> > thread.
> >
> > See also pfil_add_hook(9). couldn't it do what you need?
> >
> > Pavel Cahyna
> >   
> 
> Thanks for the pointer to the email thread - I'll follow up to tech-net,
> then, since nothing appears to have come of that discussion.  :/
> 
> I don't think I need per-packet hooks in this case (though I haven't dug
> too deep, yet), so at first blush, pfil_add_hook() looks wrong.

See the PFIL_IFADDR and PFIL_IFNET flags to pfil_add_hook. Also see the
first massage in the referenced thread: 
http://mail-index.netbsd.org/tech-net/2004/09/19/0001.html 

Pavel Cahyna