本文整理汇总了C++中PolicyRule::getStr方法的典型用法代码示例。如果您正苦于以下问题:C++ PolicyRule::getStr方法的具体用法?C++ PolicyRule::getStr怎么用?C++ PolicyRule::getStr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PolicyRule
的用法示例。
在下文中一共展示了PolicyRule::getStr方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: debugPrintRule
list<FWObject*>::iterator
PolicyCompiler::find_more_specific_rule(
PolicyRule *rule,
bool check_interface,
const list<FWObject*>::iterator &start_here,
const list<FWObject*>::iterator &stop_here,
PolicyRule **intersection)
{
list<FWObject*>::iterator j;
for (j=start_here ; j!=stop_here; j++) {
PolicyRule *r = PolicyRule::cast( *j );
if (! check_interface || (rule->getStr("acl")==r->getStr("acl")) ) {
try {
if (! intersect( *rule, *r )) continue;
if (debug>=9) {
cerr << "********* getIntersection: ------------------\n";
cerr << debugPrintRule(rule);
cerr << debugPrintRule(r);
cerr << "----------------------------------------------\n";
}
PolicyRule *ir=new PolicyRule();
/* need to place this rule into the tree somewhere so references will
* get resolved */
temp_ruleset->add( ir );
/* copy attributes from the current rule we are looking at. Do not change
* this part of the algorithm as pix compiler relies upon it.
*/
ir->duplicate(r);
getIntersection(*rule , *r, *ir );
if (! ir->isEmpty()) {
if (debug>=9) {
cerr << debugPrintRule(ir);
cerr << "------------------------------------------------\n";
}
if (intersection!=NULL) *intersection=ir;
return j;
}
} catch (FWException ex) {
cerr << " *** Exception: " << ex.toString() << endl;
}
}
}
return j;
}
示例2: assert
void PolicyCompiler_iosacl::PrintCompleteACLs::printRulesForACL::operator()(
Rule* rule)
{
// print rule if it belongs to ACL <acl>
PolicyRule *prule = PolicyRule::cast(rule);
string acl_name = prule->getStr("acl");
assert (acl_name!="");
ciscoACL *rule_acl = iosacl_comp->acls[acl_name];
assert(rule_acl!=NULL);
if (acl == rule_acl)
{
*output << print_acl_p->_printRule(prule);
}
}
示例3: slurp
bool PolicyCompiler_ipf::calculateSkip::processNext()
{
// PolicyRule *rule;
slurp();
if (tmp_queue.size()==0) return false;
/*
* first, we scan all rules and build a hash that maps attribute
* "skip_label" to rule number. Attribute "skip_label" is set in
* optimize1, after which we could have split some rules, so this
* attrbiute may not be unique. We want to skip to the first rule
* marked with the same skip label if there are few with the same
* label. The simplest way to find the first one with the same label
* is to scan rules in reverse order, that is from the bottom up.
*/
int N=tmp_queue.size()-1; // The last rule number is N
for (deque<Rule*>::reverse_iterator k=tmp_queue.rbegin(); k!=tmp_queue.rend(); ++k)
{
PolicyRule *r = PolicyRule::cast( *k );
if (!r->getStr("skip_label").empty()) allrules[r->getStr("skip_label")]=N;
r->setInt("rule_num",N);
N--;
}
for (deque<Rule*>::iterator k=tmp_queue.begin(); k!=tmp_queue.end(); ++k)
{
PolicyRule *r = PolicyRule::cast( *k );
string rl=r->getLabel();
int current_position=r->getPosition();
if (r->getAction()==PolicyRule::Skip)
{
assert(!r->getStr("skip_to").empty());
int to=allrules[r->getStr("skip_to")];
int n =r->getInt("rule_num");
r->setInt("no_to_skip",to-n-1);
}
/* Action 'Continue' means we need to jump to the next rule in the
* GUI. We scan rules down from the current one, looking for the first
* rule that corresponds to the next rule in the GUI.
*/
if (r->getAction()==PolicyRule::Continue)
{
r->setAction(PolicyRule::Skip);
r->setBool("quick",false);
deque<Rule*>::iterator j=k;
++j;
int n=0;
for ( ; j!=tmp_queue.end(); ++j)
{
PolicyRule *r2 = PolicyRule::cast( *j );
if (r2->getPosition()!=current_position) break;
/* 'skip' only skips rules with the same setting of 'in' or 'out',
* that is the same direction
*/
if (r2->getDirection()==r->getDirection()) ++n;
}
r->setInt("no_to_skip",n);
}
}
return true;
}