Search in sources :

Example 11 with Interface

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

the class CiscoControlPlaneExtractor method exitPassive_interface_is_stanza.

@Override
public void exitPassive_interface_is_stanza(Passive_interface_is_stanzaContext ctx) {
    String ifaceName = ctx.name.getText();
    String canonicalIfaceName = getCanonicalInterfaceName(ifaceName);
    Interface iface = _configuration.getInterfaces().get(canonicalIfaceName);
    if (iface == null) {
        iface = addInterface(canonicalIfaceName, ctx.name, false);
    }
    if (ctx.NO() == null) {
        iface.setIsisInterfaceMode(IsisInterfaceMode.PASSIVE);
    } else {
        iface.setIsisInterfaceMode(IsisInterfaceMode.ACTIVE);
    }
}
Also used : VrrpInterface(org.batfish.representation.cisco.VrrpInterface) Interface(org.batfish.representation.cisco.Interface)

Example 12 with Interface

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

the class CiscoControlPlaneExtractor method exitIfvrrp_priority.

@Override
public void exitIfvrrp_priority(Ifvrrp_priorityContext ctx) {
    int priority = toInteger(ctx.priority);
    final int line = ctx.getStart().getLine();
    for (Interface iface : _currentInterfaces) {
        String ifaceName = iface.getName();
        VrrpGroup vrrpGroup = _configuration.getVrrpGroups().computeIfAbsent(ifaceName, n -> new VrrpInterface(ifaceName, line)).getVrrpGroups().computeIfAbsent(_currentVrrpGroupNum, VrrpGroup::new);
        vrrpGroup.setPriority(priority);
    }
}
Also used : VrrpGroup(org.batfish.representation.cisco.VrrpGroup) VrrpInterface(org.batfish.representation.cisco.VrrpInterface) Interface(org.batfish.representation.cisco.Interface) VrrpInterface(org.batfish.representation.cisco.VrrpInterface)

Example 13 with Interface

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

the class CiscoControlPlaneExtractor method exitIfvrrp_preempt.

@Override
public void exitIfvrrp_preempt(Ifvrrp_preemptContext ctx) {
    final int line = ctx.getStart().getLine();
    for (Interface iface : _currentInterfaces) {
        String ifaceName = iface.getName();
        VrrpGroup vrrpGroup = _configuration.getVrrpGroups().computeIfAbsent(ifaceName, n -> new VrrpInterface(ifaceName, line)).getVrrpGroups().computeIfAbsent(_currentVrrpGroupNum, VrrpGroup::new);
        vrrpGroup.setPreempt(true);
    }
}
Also used : VrrpGroup(org.batfish.representation.cisco.VrrpGroup) VrrpInterface(org.batfish.representation.cisco.VrrpInterface) Interface(org.batfish.representation.cisco.Interface) VrrpInterface(org.batfish.representation.cisco.VrrpInterface)

Example 14 with Interface

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

the class CiscoControlPlaneExtractor method exitIfdhcpr_address.

@Override
public void exitIfdhcpr_address(Ifdhcpr_addressContext ctx) {
    for (Interface iface : _currentInterfaces) {
        Ip address = toIp(ctx.address);
        iface.getDhcpRelayAddresses().add(address);
    }
}
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)

Example 15 with Interface

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

the class CiscoControlPlaneExtractor method exitIfvrrp_ip.

@Override
public void exitIfvrrp_ip(Ifvrrp_ipContext ctx) {
    Ip ip = toIp(ctx.ip);
    final int line = ctx.getStart().getLine();
    for (Interface iface : _currentInterfaces) {
        String ifaceName = iface.getName();
        VrrpGroup vrrpGroup = _configuration.getVrrpGroups().computeIfAbsent(ifaceName, n -> new VrrpInterface(ifaceName, line)).getVrrpGroups().computeIfAbsent(_currentVrrpGroupNum, VrrpGroup::new);
        vrrpGroup.setVirtualAddress(ip);
    }
}
Also used : VrrpGroup(org.batfish.representation.cisco.VrrpGroup) Ip(org.batfish.datamodel.Ip) RoutePolicyNextHopIp(org.batfish.representation.cisco.RoutePolicyNextHopIp) VrrpInterface(org.batfish.representation.cisco.VrrpInterface) Interface(org.batfish.representation.cisco.Interface) VrrpInterface(org.batfish.representation.cisco.VrrpInterface)

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