* OSConfigurator_pix_os.cpp (_printSSHConfiguration): see #2344

"FWSM install errors for clear commands". Using correct syntax for
"clear" commands for FWSM v4.x
This commit is contained in:
Vadim Kurland
2011-04-13 12:27:52 -07:00
parent d64b12221a
commit 5c07a81c7b
7 changed files with 132 additions and 3 deletions
+6
View File
@@ -1,3 +1,9 @@
2011-04-13 Vadim Kurland <vadim@netcitadel.com>
* OSConfigurator_pix_os.cpp (_printSSHConfiguration): see #2344
"FWSM install errors for clear commands". Using correct syntax for
"clear" commands for FWSM v4.x
2011-04-11 vadim <vadim@netcitadel.com>
* PolicyCompiler_PrintRule.cpp (_printTarget): see #2235 "Modified
+2 -2
View File
@@ -121,8 +121,8 @@ QString CompilerDriver_pix::assembleFwScript(Cluster *cluster,
bool cluster_member,
OSConfigurator *oscnf)
{
Configlet script_skeleton(fw, "cisco", "script_skeleton");
Configlet top_comment(fw, "cisco", "top_comment");
Configlet script_skeleton(fw, "pix_os", "script_skeleton");
Configlet top_comment(fw, "pix_os", "top_comment");
FWOptions* options = fw->getOptionsObject();
options->setStr("prolog_script", options->getStr("pix_prolog_script"));
+18
View File
@@ -517,13 +517,20 @@ string OSConfigurator_pix_os::_printSNMP()
{
string version = fw->getStr("version");
string platform = fw->getStr("platform");
// for pix
bool version_ge_70 = XMLTools::version_compare(version, "7.0") >= 0;
// for fwsm
bool version_ge_40 = XMLTools::version_compare(version, "4.0") >= 0;
Configlet cnf(fw, "pix_os", "snmp");
cnf.removeComments();
cnf.collapseEmptyStrings(true);
cnf.setVariable("pix_version_lt_70", ! version_ge_70);
cnf.setVariable("pix_version_ge_70", version_ge_70);
cnf.setVariable("fwsm_version_lt_40", ! version_ge_40);
cnf.setVariable("fwsm_version_ge_40", version_ge_40);
bool set_communities = fw->getOptionsObject()->getBool(
"pix_set_communities_from_object_data");
@@ -591,13 +598,19 @@ string OSConfigurator_pix_os::_printNTP()
{
string version = fw->getStr("version");
string platform = fw->getStr("platform");
// for pix
bool version_ge_70 = XMLTools::version_compare(version, "7.0") >= 0;
// for fwsm
bool version_ge_40 = XMLTools::version_compare(version, "4.0") >= 0;
Configlet cnf(fw, "pix_os", "ntp");
cnf.removeComments();
cnf.collapseEmptyStrings(true);
cnf.setVariable("pix_version_lt_70", ! version_ge_70);
cnf.setVariable("pix_version_ge_70", version_ge_70);
cnf.setVariable("fwsm_version_lt_40", ! version_ge_40);
cnf.setVariable("fwsm_version_ge_40", version_ge_40);
string ntp_server_1=fw->getOptionsObject()->getStr("pix_ntp1");
bool ntp1_pref=fw->getOptionsObject()->getBool("pix_ntp1_pref");
@@ -772,13 +785,18 @@ string OSConfigurator_pix_os::_printSSHConfiguration()
string platform = fw->getStr("platform");
string version = fw->getStr("version");
// for pix
bool version_ge_70 = XMLTools::version_compare(version, "7.0") >= 0;
// for fwsm
bool version_ge_40 = XMLTools::version_compare(version, "4.0") >= 0;
Configlet cnf(fw, "pix_os", "ssh");
cnf.removeComments();
cnf.collapseEmptyStrings(true);
cnf.setVariable("pix_version_lt_70", ! version_ge_70);
cnf.setVariable("pix_version_ge_70", version_ge_70);
cnf.setVariable("fwsm_version_lt_40", ! version_ge_40);
cnf.setVariable("fwsm_version_ge_40", version_ge_40);
cnf.setVariable("clear", 1);
cnf.setVariable("use_scp", fw->getOptionsObject()->getBool("use_scp"));
+27
View File
@@ -0,0 +1,27 @@
## -*- mode: shell-script; -*-
##
## To be able to make changes to the part of configuration created
## from this configlet you need to copy this file to the directory
## fwbuilder/configlets/pix_os/ in your home directory and modify it.
## Double "##" comments are removed during processing but single "#"
## comments are be retained and appear in the generated script. Empty
## lines are removed as well.
##
## Configlets support simple macro language with these constructs:
## {{$var}} is variable expansion
## {{if var}} is conditional operator.
##
{{if clear}}
{{if fwsm_version_lt_40}}
clear ntp
{{endif}}
{{if fwsm_version_ge_40}}
clear config ntp
{{endif}}
{{endif}}
{{if not_server_1_empty}}ntp server {{$address_1}} source {{$interface_1_label}} {{if prefer_1}}prefer{{endif}} {{endif}}
{{if not_server_2_empty}}ntp server {{$address_2}} source {{$interface_2_label}} {{if prefer_2}}prefer{{endif}} {{endif}}
{{if not_server_3_empty}}ntp server {{$address_3}} source {{$interface_3_label}} {{if prefer_3}}prefer{{endif}} {{endif}}
+44
View File
@@ -0,0 +1,44 @@
## -*- mode: shell-script; -*-
##
## To be able to make changes to the part of configuration created
## from this configlet you need to copy this file to the directory
## fwbuilder/configlets/fwsm_os/ in your home directory and modify it.
## Double "##" comments are removed during processing but single "#"
## comments are be retained and appear in the generated script. Empty
## lines are removed as well.
##
## Configlets support simple macro language with these constructs:
## {{$var}} is variable expansion
## {{if var}} is conditional operator.
##
{{if clear}}
{{if fwsm_version_lt_40}}
clear snmp-server
{{endif}}
{{if fwsm_version_ge_40}}
clear config snmp-server
{{endif}}
{{endif}}
{{if disable}}
no snmp-server
{{endif}}
{{if not_disable}}
{{if set_community}}
snmp-server community {{$read_community}}
{{endif}}
{{if set_sysinfo}}
{{if not_location_empty}}snmp-server location {{$location}}{{endif}}
{{if not_contact_empty}}snmp-server contact {{$contact}}{{endif}}
{{endif}}
{{if not_enable_traps}}no {{endif}}snmp-server enable traps
{{if not_server_1_empty}}snmp-server host {{$interface_1_label}} {{$address_1}} {{$poll_or_trap_1}} {{endif}}
{{if not_server_2_empty}}snmp-server host {{$interface_2_label}} {{$address_2}} {{$poll_or_trap_2}} {{endif}}
{{endif}}
+34
View File
@@ -0,0 +1,34 @@
## -*- mode: shell-script; -*-
##
## To be able to make changes to the part of configuration created
## from this configlet you need to copy this file to the directory
## fwbuilder/configlets/pix_os/ in your home directory and modify it.
## Double "##" comments are removed during processing but single "#"
## comments are be retained and appear in the generated script. Empty
## lines are removed as well.
##
## Configlets support simple macro language with these constructs:
## {{$var}} is variable expansion
## {{if var}} is conditional operator.
##
{{if clear}}
{{if fwsm_version_lt_40}}
clear ssh
{{endif}}
{{if fwsm_version_ge_40}}
clear config ssh
{{endif}}
{{endif}}
aaa authentication ssh console LOCAL
{{if use_scp}}
ssh version 2
ssh scopy enable
{{endif}}
{{if ssh_timeout}}
ssh timeout {{$ssh_timeout}}
{{endif}}
+1 -1
View File
@@ -4,7 +4,7 @@
<description>Cisco FWSM</description>
<status>active</status>
<compiler>fwb_pix</compiler>
<family>pix_os</family>
<family>fwsm_os</family>
<dialog>pix_os</dialog>
<options>