use of org.batfish.representation.cisco.IsisRedistributionPolicy in project batfish by batfish.
the class CiscoControlPlaneExtractor method exitRedistribute_static_is_stanza.
@Override
public void exitRedistribute_static_is_stanza(Redistribute_static_is_stanzaContext ctx) {
IsisProcess proc = currentVrf().getIsisProcess();
RoutingProtocol sourceProtocol = RoutingProtocol.STATIC;
IsisRedistributionPolicy r = new IsisRedistributionPolicy(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();
r.setMap(map);
}
if (ctx.LEVEL_1() != null) {
r.setLevel(IsisLevel.LEVEL_1);
} else if (ctx.LEVEL_2() != null) {
r.setLevel(IsisLevel.LEVEL_2);
} else if (ctx.LEVEL_1_2() != null) {
r.setLevel(IsisLevel.LEVEL_1_2);
} else {
r.setLevel(IsisRedistributionPolicy.DEFAULT_LEVEL);
}
}
use of org.batfish.representation.cisco.IsisRedistributionPolicy in project batfish by batfish.
the class CiscoControlPlaneExtractor method exitSummary_address_is_stanza.
// @Override
// public void exitSubnet_bgp_tail(Subnet_bgp_tailContext ctx) {
// BgpProcess proc = currentVrf().getBgpProcess();
// if (ctx.IP_PREFIX() != null) {
// Prefix prefix = new Prefix(ctx.IP_PREFIX().getText());
// NamedBgpPeerGroup namedGroup = _currentNamedPeerGroup;
// namedGroup.addNeighborIpPrefix(prefix);
// DynamicIpBgpPeerGroup pg = proc.addDynamicIpPeerGroup(prefix);
// pg.setGroupName(namedGroup.getName());
// }
// else if (ctx.IPV6_PREFIX() != null) {
// Prefix6 prefix6 = new Prefix6(ctx.IPV6_PREFIX().getText());
// NamedBgpPeerGroup namedGroup = _currentNamedPeerGroup;
// namedGroup.addNeighborIpv6Prefix(prefix6);
// DynamicIpv6BgpPeerGroup pg = proc.addDynamicIpv6PeerGroup(prefix6);
// pg.setGroupName(namedGroup.getName());
// }
// }
//
@Override
public void exitSummary_address_is_stanza(Summary_address_is_stanzaContext ctx) {
Ip ip = toIp(ctx.ip);
Ip mask = toIp(ctx.mask);
Prefix prefix = new Prefix(ip, mask);
RoutingProtocol sourceProtocol = RoutingProtocol.ISIS_L1;
IsisRedistributionPolicy r = new IsisRedistributionPolicy(sourceProtocol);
r.setSummaryPrefix(prefix);
_currentIsisProcess.getRedistributionPolicies().put(sourceProtocol, r);
if (ctx.metric != null) {
int metric = toInteger(ctx.metric);
r.setMetric(metric);
}
if (!ctx.LEVEL_1().isEmpty()) {
r.setLevel(IsisLevel.LEVEL_1);
} else if (!ctx.LEVEL_2().isEmpty()) {
r.setLevel(IsisLevel.LEVEL_2);
} else if (!ctx.LEVEL_1_2().isEmpty()) {
r.setLevel(IsisLevel.LEVEL_1_2);
} else {
r.setLevel(IsisRedistributionPolicy.DEFAULT_LEVEL);
}
}
use of org.batfish.representation.cisco.IsisRedistributionPolicy in project batfish by batfish.
the class CiscoControlPlaneExtractor method exitRedistribute_connected_is_stanza.
@Override
public void exitRedistribute_connected_is_stanza(Redistribute_connected_is_stanzaContext ctx) {
IsisProcess proc = currentVrf().getIsisProcess();
RoutingProtocol sourceProtocol = RoutingProtocol.CONNECTED;
IsisRedistributionPolicy r = new IsisRedistributionPolicy(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();
r.setMap(map);
}
if (ctx.LEVEL_1() != null) {
r.setLevel(IsisLevel.LEVEL_1);
} else if (ctx.LEVEL_2() != null) {
r.setLevel(IsisLevel.LEVEL_2);
} else if (ctx.LEVEL_1_2() != null) {
r.setLevel(IsisLevel.LEVEL_1_2);
} else {
r.setLevel(IsisRedistributionPolicy.DEFAULT_LEVEL);
}
}
Aggregations