perl regexp for iptables

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I want to use the perl regular Expression for iptables script and
arrange the data in tables . I have no idea how to insert the
variables like -m , -A etc . which stand for Appending a new rule to
the script . Then I want to write a custom application ( GUI interface
) that can modify or add rules easily .

eg of a line in the script
-A OUTPUT -p tcp --dport 21 -j ACCEPT FTP

I compared my approach with the webmin mechanism , there seems to be
large difference the way it handles files ..

Can anybody help me with this ??


Re: perl regexp for iptables

Quoted text here. Click to load it

Which iptables script?  Iptables itself appears to be a binary.  Their
web site lists dozens of scripts that go with it.

Quoted text here. Click to load it

"-m" and "-A" aren't variables, they are text strings.  Where do you
want to insert them?

Quoted text here. Click to load it

Not before you describe in some more detail what you want to accomplish.

Is the "script" something your program will generate and modify?  Or
will your program generate output that is going to be used to run a
given script?

Note that people here will have first-hand knowledge of iptables
only by coincidence.  We can help with Perl programs, but not with
how to build  an iptables script for a certain purpose.


Re: perl regexp for iptables

Actually I want a script that can modify and generate the script that has default rules for iptables in it . I
want a script that can generate new rules , add to the
file and restart the services if necessary . So I have to write system
API and userAPI that can handle this .

I am very much used to the regular expressions . But when u have a
look at the file anyone can guess the irregularity in
variables and rules pattern . So I need to have a lot of elseifs in my
script . What I am not getting is whether you can put all the
variables like -m , -A , --dport etc. in an array and use them as
$array[4] ( like this ) in an regular expression .
Or is there any other way we can do this ??

Kaushal (Anno Siegel) wrote in message
Quoted text here. Click to load it

Site Timeline