diff --git a/src/gui/main.cpp b/src/gui/main.cpp index 798bd6ddf..2b3996194 100644 --- a/src/gui/main.cpp +++ b/src/gui/main.cpp @@ -265,7 +265,13 @@ int main( int argc, char *argv[] ) // setup single shot timer to call startupLoad() QTimer::singleShot(500, mw, SLOT(startupLoad())); - app->exec(); + try + { + app->exec(); + } catch (const FWException &ex) + { + qDebug() << "Caught FWException: " << ex.toString().c_str(); + } mw->hide(); // must do this before settings object is destroyed diff --git a/src/import/PIXImporter.cpp b/src/import/PIXImporter.cpp index 2a851315f..ac36ff2ea 100644 --- a/src/import/PIXImporter.cpp +++ b/src/import/PIXImporter.cpp @@ -629,26 +629,31 @@ Firewall* PIXImporter::finalize() { Firewall *fw = Firewall::cast(getFirewallObject()); - QString pl = QString(discovered_platform.c_str()).toLower(); - if (pl == "asa") pl = "pix"; - - string host_os; - - if (pl == "pix") host_os = "pix_os"; - if (pl == "fwsm") host_os = "fwsm_os"; - - if (! host_os.empty()) + if (! discovered_platform.empty()) { - fw->setStr("host_OS", host_os); - Resources::setDefaultTargetOptions(host_os , fw); + QString pl = QString(discovered_platform.c_str()).toLower(); + + fw->setStr("platform", pl.toStdString()); + + if (pl == "asa") pl = "pix"; + + string host_os; + + if (pl == "pix") host_os = "pix_os"; + if (pl == "fwsm") host_os = "fwsm_os"; + + if (! host_os.empty()) + { + fw->setStr("host_OS", host_os); + Resources::setDefaultTargetOptions(host_os , fw); + } + + string version = findBestVersionMatch( + pl, discovered_version.c_str()).toStdString(); + + if ( ! version.empty()) fw->setStr("version", version); } - string version = findBestVersionMatch( - pl, discovered_version.c_str()).toStdString(); - - if ( ! version.empty()) - fw->setStr("version", version); - rearrangeVlanInterfaces(); FWObject *policy = getFirewallObject()->getFirstByType(Policy::TYPENAME); diff --git a/src/unit_tests/PIXImporterTest/test_data/asa8.0-names.fwb b/src/unit_tests/PIXImporterTest/test_data/asa8.0-names.fwb index 9606ae06e..927b168b5 100644 --- a/src/unit_tests/PIXImporterTest/test_data/asa8.0-names.fwb +++ b/src/unit_tests/PIXImporterTest/test_data/asa8.0-names.fwb @@ -1,6 +1,6 @@ - + @@ -494,7 +494,7 @@ - + @@ -886,11 +886,11 @@ - + - + @@ -903,6 +903,7 @@ + diff --git a/src/unit_tests/PIXImporterTest/test_data/asa8.0-names.output b/src/unit_tests/PIXImporterTest/test_data/asa8.0-names.output index 915e376e4..140d67343 100644 --- a/src/unit_tests/PIXImporterTest/test_data/asa8.0-names.output +++ b/src/unit_tests/PIXImporterTest/test_data/asa8.0-names.output @@ -1,6 +1,5 @@ 3: Platform: PIX 3: Version: 8.0 -5: Host name: pixfirewall 14: New interface: Ethernet0 14: Interface parameters: inside 14: Interface label: inside diff --git a/src/unit_tests/PIXImporterTest/test_data/asa8.0.fwb b/src/unit_tests/PIXImporterTest/test_data/asa8.0.fwb index 37f22e042..92a308b55 100644 --- a/src/unit_tests/PIXImporterTest/test_data/asa8.0.fwb +++ b/src/unit_tests/PIXImporterTest/test_data/asa8.0.fwb @@ -1,6 +1,6 @@ - + @@ -576,7 +576,7 @@ - + @@ -927,11 +927,11 @@ - + - + @@ -944,6 +944,7 @@ + diff --git a/src/unit_tests/PIXImporterTest/test_data/asa8.0.output b/src/unit_tests/PIXImporterTest/test_data/asa8.0.output index 8078eac41..cdee5005c 100644 --- a/src/unit_tests/PIXImporterTest/test_data/asa8.0.output +++ b/src/unit_tests/PIXImporterTest/test_data/asa8.0.output @@ -1,6 +1,5 @@ 3: Platform: PIX 3: Version: 8.0 -5: Host name: pixfirewall 9: New interface: Ethernet0 9: Interface parameters: inside 9: Interface label: inside diff --git a/src/unit_tests/PIXImporterTest/test_data/asa8.3-acl-object-groups.fwb b/src/unit_tests/PIXImporterTest/test_data/asa8.3-acl-object-groups.fwb index 57e125a28..e000ac4ed 100644 --- a/src/unit_tests/PIXImporterTest/test_data/asa8.3-acl-object-groups.fwb +++ b/src/unit_tests/PIXImporterTest/test_data/asa8.3-acl-object-groups.fwb @@ -1,6 +1,6 @@ - + @@ -519,7 +519,7 @@ - + @@ -1050,7 +1050,7 @@ - + @@ -1069,6 +1069,7 @@ + diff --git a/src/unit_tests/PIXImporterTest/test_data/asa8.3-acl-object-groups.output b/src/unit_tests/PIXImporterTest/test_data/asa8.3-acl-object-groups.output index 5e18b787c..56e261ef9 100644 --- a/src/unit_tests/PIXImporterTest/test_data/asa8.3-acl-object-groups.output +++ b/src/unit_tests/PIXImporterTest/test_data/asa8.3-acl-object-groups.output @@ -1,6 +1,5 @@ 3: Platform: ASA 3: Version: 8.3 -5: Host name: asa5505 8: New interface: Vlan1 8: Interface parameters: inside 8: Interface label: inside diff --git a/src/unit_tests/PIXImporterTest/test_data/asa8.3-acl.fwb b/src/unit_tests/PIXImporterTest/test_data/asa8.3-acl.fwb index 1037df7e8..69a07804f 100644 --- a/src/unit_tests/PIXImporterTest/test_data/asa8.3-acl.fwb +++ b/src/unit_tests/PIXImporterTest/test_data/asa8.3-acl.fwb @@ -1,6 +1,6 @@ - + @@ -675,7 +675,7 @@ - + @@ -2235,7 +2235,7 @@ - + @@ -2254,6 +2254,7 @@ + diff --git a/src/unit_tests/PIXImporterTest/test_data/asa8.3-acl.output b/src/unit_tests/PIXImporterTest/test_data/asa8.3-acl.output index bc2ea496d..a15a14dac 100644 --- a/src/unit_tests/PIXImporterTest/test_data/asa8.3-acl.output +++ b/src/unit_tests/PIXImporterTest/test_data/asa8.3-acl.output @@ -1,6 +1,5 @@ 3: Platform: ASA 3: Version: 8.3 -5: Host name: asa5505 8: New interface: Vlan1 8: Interface parameters: inside 8: Interface label: inside diff --git a/src/unit_tests/PIXImporterTest/test_data/asa8.3-objects-and-groups.fwb b/src/unit_tests/PIXImporterTest/test_data/asa8.3-objects-and-groups.fwb index a815637dd..6137d415d 100644 --- a/src/unit_tests/PIXImporterTest/test_data/asa8.3-objects-and-groups.fwb +++ b/src/unit_tests/PIXImporterTest/test_data/asa8.3-objects-and-groups.fwb @@ -1,6 +1,6 @@ - + @@ -835,7 +835,7 @@ - + @@ -869,7 +869,7 @@ - + @@ -885,6 +885,7 @@ + diff --git a/src/unit_tests/PIXImporterTest/test_data/asa8.3-objects-and-groups.output b/src/unit_tests/PIXImporterTest/test_data/asa8.3-objects-and-groups.output index 05ab516c3..f0b43ad52 100644 --- a/src/unit_tests/PIXImporterTest/test_data/asa8.3-objects-and-groups.output +++ b/src/unit_tests/PIXImporterTest/test_data/asa8.3-objects-and-groups.output @@ -1,6 +1,5 @@ 3: Platform: ASA 3: Version: 8.3 -5: Host name: asa5505 7: New interface: Vlan1 7: Interface comment: inside interface 8: Interface parameters: inside diff --git a/src/unit_tests/PIXImporterTest/test_data/asa8.3.fwb b/src/unit_tests/PIXImporterTest/test_data/asa8.3.fwb index f00e649a3..33d29de60 100644 --- a/src/unit_tests/PIXImporterTest/test_data/asa8.3.fwb +++ b/src/unit_tests/PIXImporterTest/test_data/asa8.3.fwb @@ -1,6 +1,6 @@ - + @@ -466,7 +466,7 @@ - + @@ -603,7 +603,7 @@ - + @@ -622,6 +622,7 @@ + diff --git a/src/unit_tests/PIXImporterTest/test_data/asa8.3.output b/src/unit_tests/PIXImporterTest/test_data/asa8.3.output index 636140689..3642c6af3 100644 --- a/src/unit_tests/PIXImporterTest/test_data/asa8.3.output +++ b/src/unit_tests/PIXImporterTest/test_data/asa8.3.output @@ -1,6 +1,5 @@ 3: Platform: ASA 3: Version: 8.3 -5: Host name: asa5505 14: New interface: Vlan1 14: Interface comment: inside interface 15: Interface parameters: inside diff --git a/src/unit_tests/PIXImporterTest/test_data/pix6.fwb b/src/unit_tests/PIXImporterTest/test_data/pix6.fwb index 0ccbfc37a..a02495d6b 100644 --- a/src/unit_tests/PIXImporterTest/test_data/pix6.fwb +++ b/src/unit_tests/PIXImporterTest/test_data/pix6.fwb @@ -1,6 +1,6 @@ - + @@ -520,7 +520,7 @@ - + @@ -1674,7 +1674,7 @@ - + @@ -1687,6 +1687,7 @@ + diff --git a/src/unit_tests/PIXImporterTest/test_data/pix6.output b/src/unit_tests/PIXImporterTest/test_data/pix6.output index 0701fc738..1aefc836e 100644 --- a/src/unit_tests/PIXImporterTest/test_data/pix6.output +++ b/src/unit_tests/PIXImporterTest/test_data/pix6.output @@ -4,7 +4,6 @@ 5: New interface: ethernet1 5: Interface parameters: ethernet0 outside security0 5: Interface parameters: ethernet1 inside security100 -10: Host name: guardian 34: Object Group (icmp) inside.id12349X2458.srv.icmp.0 38: Object Group (icmp) outside.id12363X2458.srv.icmp.0 43: Object Group (service) outside.id12376X2458.srv.udp.0 diff --git a/src/unit_tests/PIXImporterTest/test_data/pix7-nat.fwb b/src/unit_tests/PIXImporterTest/test_data/pix7-nat.fwb index 2f75550dc..b8f851b9a 100644 --- a/src/unit_tests/PIXImporterTest/test_data/pix7-nat.fwb +++ b/src/unit_tests/PIXImporterTest/test_data/pix7-nat.fwb @@ -1,6 +1,6 @@ - + @@ -565,7 +565,7 @@ - + @@ -3036,14 +3036,14 @@ - + - + @@ -3051,7 +3051,7 @@ - + @@ -3064,6 +3064,7 @@ + diff --git a/src/unit_tests/PIXImporterTest/test_data/pix7-nat.output b/src/unit_tests/PIXImporterTest/test_data/pix7-nat.output index edd27ee70..5ad30862e 100644 --- a/src/unit_tests/PIXImporterTest/test_data/pix7-nat.output +++ b/src/unit_tests/PIXImporterTest/test_data/pix7-nat.output @@ -1,6 +1,5 @@ 3: Platform: PIX 3: Version: 7.2 -6: Host name: pix1 16: New interface: Ethernet0 21: New interface: Ethernet0.101 22: Interface parameters: outside diff --git a/src/unit_tests/PIXImporterTest/test_data/pix7.fwb b/src/unit_tests/PIXImporterTest/test_data/pix7.fwb index 019eda960..d441a073b 100644 --- a/src/unit_tests/PIXImporterTest/test_data/pix7.fwb +++ b/src/unit_tests/PIXImporterTest/test_data/pix7.fwb @@ -1,6 +1,6 @@ - + @@ -484,7 +484,7 @@ - + @@ -872,14 +872,14 @@ - + - + @@ -887,7 +887,7 @@ - + @@ -903,6 +903,7 @@ + diff --git a/src/unit_tests/PIXImporterTest/test_data/pix7.output b/src/unit_tests/PIXImporterTest/test_data/pix7.output index cbfda3847..1ff4547de 100644 --- a/src/unit_tests/PIXImporterTest/test_data/pix7.output +++ b/src/unit_tests/PIXImporterTest/test_data/pix7.output @@ -1,6 +1,5 @@ 3: Platform: PIX 3: Version: 7.2 -6: Host name: pix1 16: New interface: Ethernet0 21: New interface: Ethernet0.101 22: Interface parameters: outside