bool RoutingCompiler_iosacl::checkRItfAndGw::processNext()
{
    RoutingRule *rule=getNext(); if (rule==NULL) return false;
    tmp_queue.push_back(rule);

    RuleElementRItf *itfrel = rule->getRItf();    assert(itfrel);
    RuleElementRGtw *gtwrel = rule->getRGtw();    assert(gtwrel);

    if (!itfrel->isAny() && !gtwrel->isAny())
        compiler->abort(rule, "Can not use both gateway address and interface in "
                        "IOS routing rule");

    return true;
}
Ejemplo n.º 2
0
bool RoutingCompiler::interfaceOrGateway::processNext()
{
    RoutingRule *rule = getNext(); if (rule==NULL) return false;
    tmp_queue.push_back(rule);
    
    RuleElementRItf *itfrel = rule->getRItf();
    RuleElementRGtw *gtwrel = rule->getRGtw();

    if (!itfrel->isAny() && !gtwrel->isAny())
    {
        compiler->abort(rule,
                        "Use either gateway or interface in a routing rule "
                        "but not both at the same time");
    }

    return true;
}
bool RoutingCompiler_pix::emptyRDstOrRItf::processNext()
{
    RoutingRule *rule=getNext(); if (rule==NULL) return false;
    tmp_queue.push_back(rule);
    
    RuleElementRGtw *gtwrel = rule->getRGtw();
    RuleElementRItf *itfrel = rule->getRItf();

    if (itfrel->isAny() || gtwrel->isAny())
    {
        compiler->abort(
            rule,
            "Interface and gateway rule elements can not be empty in "
            "the PIX routing rule");
    }

    return true;
}