Search in sources :

Example 1 with OspfNetwork

use of org.batfish.representation.cisco.OspfNetwork in project batfish by batfish.

the class CiscoControlPlaneExtractor method enterRoa_interface.

@Override
public void enterRoa_interface(Roa_interfaceContext ctx) {
    String ifaceName = ctx.iname.getText();
    String canonicalIfaceName = getCanonicalInterfaceName(ifaceName);
    Interface iface = _configuration.getInterfaces().get(canonicalIfaceName);
    if (iface == null) {
        _w.redFlag("OSPF: Interface: '" + ifaceName + "' not declared before OSPF process");
        iface = addInterface(canonicalIfaceName, ctx.iname, false);
    }
    // whatever
    for (InterfaceAddress address : iface.getAllAddresses()) {
        Prefix prefix = address.getPrefix();
        OspfNetwork network = new OspfNetwork(prefix, _currentOspfArea);
        _currentOspfProcess.getNetworks().add(network);
    }
    _currentOspfInterface = iface.getName();
}
Also used : InterfaceAddress(org.batfish.datamodel.InterfaceAddress) OspfNetwork(org.batfish.representation.cisco.OspfNetwork) Prefix(org.batfish.datamodel.Prefix) VrrpInterface(org.batfish.representation.cisco.VrrpInterface) Interface(org.batfish.representation.cisco.Interface)

Aggregations

InterfaceAddress (org.batfish.datamodel.InterfaceAddress)1 Prefix (org.batfish.datamodel.Prefix)1 Interface (org.batfish.representation.cisco.Interface)1 OspfNetwork (org.batfish.representation.cisco.OspfNetwork)1 VrrpInterface (org.batfish.representation.cisco.VrrpInterface)1