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);
}
}
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);
}
}
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);
}
}
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);
}
}
Aggregations