use of org.batfish.representation.cisco.DynamicIpBgpPeerGroup in project batfish by batfish.
the class CiscoControlPlaneExtractor method exitBgp_listen_range_rb_stanza.
@Override
public void exitBgp_listen_range_rb_stanza(Bgp_listen_range_rb_stanzaContext ctx) {
String name = ctx.name.getText();
int line = ctx.name.getStart().getLine();
BgpProcess proc = currentVrf().getBgpProcess();
if (ctx.IP_PREFIX() != null) {
Prefix prefix = Prefix.parse(ctx.IP_PREFIX().getText());
DynamicIpBgpPeerGroup pg = proc.addDynamicIpPeerGroup(prefix);
pg.setGroupName(name);
pg.setGroupNameLine(line);
if (ctx.as != null) {
int remoteAs = toInteger(ctx.as);
pg.setRemoteAs(remoteAs);
}
} else if (ctx.IPV6_PREFIX() != null) {
Prefix6 prefix6 = new Prefix6(ctx.IPV6_PREFIX().getText());
DynamicIpv6BgpPeerGroup pg = proc.addDynamicIpv6PeerGroup(prefix6);
pg.setGroupName(name);
pg.setGroupNameLine(line);
if (ctx.as != null) {
int remoteAs = toInteger(ctx.as);
pg.setRemoteAs(remoteAs);
}
}
}
Aggregations