Hi Mario,

On Sat, Feb 25, 2017 at 02:59:40PM -0600, Mario Campos wrote:
> [...]
> These configuration settings should probably be in a configuration file. I
> read somewhere on the interwebs that OpenBSD config files try to resemble
> each other, or rather, they try to keep to a format/style. Is this
> format/style documented anywhere? Or is there a C library that I should be
> using?
> [...]

pfctl's parse.y should be a good starting point. It's not exactly a
library but provides things like macros, string handling and file
includes for nearly free.

> [...]
> The second question I have is around polling the interface for its IP
> address. Correct me if I'm wrong, but I don't think it's possible to
> register a callback for whenever the interface changes its IP address,
> right? Instead, this daemon will have to poll it periodically?
> [...]

You could use route(4) for that. It has RTM_{NEW,DEL}ADDR messages that
seem to do what you need.

-- 
        Gregor

Reply via email to