Search in sources :

Example 1 with AsPathAccessListLine

use of org.batfish.datamodel.AsPathAccessListLine in project batfish by batfish.

the class CiscoConfiguration method toAsPathAccessListLine.

private AsPathAccessListLine toAsPathAccessListLine(AsPathSetElem elem) {
    String rawRegex = elem.regex();
    String regex = toJavaRegex(rawRegex);
    AsPathAccessListLine line = new AsPathAccessListLine();
    line.setAction(LineAction.ACCEPT);
    line.setRegex(regex);
    return line;
}
Also used : AsPathAccessListLine(org.batfish.datamodel.AsPathAccessListLine)

Example 2 with AsPathAccessListLine

use of org.batfish.datamodel.AsPathAccessListLine in project batfish by batfish.

the class CiscoConfiguration method toAsPathAccessList.

private AsPathAccessList toAsPathAccessList(AsPathSet asPathSet) {
    String name = asPathSet.getName();
    AsPathAccessList list = new AsPathAccessList(name);
    for (AsPathSetElem elem : asPathSet.getElements()) {
        AsPathAccessListLine line = toAsPathAccessListLine(elem);
        list.getLines().add(line);
    }
    return list;
}
Also used : AsPathSetElem(org.batfish.datamodel.routing_policy.expr.AsPathSetElem) AsPathAccessList(org.batfish.datamodel.AsPathAccessList) AsPathAccessListLine(org.batfish.datamodel.AsPathAccessListLine)

Example 3 with AsPathAccessListLine

use of org.batfish.datamodel.AsPathAccessListLine in project batfish by batfish.

the class IpAsPathAccessListLine method applyTo.

public void applyTo(AsPathAccessList newList) {
    List<AsPathAccessListLine> lines = newList.getLines();
    AsPathAccessListLine line = new AsPathAccessListLine();
    line.setAction(_action);
    String regex = CiscoConfiguration.toJavaRegex(_regex);
    line.setRegex(regex);
    lines.add(line);
}
Also used : AsPathAccessListLine(org.batfish.datamodel.AsPathAccessListLine)

Aggregations

AsPathAccessListLine (org.batfish.datamodel.AsPathAccessListLine)3 AsPathAccessList (org.batfish.datamodel.AsPathAccessList)1 AsPathSetElem (org.batfish.datamodel.routing_policy.expr.AsPathSetElem)1