Actiondialog for action Branch finds ruleset using getBranch()

This commit is contained in:
Vadim Kurland
2008-05-31 19:09:09 +00:00
parent 0e208db731
commit ea8b6b1292
2 changed files with 8 additions and 15 deletions
+5 -12
View File
@@ -412,24 +412,17 @@ void ActionsDialog::setRule(PolicyRule *r )
else if (editor=="BranchChain") else if (editor=="BranchChain")
{ {
w=m_dialog->BranchChainPage; w=m_dialog->BranchChainPage;
std::string id = ropt->getStr("branch_id"); RuleSet *ruleset = r->getBranch();
FWObject * o = rule->getRoot()->getById(id,true); if (ruleset!=NULL) BranchChainArea->setObject(ruleset);
if (o!=NULL)
{
BranchChainArea->setObject(o);
}
//data.registerOption ( m_dialog->branchChainName , ropt , "branch_name" ); //data.registerOption ( m_dialog->branchChainName , ropt , "branch_name" );
data.registerOption ( m_dialog->ipt_branch_in_mangle, ropt , "ipt_branch_in_mangle" ); data.registerOption ( m_dialog->ipt_branch_in_mangle, ropt , "ipt_branch_in_mangle" );
} }
else if (editor=="BranchAnchor") else if (editor=="BranchAnchor")
{ {
w=m_dialog->BranchAnchorPage; w=m_dialog->BranchAnchorPage;
std::string id = ropt->getStr("branch_id"); RuleSet *ruleset = r->getBranch();
FWObject * o = rule->getRoot()->getById(id,true); if (ruleset!=NULL) BranchChainArea->setObject(ruleset);
if (o!=NULL)
{
BranchAnchorArea->setObject(o);
}
//int idx = ropt->getInt("branch_id"); //int idx = ropt->getInt("branch_id");
//data.registerOption ( m_dialog->branchAnchorName , ropt , "branch_name" ); //data.registerOption ( m_dialog->branchAnchorName , ropt , "branch_name" );
+3 -3
View File
@@ -349,9 +349,9 @@ bool PolicyCompiler_pf::fillDirection::processNext()
{ {
rule->setDirection( PolicyRule::Both ); rule->setDirection( PolicyRule::Both );
Address *src=compiler->getFirstSrc(rule); Address *src = compiler->getFirstSrc(rule);
Address *dst=compiler->getFirstDst(rule); Address *dst = compiler->getFirstDst(rule);
string fwid=compiler->getFwId(); string fwid = compiler->getFwId();
if (src==NULL || dst==NULL) if (src==NULL || dst==NULL)
compiler->abort("Broken src or dst in rule "+rule->getLabel()); compiler->abort("Broken src or dst in rule "+rule->getLabel());