Search in sources :

Example 16 with Interface

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

the class CiscoControlPlaneExtractor method exitIf_ip_ospf_dead_interval_minimal.

@Override
public void exitIf_ip_ospf_dead_interval_minimal(If_ip_ospf_dead_interval_minimalContext ctx) {
    int multiplier = toInteger(ctx.mult);
    for (Interface currentInterface : _currentInterfaces) {
        currentInterface.setOspfDeadInterval(1);
        currentInterface.setOspfHelloMultiplier(multiplier);
    }
}
Also used : VrrpInterface(org.batfish.representation.cisco.VrrpInterface) Interface(org.batfish.representation.cisco.Interface)

Example 17 with Interface

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

the class CiscoControlPlaneExtractor method exitIf_switchport_access.

@Override
public void exitIf_switchport_access(If_switchport_accessContext ctx) {
    if (ctx.vlan != null) {
        int vlan = toInteger(ctx.vlan);
        for (Interface currentInterface : _currentInterfaces) {
            currentInterface.setSwitchportMode(SwitchportMode.ACCESS);
            currentInterface.setAccessVlan(vlan);
        }
    } else {
        for (Interface currentInterface : _currentInterfaces) {
            currentInterface.setSwitchportMode(SwitchportMode.ACCESS);
            currentInterface.setSwitchportAccessDynamic(true);
        }
    }
}
Also used : VrrpInterface(org.batfish.representation.cisco.VrrpInterface) Interface(org.batfish.representation.cisco.Interface)

Example 18 with Interface

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

the class CiscoControlPlaneExtractor method exitIftunnel_protection.

@Override
public void exitIftunnel_protection(Iftunnel_protectionContext ctx) {
    String name = ctx.name.getText();
    int line = ctx.getStart().getLine();
    _configuration.referenceStructure(CiscoStructureType.IPSEC_PROFILE, name, CiscoStructureUsage.TUNNEL_PROTECTION_IPSEC_PROFILE, line);
    for (Interface iface : _currentInterfaces) {
        iface.getTunnelInitIfNull().setIpsecProfileName(name);
    }
}
Also used : VrrpInterface(org.batfish.representation.cisco.VrrpInterface) Interface(org.batfish.representation.cisco.Interface)

Example 19 with Interface

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

the class CiscoControlPlaneExtractor method exitIf_ip_ospf_dead_interval.

@Override
public void exitIf_ip_ospf_dead_interval(If_ip_ospf_dead_intervalContext ctx) {
    int seconds = toInteger(ctx.seconds);
    for (Interface currentInterface : _currentInterfaces) {
        currentInterface.setOspfDeadInterval(seconds);
        currentInterface.setOspfHelloMultiplier(0);
    }
}
Also used : VrrpInterface(org.batfish.representation.cisco.VrrpInterface) Interface(org.batfish.representation.cisco.Interface)

Example 20 with Interface

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

the class CiscoControlPlaneExtractor method exitIftunnel_source.

@Override
public void exitIftunnel_source(Iftunnel_sourceContext ctx) {
    if (ctx.IP_ADDRESS() != null) {
        Ip source = toIp(ctx.IP_ADDRESS());
        for (Interface iface : _currentInterfaces) {
            iface.getTunnelInitIfNull().setSource(source);
        }
    } else {
        _configuration.referenceStructure(CiscoStructureType.INTERFACE, ctx.interface_name().getText(), CiscoStructureUsage.TUNNEL_SOURCE, ctx.interface_name().getStart().getLine());
        todo(ctx, "tunnel source [interface]");
    }
}
Also used : Ip(org.batfish.datamodel.Ip) RoutePolicyNextHopIp(org.batfish.representation.cisco.RoutePolicyNextHopIp) VrrpInterface(org.batfish.representation.cisco.VrrpInterface) Interface(org.batfish.representation.cisco.Interface)

Aggregations

Interface (org.batfish.representation.cisco.Interface)25 VrrpInterface (org.batfish.representation.cisco.VrrpInterface)25 Ip (org.batfish.datamodel.Ip)6 RoutePolicyNextHopIp (org.batfish.representation.cisco.RoutePolicyNextHopIp)6 VrrpGroup (org.batfish.representation.cisco.VrrpGroup)4 InterfaceAddress (org.batfish.datamodel.InterfaceAddress)3 Token (org.antlr.v4.runtime.Token)1 BatfishException (org.batfish.common.BatfishException)1 RedFlagBatfishException (org.batfish.common.RedFlagBatfishException)1 Prefix (org.batfish.datamodel.Prefix)1 CiscoSourceNat (org.batfish.representation.cisco.CiscoSourceNat)1 OspfNetwork (org.batfish.representation.cisco.OspfNetwork)1