mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-03-25 04:37:22 +01:00
generate unique string id on denand, compiler speed-up x3
This commit is contained in:
parent
e56748592d
commit
bbb28ace8e
@ -1,3 +1,31 @@
|
||||
2008-09-21 Vadim Kurland <vadim@vk.crocodile.org>
|
||||
|
||||
* FWObject.cpp (FWObject::fromXML): (change in libfwbuilder)
|
||||
converted attribute "ro" (read-only) from a dictionary variable to
|
||||
the member variable of class FWObject. We check read-only status
|
||||
of objects very often and dictionary lookups were slowing compiler
|
||||
down considerably.
|
||||
|
||||
* FWObjectDatabase.cpp (FWObjectDatabase::getStringId): (change in
|
||||
libfwbuilder) generate unique string object id on demand instead
|
||||
of in the call to generateUniqeueId. This helps speed up compiler
|
||||
operations by a factor of about 3 because we generate unique int
|
||||
ID every time object is created or copied, yet string ID is only
|
||||
needed when object is stored in external XML file. Also using
|
||||
sprintf to assemble string ID, it works faster than ostringstream.
|
||||
|
||||
* RoutingCompiler.cpp (reachableAddressInRGtw::processNext): (change
|
||||
in libfwbuilder) fixed crashes in RoutingCompiler that happened
|
||||
because Routing ruleset object being processed is disconnected
|
||||
from the firewall parent at the time compiler works with it.
|
||||
|
||||
* RoutingCompiler.cpp (rItfChildOfFw::processNext): (change in
|
||||
libfwbuilder) fixed compiler error "Error (iptables): The object
|
||||
"eth0" used as interface in the routing rule 0 (main) is not a
|
||||
child of the firewall the rule belongs to!" that also happened
|
||||
because Routing ruleset object being processed is disconnected
|
||||
from the firewall parent at the time compiler works with it.
|
||||
|
||||
2008-09-19 Vadim Kurland <vadim@vk.crocodile.org>
|
||||
|
||||
* ipfw.cpp (main): Basic suport for IPv6 for ipfw. IPv6 rules
|
||||
|
||||
@ -156,43 +156,53 @@ bool RoutingCompiler_ipt::eliminateDuplicateRules::processNext()
|
||||
*/
|
||||
void RoutingCompiler_ipt::compile()
|
||||
{
|
||||
cout << _(" Compiling routing rules for ") << fw->getName() << " ..." << endl << flush;
|
||||
cout << _(" Compiling routing rules for ")
|
||||
<< fw->getName() << " ..." << endl << flush;
|
||||
|
||||
try {
|
||||
|
||||
Compiler::compile();
|
||||
//bool check_for_recursive_groups=true;
|
||||
|
||||
add(new RoutingCompiler::Begin());
|
||||
add(new printTotalNumberOfRules());
|
||||
|
||||
add(new recursiveGroupsInRDst("Check for recursive Groups in RDst"));
|
||||
add(new emptyGroupsInRDst("Check for empty Groups in RDst"));
|
||||
add(new emptyRDstAndRItf("Check if RDst and RItf are both empty"));
|
||||
add(new singleAdressInRGtw(
|
||||
"Check if RGtw object has exactly one IP adress"));
|
||||
add(new rItfChildOfFw("Check if RItf is an Iterface of this firewall"));
|
||||
add(new validateNetwork("Validate network addresses"));
|
||||
add(new reachableAddressInRGtw(
|
||||
"Check if RGtw is reachable via local networks"));
|
||||
add(new contradictionRGtwAndRItf(
|
||||
"Check if RGtw is in a network of RItf"));
|
||||
|
||||
add( new RoutingCompiler::Begin());
|
||||
add( new printTotalNumberOfRules());
|
||||
add(new ExpandGroups("Expand groups in DST"));
|
||||
add(new ExpandMultipleAddresses(
|
||||
"Expand objects with multiple addresses in DST"));
|
||||
add(new eliminateDuplicatesInDST("Eliminate duplicates in DST"));
|
||||
|
||||
add( new recursiveGroupsInRDst( "Check for recursive Groups in RDst" ) );
|
||||
add( new emptyGroupsInRDst( "Check for empty Groups in RDst" ) );
|
||||
add( new emptyRDstAndRItf( "Check if RDst and RItf are both empty" ) );
|
||||
add( new singleAdressInRGtw( "Check if RGtw object has exactly one IP adress" ) );
|
||||
add( new rItfChildOfFw( "Check if RItf is an Iterface of this firewall" ) );
|
||||
add( new validateNetwork( "Validate network addresses" ) );
|
||||
add( new reachableAdressInRGtw( "Check if RGtw is reachable via local networks" ) );
|
||||
add( new contradictionRGtwAndRItf( "Check if RGtw is in a network of RItf" ) );
|
||||
add(new createSortedDstIdsLabel(
|
||||
"Create label with a sorted dst-id-list for 'competingRules'"));
|
||||
add(new competingRules("Check for competing rules"));
|
||||
|
||||
add( new ExpandGroups( "Expand groups in DST" ) );
|
||||
add( new ExpandMultipleAddresses( "Expand objects with multiple addresses in DST" ) );
|
||||
add( new eliminateDuplicatesInDST( "Eliminate duplicates in DST" ) );
|
||||
add(new ConvertToAtomicForDST(
|
||||
"Convert to atomic rules by dst address elements"));
|
||||
|
||||
add( new createSortedDstIdsLabel( "Creates a label with a sorted dst-id-list for 'competingRules'" ) );
|
||||
add( new competingRules( "Check for competing rules" ) );
|
||||
|
||||
add( new ConvertToAtomicForDST( "Convert to atomic rules by dst address elements") );
|
||||
add(new createSortedDstIdsLabel(
|
||||
"Create label with a sorted dst-id-list for 'classifyRoutingRules'"));
|
||||
add(new classifyRoutingRules(
|
||||
"Classify into single path or part of a multi path rule"));
|
||||
|
||||
add( new createSortedDstIdsLabel( "Creates a label with a sorted dst-id-list for 'classifyRoutingRules'") );
|
||||
add( new classifyRoutingRules( "Classify into single path or part of a multi path rule" ) );
|
||||
add(new optimize3(
|
||||
"Eliminate duplicate rules generated from a single gui-rule"));
|
||||
add(new eliminateDuplicateRules(
|
||||
"Eliminate duplicate rules over the whole table"));
|
||||
|
||||
add( new optimize3( "Eliminate duplicate rules generated from a single gui-rule" ) );
|
||||
add( new eliminateDuplicateRules( "Eliminate duplicate rules over the whole table" ) );
|
||||
|
||||
add( new PrintRule( "generate ip code" ) );
|
||||
add( new simplePrintProgress( ) );
|
||||
add(new PrintRule("generate ip code"));
|
||||
add(new simplePrintProgress());
|
||||
|
||||
runRuleProcessors();
|
||||
|
||||
@ -219,13 +229,13 @@ void RoutingCompiler_ipt::epilog()
|
||||
int nb = 0;
|
||||
|
||||
// ecmp roules can only be generated after all the rules have been parsed, that is the reason for putting this code in the epilog function
|
||||
if( ecmp_rules_buffer.size() > 0) {
|
||||
if(ecmp_rules_buffer.size() > 0) {
|
||||
|
||||
output << "\n#\n# ======================================= EQUAL COST MULTI PATH ========================================\n#" << endl;
|
||||
|
||||
output << "echo \"Activating ecmp routing rules...\"" << endl;
|
||||
|
||||
for( map<string,string>::iterator ecmp_comments_buffer_it = ecmp_comments_buffer.begin(); ecmp_comments_buffer_it != ecmp_comments_buffer.end(); ++ecmp_comments_buffer_it) {
|
||||
for (map<string,string>::iterator ecmp_comments_buffer_it = ecmp_comments_buffer.begin(); ecmp_comments_buffer_it != ecmp_comments_buffer.end(); ++ecmp_comments_buffer_it) {
|
||||
|
||||
output << ecmp_comments_buffer_it->second << "#\n" << flush;
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user