Changes to pfctl to allow easier integration into a library
Christian Mauderer
christian.mauderer at embedded-brains.de
Thu Jul 28 14:29:44 UTC 2016
Hello,
I'm currently working on a porting pfctl to a real-time operating
system. This is done using the same framework that Sebastian Huber
mentioned here (and probably at some other occasions):
https://lists.freebsd.org/pipermail/freebsd-hackers/2013-October/043553.html
We more or less want to use the pfctl program as a library. The
following changes simplify this. Obviously my problems are quiet similar
to the ones discussed in the linked topic.
- There has been a prototype that didn't quite match with its
implementation. A parameter was unsigned int instead of u_int32_t what
is the same on FreeBSD but not necessarily on a newlib based system.
- I added const qualifiers wherever they were applicable. This saves RAM
on a system where the code is executed from a ROM (like Flash).
- I had to pull some static variables out of their functions. This
allows to put them into an extra linker section without touching too
much of the code. We use the linker section to save / restore the
content before / after the program is called.
Would the attached patches be acceptable for integration into the
FreeBSD sources?
I've generated the patches against the git commit b6ff7c02cf9 on
https://github.com/freebsd/freebsd.git. Please tell me if another form
would be better.
Kind regards,
Christian Mauderer
--
--------------------------------------------
embedded brains GmbH
Christian Mauderer
Dornierstr. 4
D-82178 Puchheim
Germany
email: christian.mauderer at 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äftliche Mitteilung im Sinne des EHUG.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-pfctl-Match-prototype-of-pfctl_load_hostid.patch
Type: text/x-patch
Size: 1112 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20160728/32ccca79/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-pfctl-Use-const-where-possible.patch
Type: text/x-patch
Size: 4102 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20160728/32ccca79/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-pfctl-Pull-static-variables-out-of-the-function.patch
Type: text/x-patch
Size: 5258 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20160728/32ccca79/attachment-0002.bin>
More information about the freebsd-hackers
mailing list