Date: Wed, 10 Aug 2016 07:52:23 +0200 From: Christian Mauderer <christian.mauderer@embedded-brains.de> To: Adrian Chadd <adrian.chadd@gmail.com> Cc: "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org> Subject: Re: Changes to pfctl to allow easier integration into a library Message-ID: <23714335-7f8c-63b6-4f9c-747ceba954d7@embedded-brains.de> In-Reply-To: <CAJ-Vmo=5MBa38TytDMnqdZEUgxF5XXXSqFkcoWSyW_rBuu3x3A@mail.gmail.com> References: <25df9fd5-be75-b9ae-aa3a-22abef3bddf0@embedded-brains.de> <cb7c6bb6-8160-3524-5432-d4ff46e16af5@embedded-brains.de> <0C7EC45D-C3BC-4417-AF77-3ACC027D28B5@FreeBSD.org> <a2479a3c-031c-c137-78a9-8a8f34a12100@embedded-brains.de> <B5DEAF43-9CBD-4C74-AE71-8B7FD278BAA8@FreeBSD.org> <336150f6-9dcd-873f-1f8f-a264dfa4c4ed@embedded-brains.de> <4571f890-6d35-b843-9bd8-86966fe515f5@embedded-brains.de> <57A97463.9000801@embedded-brains.de> <CAJ-Vmo=5MBa38TytDMnqdZEUgxF5XXXSqFkcoWSyW_rBuu3x3A@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Am 09.08.2016 um 21:42 schrieb Adrian Chadd: > [snip] >=20 > hi, >=20 > I'm looking at this, because I'm thinking of what it'd take to make > some of this stuff in a daemon and be persistent, versus having to > fork/exec commands in a memory constrained environment. >=20 > Some static vars are effectively consts and are consts. Those may just > be committed as-is to make things clearer. >=20 > Some are actual state, which means I can't run this in a > multi-threaded environment.. :) >=20 >=20 >=20 > -adrian >=20 Hello Adrian, I'm quite sure there would be some more use cases where a library would be preferable to a stand alone tool. This could also simplify calls from perl or python scripts. Like I already mentioned in my first mail Sebastian had a discussion into this direction in 2013: https://lists.freebsd.org/pipermail/freebsd-hackers/2013-October/043553.h= tml If it is of any use to you, you can take a look at the method we use here= : https://git.rtems.org/rtems-libbsd/ Please note that this work is currently based on an FreeBSD 9.3. Some of the changes (mainly in the user space tools) make it hard to update to the current version. I hoped that my approach that I used on pfctl would bring us closer to the FreeBSD sources. Some of the other tools (like route which has been ported as one of the earlier tools) have some extensive modifications. We plan to reduce the modifications in the futur= e. Most of the tools use a mutex to prevent parallel execution of multiple instances of the tool. But it could be really tricky to have multiple instances of a configuration tool like pfctl (or ifconfig, or ...) at the same time anyway. So this is not really a restriction. Kind regards Christian --=20 -------------------------------------------- embedded brains GmbH Christian Mauderer Dornierstr. 4 D-82178 Puchheim Germany email: christian.mauderer@embedded-brains.de Phone: +49-89-18 94 741 - 18 Fax: +49-89-18 94 741 - 08 PGP: Public key available on request. Diese Nachricht ist keine gesch=C3=A4ftliche Mitteilung im Sinne des EHUG= .
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?23714335-7f8c-63b6-4f9c-747ceba954d7>
