Adaptation for Cleanliness

Written for OpenPIX by Duncan McGreggor on 2008-10-14

Last night saw some really great new additions in OpenPIX. Despite "enable" now working and the priv mode's "interface" command supported, the most important work was actually hidden way under the covers, and it involved the use of zope.component.

The problem was that in an effort to reduce the amount of code duplication as well as manually coded references to other code, OpenPIX had accreted (in a short time) code that used inspect to perform these duties. I finally got fed up because it's just the sort of problem adaptation was meant to solve. In short, the appropriate grammar is now selected, adapted to the parser and the mode (e.g., user mode, priv mode, config mode) in order to parse the commands entered in the shell.

Next up, I'll be applying similar patterns to the code that selects which *NIX variant to support when making system calls, and which backend to use (pf, iptables, etc.).

The new NICs for my firewall should be arriving today, which means that over the next few days I should start adding code that allows me to do basic configuration at the system and pf levels. This probably also means that I'll have to work on the "flash drive" code sooner than expected, so that I don't loose info between sessions.

Read all announcements