> It is doable, and optimization will happen automatically. The biggest
> effort will be in parsing.
>
> Because of the tabular format of the Shorewall files, the rules compiler
> doesn't have a LR lexical analyzer. It rather splits the line on
> whitespace and then analyzes each 'column'. So embedded whitespace in the
> contents of a column is problematic.
I don't know much about perl (as you know), but is there a notion for a 
"quoted string" in it? In other words, only consider spaces if they are 
not quoted (allowing for escaping, in other words "something else", as 
well as "\"and so on"). If there isn't such functionality built-in, then 
you can devise it as a separate function so that every bit of "string" 
during the parsing process is passed through that function first and 
then you can break it into tokens. At least that is how I will do it in C.

> The code already has to deal with a
> similar problem when parsing the parameters to a action where it is
> splitting the parameters on commas, so no new algorithm should be needed.
>   
Indeed. "one,two,three and more" should be passed on as one argument, 
but one,two,three and more should produce 3 parameters (based on a comma 
separation) or 3 arguments based on space separation.

------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire 
the most talented Cisco Certified professionals. Visit the 
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
_______________________________________________
Shorewall-devel mailing list
Shorewall-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/shorewall-devel

Reply via email to