use of org.batfish.representation.cisco.OspfProcess in project batfish by batfish.
the class CiscoControlPlaneExtractor method exitRo_passive_interface.
@Override
public void exitRo_passive_interface(Ro_passive_interfaceContext ctx) {
boolean passive = ctx.NO() == null;
String iname = ctx.i.getText();
OspfProcess proc = _currentOspfProcess;
if (passive) {
proc.getPassiveInterfaceList().add(iname);
} else {
proc.getActiveInterfaceList().add(iname);
}
}
use of org.batfish.representation.cisco.OspfProcess in project batfish by batfish.
the class CiscoControlPlaneExtractor method exitRo_default_information.
@Override
public void exitRo_default_information(Ro_default_informationContext ctx) {
OspfProcess proc = _currentOspfProcess;
proc.setDefaultInformationOriginate(true);
boolean always = ctx.ALWAYS().size() > 0;
proc.setDefaultInformationOriginateAlways(always);
if (ctx.metric != null) {
int metric = toInteger(ctx.metric);
proc.setDefaultInformationMetric(metric);
}
if (ctx.metric_type != null) {
int metricTypeInt = toInteger(ctx.metric_type);
OspfMetricType metricType = OspfMetricType.fromInteger(metricTypeInt);
proc.setDefaultInformationMetricType(metricType);
}
if (ctx.map != null) {
int line = ctx.map.getLine();
proc.setDefaultInformationOriginateMap(ctx.map.getText());
proc.setDefaultInformationOriginateMapLine(line);
}
}
use of org.batfish.representation.cisco.OspfProcess in project batfish by batfish.
the class CiscoControlPlaneExtractor method exitRo_area_nssa.
@Override
public void exitRo_area_nssa(Ro_area_nssaContext ctx) {
OspfProcess proc = _currentOspfProcess;
long area = (ctx.area_int != null) ? toLong(ctx.area_int) : toIp(ctx.area_ip).asLong();
boolean noSummary = ctx.NO_SUMMARY() != null;
boolean defaultOriginate = ctx.DEFAULT_INFORMATION_ORIGINATE() != null;
boolean noRedstribution = ctx.NO_REDISTRIBUTION() != null;
if (defaultOriginate) {
todo(ctx, F_OSPF_AREA_NSSA_DEFAULT_ORIGINATE);
}
if (noRedstribution) {
todo(ctx, F_OSPF_AREA_NSSA_NO_REDISTRIBUTION);
}
proc.getNssas().put(area, noSummary);
}
use of org.batfish.representation.cisco.OspfProcess in project batfish by batfish.
the class CiscoControlPlaneExtractor method exitRo_redistribute_static.
@Override
public void exitRo_redistribute_static(Ro_redistribute_staticContext ctx) {
OspfProcess proc = _currentOspfProcess;
RoutingProtocol sourceProtocol = RoutingProtocol.STATIC;
OspfRedistributionPolicy r = new OspfRedistributionPolicy(sourceProtocol);
proc.getRedistributionPolicies().put(sourceProtocol, r);
if (ctx.metric != null) {
int metric = toInteger(ctx.metric);
r.setMetric(metric);
}
if (ctx.map != null) {
String map = ctx.map.getText();
int mapLine = ctx.map.getLine();
r.setRouteMap(map);
r.setRouteMapLine(mapLine);
}
if (ctx.type != null) {
int typeInt = toInteger(ctx.type);
OspfMetricType type = OspfMetricType.fromInteger(typeInt);
r.setOspfMetricType(type);
} else {
r.setOspfMetricType(OspfRedistributionPolicy.DEFAULT_METRIC_TYPE);
}
if (ctx.tag != null) {
long tag = toLong(ctx.tag);
r.setTag(tag);
}
r.setSubnets(ctx.subnets != null);
}
use of org.batfish.representation.cisco.OspfProcess in project batfish by batfish.
the class CiscoControlPlaneExtractor method enterRo_vrf.
@Override
public void enterRo_vrf(Ro_vrfContext ctx) {
Ip routerId = _currentOspfProcess.getRouterId();
_currentVrf = ctx.name.getText();
OspfProcess proc = currentVrf().getOspfProcess();
if (proc == null) {
proc = new OspfProcess(_currentOspfProcess.getName(), _format);
currentVrf().setOspfProcess(proc);
proc.setRouterId(routerId);
}
_currentOspfProcess = proc;
}
Aggregations