Search in sources :

Example 1 with VrrpInterface

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

the class CiscoControlPlaneExtractor method exitIfvrrp_authentication.

@Override
public void exitIfvrrp_authentication(Ifvrrp_authenticationContext ctx) {
    String hashedAuthenticationText = CommonUtil.sha256Digest(ctx.text.getText() + CommonUtil.salt());
    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.setAuthenticationTextHash(hashedAuthenticationText);
    }
}
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 2 with VrrpInterface

use of org.batfish.representation.cisco.VrrpInterface 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 3 with VrrpInterface

use of org.batfish.representation.cisco.VrrpInterface 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 4 with VrrpInterface

use of org.batfish.representation.cisco.VrrpInterface 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)4 VrrpGroup (org.batfish.representation.cisco.VrrpGroup)4 VrrpInterface (org.batfish.representation.cisco.VrrpInterface)4 Ip (org.batfish.datamodel.Ip)1 RoutePolicyNextHopIp (org.batfish.representation.cisco.RoutePolicyNextHopIp)1