mirror of
https://github.com/fwbuilder/fwbuilder
synced 2025-11-06 18:52:58 +01:00
refactor: Disable unused variables in production code
This commit is contained in:
parent
a8f38647c9
commit
65a2009f97
@ -915,8 +915,10 @@ void CompilerDriver_pix::pixClusterConfigurationChecks(Cluster *cluster,
|
||||
failover_group->findByType(FWObjectReference::TYPENAME);
|
||||
it != it.end(); ++it)
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
Interface *member_iface = Interface::cast(FWObjectReference::getObject(*it));
|
||||
assert(member_iface);
|
||||
#endif
|
||||
|
||||
pixClusterGroupChecks(failover_group);
|
||||
|
||||
|
||||
@ -240,8 +240,10 @@ string NATCompiler_pix::debugPrintRule(Rule *r)
|
||||
{
|
||||
NATRule *rule=NATRule::cast(r);
|
||||
|
||||
#ifndef NDEBUG
|
||||
RuleElementItfInb *itf_in_re = rule->getItfInb(); assert(itf_in_re!=nullptr);
|
||||
RuleElementItfOutb *itf_out_re = rule->getItfOutb(); assert(itf_out_re!=nullptr);
|
||||
#endif
|
||||
|
||||
ostringstream os;
|
||||
|
||||
@ -567,11 +569,15 @@ bool NATCompiler_pix::verifyRuleElements::processNext()
|
||||
{
|
||||
NATRule *rule=getNext(); if (rule==nullptr) return false;
|
||||
|
||||
#ifndef NDEBUG
|
||||
Address *osrc=compiler->getFirstOSrc(rule); assert(osrc);
|
||||
#endif
|
||||
Address *odst=compiler->getFirstODst(rule); assert(odst);
|
||||
Service *osrv=compiler->getFirstOSrv(rule); assert(osrv);
|
||||
|
||||
#ifndef NDEBUG
|
||||
Address *tsrc=compiler->getFirstTSrc(rule); assert(tsrc);
|
||||
#endif
|
||||
Address *tdst=compiler->getFirstTDst(rule); assert(tdst);
|
||||
Service *tsrv=compiler->getFirstTSrv(rule); assert(tsrv);
|
||||
|
||||
|
||||
@ -100,7 +100,9 @@ list<NATRule*> NATCompiler_pix::findMatchingDNATRules(
|
||||
Address *odst = getFirstODst(rule); assert(odst);
|
||||
Service *osrv = getFirstOSrv(rule); assert(osrv);
|
||||
|
||||
#ifndef NDEBUG
|
||||
Address *tsrc = getFirstTSrc(rule); assert(tsrc);
|
||||
#endif
|
||||
// Address *tdst = getFirstTDst(rule); assert(tdst);
|
||||
Service *tsrv = getFirstTSrv(rule); assert(tsrv);
|
||||
|
||||
|
||||
@ -430,7 +430,9 @@ bool NATCompiler_pix::DetectOverlappingGlobalPoolsAndStaticRules::processNext()
|
||||
if (rule->getRuleType()== NATRule::DNAT )
|
||||
{
|
||||
Address *outa=compiler->getFirstODst(rule); assert(outa);
|
||||
#ifndef NDEBUG
|
||||
Address *insa=compiler->getFirstTDst(rule); assert(insa);
|
||||
#endif
|
||||
|
||||
for (map<int,NATCmd*>::iterator i=pix_comp->nat_commands.begin();
|
||||
i!=pix_comp->nat_commands.end(); ++i)
|
||||
|
||||
@ -162,13 +162,15 @@ void NATCompiler_pix::PrintRule::printNONAT(NATRule *rule)
|
||||
string("/FWBuilderResources/Target/options/")+
|
||||
"version_"+version+"/pix_commands/clear_acl");
|
||||
|
||||
Address *osrc=compiler->getFirstOSrc(rule); assert(osrc);
|
||||
Address *odst=compiler->getFirstODst(rule); assert(odst);
|
||||
#ifndef NDEBUG
|
||||
Address *osrc=compiler->getFirstOSrc(rule); assert(osrc);
|
||||
Service *osrv=compiler->getFirstOSrv(rule); assert(osrv);
|
||||
|
||||
Address *tsrc=compiler->getFirstTSrc(rule); assert(tsrc);
|
||||
Address *tdst=compiler->getFirstTDst(rule); assert(tdst);
|
||||
Service *tsrv=compiler->getFirstTSrv(rule); assert(tsrv);
|
||||
#endif
|
||||
|
||||
RuleElementItfInb *itf_in_re = rule->getItfInb(); assert(itf_in_re!=nullptr);
|
||||
RuleElementItfOutb *itf_out_re = rule->getItfOutb(); assert(itf_out_re!=nullptr);
|
||||
@ -260,10 +262,12 @@ void NATCompiler_pix::PrintRule::printSNAT(NATRule *rule)
|
||||
Address *osrc = compiler->getFirstOSrc(rule); assert(osrc);
|
||||
Address *odst = compiler->getFirstODst(rule); assert(odst);
|
||||
Service *osrv = compiler->getFirstOSrv(rule); assert(osrv);
|
||||
|
||||
|
||||
#ifndef NDEBUG
|
||||
Address *tsrc = compiler->getFirstTSrc(rule); assert(tsrc);
|
||||
Address *tdst = compiler->getFirstTDst(rule); assert(tdst);
|
||||
Service *tsrv = compiler->getFirstTSrv(rule); assert(tsrv);
|
||||
#endif
|
||||
|
||||
RuleElementItfInb *itf_in_re = rule->getItfInb(); assert(itf_in_re!=nullptr);
|
||||
RuleElementItfOutb *itf_out_re = rule->getItfOutb(); assert(itf_out_re!=nullptr);
|
||||
@ -391,13 +395,16 @@ void NATCompiler_pix::PrintRule::printDNAT(NATRule *rule)
|
||||
string("/FWBuilderResources/Target/options/") +
|
||||
"version_" + version+"/pix_commands/clear_acl");
|
||||
|
||||
Service *osrv = compiler->getFirstOSrv(rule); assert(osrv);
|
||||
|
||||
#ifndef NDEBUG
|
||||
Address *osrc = compiler->getFirstOSrc(rule); assert(osrc);
|
||||
Address *odst = compiler->getFirstODst(rule); assert(odst);
|
||||
Service *osrv = compiler->getFirstOSrv(rule); assert(osrv);
|
||||
|
||||
Address *tsrc = compiler->getFirstTSrc(rule); assert(tsrc);
|
||||
Address *tdst = compiler->getFirstTDst(rule); assert(tdst);
|
||||
Service *tsrv = compiler->getFirstTSrv(rule); assert(tsrv);
|
||||
#endif
|
||||
|
||||
RuleElementItfInb *itf_in_re = rule->getItfInb(); assert(itf_in_re!=nullptr);
|
||||
RuleElementItfOutb *itf_out_re = rule->getItfOutb(); assert(itf_out_re!=nullptr);
|
||||
|
||||
@ -659,8 +659,10 @@ string OSConfigurator_pix_os::_printSysopt()
|
||||
string platform = fw->getStr("platform");
|
||||
string version = fw->getStr("version");
|
||||
|
||||
#ifndef NDEBUG
|
||||
FWOptions *options=fw->getOptionsObject();
|
||||
assert(options!=nullptr);
|
||||
#endif
|
||||
|
||||
bool tcpmss = fw->getOptionsObject()->getBool("pix_tcpmss");
|
||||
int tcpmss_val = fw->getOptionsObject()->getInt("pix_tcpmss_value");
|
||||
|
||||
@ -134,8 +134,11 @@ void PolicyCompiler_pix::replaceTranslatedAddresses::action(
|
||||
FWObject *rule_iface = FWObjectReference::getObject(intf_re->front());
|
||||
|
||||
RuleElement *re = nat_rule->getOSrc();
|
||||
|
||||
FWObject *o = FWReference::getObject(re->front());
|
||||
#ifndef NDEBUG
|
||||
Address *osrc = Address::cast(o); assert(osrc);
|
||||
#endif
|
||||
|
||||
re = nat_rule->getODst();
|
||||
o = FWReference::getObject(re->front());
|
||||
@ -145,6 +148,7 @@ void PolicyCompiler_pix::replaceTranslatedAddresses::action(
|
||||
o = FWReference::getObject(re->front());
|
||||
Service *osrv = Service::cast(o); assert(osrv);
|
||||
|
||||
#ifndef NDEBUG
|
||||
re = nat_rule->getTSrc();
|
||||
o = FWReference::getObject(re->front());
|
||||
Address *tsrc = Address::cast(o); assert(tsrc);
|
||||
@ -156,7 +160,7 @@ void PolicyCompiler_pix::replaceTranslatedAddresses::action(
|
||||
re = nat_rule->getTSrv();
|
||||
o = FWReference::getObject(re->front());
|
||||
Service *tsrv = Service::cast(o); assert(tsrv);
|
||||
|
||||
#endif
|
||||
|
||||
FWObject *p = odst->getParent();
|
||||
|
||||
|
||||
@ -172,7 +172,9 @@ bool PolicyCompiler_pix::EmulateOutboundACL_v6::processNext()
|
||||
if ( compiler->fw->getOptionsObject()->getBool("pix_emulate_out_acl") )
|
||||
{
|
||||
RuleElementSrc *src = rule->getSrc(); assert(src);
|
||||
#ifndef NDEBUG
|
||||
RuleElementDst *dst = rule->getDst(); assert(dst);
|
||||
#endif
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
@ -396,6 +396,7 @@ void IPTImporter::addSrv()
|
||||
void IPTImporter::processModuleMatches()
|
||||
{
|
||||
PolicyRule *rule = PolicyRule::cast(current_rule);
|
||||
#ifndef NDEBUG
|
||||
RuleElementSrv* srv = rule->getSrv();
|
||||
assert(srv!=nullptr);
|
||||
|
||||
@ -404,6 +405,7 @@ void IPTImporter::processModuleMatches()
|
||||
|
||||
FWOptions *ropt = current_rule->getOptionsObject();
|
||||
assert(ropt!=nullptr);
|
||||
#endif
|
||||
|
||||
addAllModuleMatches(rule);
|
||||
|
||||
@ -1250,11 +1252,13 @@ void IPTImporter::pushNATRule()
|
||||
|
||||
NATRule *rule = NATRule::cast(current_rule);
|
||||
|
||||
#ifndef NDEBUG
|
||||
FWOptions *fwopt = getFirewallObject()->getOptionsObject();
|
||||
assert(fwopt!=nullptr);
|
||||
|
||||
FWOptions *ropt = current_rule->getOptionsObject();
|
||||
assert(ropt!=nullptr);
|
||||
#endif
|
||||
|
||||
addOSrc();
|
||||
addODst();
|
||||
|
||||
@ -477,9 +477,11 @@ bool NATCompiler_ipt::VerifyRules::processNext()
|
||||
{
|
||||
NATRule *rule=getNext(); if (rule==nullptr) return false;
|
||||
|
||||
#ifndef NDEBUG
|
||||
RuleElementOSrc *osrc=rule->getOSrc(); assert(osrc);
|
||||
RuleElementODst *odst=rule->getODst(); assert(odst);
|
||||
RuleElementOSrv *osrv=rule->getOSrv(); assert(osrv);
|
||||
#endif
|
||||
|
||||
RuleElementTSrc *tsrc=rule->getTSrc(); assert(tsrc);
|
||||
RuleElementTDst *tdst=rule->getTDst(); assert(tdst);
|
||||
|
||||
@ -558,8 +558,10 @@ string PolicyCompiler_ipt::PrintRule::_printActionOnReject(PolicyRule *rule)
|
||||
PolicyCompiler_ipt *ipt_comp = dynamic_cast<PolicyCompiler_ipt*>(compiler);
|
||||
|
||||
// RuleElementSrv *srvrel=rule->getSrv();
|
||||
#ifndef NDEBUG
|
||||
Service *srv = compiler->getFirstSrv(rule);
|
||||
assert(srv);
|
||||
#endif
|
||||
|
||||
string s = ipt_comp->getActionOnReject(rule);
|
||||
if (!s.empty())
|
||||
|
||||
@ -915,7 +915,9 @@ bool PolicyCompiler_ipt::Logging2::processNext()
|
||||
PolicyCompiler_ipt *ipt_comp = dynamic_cast<PolicyCompiler_ipt*>(compiler);
|
||||
PolicyRule *rule = getNext(); if (rule==nullptr) return false;
|
||||
|
||||
#ifndef NDEBUG
|
||||
RuleElementItf *itf_re = rule->getItf(); assert(itf_re!=nullptr);
|
||||
#endif
|
||||
|
||||
RuleElementSrc *nsrc;
|
||||
RuleElementDst *ndst;
|
||||
@ -1975,8 +1977,11 @@ bool PolicyCompiler_ipt::bridgingFw::processNext()
|
||||
* this only if the rule is not associated with any bridging
|
||||
* interfaces
|
||||
*/
|
||||
|
||||
#ifndef NDEBUG
|
||||
RuleElementItf *itfre = rule->getItf();
|
||||
assert(itfre);
|
||||
#endif
|
||||
|
||||
RuleElementItf *itf_re = rule->getItf(); assert(itf_re!=nullptr);
|
||||
Interface *rule_iface =
|
||||
@ -2189,7 +2194,9 @@ bool PolicyCompiler_ipt::splitIfSrcAny::processNext()
|
||||
/* See #2008. It appears "--physdev-out" is not allowed in OUTPUT
|
||||
* chain.
|
||||
*/
|
||||
#ifndef NDEBUG
|
||||
RuleElementItf *itfre = rule->getItf(); assert(itfre);
|
||||
#endif
|
||||
Interface *itf = compiler->getFirstItf(rule);
|
||||
|
||||
if (fwopt->getBool("bridging_fw") && itf && itf->isBridgePort())
|
||||
|
||||
@ -511,11 +511,15 @@ bool NATCompiler::ConvertToAtomicForAddresses::processNext()
|
||||
|
||||
RuleElementOSrc *osrc=rule->getOSrc(); assert(osrc);
|
||||
RuleElementODst *odst=rule->getODst(); assert(odst);
|
||||
#ifndef NDEBUG
|
||||
RuleElementOSrv *osrv=rule->getOSrv(); assert(osrv);
|
||||
#endif
|
||||
|
||||
RuleElementTSrc *tsrc=rule->getTSrc(); assert(tsrc);
|
||||
RuleElementTDst *tdst=rule->getTDst(); assert(tdst);
|
||||
#ifndef NDEBUG
|
||||
RuleElementTSrv *tsrv=rule->getTSrv(); assert(tsrv);
|
||||
#endif
|
||||
|
||||
for (FWObject::iterator i1=osrc->begin(); i1!=osrc->end(); ++i1)
|
||||
{
|
||||
|
||||
@ -98,8 +98,10 @@ void AddressRangeDialog::validate(bool *res)
|
||||
|
||||
if (!validateName(this,obj,m_dialog->obj_name->text())) { *res=false; return; }
|
||||
|
||||
#ifndef NDEBUG
|
||||
AddressRange *s = dynamic_cast<AddressRange*>(obj);
|
||||
assert(s!=nullptr);
|
||||
#endif
|
||||
try
|
||||
{
|
||||
InetAddr range_start(AF_UNSPEC, m_dialog->rangeStart->text().toLatin1().constData());
|
||||
|
||||
@ -115,8 +115,11 @@ void AddressTableDialog::updateButtons()
|
||||
void AddressTableDialog::validate(bool *res)
|
||||
{
|
||||
*res=true;
|
||||
|
||||
#ifndef NDEBUG
|
||||
AddressTable *s = dynamic_cast<AddressTable*>(obj);
|
||||
assert(s!=nullptr);
|
||||
#endif
|
||||
|
||||
if (!validateName(this,obj,m_dialog->obj_name->text())) { *res=false; return; }
|
||||
}
|
||||
|
||||
@ -128,8 +128,11 @@ void AttachedNetworksDialog::validate(bool *result)
|
||||
if (fwbdebug) qDebug() << "AttachedNetworksDialog::validate";
|
||||
|
||||
*result = true;
|
||||
|
||||
#ifndef NDEBUG
|
||||
AttachedNetworks *s = dynamic_cast<AttachedNetworks*>(obj);
|
||||
assert(s!=nullptr);
|
||||
#endif
|
||||
|
||||
if (!validateName(this, obj, m_dialog->obj_name->text()))
|
||||
{
|
||||
@ -143,8 +146,10 @@ void AttachedNetworksDialog::applyChanges()
|
||||
std::unique_ptr<FWCmdChange> cmd( new FWCmdChange(m_project, obj));
|
||||
FWObject* new_state = cmd->getNewState();
|
||||
|
||||
#ifndef NDEBUG
|
||||
AttachedNetworks *s = dynamic_cast<AttachedNetworks*>(new_state);
|
||||
assert(s!=nullptr);
|
||||
#endif
|
||||
|
||||
string oldname = obj->getName();
|
||||
new_state->setName(string(m_dialog->obj_name->text().toUtf8().constData()));
|
||||
|
||||
@ -279,8 +279,10 @@ void ClusterGroupDialog::applyChanges()
|
||||
std::unique_ptr<FWCmdChange> cmd( new FWCmdChange(m_project, obj));
|
||||
FWObject* new_state = cmd->getNewState();
|
||||
|
||||
#ifndef NDEBUG
|
||||
ClusterGroup *g = dynamic_cast<ClusterGroup*>(new_state);
|
||||
assert(g != nullptr);
|
||||
#endif
|
||||
|
||||
QString oldname = obj->getName().c_str();
|
||||
new_state->setName(string(m_dialog->obj_name->text().toUtf8().constData()));
|
||||
|
||||
@ -104,9 +104,10 @@ void DNSNameDialog::loadFWObject(FWObject *o)
|
||||
void DNSNameDialog::validate(bool *res)
|
||||
{
|
||||
*res=true;
|
||||
#ifndef NDEBUG
|
||||
DNSName *s = dynamic_cast<DNSName*>(obj);
|
||||
assert(s!=nullptr);
|
||||
|
||||
#endif
|
||||
if (!validateName(this,obj,m_dialog->obj_name->text())) { *res=false; return; }
|
||||
}
|
||||
|
||||
|
||||
@ -105,8 +105,10 @@ void FirewallDialog::loadFWObject(FWObject *o)
|
||||
/* ---------------- */
|
||||
updateTimeStamps();
|
||||
|
||||
#ifndef NDEBUG
|
||||
Management *mgmt=s->getManagementObject();
|
||||
assert(mgmt!=nullptr);
|
||||
#endif
|
||||
|
||||
// FWOptions *opt =s->getOptionsObject();
|
||||
|
||||
@ -308,8 +310,11 @@ void FirewallDialog::applyChanges()
|
||||
FWObject* new_state = cmd->getNewState();
|
||||
|
||||
Firewall *s = dynamic_cast<Firewall*>(new_state);
|
||||
|
||||
#ifndef NDEBUG
|
||||
Management *mgmt = s->getManagementObject();
|
||||
assert(mgmt!=nullptr);
|
||||
#endif
|
||||
|
||||
string old_name = obj->getName();
|
||||
string new_name = string(m_dialog->obj_name->text().toUtf8().constData());
|
||||
|
||||
@ -75,8 +75,10 @@ void HostDialog::loadFWObject(FWObject *o)
|
||||
|
||||
init = true;
|
||||
|
||||
#ifndef NDEBUG
|
||||
Management *mgmt=s->getManagementObject();
|
||||
assert(mgmt!=nullptr);
|
||||
#endif
|
||||
|
||||
FWOptions *opt =s->getOptionsObject();
|
||||
|
||||
@ -147,8 +149,10 @@ void HostDialog::applyChanges()
|
||||
Host *s = dynamic_cast<Host*>(new_state);
|
||||
assert(s!=nullptr);
|
||||
|
||||
#ifndef NDEBUG
|
||||
Management *mgmt = s->getManagementObject();
|
||||
assert(mgmt!=nullptr);
|
||||
#endif
|
||||
|
||||
FWOptions *opt =s->getOptionsObject();
|
||||
|
||||
|
||||
@ -136,8 +136,11 @@ void IPv4Dialog::validate(bool *result)
|
||||
return;
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
IPv4 *s = dynamic_cast<IPv4*>(obj);
|
||||
assert(s!=nullptr);
|
||||
#endif
|
||||
|
||||
try
|
||||
{
|
||||
InetAddr( m_dialog->address->text().trimmed().toLatin1().constData() );
|
||||
|
||||
@ -139,8 +139,11 @@ void IPv6Dialog::validate(bool *res)
|
||||
|
||||
if (!validateName(this,obj,m_dialog->obj_name->text())) { *res=false; return; }
|
||||
|
||||
#ifndef NDEBUG
|
||||
IPv6 *s = dynamic_cast<IPv6*>(obj);
|
||||
assert(s!=nullptr);
|
||||
#endif
|
||||
|
||||
try
|
||||
{
|
||||
InetAddr(AF_INET6, m_dialog->address->text().trimmed().toLatin1().constData() );
|
||||
|
||||
@ -127,8 +127,11 @@ void NetworkDialog::validate(bool *result)
|
||||
return;
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
Network *s = dynamic_cast<Network*>(obj);
|
||||
assert(s!=nullptr);
|
||||
#endif
|
||||
|
||||
try
|
||||
{
|
||||
InetAddr( m_dialog->address->text().toStdString() );
|
||||
|
||||
@ -110,8 +110,11 @@ void NetworkDialogIPv6::validate(bool *res)
|
||||
return;
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
NetworkIPv6 *s = dynamic_cast<NetworkIPv6*>(obj);
|
||||
assert(s != nullptr);
|
||||
#endif
|
||||
|
||||
try
|
||||
{
|
||||
InetAddr(AF_INET6, m_dialog->address->text().toStdString() );
|
||||
|
||||
@ -510,8 +510,11 @@ FWObject* ObjectManipulator::newFirewall(QUndoCommand* macro)
|
||||
FWObject *parent =
|
||||
FWBTree().getStandardSlotForObject(getCurrentLib(), Firewall::TYPENAME);
|
||||
assert(parent);
|
||||
|
||||
#ifndef NDEBUG
|
||||
ObjectTreeViewItem* parent_item = allItems[parent];
|
||||
assert(parent_item);
|
||||
#endif
|
||||
|
||||
newFirewallDialog *nfd = new newFirewallDialog(this, parent);
|
||||
if (mw->isEditorVisible()) mw->hideEditor();
|
||||
@ -539,8 +542,11 @@ FWObject* ObjectManipulator::newCluster(QUndoCommand* macro, bool fromSelected)
|
||||
FWObject *parent =
|
||||
FWBTree().getStandardSlotForObject(getCurrentLib(), Cluster::TYPENAME);
|
||||
assert(parent);
|
||||
|
||||
#ifndef NDEBUG
|
||||
ObjectTreeViewItem* parent_item = allItems[parent];
|
||||
assert(parent_item);
|
||||
#endif
|
||||
|
||||
newClusterDialog *ncd = new newClusterDialog(this, parent);
|
||||
if (mw->isEditorVisible()) mw->hideEditor();
|
||||
|
||||
@ -90,9 +90,11 @@ void ObjectManipulator::autoRenameChildren(FWObject *obj,
|
||||
|
||||
if (oldName == QString::fromUtf8(obj->getName().c_str())) return;
|
||||
|
||||
#ifndef NDEBUG
|
||||
QTreeWidgetItem *itm = allItems[obj];
|
||||
assert(itm!=nullptr);
|
||||
|
||||
#endif
|
||||
|
||||
if ((QString::fromUtf8(obj->getName().c_str())!=oldName) &&
|
||||
(Host::isA(obj) || Firewall::cast(obj)!=nullptr || Interface::isA(obj)))
|
||||
{
|
||||
|
||||
@ -97,9 +97,10 @@ void TagServiceDialog::loadFWObject(FWObject *o)
|
||||
void TagServiceDialog::validate(bool *res)
|
||||
{
|
||||
*res=true;
|
||||
#ifndef NDEBUG
|
||||
TagService *s = dynamic_cast<TagService*>(obj);
|
||||
assert(s!=nullptr);
|
||||
|
||||
#endif
|
||||
if (!validateName(this,obj,m_dialog->obj_name->text())) { *res=false; return; }
|
||||
}
|
||||
|
||||
|
||||
@ -93,8 +93,10 @@ void UserDialog::validate(bool *res)
|
||||
|
||||
if (!validateName(this,obj,m_dialog->obj_name->text())) { *res=false; return; }
|
||||
|
||||
#ifndef NDEBUG
|
||||
UserService *s = dynamic_cast<UserService*>(obj);
|
||||
assert(s!=nullptr);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -62,8 +62,10 @@ freebsdAdvancedDialog::freebsdAdvancedDialog(QWidget *parent,FWObject *o)
|
||||
FWOptions *fwopt=(Firewall::cast(obj))->getOptionsObject();
|
||||
assert(fwopt!=nullptr);
|
||||
|
||||
#ifndef NDEBUG
|
||||
Management *mgmt=(Firewall::cast(obj))->getManagementObject();
|
||||
assert(mgmt!=nullptr);
|
||||
#endif
|
||||
|
||||
QStringList threeStateMapping;
|
||||
|
||||
|
||||
@ -64,8 +64,10 @@ iosAdvancedDialog::iosAdvancedDialog(QWidget *parent,FWObject *o)
|
||||
FWOptions *fwoptions=(Firewall::cast(obj))->getOptionsObject();
|
||||
assert(fwoptions!=nullptr);
|
||||
|
||||
#ifndef NDEBUG
|
||||
Management *mgmt=(Firewall::cast(obj))->getManagementObject();
|
||||
assert(mgmt!=nullptr);
|
||||
#endif
|
||||
|
||||
/* Page "General" */
|
||||
data.registerOption( m_dialog->ios_set_host_name , fwoptions, "ios_set_host_name" );
|
||||
|
||||
@ -69,8 +69,10 @@ ipcoposAdvancedDialog::ipcoposAdvancedDialog(QWidget *parent,FWObject *o)
|
||||
FWOptions *fwopt=(Firewall::cast(obj))->getOptionsObject();
|
||||
assert(fwopt!=nullptr);
|
||||
|
||||
#ifndef NDEBUG
|
||||
Management *mgmt=(Firewall::cast(obj))->getManagementObject();
|
||||
assert(mgmt!=nullptr);
|
||||
#endif
|
||||
|
||||
QStringList threeStateMapping;
|
||||
|
||||
|
||||
@ -64,8 +64,10 @@ junosAdvancedDialog::junosAdvancedDialog(QWidget *parent,FWObject *o)
|
||||
FWOptions *fwoptions=(Firewall::cast(obj))->getOptionsObject();
|
||||
assert(fwoptions!=nullptr);
|
||||
|
||||
#ifndef NDEBUG
|
||||
Management *mgmt=(Firewall::cast(obj))->getManagementObject();
|
||||
assert(mgmt!=nullptr);
|
||||
#endif
|
||||
|
||||
/* Page "General" */
|
||||
data.registerOption( m_dialog->junos_set_host_name , fwoptions, "junos_set_host_name" );
|
||||
|
||||
@ -63,8 +63,11 @@ linksysAdvancedDialog::linksysAdvancedDialog(QWidget *parent,FWObject *o)
|
||||
FWOptions *fwopt=(Firewall::cast(obj))->getOptionsObject();
|
||||
assert(fwopt!=nullptr);
|
||||
|
||||
#ifndef NDEBUG
|
||||
Management *mgmt=(Firewall::cast(obj))->getManagementObject();
|
||||
assert(mgmt!=nullptr);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* since v2.0.3 we do not need to know shell prompt on linksys. Will
|
||||
* remove the page completely when code becomes stable.
|
||||
@ -156,8 +159,10 @@ void linksysAdvancedDialog::reject()
|
||||
|
||||
void linksysAdvancedDialog::setDefaultPrompts()
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
FWOptions *fwopt=(Firewall::cast(obj))->getOptionsObject();
|
||||
assert(fwopt!=nullptr);
|
||||
#endif
|
||||
m_dialog->linksys_prompt1->setText(
|
||||
Resources::getTargetOptionStr("sveasoft","default/prompt1").c_str() );
|
||||
m_dialog->linksys_prompt2->setText(
|
||||
|
||||
@ -70,8 +70,10 @@ linux24AdvancedDialog::linux24AdvancedDialog(QWidget *parent,FWObject *o)
|
||||
FWOptions *fwopt=(Firewall::cast(obj))->getOptionsObject();
|
||||
assert(fwopt!=nullptr);
|
||||
|
||||
#ifndef NDEBUG
|
||||
Management *mgmt=(Firewall::cast(obj))->getManagementObject();
|
||||
assert(mgmt!=nullptr);
|
||||
#endif
|
||||
|
||||
QStringList threeStateMapping;
|
||||
|
||||
@ -207,8 +209,10 @@ void linux24AdvancedDialog::accept()
|
||||
FWOptions* fwoptions = Firewall::cast(new_state)->getOptionsObject();
|
||||
assert(fwoptions!=nullptr);
|
||||
|
||||
#ifndef NDEBUG
|
||||
Management *mgmt = (Firewall::cast(new_state))->getManagementObject();
|
||||
assert(mgmt!=nullptr);
|
||||
#endif
|
||||
|
||||
data.saveAll(fwoptions);
|
||||
|
||||
|
||||
@ -62,8 +62,10 @@ macosxAdvancedDialog::macosxAdvancedDialog(QWidget *parent,FWObject *o)
|
||||
FWOptions *fwopt=(Firewall::cast(obj))->getOptionsObject();
|
||||
assert(fwopt!=nullptr);
|
||||
|
||||
#ifndef NDEBUG
|
||||
Management *mgmt=(Firewall::cast(obj))->getManagementObject();
|
||||
assert(mgmt!=nullptr);
|
||||
#endif
|
||||
|
||||
QStringList threeStateMapping;
|
||||
|
||||
|
||||
@ -64,8 +64,10 @@ nxosAdvancedDialog::nxosAdvancedDialog(QWidget *parent,FWObject *o)
|
||||
FWOptions *fwoptions=(Firewall::cast(obj))->getOptionsObject();
|
||||
assert(fwoptions!=nullptr);
|
||||
|
||||
#ifndef NDEBUG
|
||||
Management *mgmt=(Firewall::cast(obj))->getManagementObject();
|
||||
assert(mgmt!=nullptr);
|
||||
#endif
|
||||
|
||||
/* Page "General" */
|
||||
data.registerOption( m_dialog->nxos_set_host_name , fwoptions, "nxos_set_host_name" );
|
||||
|
||||
@ -63,8 +63,10 @@ openbsdAdvancedDialog::openbsdAdvancedDialog(QWidget *parent,FWObject *o)
|
||||
FWOptions *fwopt=(Firewall::cast(obj))->getOptionsObject();
|
||||
assert(fwopt!=nullptr);
|
||||
|
||||
#ifndef NDEBUG
|
||||
Management *mgmt=(Firewall::cast(obj))->getManagementObject();
|
||||
assert(mgmt!=nullptr);
|
||||
#endif
|
||||
|
||||
QStringList threeStateMapping;
|
||||
|
||||
@ -119,8 +121,10 @@ void openbsdAdvancedDialog::accept()
|
||||
FWOptions* fwoptions = Firewall::cast(new_state)->getOptionsObject();
|
||||
assert(fwoptions!=nullptr);
|
||||
|
||||
#ifndef NDEBUG
|
||||
Management *mgmt = (Firewall::cast(new_state))->getManagementObject();
|
||||
assert(mgmt!=nullptr);
|
||||
#endif
|
||||
|
||||
data.saveAll(fwoptions);
|
||||
|
||||
|
||||
@ -909,9 +909,10 @@ void pixAdvancedDialog::editEpilog()
|
||||
void pixAdvancedDialog::setDefaultTimeoutValue(const QString &option)
|
||||
{
|
||||
string platform = obj->getStr("platform"); // could be 'pix' or 'fwsm'
|
||||
#ifndef NDEBUG
|
||||
FWOptions *fwoptions=(Firewall::cast(obj))->getOptionsObject();
|
||||
assert(fwoptions!=nullptr);
|
||||
|
||||
#endif
|
||||
string vers="version_"+obj->getStr("version");
|
||||
|
||||
if (option=="uauth_abs" || option=="uauth_inact")
|
||||
@ -926,9 +927,10 @@ void pixAdvancedDialog::setDefaultTimeoutValue(const QString &option)
|
||||
|
||||
void pixAdvancedDialog::defaultTimeouts()
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
FWOptions *fwoptions=(Firewall::cast(obj))->getOptionsObject();
|
||||
assert(fwoptions!=nullptr);
|
||||
|
||||
#endif
|
||||
string vers="version_"+obj->getStr("version");
|
||||
|
||||
setDefaultTimeoutValue("xlate_hh" );
|
||||
|
||||
@ -65,8 +65,10 @@ pixosAdvancedDialog::pixosAdvancedDialog(QWidget *parent,FWObject *o)
|
||||
FWOptions *fwoptions=(Firewall::cast(obj))->getOptionsObject();
|
||||
assert(fwoptions!=nullptr);
|
||||
|
||||
#ifndef NDEBUG
|
||||
Management *mgmt=(Firewall::cast(obj))->getManagementObject();
|
||||
assert(mgmt!=nullptr);
|
||||
#endif
|
||||
|
||||
/* Page "General" */
|
||||
data.registerOption(
|
||||
|
||||
@ -62,8 +62,10 @@ solarisAdvancedDialog::solarisAdvancedDialog(QWidget *parent,FWObject *o)
|
||||
FWOptions *fwopt=(Firewall::cast(obj))->getOptionsObject();
|
||||
assert(fwopt!=nullptr);
|
||||
|
||||
#ifndef NDEBUG
|
||||
Management *mgmt=(Firewall::cast(obj))->getManagementObject();
|
||||
assert(mgmt!=nullptr);
|
||||
#endif
|
||||
|
||||
QStringList threeStateMapping;
|
||||
|
||||
|
||||
@ -72,7 +72,9 @@ bool NATCompiler_ipf::VerifyRules::processNext()
|
||||
RuleElementOSrv *osrv=rule->getOSrv(); assert(osrv);
|
||||
|
||||
RuleElementTSrc *tsrc=rule->getTSrc(); assert(tsrc);
|
||||
#ifndef NDEBUG
|
||||
RuleElementTDst *tdst=rule->getTDst(); assert(tdst);
|
||||
#endif
|
||||
RuleElementTSrv *tsrv=rule->getTSrv(); assert(tsrv);
|
||||
|
||||
if (rule->getRuleType()==NATRule::DNAT && odst->size()!=1)
|
||||
|
||||
@ -384,8 +384,10 @@ bool NATCompiler_pf::VerifyRules::processNext()
|
||||
|
||||
string version = compiler->fw->getStr("version");
|
||||
|
||||
#ifndef NDEBUG
|
||||
RuleElementOSrc *osrc=rule->getOSrc(); assert(osrc);
|
||||
RuleElementODst *odst=rule->getODst(); assert(odst);
|
||||
#endif
|
||||
RuleElementOSrv *osrv=rule->getOSrv(); assert(osrv);
|
||||
|
||||
RuleElementTSrc *tsrc=rule->getTSrc(); assert(tsrc);
|
||||
|
||||
@ -317,9 +317,11 @@ bool PolicyCompiler_ipf::PrintRule::processNext()
|
||||
compiler->output << compiler->printComment(rule, current_rule_label, "#");
|
||||
|
||||
RuleElementSrc *srcrel=rule->getSrc();
|
||||
#ifndef NDEBUG
|
||||
Address *src =compiler->getFirstSrc(rule); assert(src);
|
||||
RuleElementDst *dstrel=rule->getDst();
|
||||
Address *dst =compiler->getFirstDst(rule); assert(dst);
|
||||
#endif
|
||||
RuleElementDst *dstrel=rule->getDst();
|
||||
RuleElementSrv *srvrel=rule->getSrv();
|
||||
Service *srv =compiler->getFirstSrv(rule); assert(srv);
|
||||
|
||||
|
||||
@ -515,9 +515,11 @@ bool PolicyCompiler_ipfw::PrintRule::processNext()
|
||||
compiler->output << compiler->printComment(rule, current_rule_label, "#");
|
||||
|
||||
RuleElementSrc *srcrel=rule->getSrc();
|
||||
#ifndef NDEBUG
|
||||
Address *src =compiler->getFirstSrc(rule); assert(src);
|
||||
RuleElementDst *dstrel=rule->getDst();
|
||||
Address *dst =compiler->getFirstDst(rule); assert(dst);
|
||||
#endif
|
||||
RuleElementDst *dstrel=rule->getDst();
|
||||
RuleElementSrv *srvrel=rule->getSrv();
|
||||
Service *srv =compiler->getFirstSrv(rule); assert(srv);
|
||||
|
||||
|
||||
@ -70,7 +70,9 @@ using namespace std;
|
||||
void PolicyCompiler_pf::PrintRule::_printAction(PolicyRule *rule)
|
||||
{
|
||||
FWOptions *ruleopt = rule->getOptionsObject();
|
||||
#ifndef NDEBUG
|
||||
Service *srv = compiler->getFirstSrv(rule); assert(srv);
|
||||
#endif
|
||||
string version = compiler->fw->getStr("version");
|
||||
|
||||
switch (rule->getAction())
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user