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