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