News for hackers. Stuff that matters.
Re:Finally iptables works the same on every Linux distro by ambrop7 on Monday September 02, 2013 @02:59PM (#6316544)
For complex setups you sooner or later have to dynamically add/remove rules, based on values only known at runtime (such as an IP address obtained by DHCP). Then, a simple list of rules doesn't suffice, and some kind of programming is needed.

To solve such problems elegantly I designed my "NCD programming language" (link: https://code.google.com/p/badvpn/wiki/NCD ). The language has built-in backtracking, so in the case of iptables, the language itself makes sure any iptables rule that was added is also removed when that is necessary, in a manner not unlike exception handling in C++ etc. Link to iptables module: https://code.google.com/p/badvpn/source/browse/trunk/ncd/mod...

Re:Finally iptables works the same on every Linux distro by mmastrac on Monday September 02, 2013 @04:00PM (#6316840)
This looks pretty cool. Does it run the script(s) in kernel space or user space?
Re:Finally iptables works the same on every Linux distro by ambrop7 on Monday September 02, 2013 @04:03PM (#6316857)
The interpreter is a userspace program. You can run if from a terminal if you wish and use it as a general purpose scripting language (though it's not quite that useful in that regard, yet).

Oh, and it also runs in the browser ;) http://badvpn.googlecode.com/svn/wiki/emncd.html