use of org.batfish.representation.cisco.Interface in project batfish by batfish.
the class CiscoControlPlaneExtractor method exitIf_ip_address.
@Override
public void exitIf_ip_address(If_ip_addressContext ctx) {
InterfaceAddress address;
if (ctx.prefix != null) {
address = new InterfaceAddress(ctx.prefix.getText());
} else {
Ip ip = new Ip(ctx.ip.getText());
Ip mask = new Ip(ctx.subnet.getText());
address = new InterfaceAddress(ip, mask);
}
for (Interface currentInterface : _currentInterfaces) {
currentInterface.setAddress(address);
}
if (ctx.STANDBY() != null) {
Ip standbyIp = toIp(ctx.standby_address);
InterfaceAddress standbyAddress = new InterfaceAddress(standbyIp, address.getNetworkBits());
for (Interface currentInterface : _currentInterfaces) {
currentInterface.setStandbyAddress(standbyAddress);
}
}
}
use of org.batfish.representation.cisco.Interface in project batfish by batfish.
the class CiscoControlPlaneExtractor method exitIf_ip_policy.
@Override
public void exitIf_ip_policy(If_ip_policyContext ctx) {
String policyName = ctx.name.getText();
int policyLine = ctx.name.getLine();
for (Interface currentInterface : _currentInterfaces) {
currentInterface.setRoutingPolicy(policyName);
currentInterface.setRoutingPolicyLine(policyLine);
}
}
use of org.batfish.representation.cisco.Interface in project batfish by batfish.
the class CiscoControlPlaneExtractor method exitIf_vrf_member.
@Override
public void exitIf_vrf_member(If_vrf_memberContext ctx) {
String name = ctx.name.getText();
for (Interface currentInterface : _currentInterfaces) {
currentInterface.setVrf(name);
initVrf(name);
}
}
use of org.batfish.representation.cisco.Interface in project batfish by batfish.
the class CiscoControlPlaneExtractor method enterInterface_is_stanza.
@Override
public void enterInterface_is_stanza(Interface_is_stanzaContext ctx) {
String ifaceName = ctx.iname.getText();
String canonicalIfaceName = getCanonicalInterfaceName(ifaceName);
Interface iface = _configuration.getInterfaces().get(canonicalIfaceName);
if (iface == null) {
iface = addInterface(canonicalIfaceName, ctx.iname, false);
}
iface.setIsisInterfaceMode(IsisInterfaceMode.ACTIVE);
_currentIsisInterface = iface;
}
use of org.batfish.representation.cisco.Interface in project batfish by batfish.
the class CiscoControlPlaneExtractor method exitIf_ip_address_secondary.
@Override
public void exitIf_ip_address_secondary(If_ip_address_secondaryContext ctx) {
Ip ip;
Ip mask;
InterfaceAddress address;
if (ctx.prefix != null) {
address = new InterfaceAddress(ctx.prefix.getText());
} else {
ip = new Ip(ctx.ip.getText());
mask = new Ip(ctx.subnet.getText());
address = new InterfaceAddress(ip, mask.numSubnetBits());
}
for (Interface currentInterface : _currentInterfaces) {
currentInterface.getSecondaryAddresses().add(address);
}
}
Aggregations